Skip to content

Commit 289b3df

Browse files
committed
Include QED for special runs
1 parent 6fe1a75 commit 289b3df

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

MC/bin/o2dpg_sim_workflow.py

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,9 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True):
482482

483483
workflow['stages'].append(GRP_TASK)
484484

485-
includeQED = (COLTYPE == 'PbPb' or (doembedding and COLTYPEBKG == "PbPb")) or (args.with_qed == True)
485+
# QED is enabled only for same beam species for now
486+
QED_enabled = True if (PDGA==PDGB and PDGA!=2212) else False
487+
includeQED = (QED_enabled or (doembedding and QED_enabled)) or (args.with_qed == True)
486488
signalprefix='sgn'
487489

488490
# No vertexing for event pool generation; otherwise the vertex comes from CCDB and later from CollContext
@@ -493,8 +495,15 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True):
493495
# preproduce the collision context / timeframe structure for all timeframes at once
494496
precollneeds=[GRP_TASK['name']]
495497
NEventsQED=10000 # max number of QED events to simulate per timeframe
496-
PbPbXSec=8. # expected PbPb cross section
497-
QEDXSecExpected=35237.5 # expected magnitude of QED cross section
498+
# Hadronic cross section values are taken from Glauber MC
499+
XSecSys = {'PbPb': 8., 'OO': 1.273, 'NeNe': 1.736}
500+
# QED cross section values were calculated with TEPEMGEN
501+
# OO and NeNe at 5.36 TeV, while the old PbPb value was kept as before
502+
# If the collision energy changes these values need to be updated
503+
# More info on the calculation can be found in the TEPEMGEN folder of AEGIS
504+
# specifically in the epemgen.f file
505+
QEDXSecExpected = {'PbPb': 35237.5, 'OO': 3.17289, 'NeNe': 7.74633} # expected magnitude of QED cross section from TEPEMGEN
506+
Zsys = {'PbPb': 82, 'OO': 8, 'NeNe': 10} # atomic number of colliding species
498507
PreCollContextTask=createTask(name='precollcontext', needs=precollneeds, cpu='1')
499508

500509
# adapt timeframeID + orbits + seed + qed
@@ -518,9 +527,14 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True):
518527

519528
PreCollContextTask['cmd'] += ' --bcPatternFile ccdb' # <--- the object should have been set in (local) CCDB
520529
if includeQED:
521-
qedrate = INTRATE * QEDXSecExpected / PbPbXSec # hadronic interaction rate * cross_section_ratio
522-
qedspec = 'qed' + ',' + str(qedrate) + ',10000000:' + str(NEventsQED)
523-
PreCollContextTask['cmd'] += ' --QEDinteraction ' + qedspec
530+
if PDGA==2212 or PDGB==2212:
531+
# QED is not enabled for pp and pA collisions
532+
print('o2dpg_sim_workflow: Warning! QED is not enabled for pp or pA collisions')
533+
includeQED = False
534+
else:
535+
qedrate = INTRATE * QEDXSecExpected[COLTYPE] / XSecSys[COLTYPE] # hadronic interaction rate * cross_section_ratio
536+
qedspec = 'qed' + ',' + str(qedrate) + ',10000000:' + str(NEventsQED)
537+
PreCollContextTask['cmd'] += ' --QEDinteraction ' + qedspec
524538
workflow['stages'].append(PreCollContextTask)
525539

526540

@@ -696,11 +710,11 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True):
696710
+ ' -n ' + str(NEventsQED) + ' -m PIPE ITS MFT FT0 FV0 FDD ' \
697711
+ ('', ' --timestamp ' + str(args.timestamp))[args.timestamp!=-1] + ' --run ' + str(args.run) \
698712
+ ' --seed ' + str(TFSEED) \
699-
+ ' -g extgen --configKeyValues \"GeneratorExternal.fileName=$O2_ROOT/share/Generators/external/QEDLoader.C;QEDGenParam.yMin=-7;QEDGenParam.yMax=7;QEDGenParam.ptMin=0.001;QEDGenParam.ptMax=1.;Diamond.width[2]=6.\"' # + ' --fromCollContext collisioncontext.root'
713+
+ ' -g extgen --configKeyValues \"GeneratorExternal.fileName=$O2_ROOT/share/Generators/external/QEDLoader.C;QEDGenParam.yMin=-7;QEDGenParam.yMax=7;QEDGenParam.ptMin=0.001;QEDGenParam.ptMax=1.;QEDGenParam.Z='+str(Zsys[COLTYPE])+';QEDGenParam.cmEnergy='+str(ECMS)+';Diamond.width[2]=6.\"' # + ' --fromCollContext collisioncontext.root'
700714
QED_task['cmd'] += '; RC=$?; QEDXSecCheck=`grep xSectionQED qedgenparam.ini | sed \'s/xSectionQED=//\'`'
701-
QED_task['cmd'] += '; echo "CheckXSection ' + str(QEDXSecExpected) + ' = $QEDXSecCheck"; [[ ${RC} == 0 ]]'
715+
QED_task['cmd'] += '; echo "CheckXSection ' + str(QEDXSecExpected[COLTYPE]) + ' = $QEDXSecCheck"; [[ ${RC} == 0 ]]'
702716
# TODO: propagate the Xsecion ratio dynamically
703-
QEDdigiargs=' --simPrefixQED qed' + ' --qed-x-section-ratio ' + str(QEDXSecExpected/PbPbXSec)
717+
QEDdigiargs=' --simPrefixQED qed' + ' --qed-x-section-ratio ' + str(QEDXSecExpected[COLTYPE]/XSecSys[COLTYPE])
704718
workflow['stages'].append(QED_task)
705719

706720
# recompute the number of workers to increase CPU efficiency

MC/config/common/external/generator/QEDepem.C

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ o2::eventgen::GeneratorTGenerator* QEDepem()
2929
genBg->SetPtRange(qedParam.ptMin, qedParam.ptMax); // Set pt limits (GeV) for e+-: 1MeV corresponds to max R=13.3mm at 5kGaus
3030
genBg->SetOrigin(diamond.position[0], diamond.position[1], diamond.position[2]); // vertex position in space
3131
genBg->SetSigma(diamond.width[0], diamond.width[1], diamond.width[2]); // vertex sigma
32+
genBg->SetCMEnergy(qedParam.cmEnergy); // center of mass energy per nucleon pair in GeV
33+
genBg->SetZ(qedParam.Z); // atomic number of the projectile/target (only symmetric systems are compatible for now)
3234
genBg->SetTimeOrigin(0.); // vertex position in time
3335
genBg->Init();
3436

0 commit comments

Comments
 (0)