@@ -482,7 +482,9 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True):
482482
483483workflow ['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 )
486488signalprefix = '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
494496precollneeds = [GRP_TASK ['name' ]]
495497NEventsQED = 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
498507PreCollContextTask = 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
519528PreCollContextTask ['cmd' ] += ' --bcPatternFile ccdb' # <--- the object should have been set in (local) CCDB
520529if 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
524538workflow ['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
0 commit comments