Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script to run STARlight anchored productions #1681

Merged
merged 7 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion GRID/utils/grid_submit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ while [ $# -gt 0 ] ; do
-c) CONTINUE_WORKDIR=$2; shift 2 ;; # this should be the workdir of a job to continue (without HOME and ALIEN_TOPWORKDIR)
--local) LOCAL_MODE="ON"; shift 1 ;; # if we want emulate execution in the local workdir (no GRID interaction)
--script) SCRIPT=$2; shift 2 ;; # the job script to submit
--scriptArgs) SCRIPTARGS=$2; shift 2 ;; # arguments for the job script
--jobname) JOBNAME=$2; shift 2 ;; # the job name associated to the job --> determined directory name on GRID
--topworkdir) ALIEN_TOPWORKDIR=$2; shift 2 ;; # the top workdir relative to GRID home
--ttl) JOBTTL=$2; shift 2 ;; # allows to specifiy ttl for job
Expand Down Expand Up @@ -575,7 +576,7 @@ export PATH=$PATH:$PWD
# ----------- EXECUTE ACTUAL JOB ------------------------------------
# source the actual job script from the work dir
chmod +x ./alien_jobscript.sh
./alien_jobscript.sh
./alien_jobscript.sh ${SCRIPTARGS}
mbroz84 marked this conversation as resolved.
Show resolved Hide resolved
# fetch the return code
RC=$?

Expand Down
53 changes: 40 additions & 13 deletions MC/config/PWGUD/ini/makeStarlightConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,9 @@
parser = argparse.ArgumentParser(description='Make Starlight configuration',
formatter_class=argparse.ArgumentDefaultsHelpFormatter)

parser.add_argument('--pZ', type=int, default='82',
help='Projectile charge')
parser.add_argument('--collType',default='PbPb', choices=['PbPb', 'pPb', 'Pbp', 'pp', 'OO', 'pO', 'Op'],
help='Colission system')

parser.add_argument('--pA', type=int, default='208',
help='Projectile atomic number')

parser.add_argument('--tZ', type=int, default='82',
help='Target charge')

parser.add_argument('--tA', type=int, default='208',
help='Target atomic number')

parser.add_argument('--eCM', type=float, default='5360',
help='Centre-of-mass energy')

Expand All @@ -36,17 +27,53 @@

args = parser.parse_args()

if 'PbPb' in args.collType:
pZ = 82
pA = 208
tZ = 82
tA = 208
if 'pPb' in args.collType:
pZ = 1
pA = 1
tZ = 82
tA = 208
if 'Pbp' in args.collType:
pZ = 82
pA = 208
tZ = 1
tA = 1
if 'pp' in args.collType:
pZ = 1
pA = 1
tZ = 1
tA = 1
if 'OO' in args.collType:
pZ = 8
pA = 16
tZ = 8
tA = 16
if 'pO' in args.collType:
pZ = 1
pA = 1
tZ = 8
tA = 16
if 'Op' in args.collType:
pZ = 8
pA = 16
tZ = 1
tA = 1

### open output file
fout = open(args.output, 'w')

### Generator
fout.write('[GeneratorExternal] \n')
if 'Psi2sToMuPi' in args.process or 'Psi2sToElPi' in args.process or 'RhoPrime' in args.process or 'OmegaTo3Pi' in args.process or 'JpsiToElRad' in args.process :
fout.write('fileName = ${O2DPG_ROOT}/MC/config/PWGUD/external/generator/GeneratorStarlightToEvtGen.C \n')
fout.write('funcName = GeneratorStarlightToEvtGen("%s", %f, %d, %d, %d, %d) \n' % (args.process,args.eCM ,args.pZ ,args.pA,args.tZ,args.tA))
fout.write('funcName = GeneratorStarlightToEvtGen("%s", %f, %d, %d, %d, %d) \n' % (args.process,args.eCM ,pZ,pA,tZ,tA))
else:
fout.write('fileName = ${O2DPG_ROOT}/MC/config/PWGUD/external/generator/GeneratorStarlight.C \n')
fout.write('funcName = GeneratorStarlight("%s", %f, %d, %d, %d, %d) \n' % (args.process,args.eCM ,args.pZ ,args.pA,args.tZ,args.tA))
fout.write('funcName = GeneratorStarlight("%s", %f, %d, %d, %d, %d) \n' % (args.process,args.eCM ,pZ,pA,tZ,tA))

###Trigger
fout.write('[TriggerExternal] \n')
Expand Down
27 changes: 27 additions & 0 deletions MC/run/PWGUD/runSTARlightANCHOR.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Run as: ${O2DPG_ROOT}/GRID/utils/grid_submit.sh --script ./runSTARlightANCHOR.sh --scriptArgs 'kCohPsi2sToMuPi PbPb 5360 cent' --jobname SLtest --outputspec "*.log@disk=1","*.root@disk=2" --packagespec "VO_ALICE@O2sim::v20240626-1" --wait --fetch-output --asuser mbroz --local

export ALIEN_JDL_LPMANCHORPASSNAME=apass2
export ALIEN_JDL_MCANCHOR=apass2
export ALIEN_JDL_COLLISIONSYSTEM=PbPb
export ALIEN_JDL_CPULIMIT=8
export ALIEN_JDL_LPMPASSNAME=apass2
export ALIEN_JDL_LPMRUNNUMBER=544389
export ALIEN_JDL_LPMPRODUCTIONTYPE=MC
export ALIEN_JDL_LPMINTERACTIONTYPE=PbPb
export ALIEN_JDL_LPMPRODUCTIONTAG=MyPass2Test
export ALIEN_JDL_LPMANCHORRUN=544389
export ALIEN_JDL_LPMANCHORPRODUCTION=LHC23zzi
export ALIEN_JDL_LPMANCHORYEAR=2023

export NTIMEFRAMES=2
export NSIGEVENTS=5
export NBKGEVENTS=1
export SPLITID=2
export PRODSPLIT=100
export CYCLE=0
export ALIEN_PROC_ID=2963436952

export ALIEN_JDL_ANCHOR_SIM_OPTIONS="-gen external -ini ${PWD}/GenStarlight.ini -nb ${NBKGEVENTS} -colBkg PbPb -genBkg pythia8 -procBkg heavy_ion"

${O2DPG_ROOT}/MC/config/PWGUD/ini/makeStarlightConfig.py --process $1 --collType $2 --eCM $3 --rapidity $4
${O2DPG_ROOT}/MC/run/ANCHOR/anchorMC.sh