ATLAS Offline Software
Loading...
Searching...
No Matches
python.ZdcRecConfig Namespace Reference

Functions

 zdcGeometry (flags)
 GenerateConfigTagDict ()
 SetConfigTag (flags)
 ZdcGenericFlagSetting (flags)
 ZdcStreamDependentFlagSetting (flags)
 ZdcRecOutputCfg (flags)
 ZdcAnalysisToolCfg (flags, run, config="PbPb2023", DoCalib=False, DoFADCCorr=False, DoNonLinCorr=False, DoTimeCalib=False, DoTrigEff=False, ForceCalibRun=-1, ForceCalibLB=814, AuxSuffix="")
 ZdcLEDAnalysisToolCfg (flags, config='ppPbPb2023', DoFADCCorr=True)
 ZdcTrigValToolCfg (flags, config='PbPb2023')
 RPDAnalysisToolCfg (flags, str config, AuxSuffix="")
 RpdSubtractCentroidToolCfg (flags, str config, AuxSuffix="")
 ZdcRecRun2Cfg (flags)
 ZdcRecRun3Cfg (flags)
 ZdcNtupleLocalCfg (flags)
 ZdcNtupleRun2Cfg (flags, **kwargs)
 ZdcNtupleRun3Cfg (flags, **kwargs)
 ZdcInjNtupleCfg (flags, **kwargs)
 ZdcLEDNtupleCfg (flags)
 ZdcLEDRecCfg (flags)
 ZdcLEDTrigCfg (flags)
 ZdcRecCfg (flags)

Variables

 log = logging.getLogger("ZdcRecConfig")
dict zdcConfigMap = {}
 flags = initConfigFlags()
 AODFileName
 HISTFileName
 doWriteAOD
 isLED
 isInj
 isCalib
 pn
 acc = MainServicesCfg(flags)
 zdcMonitorAcc = ZdcMonitoringConfig(flags)
 withDetails
 status = acc.run()

Function Documentation

◆ GenerateConfigTagDict()

python.ZdcRecConfig.GenerateConfigTagDict ( )

Definition at line 64 of file ZdcRecConfig.py.

64def GenerateConfigTagDict():
65
66 zdcConfigMap['data15_hi'] = {}
67 zdcConfigMap['data16_hip'] = {}
68 zdcConfigMap['data17_13TeV'] = {}
69 zdcConfigMap['data18_hi'] = {}
70 zdcConfigMap['data22_13p6TeV'] = {}
71 zdcConfigMap['data23_5p36TeV'] = {}
72 zdcConfigMap['data23_13p6TeV'] = {}
73 zdcConfigMap['data23_hi'] = {}
74 zdcConfigMap['data23_comm'] = {}
75 zdcConfigMap['data23_5p36TeV'] = {}
76 zdcConfigMap['data24_900GeV'] = {}
77
78 zdcConfigMap['data24_13p6TeV'] = {}
79 zdcConfigMap['data24_13p6TeV']['default'] = 'pp2024'
80
81 zdcConfigMap['data24_refcomm'] = {}
82 zdcConfigMap['data24_refcomm']['default'] = 'pp2024'
83 zdcConfigMap['data24_refcomm']['calibration_ZdcInjCalib'] = 'Injectorpp2024'
84
85 zdcConfigMap['data24_hicomm'] = {}
86 zdcConfigMap['data24_hicomm']['default'] = 'PbPb2024'
87 zdcConfigMap['data24_hicomm']['calibration_ZdcInjCalib'] = 'InjectorPbPb2024'
88
89 zdcConfigMap['data24_hi'] = {}
90 zdcConfigMap['data24_hi']['default']="PbPb2024"
91 zdcConfigMap['data24_hi']['calibration_ZdcInjCalib']="InjectorPbPb2024"
92

◆ RPDAnalysisToolCfg()

python.ZdcRecConfig.RPDAnalysisToolCfg ( flags,
str config,
AuxSuffix = "" )

Definition at line 350 of file ZdcRecConfig.py.

350def RPDAnalysisToolCfg(flags, config: str, AuxSuffix=""):
351 acc = ComponentAccumulator()
352 acc.setPrivateTools(
353 CompFactory.ZDC.RPDAnalysisTool(
354 name="RPDAnalysisTool",
355 Configuration=config,
356 AuxSuffix = AuxSuffix
357 )
358 )
359 return acc
360

◆ RpdSubtractCentroidToolCfg()

python.ZdcRecConfig.RpdSubtractCentroidToolCfg ( flags,
str config,
AuxSuffix = "" )

Definition at line 361 of file ZdcRecConfig.py.

361def RpdSubtractCentroidToolCfg(flags, config: str, AuxSuffix=""):
362 acc = ComponentAccumulator()
363 acc.setPrivateTools(
364 CompFactory.ZDC.RpdSubtractCentroidTool(
365 name="RpdSubtractCentroidTool",
366 Configuration=config,
367 AuxSuffix = AuxSuffix
368 )
369 )
370 return acc
371

◆ SetConfigTag()

python.ZdcRecConfig.SetConfigTag ( flags)

Definition at line 93 of file ZdcRecConfig.py.

93def SetConfigTag(flags):
94
95 aa_type = 82 # default to Pb+Pb unless a run number is provided
96 if flags.Input.RunNumbers:
97 run_num = flags.Input.RunNumbers[0]
98 aa = getTypeForRun(run_num)
99 if aa is not None:
100 aa_type = aa.getBeam1Type()
101 print('ZdcRecConfig::SetConfigTag(): Getting config for type %d' % (aa_type))
102
103 # terrible kludge for early 2025
104 if flags.Input.ProjectName == "data25_comm" and flags.Input.TriggerStream == "calibration_ZDCCalib":
105 config = "InjectorPbPb2024"
106
107 elif flags.Input.TriggerStream == "calibration_ZDCInjCalib" or flags.Input.TriggerStream == "calibration_DcmDummyProcessor": # calibration_DcmDummyProcessor is the "trigger stream" in the data we record in the standalone partition that is NOT LED data
108 config = "InjectorpOOONeNe2025" # default config tag for injector pulse - suitable also for running in standalone partition (except for standalone data taken during pp reference run + its commissionging period)
109 if flags.Input.ProjectName == "data24_5p36TeV" or flags.Input.ProjectName == "data24_900GeV" or flags.Input.ProjectName == "data24_13p6TeV" or flags.Input.ProjectName == "data24_refcomm":
110 config = "Injectorpp2024"
111 if flags.Input.ProjectName in ["data24_hi","data24_hicomm"]:
112 config = "InjectorPbPb2024"
113 if flags.Input.ProjectName in ["data25_hi","data25_hicomm","data25_hip"] :
114 if (aa_type == 8 or aa_type == 10):
115 config = "InjectorpOOONeNe2025"
116 if (aa_type == 82):
117 config = "configZDC_PbPb2025.inj.v1.json"
118
119 else:
120 config = "PbPb2023" # default config tag
121
122 run = flags.GeoModel.Run
123 if run == LHCPeriod.Run3:
124 if flags.Input.isMC:
125 config = "MonteCarloPbPb2023"
126 elif flags.Input.ProjectName == "data22_13p6TeV":
127 config = "LHCf2022"
128 elif flags.Input.ProjectName in ["data23_5p36TeV", "data23_900GeV", "data23_13p6TeV"]:
129 config = "pp2023"
130 elif flags.Input.ProjectName in ["data23_hi", "data23_comm"]:
131 config = "PbPb2023"
132 elif flags.Input.ProjectName in ["data24_5p36TeV", "data24_900GeV", "data24_13p6TeV", "data24_refcomm"]:
133 config = "pp2024"
134 elif flags.Input.ProjectName in ["data24_hi", "data24_hicomm"]:
135 config = "configZDC_PbPb2024.v5.json"
136 elif flags.Input.ProjectName in ["data25_hipcomm"]:
137 config = "pO2025"
138 elif flags.Input.ProjectName in ["data25_hip"]:
139 config = "pO2025B"
140 elif flags.Input.ProjectName in ["data25_hi","data25_hicomm"]:
141 if (aa_type == 8 or aa_type == 10):
142 config = "OONeNe2025"
143 if (aa_type == 82):
144 config = "configZDC_PbPb2025.v1.json"
145 elif run == LHCPeriod.Run2:
146 if flags.Input.ProjectName == "data15_hi":
147 config = "PbPb2015"
148 elif flags.Input.ProjectName == "data17_13TeV":
149 config = "PbPb2015"
150 elif flags.Input.ProjectName == "data16_hip":
151 config = "pPb2016"
152 elif flags.Input.ProjectName == "data18_hi":
153 config = "PbPb2018"
154
155 return config
156
157
void print(char *figname, TCanvas *c1)

◆ ZdcAnalysisToolCfg()

python.ZdcRecConfig.ZdcAnalysisToolCfg ( flags,
run,
config = "PbPb2023",
DoCalib = False,
DoFADCCorr = False,
DoNonLinCorr = False,
DoTimeCalib = False,
DoTrigEff = False,
ForceCalibRun = -1,
ForceCalibLB = 814,
AuxSuffix = "" )

Definition at line 293 of file ZdcRecConfig.py.

293def ZdcAnalysisToolCfg(flags, run, config="PbPb2023", DoCalib=False, DoFADCCorr=False, DoNonLinCorr=False, DoTimeCalib=False, DoTrigEff=False, ForceCalibRun=-1, ForceCalibLB=814, AuxSuffix=""):
294 acc = ComponentAccumulator()
295
296 log.info('ZdcAnalysisToolCfg: setting up ZdcAnalysisTool with config='+config)
297
298 jsonFile = ''
299
300 if (config[-5:]=='.json'):
301 jsonFile = config
302 config = "JSON"
303 log.info('ZdcAnalysisToolCfg: setting up with JSON file '+jsonFile)
304
305 acc.setPrivateTools(CompFactory.ZDC.ZdcAnalysisTool(
306 name = 'ZdcAnalysisTool'+config,
307 Configuration = config,
308 DoCalib = DoCalib,
309 DoFADCCorr = DoFADCCorr,
310 DoFADCCorrPerSample = True,
311 DoNonLinCorr = DoNonLinCorr,
312 DoTimeCalib = DoTimeCalib,
313 DoTrigEff = DoTrigEff,
314 ForceCalibRun = ForceCalibRun,
315 ForceCalibLB = ForceCalibLB,
316 AuxSuffix = AuxSuffix,
317 JSONConfigurationFile=jsonFile,
318 LHCRun = run ))
319 return acc
320

◆ ZdcGenericFlagSetting()

python.ZdcRecConfig.ZdcGenericFlagSetting ( flags)
set generic flags needed for ZDC reconstruction that are independent of stream type
Also fills flags from input arguments

Definition at line 158 of file ZdcRecConfig.py.

158def ZdcGenericFlagSetting(flags): # pass flags object by reference: directly set flags in function
159 '''set generic flags needed for ZDC reconstruction that are independent of stream type
160 Also fills flags from input arguments'''
161
162 flags.Scheduler.CheckDependencies = True
163 flags.Scheduler.ShowDataDeps = True
164 flags.Scheduler.ShowDataFlow = True
165 flags.Scheduler.ShowControlFlow = True
166 flags.Scheduler.EnableVerboseViews = True
167
168 flags.Detector.GeometryZDC=True
169 flags.Detector.GeometryAFP=False
170 flags.Detector.GeometryALFA=False
171 flags.Detector.GeometryLucid=False
172 flags.Detector.GeometryMDT=False
173 flags.Detector.GeometryMM=False
174 flags.Detector.GeometryMuon=False
175
176 flags.Trigger.decodeHLT=False
177 flags.Trigger.enableL1MuonPhase1=False
178 flags.Trigger.L1.doMuon=False
179 flags.Trigger.L1.doCalo=False
180 flags.Trigger.L1.doTopo=False
181
182 # This does not work in this context
183 # run = flags.GeoModel.Run
184 # The EDM Version should be auto configured, but is not working at the moment, so is set by hand
185
186 parser = flags.getArgumentParser()
187 parser.add_argument('--runInjForStandaloneData',default="Inj",help="indicate if we run inj/LED reconstruction for standalone data: inj (default) --> run injected-pulse reconstruction for injector-pulse events; LED --> run LED reconstruction for LED events")
188 flags.fillFromArgs(parser=parser)
189
190

◆ zdcGeometry()

python.ZdcRecConfig.zdcGeometry ( flags)

Definition at line 31 of file ZdcRecConfig.py.

31def zdcGeometry(flags):
32 projName = flags.Input.ProjectName
33 match projName:
34 case "data15_hi":
35 return defaultGeometryTags.RUN2_ZDC
36 case "data18_hi":
37 return defaultGeometryTags.RUN2_ZDC
38 case "data16_hi":
39 return defaultGeometryTags.RUN2_ZDC
40 case "data16_hip":
41 return defaultGeometryTags.RUN2_ZDC
42 case "data23_hi":
43 return defaultGeometryTags.RUN3_ZDC23
44 case "data24_hi":
45 return defaultGeometryTags.RUN3_ZDC24
46 case "data24_hicomm":
47 return defaultGeometryTags.RUN3_ZDC24
48 case "data25_hip":
49 return defaultGeometryTags.RUN3_ZDC24
50 case "data25_hi":
51 return defaultGeometryTags.RUN3_ZDC24
52 case "data25_hipcomm":
53 return defaultGeometryTags.RUN3_ZDC24
54 case "data25_hicomm":
55 return defaultGeometryTags.RUN3_ZDC24
56 case _:
57 run = flags.GeoModel.Run
58 if run == LHCPeriod.Run2:
59 return defaultGeometryTags.RUN2_ZDC
60 if run == LHCPeriod.Run3:
61 return defaultGeometryTags.RUN3_ZDC24
62 return ""
63

◆ ZdcInjNtupleCfg()

python.ZdcRecConfig.ZdcInjNtupleCfg ( flags,
** kwargs )

Definition at line 578 of file ZdcRecConfig.py.

578def ZdcInjNtupleCfg(flags,**kwargs):
579
580 acc = ComponentAccumulator()
581 acc.merge(ZdcNtupleCfg(flags,
582 useGRL = False,
583 zdcOnly = True,
584 zdcInj = True,
585 lhcf2022 = False,
586 lhcf2022zdc = False,
587 lhcf2022afp = False,
588 enableTrigger = False,
589 enableOutputSamples = True,
590 enableOutputTree = True,
591 writeOnlyTriggers = False,
592 enableRPD = False,
593 enableCentroid = False,
594 reprocZdc = False,
595 **kwargs))
596
597 acc.addService(CompFactory.THistSvc(Output = ["ANALYSIS DATAFILE='NTUP.root' OPT='RECREATE'"]))
598 #acc.setAppProperty("HistogramPersistency","ROOT")
599 return acc
600

◆ ZdcLEDAnalysisToolCfg()

python.ZdcRecConfig.ZdcLEDAnalysisToolCfg ( flags,
config = 'ppPbPb2023',
DoFADCCorr = True )

Definition at line 321 of file ZdcRecConfig.py.

321def ZdcLEDAnalysisToolCfg(flags, config = 'ppPbPb2023', DoFADCCorr = True):
322 acc = ComponentAccumulator()
323
324 log.info('ZdcAnalysisToolCfg: setting up ZdcAnalysisTool with config='+config)
325 acc.setPrivateTools(CompFactory.ZDC.ZdcLEDAnalysisTool(name = 'ZdcLEDAnalysisTool'+config,
326 Configuration = config,
327 DoFADCCorr = DoFADCCorr))
328 return acc
329
330

◆ ZdcLEDNtupleCfg()

python.ZdcRecConfig.ZdcLEDNtupleCfg ( flags)

Definition at line 601 of file ZdcRecConfig.py.

601def ZdcLEDNtupleCfg(flags):
602 acc = ComponentAccumulator()
603 zdcLEDNtuple = CompFactory.ZdcLEDNtuple("ZdcLEDNtuple")
604 zdcLEDNtuple.enableOutputTree = True
605 acc.addEventAlgo(zdcLEDNtuple)
606 acc.addService(CompFactory.THistSvc(Output = ["ANALYSIS DATAFILE='NTUP.root' OPT='RECREATE'"]))
607 return acc
608

◆ ZdcLEDRecCfg()

python.ZdcRecConfig.ZdcLEDRecCfg ( flags)

Definition at line 609 of file ZdcRecConfig.py.

609def ZdcLEDRecCfg(flags):
610
611 acc = ComponentAccumulator()
612
613 if flags.Input.Format is Format.BS:
614 run = flags.GeoModel.Run
615
616 # debugging message since the metadata isn't working for calibration files yet
617 log.info ("ZdcRecConfig.py: run = "+run.name)
618
619 config = 'ppPbPb2023'
620 #config = 'ppALFA2023'
621 doFADCCorr = False
622
623 if flags.Input.ProjectName in ["data24_hi","data25_hip","data25_hi"]:
624 doFADCCorr = True
625
626 acc.addEventAlgo(CompFactory.ZdcByteStreamLucrodData())
627 acc.addEventAlgo(CompFactory.ZdcRecRun3Decode())
628
629 anaTool = acc.popToolsAndMerge(ZdcLEDAnalysisToolCfg(flags, config, DoFADCCorr = doFADCCorr)) #anatool for zdcLED calibration
630
631 zdcTools = []
632 zdcTools += [anaTool] # add trigTool after deocration migration
633
634 # FIXME these are dependent on !65768
635 zdcAlg = CompFactory.ZdcRecRun3("ZdcRecRun3",DAQMode=2, ForcedEventType=2, ZdcAnalysisTools=zdcTools) # DAQMode set to PhysicsPEB, event type set to ZdcEventLED
636 acc.addEventAlgo(zdcAlg, primary=True)
637
638 if flags.Output.doWriteESD or flags.Output.doWriteAOD:
639 acc.merge(ZdcRecOutputCfg(flags))
640
641 return acc
642

◆ ZdcLEDTrigCfg()

python.ZdcRecConfig.ZdcLEDTrigCfg ( flags)

Definition at line 643 of file ZdcRecConfig.py.

643def ZdcLEDTrigCfg(flags):
644
645 acc = ComponentAccumulator()
646
647 # suggested by Tim Martin
648 tdmv = CompFactory.TrigDec.TrigDecisionMakerValidator()
649 tdmv.errorOnFailure = True
650 tdmv.TrigDecisionTool = acc.getPrimaryAndMerge(TrigDecisionToolCfg(flags))
651 tdmv.NavigationKey = getRun3NavigationContainerFromInput(flags)
652 acc.addEventAlgo( tdmv )
653 # end of Tim's suggestions
654 return acc
655

◆ ZdcNtupleLocalCfg()

python.ZdcRecConfig.ZdcNtupleLocalCfg ( flags)

Definition at line 523 of file ZdcRecConfig.py.

523def ZdcNtupleLocalCfg(flags):
524
525 acc = ComponentAccumulator()
526 run = flags.GeoModel.Run
527
528 if run == LHCPeriod.Run2:
529 log.info ('ZdcRecConfig.py: setting up Run 2 ntuple!')
530 acc.merge(ZdcNtupleRun2Cfg(flags))
531 elif run == LHCPeriod.Run3:
532 log.info ('ZdcRecConfig.py: setting up Run 3 ntuples!')
533 acc.merge(ZdcNtupleRun3Cfg(flags))
534 else:
535 log.info ('ZdcRecConfig.py: setting up no ntuple!')
536
537 return acc
538

◆ ZdcNtupleRun2Cfg()

python.ZdcRecConfig.ZdcNtupleRun2Cfg ( flags,
** kwargs )

Definition at line 539 of file ZdcRecConfig.py.

539def ZdcNtupleRun2Cfg(flags,**kwargs):
540
541 acc = ComponentAccumulator()
542 acc.merge(ZdcNtupleCfg(flags,
543 useGRL = False,
544 zdcOnly = True,
545 enableTrigger = False,
546 enableOutputSamples = True,
547 enableOutputTree = True,
548 writeOnlyTriggers = False,
549 nsamplesZdc = 7,
550 **kwargs))
551
552 acc.addService(CompFactory.THistSvc(Output = ["ANALYSIS DATAFILE='zdctree.root' OPT='RECREATE'"]))
553 return acc
554

◆ ZdcNtupleRun3Cfg()

python.ZdcRecConfig.ZdcNtupleRun3Cfg ( flags,
** kwargs )

Definition at line 555 of file ZdcRecConfig.py.

555def ZdcNtupleRun3Cfg(flags,**kwargs):
556
557 acc = ComponentAccumulator()
558 acc.merge(ZdcNtupleCfg(flags,
559 useGRL = False,
560 zdcOnly = True,
561 lhcf2022 = False,
562 lhcf2022zdc = False,
563 lhcf2022afp = False,
564 isMC = flags.Input.isMC,
565 enableTrigger = not flags.Input.isMC,
566 enableOutputSamples = True,
567 enableOutputTree = True,
568 writeOnlyTriggers = False,
569 enableRPD = flags.Detector.EnableZDC_RPD,
570 enableCentroid = flags.Detector.EnableZDC_RPD,
571 reprocZdc = False,
572 **kwargs))
573
574 acc.addService(CompFactory.THistSvc(Output = ["ANALYSIS DATAFILE='NTUP.root' OPT='RECREATE'"]))
575 #acc.setAppProperty("HistogramPersistency","ROOT")
576 return acc
577

◆ ZdcRecCfg()

python.ZdcRecConfig.ZdcRecCfg ( flags)
Configure Zdc analysis alg
Additional arguments are useful in calibration runs

Definition at line 656 of file ZdcRecConfig.py.

656def ZdcRecCfg(flags):
657 """Configure Zdc analysis alg
658 Additional arguments are useful in calibration runs
659 """
660
661 acc = ComponentAccumulator()
662
663 run = flags.GeoModel.Run
664
665 # debugging message since the metadata isn't working for calibration files yet
666 log.info ("ZdcRecConfig.py: run = "+run.name)
667
668 if run == LHCPeriod.Run2:
669 log.info ('ZdcRecConfig.py: setting up Run 2!')
670 acc.merge(ZdcRecRun2Cfg(flags))
671 elif run == LHCPeriod.Run3:
672 log.info ('ZdcRecConfig.py: setting up Run 3!')
673 acc.merge(ZdcRecRun3Cfg(flags))
674 else:
675 log.warning ('ZdcRecConfig.py: setting up nothing (problem)!')
676
677 if flags.Output.doWriteESD or flags.Output.doWriteAOD:
678 acc.merge(ZdcRecOutputCfg(flags))
679
680 return acc
681
682

◆ ZdcRecOutputCfg()

python.ZdcRecConfig.ZdcRecOutputCfg ( flags)

Definition at line 272 of file ZdcRecConfig.py.

272def ZdcRecOutputCfg(flags):
273
274 acc = ComponentAccumulator()
275
276 ZDC_ItemList=[]
277 if flags.Input.Format is Format.BS:
278 ZDC_ItemList.append("xAOD::ZdcModuleContainer#ZdcModules")
279 ZDC_ItemList.append("xAOD::ZdcModuleAuxContainer#ZdcModulesAux.")
280 ZDC_ItemList.append("xAOD::ZdcModuleContainer#ZdcSums")
281 ZDC_ItemList.append("xAOD::ZdcModuleAuxContainer#ZdcSumsAux.")
282
283 acc.merge(addToESD(flags,ZDC_ItemList))
284 acc.merge(addToAOD(flags,ZDC_ItemList))
285
286 if flags.Output.doWriteAOD:
287 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
288 acc.merge(SetupMetaDataForStreamCfg(flags,streamName="AOD"))
289
290 return acc
291
292

◆ ZdcRecRun2Cfg()

python.ZdcRecConfig.ZdcRecRun2Cfg ( flags)

Definition at line 372 of file ZdcRecConfig.py.

372def ZdcRecRun2Cfg(flags):
373 acc = ComponentAccumulator()
374 config = SetConfigTag(flags)
375 log.info ('ZdcRecConfig.py: Running with config tag%s', config)
376
377 doCalib = False
378 doTimeCalib = False
379 doTrigEff = False
380 doNonLinCorr = False
381 doFADCCorr = False
382
383 if flags.Input.ProjectName == "data15_hi":
384 doCalib = True
385 doTimeCalib = True
386 doTrigEff = True
387 elif flags.Input.ProjectName == "data17_13TeV":
388 doCalib = False
389 doTimeCalib = False
390 doTrigEff = False
391 elif flags.Input.ProjectName == "data16_hip":
392 doCalib = True
393 doTimeCalib = False
394 doTrigEff = False
395 elif flags.Input.ProjectName == "data18_hi":
396 doCalib = True
397 doTimeCalib = False
398 doTrigEff = False
399
400 acc.merge(ByteStreamReadCfg(flags, type_names=['xAOD::TriggerTowerContainer/ZdcTriggerTowers',
401 'xAOD::TriggerTowerAuxContainer/ZdcTriggerTowersAux.']))
402
403 acc.addEventAlgo(CompFactory.ZdcByteStreamRawDataV2())
404 acc.addEventAlgo(CompFactory.ZdcRecV3Decode())
405
406 anaTool = acc.popToolsAndMerge(ZdcAnalysisToolCfg(flags,2,config,doCalib,doFADCCorr,doNonLinCorr,doTimeCalib,doTrigEff))
407
408 acc.addEventAlgo(CompFactory.ZdcRecV3("ZdcRecV3",ZdcAnalysisTool=anaTool))
409
410 return acc
411

◆ ZdcRecRun3Cfg()

python.ZdcRecConfig.ZdcRecRun3Cfg ( flags)

Definition at line 412 of file ZdcRecConfig.py.

412def ZdcRecRun3Cfg(flags):
413
414 acc = ComponentAccumulator()
415 config = SetConfigTag(flags)
416 log.info ('ZdcRecConfig.py: Running with config tag %s', config)
417
418 doCalib = False
419 doTimeCalib = False
420 doTrigEff = False
421 doFADCCorr = False
422 doNonLinCorr = True #default for 2023
423 ForceCalibRun = -1
424 ForceCalibLB = 814
425 AuxSuffix = ""
426
427 if flags.Input.TriggerStream != "calibration_ZDCInjCalib" and flags.Input.TriggerStream != "calibration_DcmDummyProcessor":
428 if flags.Common.isOnline: # calibration file for ongoing run not available - copy calib file from eos & hard code the run + lb
429 doCalib = True
430 doTimeCalib = True
431 if flags.Input.ProjectName == "data24_5p36TeV" or flags.Input.ProjectName == "data24_refcomm":
432 ForceCalibRun = 488239
433 ForceCalibLB = 1
434 elif flags.Input.ProjectName == "data24_hi" or flags.Input.ProjectName == "data24_hicomm":
435 ForceCalibRun = 488980 # place holder available at point1 - replace with a 2024 run during data taking
436 ForceCalibLB = 80
437 else:
438 doCalib = False
439 doTimeCalib = False
440 elif flags.Input.ProjectName == "data23_comm":
441 doCalib = True
442 elif flags.Input.ProjectName == "data23_hi":
443 doCalib = True
444 doTimeCalib = True
445 elif flags.Input.ProjectName == "data24_hi":
446 doCalib = True
447 doTimeCalib = True
448 doFADCCorr = True
449 doNonLinCorr = False
450 elif flags.Input.ProjectName in ["data25_hip","data25_hipcomm"]:
451 doCalib = True
452 doTimeCalib = False
453 doFADCCorr = False
454 doNonLinCorr = False
455 elif flags.Input.ProjectName in ["data25_hicomm"]:
456 doCalib = False
457 doTimeCalib = False
458 doFADCCorr = False
459 doNonLinCorr = False
460 elif flags.Input.ProjectName in ["data25_hi"]:
461 doCalib = True
462 doTimeCalib = True
463 doFADCCorr = True
464 doNonLinCorr = False
465
466 # No calibration required (or exists) for MC
467 if flags.Input.isMC:
468 doCalib = False
469
470 doRPD = flags.Detector.EnableZDC_RPD
471
472 log.info('ZdcRecRun3Cfg: doCalib = '+str(doCalib)+' for project '+flags.Input.ProjectName)
473 log.info('RPD enable flag is '+str(doRPD))
474
475 zdcReproc = False
476 if "ZdcModules" in flags.Input.Collections:
477 log.info('ZdcRecConfig.py: found ZdcModules in input, reprocessing mode set')
478 AuxSuffix="RP"
479 zdcReproc = True
480
481 anaTool = acc.popToolsAndMerge(ZdcAnalysisToolCfg(flags,3,config,doCalib,doFADCCorr,doNonLinCorr,doTimeCalib,doTrigEff,ForceCalibRun,ForceCalibLB, AuxSuffix))
482
483
484 if (doRPD):
485 rpdAnaTool = acc.popToolsAndMerge(RPDAnalysisToolCfg(flags, config, AuxSuffix))
486 centroidTool = acc.popToolsAndMerge(RpdSubtractCentroidToolCfg(flags, config, AuxSuffix))
487
488 if flags.Input.isMC :
489 zdcTools = [anaTool] # expand list as needed
490 if doRPD:
491 zdcTools += [rpdAnaTool,centroidTool]
492 elif flags.Trigger.doZDC : # if doZDC flag is true we are in a trigger reprocessing -> no TrigValidTool
493 zdcTools = [anaTool] # expand list as needed
494 elif flags.Input.TriggerStream == "calibration_ZDCInjCalib" or flags.Input.TriggerStream == "calibration_DcmDummyProcessor":
495 zdcTools = [anaTool] # no trigger / RPD / centroid - either online or offline
496 elif flags.Common.isOnline: # running online + NOT injector pulse: with RPD + centroid but no trigger validation for now; may add later
497 zdcTools = [anaTool] # expand list as needed
498 if doRPD:
499 zdcTools += [rpdAnaTool,centroidTool]
500 elif (zdcReproc): # ZDC reprocessing (will take work to make it work for RPD)
501 zdcTools = [anaTool]
502 if doRPD:
503 zdcTools += [rpdAnaTool,centroidTool]
504 else: # default (not MC, not trigger repoc, not injector pulse, not online)
505 trigTool = acc.popToolsAndMerge(ZdcTrigValToolCfg(flags,config))
506 zdcTools = [anaTool,trigTool] # expand list as needed
507 if doRPD:
508 zdcTools += [rpdAnaTool,centroidTool]
509
510 if flags.Input.Format is Format.BS:
511 acc.addEventAlgo(CompFactory.ZdcByteStreamLucrodData())
512 acc.addEventAlgo(CompFactory.ZdcRecRun3Decode())
513 if flags.Input.isMC:
514 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
515 acc.merge(PoolReadCfg(flags))
516 acc.addEventAlgo(CompFactory.ZdcMCTruthAlg())
517
518 zdcAlg = CompFactory.ZdcRecRun3("ZdcRecRun3",ZdcAnalysisTools=zdcTools)
519 acc.addEventAlgo(zdcAlg, primary=True)
520
521 return acc
522

◆ ZdcStreamDependentFlagSetting()

python.ZdcRecConfig.ZdcStreamDependentFlagSetting ( flags)
Function that checks on data type from triggerstream tag
and sets run-type-and-year-dependent settings
Returns: a tuple of the following four values
    isLED - bool, true if running on LED data
    isInj - bool, true if running on Inj data
    isCalib - bool, true if running on Calib data
    pn - string, project name such as data24_hi

Definition at line 191 of file ZdcRecConfig.py.

191def ZdcStreamDependentFlagSetting(flags):
192 '''Function that checks on data type from triggerstream tag
193 and sets run-type-and-year-dependent settings
194 Returns: a tuple of the following four values
195 isLED - bool, true if running on LED data
196 isInj - bool, true if running on Inj data
197 isCalib - bool, true if running on Calib data
198 pn - string, project name such as data24_hi
199 '''
200 # check for LED / calibration data running, and configure appropriately
201 isComm = (flags.Input.ProjectName == "data25_comm" and flags.Input.TriggerStream == "calibration_ZDCCalib")
202 isLED = (flags.Input.TriggerStream == "calibration_ZDCLEDCalib")
203 isInj = (flags.Input.TriggerStream == "calibration_ZDCInjCalib" or isComm)
204 isCalib = (flags.Input.TriggerStream == "calibration_ZDCCalib" or "physics_" in flags.Input.TriggerStream or flags.Input.TriggerStream == "express_express" and not isComm)
205
206 if flags.Input.TriggerStream == "calibration_DcmDummyProcessor": # standalone data: do we want to run calibration or LED?
207 runInjForStandaloneDataArgValid = False
208
209 if flags.hasFlag("runInjForStandaloneData"): # if passed as an argument, runInjForStandaloneData should have been dynamically loaded as a flag in fillFromArgs
210 if flags.runInjForStandaloneData.lower() == "inj":
211 isInj = True
212 runInjForStandaloneDataArgValid = True
213 elif flags.runInjForStandaloneData.lower() == "led":
214 isLED = True
215 runInjForStandaloneDataArgValid = True
216
217 if not runInjForStandaloneDataArgValid: # runInjForStandaloneData is not a defined flag
218 log.warning("runInjForStandaloneData is either not a defined flag or has invalid value (value must be Inj / LED, case insensitive).")
219 log.warning("Running nominal reconstruction (injector-pulse) by default for standalone data")
220 log.warning("Could lead to undesired behavior if pulsing LED in standalone mode")
221 isInj = True
222
223 if isLED:
224 log.info('ZdcRecConfig: Running LED data!')
225 if isInj:
226 log.info('ZdcRecConfig: Running Injected pulse data!')
227 if isCalib:
228 log.info('ZdcRecConfig: Running ZDC calibration data!')
229 if flags.Input.isMC:
230 log.info('ZdcRecConfig: Running over MC Samples')
231 flags.Input.ProjectName = "data23_hi"
232 flags.Reco.EnableTrigger = False
233
234 # supply missing metadata based on project name
235 pn = flags.Input.ProjectName
236 if not pn:
237 raise ValueError('Unknown project name')
238
239 if isLED or isInj or pn == 'data_test':
240 flags.Trigger.EDMVersion=3
241 flags.GeoModel.Run = LHCPeriod.Run3
242 flags.IOVDb.GlobalTag=defaultConditionsTags.RUN3_DATA
243 else:
244 year = int(pn.split('_')[0].split('data')[1])
245 if year < 20:
246 flags.Trigger.EDMVersion=2
247 flags.GeoModel.Run = LHCPeriod.Run2
248 flags.IOVDb.GlobalTag=defaultConditionsTags.RUN2_DATA
249 elif year > 20:
250 flags.Trigger.EDMVersion=3
251 flags.GeoModel.Run = LHCPeriod.Run3
252 flags.IOVDb.GlobalTag=defaultConditionsTags.RUN3_DATA
253
254 if flags.Input.isMC:
255 log.info('ZdcRecConfig: Overriding MC run to be Run 3!')
256 flags.GeoModel.Run = LHCPeriod.Run3
257
258 if (isInj
259 or flags.Input.TriggerStream == "calibration_DcmDummyProcessor"
260 or pn == "data22_13p6TeV"):
261 flags.Detector.EnableZDC_RPD = False # disable RPD for injector, LHCf
262
263 if flags.Input.TriggerStream == "calibration_DcmDummyProcessor": # standalone data: no trigger info available
264 flags.DQ.useTrigger = False
265 flags.DQ.triggerDataAvailable = False
266
267 flags.GeoModel.AtlasVersion=zdcGeometry(flags)
268
269 return isLED, isInj, isCalib, pn # return a ntuple of stream and project-name info for further use
270
271
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:177

◆ ZdcTrigValToolCfg()

python.ZdcRecConfig.ZdcTrigValToolCfg ( flags,
config = 'PbPb2023' )

Definition at line 331 of file ZdcRecConfig.py.

331def ZdcTrigValToolCfg(flags, config = 'PbPb2023'):
332 acc = ComponentAccumulator()
333
334 acc.merge(TrigDecisionToolCfg(flags))
335
336 trigValTool = CompFactory.ZDC.ZdcTrigValidTool(
337 name = 'ZdcTrigValTool',
338 WriteAux = True,
339 AuxSuffix = '',
340 filepath_LUT = 'TrigT1ZDC/zdc_json_PbPb5.36TeV_2023.json') # changed on Oct 13 to accomodate Zdc 1n peak shift
341
342 trigValTool.TrigDecisionTool = acc.getPublicTool('TrigDecisionTool')
343
344 trigValTool.triggerList = [c for c in getL1MenuAccess(flags) if 'L1_ZDC_BIT' in c]
345
346 acc.setPrivateTools(trigValTool)
347
348 return acc
349

Variable Documentation

◆ acc

python.ZdcRecConfig.acc = MainServicesCfg(flags)

Definition at line 709 of file ZdcRecConfig.py.

◆ AODFileName

python.ZdcRecConfig.AODFileName

Definition at line 700 of file ZdcRecConfig.py.

◆ doWriteAOD

python.ZdcRecConfig.doWriteAOD

Definition at line 702 of file ZdcRecConfig.py.

◆ flags

python.ZdcRecConfig.flags = initConfigFlags()

Definition at line 694 of file ZdcRecConfig.py.

◆ HISTFileName

python.ZdcRecConfig.HISTFileName

Definition at line 701 of file ZdcRecConfig.py.

◆ isCalib

python.ZdcRecConfig.isCalib

Definition at line 704 of file ZdcRecConfig.py.

◆ isInj

python.ZdcRecConfig.isInj

Definition at line 704 of file ZdcRecConfig.py.

◆ isLED

python.ZdcRecConfig.isLED

Definition at line 704 of file ZdcRecConfig.py.

◆ log

python.ZdcRecConfig.log = logging.getLogger("ZdcRecConfig")

Definition at line 25 of file ZdcRecConfig.py.

◆ pn

python.ZdcRecConfig.pn

Definition at line 704 of file ZdcRecConfig.py.

◆ status

python.ZdcRecConfig.status = acc.run()

Definition at line 751 of file ZdcRecConfig.py.

◆ withDetails

python.ZdcRecConfig.withDetails

Definition at line 746 of file ZdcRecConfig.py.

◆ zdcConfigMap

dict python.ZdcRecConfig.zdcConfigMap = {}

Definition at line 29 of file ZdcRecConfig.py.

◆ zdcMonitorAcc

python.ZdcRecConfig.zdcMonitorAcc = ZdcMonitoringConfig(flags)

Definition at line 733 of file ZdcRecConfig.py.