@@ -258,21 +258,45 @@ def retrieve_MinBias_CTPScaler_Rate(ctpscaler, finaltime, trig_eff_arg, NBunches
258258 and calculates the interation rate to be applied in Monte Carlo digitizers.
259259 Uses trig_eff_arg when positive, otherwise calculates the effTrigger.
260260 """
261+ trigger_effs = {
262+ "pp" : {
263+ "1000" : 0.68 ,
264+ "6000" : 0.737 ,
265+ "default" : 0.759
266+ },
267+ "pO" : {
268+ "default" : 0.8222
269+ },
270+ "Op" : {
271+ "default" : 0.8222
272+ },
273+ "OO" : {
274+ "default" : 0.8677
275+ },
276+ "NeNe" : {
277+ "default" : 0.9147
278+ },
279+ "PbPb" : {
280+ "default" : 28.0 # this is ZDC
281+ }
282+ }
261283
262284 # determine first of all the trigger efficiency
263285 effTrigger = trig_eff_arg
264286 if effTrigger < 0 :
265- if ColSystem == "pp" :
266- if eCM < 1000 :
267- effTrigger = 0.68
268- elif eCM < 6000 :
269- effTrigger = 0.737
287+ # Check if ColSystem is defined in trigger_effs
288+ if ColSystem in trigger_effs :
289+ if ColSystem == "pp" :
290+ if eCM < 1000 :
291+ effTrigger = trigger_effs ["pp" ]["1000" ]
292+ elif eCM < 6000 :
293+ effTrigger = trigger_effs ["pp" ]["6000" ]
294+ else :
295+ effTrigger = trigger_effs ["pp" ]["default" ]
270296 else :
271- effTrigger = 0.759
272- elif ColSystem == "PbPb" :
273- effTrigger = 28.0 # this is ZDC
297+ effTrigger = trigger_effs [ColSystem ]["default" ]
274298 else :
275- effTrigger = 0.759
299+ effTrigger = 0.759 # The simulation will fail later if the collision system is not defined
276300
277301 # this is the default for pp
278302 ctpclass = 0 # <---- we take the scaler for FT0
@@ -481,21 +505,34 @@ def main():
481505
482506 # determine some fundamental physics quantities
483507 eCM = grplhcif .getSqrtS ()
508+ eA = grplhcif .getBeamEnergyPerNucleonInGeV (o2 .constants .lhc .BeamDirection .BeamC )
509+ eB = grplhcif .getBeamEnergyPerNucleonInGeV (o2 .constants .lhc .BeamDirection .BeamA )
484510 A1 = grplhcif .getAtomicNumberB1 ()
485511 A2 = grplhcif .getAtomicNumberB2 ()
486512
487513 # determine collision system and energy
488- print ("Determined eMC " , eCM )
514+ print ("Determined eCM " , eCM )
515+ print ("Determined eA " , eA )
516+ print ("Determined eB " , eB )
489517 print ("Determined atomic number A1 " , A1 )
490518 print ("Determined atomic number A2 " , A2 )
491519 ColSystem = ""
492- if A1 == 82 and A2 == 82 :
493- ColSystem = "PbPb"
494- elif A1 == 1 and A2 == 1 :
495- ColSystem = "pp"
496- else :
497- print ("Unknown collision system ... exiting" )
498- exit (1 )
520+ col_systems = {
521+ "pp" : (1 , 1 ),
522+ "pO" : (1 , 8 ),
523+ "Op" : (8 , 1 ),
524+ "OO" : (8 , 8 ),
525+ "NeNe" : (10 , 10 ),
526+ "PbPb" : (82 , 82 )
527+ }
528+ # check if we have a known collision system
529+ for system , (a1 , a2 ) in col_systems .items ():
530+ if A1 == a1 and A2 == a2 :
531+ ColSystem = system
532+ break
533+ if ColSystem == "" :
534+ print (f"ERROR: Unknown collision system for A1={ A1 } , A2={ A2 } . Check the GRPLHCIF object." )
535+ exit (1 )
499536
500537 print ("Collision system " , ColSystem )
501538
@@ -555,8 +592,9 @@ def main():
555592 # we finally pass forward to the unanchored MC workflow creation
556593 # TODO: this needs to be done in a pythonic way clearly
557594 # NOTE: forwardargs can - in principle - contain some of the arguments that are appended here. However, the last passed argument wins, so they would be overwritten.
595+ energyarg = (" -eCM " + str (eCM )) if A1 == A2 else (" -eA " + str (eA ) + " -eB " + str (eB ))
558596 forwardargs += " -tf " + str (args .tf ) + " --sor " + str (run_start ) + " --timestamp " + str (timestamp ) + " --production-offset " + str (prod_offset ) + " -run " + str (args .run_number ) + " --run-anchored --first-orbit " \
559- + str (GLOparams ["FirstOrbit" ]) + " -field ccdb -bcPatternFile ccdb" + " --orbitsPerTF " + str (GLOparams ["OrbitsPerTF" ]) + " -col " + str (ColSystem ) + " -eCM " + str (eCM )
597+ + str (GLOparams ["FirstOrbit" ]) + " -field ccdb -bcPatternFile ccdb" + " --orbitsPerTF " + str (GLOparams ["OrbitsPerTF" ]) + " -col " + str (ColSystem ) + str (energyarg )
560598 if not '--readoutDets' in forwardargs :
561599 forwardargs += ' --readoutDets ' + GLOparams ['detList' ]
562600 print ("forward args " , forwardargs )
0 commit comments