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_hip5TeV'] = {}
68 zdcConfigMap['data16_hip8TeV'] = {}
69 zdcConfigMap['data17_13TeV'] = {}
70 zdcConfigMap['data18_hi'] = {}
71 zdcConfigMap['data22_13p6TeV'] = {}
72 zdcConfigMap['data23_5p36TeV'] = {}
73 zdcConfigMap['data23_13p6TeV'] = {}
74 zdcConfigMap['data23_hi'] = {}
75 zdcConfigMap['data23_comm'] = {}
76 zdcConfigMap['data23_5p36TeV'] = {}
77 zdcConfigMap['data24_900GeV'] = {}
78
79 zdcConfigMap['data24_13p6TeV'] = {}
80 zdcConfigMap['data24_13p6TeV']['default'] = 'pp2024'
81
82 zdcConfigMap['data24_refcomm'] = {}
83 zdcConfigMap['data24_refcomm']['default'] = 'pp2024'
84 zdcConfigMap['data24_refcomm']['calibration_ZdcInjCalib'] = 'Injectorpp2024'
85
86 zdcConfigMap['data24_hicomm'] = {}
87 zdcConfigMap['data24_hicomm']['default'] = 'PbPb2024'
88 zdcConfigMap['data24_hicomm']['calibration_ZdcInjCalib'] = 'InjectorPbPb2024'
89
90 zdcConfigMap['data24_hi'] = {}
91 zdcConfigMap['data24_hi']['default']="PbPb2024"
92 zdcConfigMap['data24_hi']['calibration_ZdcInjCalib']="InjectorPbPb2024"
93

◆ RPDAnalysisToolCfg()

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

Definition at line 353 of file ZdcRecConfig.py.

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

◆ RpdSubtractCentroidToolCfg()

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

Definition at line 364 of file ZdcRecConfig.py.

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

◆ SetConfigTag()

python.ZdcRecConfig.SetConfigTag ( flags)

Definition at line 94 of file ZdcRecConfig.py.

94def SetConfigTag(flags):
95
96 aa_type = 82 # default to Pb+Pb unless a run number is provided
97 if flags.Input.RunNumbers:
98 run_num = flags.Input.RunNumbers[0]
99 aa = getTypeForRun(run_num)
100 if aa is not None:
101 aa_type = aa.getBeam1Type()
102 print('ZdcRecConfig::SetConfigTag(): Getting config for type %d' % (aa_type))
103
104 # terrible kludge for early 2025
105 if flags.Input.ProjectName == "data25_comm" and flags.Input.TriggerStream == "calibration_ZDCCalib":
106 config = "InjectorPbPb2024"
107
108 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
109 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)
110 if flags.Input.ProjectName == "data24_5p36TeV" or flags.Input.ProjectName == "data24_900GeV" or flags.Input.ProjectName == "data24_13p6TeV" or flags.Input.ProjectName == "data24_refcomm":
111 config = "Injectorpp2024"
112 if flags.Input.ProjectName in ["data24_hi","data24_hicomm"]:
113 config = "InjectorPbPb2024"
114 if flags.Input.ProjectName in ["data25_hi","data25_hicomm","data25_hip"] :
115 if (aa_type == 8 or aa_type == 10):
116 config = "InjectorpOOONeNe2025"
117 if (aa_type == 82):
118 config = "configZDC_PbPb2025.inj.v1.json"
119
120 else:
121 config = "PbPb2023" # default config tag
122
123 run = flags.GeoModel.Run
124 if run == LHCPeriod.Run3:
125 if flags.Input.isMC:
126 config = "MonteCarloPbPb2023"
127 elif flags.Input.ProjectName == "data22_13p6TeV":
128 config = "LHCf2022"
129 elif flags.Input.ProjectName in ["data23_5p36TeV", "data23_900GeV", "data23_13p6TeV"]:
130 config = "pp2023"
131 elif flags.Input.ProjectName in ["data23_hi", "data23_comm"]:
132 config = "PbPb2023"
133 elif flags.Input.ProjectName in ["data24_5p36TeV", "data24_900GeV", "data24_13p6TeV", "data24_refcomm"]:
134 config = "pp2024"
135 elif flags.Input.ProjectName in ["data24_hi", "data24_hicomm"]:
136 config = "configZDC_PbPb2024.v5.json"
137 elif flags.Input.ProjectName in ["data25_hipcomm"]:
138 config = "pO2025"
139 elif flags.Input.ProjectName in ["data25_hip"]:
140 config = "pO2025B"
141 elif flags.Input.ProjectName in ["data25_hi","data25_hicomm"]:
142 if (aa_type == 8 or aa_type == 10):
143 config = "OONeNe2025"
144 if (aa_type == 82):
145 config = "configZDC_PbPb2025.v1.json"
146 elif run == LHCPeriod.Run2:
147 if flags.Input.ProjectName == "data15_hi":
148 config = "PbPb2015"
149 elif flags.Input.ProjectName == "data17_13TeV":
150 config = "PbPb2015"
151 elif flags.Input.ProjectName == "data16_hip5TeV":
152 config = "pPb2016"
153 elif flags.Input.ProjectName == "data16_hip8TeV":
154 config = "pPb2016"
155 elif flags.Input.ProjectName == "data18_hi":
156 config = "PbPb2018"
157
158 return config
159
160
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 296 of file ZdcRecConfig.py.

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

◆ 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 161 of file ZdcRecConfig.py.

161def ZdcGenericFlagSetting(flags): # pass flags object by reference: directly set flags in function
162 '''set generic flags needed for ZDC reconstruction that are independent of stream type
163 Also fills flags from input arguments'''
164
165 flags.Scheduler.CheckDependencies = True
166 flags.Scheduler.ShowDataDeps = True
167 flags.Scheduler.ShowDataFlow = True
168 flags.Scheduler.ShowControlFlow = True
169 flags.Scheduler.EnableVerboseViews = True
170
171 flags.Detector.GeometryZDC=True
172 flags.Detector.GeometryAFP=False
173 flags.Detector.GeometryALFA=False
174 flags.Detector.GeometryLucid=False
175 flags.Detector.GeometryMDT=False
176 flags.Detector.GeometryMM=False
177 flags.Detector.GeometryMuon=False
178
179 flags.Trigger.decodeHLT=False
180 flags.Trigger.enableL1MuonPhase1=False
181 flags.Trigger.L1.doMuon=False
182 flags.Trigger.L1.doCalo=False
183 flags.Trigger.L1.doTopo=False
184
185 # This does not work in this context
186 # run = flags.GeoModel.Run
187 # The EDM Version should be auto configured, but is not working at the moment, so is set by hand
188
189 parser = flags.getArgumentParser()
190 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")
191 flags.fillFromArgs(parser=parser)
192
193

◆ 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_hip5TeV":
39 return defaultGeometryTags.RUN2_ZDC
40 case "data16_hip8TeV":
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 585 of file ZdcRecConfig.py.

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

◆ ZdcLEDAnalysisToolCfg()

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

Definition at line 324 of file ZdcRecConfig.py.

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

◆ ZdcLEDNtupleCfg()

python.ZdcRecConfig.ZdcLEDNtupleCfg ( flags)

Definition at line 608 of file ZdcRecConfig.py.

608def ZdcLEDNtupleCfg(flags):
609 acc = ComponentAccumulator()
610 zdcLEDNtuple = CompFactory.ZdcLEDNtuple("ZdcLEDNtuple")
611 zdcLEDNtuple.enableOutputTree = True
612 acc.addEventAlgo(zdcLEDNtuple)
613 acc.addService(CompFactory.THistSvc(Output = ["ANALYSIS DATAFILE='NTUP.root' OPT='RECREATE'"]))
614 return acc
615

◆ ZdcLEDRecCfg()

python.ZdcRecConfig.ZdcLEDRecCfg ( flags)

Definition at line 616 of file ZdcRecConfig.py.

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

◆ ZdcLEDTrigCfg()

python.ZdcRecConfig.ZdcLEDTrigCfg ( flags)

Definition at line 650 of file ZdcRecConfig.py.

650def ZdcLEDTrigCfg(flags):
651
652 acc = ComponentAccumulator()
653
654 # suggested by Tim Martin
655 tdmv = CompFactory.TrigDec.TrigDecisionMakerValidator()
656 tdmv.errorOnFailure = True
657 tdmv.TrigDecisionTool = acc.getPrimaryAndMerge(TrigDecisionToolCfg(flags))
658 tdmv.NavigationKey = getRun3NavigationContainerFromInput(flags)
659 acc.addEventAlgo( tdmv )
660 # end of Tim's suggestions
661 return acc
662

◆ ZdcNtupleLocalCfg()

python.ZdcRecConfig.ZdcNtupleLocalCfg ( flags)

Definition at line 530 of file ZdcRecConfig.py.

530def ZdcNtupleLocalCfg(flags):
531
532 acc = ComponentAccumulator()
533 run = flags.GeoModel.Run
534
535 if run == LHCPeriod.Run2:
536 log.info ('ZdcRecConfig.py: setting up Run 2 ntuple!')
537 acc.merge(ZdcNtupleRun2Cfg(flags))
538 elif run == LHCPeriod.Run3:
539 log.info ('ZdcRecConfig.py: setting up Run 3 ntuples!')
540 acc.merge(ZdcNtupleRun3Cfg(flags))
541 else:
542 log.info ('ZdcRecConfig.py: setting up no ntuple!')
543
544 return acc
545

◆ ZdcNtupleRun2Cfg()

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

Definition at line 546 of file ZdcRecConfig.py.

546def ZdcNtupleRun2Cfg(flags,**kwargs):
547
548 acc = ComponentAccumulator()
549 acc.merge(ZdcNtupleCfg(flags,
550 useGRL = False,
551 zdcOnly = True,
552 enableTrigger = False,
553 enableOutputSamples = True,
554 enableOutputTree = True,
555 writeOnlyTriggers = False,
556 nsamplesZdc = 7,
557 **kwargs))
558
559 acc.addService(CompFactory.THistSvc(Output = ["ANALYSIS DATAFILE='NTUP.root' OPT='RECREATE'"]))
560 return acc
561

◆ ZdcNtupleRun3Cfg()

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

Definition at line 562 of file ZdcRecConfig.py.

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

◆ ZdcRecCfg()

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

Definition at line 663 of file ZdcRecConfig.py.

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

◆ ZdcRecOutputCfg()

python.ZdcRecConfig.ZdcRecOutputCfg ( flags)

Definition at line 275 of file ZdcRecConfig.py.

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

◆ ZdcRecRun2Cfg()

python.ZdcRecConfig.ZdcRecRun2Cfg ( flags)

Definition at line 375 of file ZdcRecConfig.py.

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

◆ ZdcRecRun3Cfg()

python.ZdcRecConfig.ZdcRecRun3Cfg ( flags)

Definition at line 419 of file ZdcRecConfig.py.

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

◆ 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 194 of file ZdcRecConfig.py.

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

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

Variable Documentation

◆ acc

python.ZdcRecConfig.acc = MainServicesCfg(flags)

Definition at line 716 of file ZdcRecConfig.py.

◆ AODFileName

python.ZdcRecConfig.AODFileName

Definition at line 707 of file ZdcRecConfig.py.

◆ doWriteAOD

python.ZdcRecConfig.doWriteAOD

Definition at line 709 of file ZdcRecConfig.py.

◆ flags

python.ZdcRecConfig.flags = initConfigFlags()

Definition at line 701 of file ZdcRecConfig.py.

◆ HISTFileName

python.ZdcRecConfig.HISTFileName

Definition at line 708 of file ZdcRecConfig.py.

◆ isCalib

python.ZdcRecConfig.isCalib

Definition at line 711 of file ZdcRecConfig.py.

◆ isInj

python.ZdcRecConfig.isInj

Definition at line 711 of file ZdcRecConfig.py.

◆ isLED

python.ZdcRecConfig.isLED

Definition at line 711 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 711 of file ZdcRecConfig.py.

◆ status

python.ZdcRecConfig.status = acc.run()

Definition at line 761 of file ZdcRecConfig.py.

◆ withDetails

python.ZdcRecConfig.withDetails

Definition at line 756 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 749 of file ZdcRecConfig.py.