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="")
 LISAnalysisToolCfg (flags, str config)
 ZdcLisNtupleCfg (flags, lisInj=False, lisLED=False, enableTrigger=True)
 ZdcRecRun2Cfg (flags)
 ZdcRecRun3Cfg (flags)
 ZdcNtupleLocalCfg (flags)
 ZdcNtupleRun2Cfg (flags, **kwargs)
 ZdcNtupleRun3Cfg (flags, **kwargs)
 ZdcInjNtupleCfg (flags, **kwargs)
 ZdcLEDNtupleCfg (flags)
 ZdcLEDRecCfg (flags)
 ZdcLEDTrigCfg (flags)
 LisRecCfg (flags)
 ZdcRecCfg (flags)

Variables

 log = logging.getLogger("ZdcRecConfig")
dict zdcConfigMap = {}
 flags = initConfigFlags()
list ProjectNamesLIS = ["data26_cos", "data26_900GeV", "data26_13p6TeV","data26_comm", "data_test"]
 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 68 of file ZdcRecConfig.py.

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

◆ LISAnalysisToolCfg()

python.ZdcRecConfig.LISAnalysisToolCfg ( flags,
str config )

Definition at line 387 of file ZdcRecConfig.py.

387def LISAnalysisToolCfg(flags, config: str):
388 acc = ComponentAccumulator()
389 acc.setPrivateTools(
390 CompFactory.ZDC.LISAnalysisTool(
391 name="LISAnalysisTool",
392 Configuration=config,
393 BaselineStart=0,
394 BaselineEnd=5,
395 PulseStart=6,
396 PulseEnd=12,
397 ChannelPedestals=[100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]
398 )
399 )
400 return acc
401

◆ LisRecCfg()

python.ZdcRecConfig.LisRecCfg ( flags)

Definition at line 715 of file ZdcRecConfig.py.

715def LisRecCfg(flags):
716
717 acc = ComponentAccumulator()
718
719 run = flags.GeoModel.Run
720
721 # debugging message since the metadata isn't working for calibration files yet
722 log.info ("LisRecConfig.py: run = "+run.name)
723 config = SetConfigTag(flags)
724
725 DecodeRunMode = 1 # LIS run mode
726
727 if flags.Input.ProjectName in ["data26_comm", "data26_900GeV", "data26_13p6TeV", "data26_cos"]:
728 DecodeRunMode = 1 # LIS run mode
729 elif flags.Input.ProjectName in []: #special run mode for 7 lucrod - not currently used
730 DecodeRunMode = 2 # 7 lucrod run mode, 2026 jan M week
731
732 # LIS processing
733
734 isLED = (flags.Input.TriggerStream == "calibration_ZDCLEDCalib")
735
736 anaTool = acc.popToolsAndMerge(LISAnalysisToolCfg(flags,config))
737 zdcTools = [anaTool]
738
739 if flags.Input.Format is Format.BS:
740 acc.merge(ByteStreamReadCfg(flags))
741 acc.addEventAlgo(CompFactory.ZdcByteStreamLucrodData())
742 acc.addEventAlgo(CompFactory.ZdcRecRun3Decode( DecodeRunMode = DecodeRunMode ))
743
744 evtType = 2 if isLED else 1 # event type set to ZdcEventLED for LED, otherwise default to normal data/MC event type
745 DAQMode = 2 if isLED else 3 # DAQMode set to PhysicsPEB for LED, otherwise default to normal data/MC run mode
746
747 zdcAlg = CompFactory.ZdcRecRun3("ZdcRecRun3",DAQMode=DAQMode, ForcedEventType=evtType, ZdcAnalysisTools=zdcTools) # DAQMode set to PhysicsPEB, event type set to ZdcEventLED
748 acc.addEventAlgo(zdcAlg, primary=True)
749
750 if flags.Output.doWriteESD or flags.Output.doWriteAOD:
751 acc.merge(ZdcRecOutputCfg(flags))
752
753 return acc
754

◆ RPDAnalysisToolCfg()

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

Definition at line 365 of file ZdcRecConfig.py.

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

◆ RpdSubtractCentroidToolCfg()

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

Definition at line 376 of file ZdcRecConfig.py.

376def RpdSubtractCentroidToolCfg(flags, config: str, AuxSuffix=""):
377 acc = ComponentAccumulator()
378 acc.setPrivateTools(
379 CompFactory.ZDC.RpdSubtractCentroidTool(
380 name="RpdSubtractCentroidTool",
381 Configuration=config,
382 AuxSuffix = AuxSuffix
383 )
384 )
385 return acc
386

◆ SetConfigTag()

python.ZdcRecConfig.SetConfigTag ( flags)

Definition at line 98 of file ZdcRecConfig.py.

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

307def ZdcAnalysisToolCfg(flags, run, config="PbPb2023", DoCalib=False, DoFADCCorr=False, DoNonLinCorr=False, DoTimeCalib=False, DoTrigEff=False, ForceCalibRun=-1, ForceCalibLB=814, AuxSuffix=""):
308 acc = ComponentAccumulator()
309
310 log.info('ZdcAnalysisToolCfg: setting up ZdcAnalysisTool with config='+config)
311
312 jsonFile = ''
313
314 if (config[-5:]=='.json'):
315 jsonFile = config
316 config = "JSON"
317 log.info('ZdcAnalysisToolCfg: setting up with JSON file '+jsonFile)
318
319 acc.setPrivateTools(CompFactory.ZDC.ZdcAnalysisTool(
320 name = 'ZdcAnalysisTool'+config,
321 Configuration = config,
322 DoCalib = DoCalib,
323 DoFADCCorr = DoFADCCorr,
324 DoFADCCorrPerSample = True,
325 DoNonLinCorr = DoNonLinCorr,
326 DoTimeCalib = DoTimeCalib,
327 DoTrigEff = DoTrigEff,
328 ForceCalibRun = ForceCalibRun,
329 ForceCalibLB = ForceCalibLB,
330 AuxSuffix = AuxSuffix,
331 JSONConfigurationFile=jsonFile,
332 LHCRun = run,
333 CombineDelay = True if flags.Input.ProjectName == "data16_hip8TeV" else False))
334 return acc
335

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

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

◆ 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 "data26_hi":
57 return defaultGeometryTags.RUN3_ZDC24
58 case "data26_hicomm":
59 return defaultGeometryTags.RUN3_ZDC24
60 case _:
61 run = flags.GeoModel.Run
62 if run == LHCPeriod.Run2:
63 return defaultGeometryTags.RUN2_ZDC
64 if run == LHCPeriod.Run3:
65 return defaultGeometryTags.RUN3_ZDC24
66 return ""
67

◆ ZdcInjNtupleCfg()

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

Definition at line 636 of file ZdcRecConfig.py.

636def ZdcInjNtupleCfg(flags,**kwargs):
637
638 acc = ComponentAccumulator()
639 acc.merge(ZdcNtupleCfg(flags,
640 useGRL = False,
641 zdcOnly = True,
642 zdcInj = True,
643 pbpb2023 = False,
644 lhcf2022 = False,
645 lhcf2022zdc = False,
646 lhcf2022afp = False,
647 enableTrigger = False,
648 enableOutputSamples = True,
649 enableOutputTree = True,
650 writeOnlyTriggers = False,
651 enableRPD = False,
652 enableCentroid = False,
653 reprocZdc = False,
654 **kwargs))
655
656 acc.addService(CompFactory.THistSvc(Output = ["ANALYSIS DATAFILE='NTUP.root' OPT='RECREATE'"]))
657 #acc.setAppProperty("HistogramPersistency","ROOT")
658 return acc
659

◆ ZdcLEDAnalysisToolCfg()

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

Definition at line 336 of file ZdcRecConfig.py.

336def ZdcLEDAnalysisToolCfg(flags, config = 'ppPbPb2023', DoFADCCorr = True):
337 acc = ComponentAccumulator()
338
339 log.info('ZdcAnalysisToolCfg: setting up ZdcAnalysisTool with config='+config)
340 acc.setPrivateTools(CompFactory.ZDC.ZdcLEDAnalysisTool(name = 'ZdcLEDAnalysisTool'+config,
341 Configuration = config,
342 DoFADCCorr = DoFADCCorr))
343 return acc
344
345

◆ ZdcLEDNtupleCfg()

python.ZdcRecConfig.ZdcLEDNtupleCfg ( flags)

Definition at line 660 of file ZdcRecConfig.py.

660def ZdcLEDNtupleCfg(flags):
661 acc = ComponentAccumulator()
662 zdcLEDNtuple = CompFactory.ZdcLEDNtuple("ZdcLEDNtuple")
663 zdcLEDNtuple.enableOutputTree = True
664 acc.addEventAlgo(zdcLEDNtuple)
665 acc.addService(CompFactory.THistSvc(Output = ["ANALYSIS DATAFILE='NTUP.root' OPT='RECREATE'"]))
666 return acc
667

◆ ZdcLEDRecCfg()

python.ZdcRecConfig.ZdcLEDRecCfg ( flags)

Definition at line 668 of file ZdcRecConfig.py.

668def ZdcLEDRecCfg(flags):
669
670 acc = ComponentAccumulator()
671
672 if flags.Input.Format is Format.BS:
673 run = flags.GeoModel.Run
674
675 # debugging message since the metadata isn't working for calibration files yet
676 log.info ("ZdcRecConfig.py: run = "+run.name)
677
678 config = 'ppPbPb2023'
679 #config = 'ppALFA2023'
680 doFADCCorr = False
681
682 if flags.Input.ProjectName in ["data24_hi","data25_hip","data25_hi","data26_hicomm","data26_hi"]:
683 doFADCCorr = True
684
685 acc.addEventAlgo(CompFactory.ZdcByteStreamLucrodData())
686 acc.addEventAlgo(CompFactory.ZdcRecRun3Decode())
687
688 anaTool = acc.popToolsAndMerge(ZdcLEDAnalysisToolCfg(flags, config, DoFADCCorr = doFADCCorr)) #anatool for zdcLED calibration
689
690 zdcTools = []
691 zdcTools += [anaTool] # add trigTool after deocration migration
692
693 # FIXME these are dependent on !65768
694 zdcAlg = CompFactory.ZdcRecRun3("ZdcRecRun3",DAQMode=2, ForcedEventType=2, ZdcAnalysisTools=zdcTools) # DAQMode set to PhysicsPEB, event type set to ZdcEventLED
695 acc.addEventAlgo(zdcAlg, primary=True)
696
697 if flags.Output.doWriteESD or flags.Output.doWriteAOD:
698 acc.merge(ZdcRecOutputCfg(flags))
699
700 return acc
701

◆ ZdcLEDTrigCfg()

python.ZdcRecConfig.ZdcLEDTrigCfg ( flags)

Definition at line 702 of file ZdcRecConfig.py.

702def ZdcLEDTrigCfg(flags):
703
704 acc = ComponentAccumulator()
705
706 # suggested by Tim Martin
707 tdmv = CompFactory.TrigDec.TrigDecisionMakerValidator()
708 tdmv.errorOnFailure = True
709 tdmv.TrigDecisionTool = acc.getPrimaryAndMerge(TrigDecisionToolCfg(flags))
710 tdmv.NavigationKey = getRun3NavigationContainerFromInput(flags)
711 acc.addEventAlgo( tdmv )
712 # end of Tim's suggestions
713 return acc
714

◆ ZdcLisNtupleCfg()

python.ZdcRecConfig.ZdcLisNtupleCfg ( flags,
lisInj = False,
lisLED = False,
enableTrigger = True )

Definition at line 402 of file ZdcRecConfig.py.

402def ZdcLisNtupleCfg(flags, lisInj=False, lisLED=False, enableTrigger=True):
403 acc = ComponentAccumulator()
404 LisNtuple = CompFactory.LisNtuple("LisNtuple")
405 LisNtuple.enableOutputTree = True
406 LisNtuple.lisInj = lisInj
407 LisNtuple.lisLED = lisLED
408 LisNtuple.enableTrigger = enableTrigger
409 acc.addEventAlgo(LisNtuple)
410 acc.addService(CompFactory.THistSvc(Output = ["ANALYSIS DATAFILE='NTUP.root' OPT='RECREATE'"]))
411 return acc
412

◆ ZdcNtupleLocalCfg()

python.ZdcRecConfig.ZdcNtupleLocalCfg ( flags)

Definition at line 579 of file ZdcRecConfig.py.

579def ZdcNtupleLocalCfg(flags):
580
581 acc = ComponentAccumulator()
582 run = flags.GeoModel.Run
583
584 if run == LHCPeriod.Run2:
585 log.info ('ZdcRecConfig.py: setting up Run 2 ntuple!')
586 acc.merge(ZdcNtupleRun2Cfg(flags))
587 elif run == LHCPeriod.Run3:
588 log.info ('ZdcRecConfig.py: setting up Run 3 ntuples!')
589 acc.merge(ZdcNtupleRun3Cfg(flags))
590 else:
591 log.info ('ZdcRecConfig.py: setting up no ntuple!')
592
593 return acc
594

◆ ZdcNtupleRun2Cfg()

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

Definition at line 595 of file ZdcRecConfig.py.

595def ZdcNtupleRun2Cfg(flags,**kwargs):
596
597 acc = ComponentAccumulator()
598 acc.merge(ZdcNtupleCfg(flags,
599 useGRL = False,
600 zdcOnly = True,
601 enableTrigger = False,
602 enableOutputSamples = True,
603 enableOutputTree = True,
604 writeOnlyTriggers = False,
605 nsamplesZdc = 7,
606 **kwargs))
607
608 acc.addService(CompFactory.THistSvc(Output = ["ANALYSIS DATAFILE='NTUP.root' OPT='RECREATE'"]))
609 return acc
610

◆ ZdcNtupleRun3Cfg()

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

Definition at line 611 of file ZdcRecConfig.py.

611def ZdcNtupleRun3Cfg(flags,**kwargs):
612
613 acc = ComponentAccumulator()
614 acc.merge(ZdcNtupleCfg(flags,
615 useGRL = False,
616 zdcOnly = False,
617 zdcCalib = True,
618 lhcf2022 = False,
619 lhcf2022zdc = False,
620 lhcf2022afp = False,
621 pbpb2023 = True,
622 isMC = flags.Input.isMC,
623 enableTrigger = not flags.Input.isMC,
624 enableOutputSamples = True,
625 enableOutputTree = True,
626 writeOnlyTriggers = False,
627 enableRPD = flags.Detector.EnableZDC_RPD,
628 enableCentroid = flags.Detector.EnableZDC_RPD,
629 reprocZdc = False,
630 **kwargs))
631
632 acc.addService(CompFactory.THistSvc(Output = ["ANALYSIS DATAFILE='NTUP.root' OPT='RECREATE'"]))
633 #acc.setAppProperty("HistogramPersistency","ROOT")
634 return acc
635

◆ ZdcRecCfg()

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

Definition at line 755 of file ZdcRecConfig.py.

755def ZdcRecCfg(flags):
756 """Configure Zdc analysis alg
757 Additional arguments are useful in calibration runs
758 """
759
760 acc = ComponentAccumulator()
761
762 run = flags.GeoModel.Run
763
764 # debugging message since the metadata isn't working for calibration files yet
765 log.info ("ZdcRecConfig.py: run = "+run.name)
766
767 if run == LHCPeriod.Run2:
768 log.info ('ZdcRecConfig.py: setting up Run 2!')
769 acc.merge(ZdcRecRun2Cfg(flags))
770 elif run == LHCPeriod.Run3:
771 log.info ('ZdcRecConfig.py: setting up Run 3!')
772 acc.merge(ZdcRecRun3Cfg(flags))
773 else:
774 log.warning ('ZdcRecConfig.py: setting up nothing (problem)!')
775
776 if flags.Output.doWriteESD or flags.Output.doWriteAOD:
777 acc.merge(ZdcRecOutputCfg(flags))
778
779 return acc
780
781

◆ ZdcRecOutputCfg()

python.ZdcRecConfig.ZdcRecOutputCfg ( flags)

Definition at line 286 of file ZdcRecConfig.py.

286def ZdcRecOutputCfg(flags):
287
288 acc = ComponentAccumulator()
289
290 ZDC_ItemList=[]
291 if flags.Input.Format is Format.BS:
292 ZDC_ItemList.append("xAOD::ZdcModuleContainer#ZdcModules")
293 ZDC_ItemList.append("xAOD::ZdcModuleAuxContainer#ZdcModulesAux.")
294 ZDC_ItemList.append("xAOD::ZdcModuleContainer#ZdcSums")
295 ZDC_ItemList.append("xAOD::ZdcModuleAuxContainer#ZdcSumsAux.")
296
297 acc.merge(addToESD(flags,ZDC_ItemList))
298 acc.merge(addToAOD(flags,ZDC_ItemList))
299
300 if flags.Output.doWriteAOD:
301 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
302 acc.merge(SetupMetaDataForStreamCfg(flags,streamName="AOD"))
303
304 return acc
305
306

◆ ZdcRecRun2Cfg()

python.ZdcRecConfig.ZdcRecRun2Cfg ( flags)

Definition at line 413 of file ZdcRecConfig.py.

413def ZdcRecRun2Cfg(flags):
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 doNonLinCorr = False
422 doFADCCorr = False
423
424 if flags.Input.ProjectName == "data15_hi":
425 doCalib = True
426 doTimeCalib = True
427 doTrigEff = True
428 elif flags.Input.ProjectName == "data17_13TeV":
429 doCalib = False
430 doTimeCalib = False
431 doTrigEff = False
432 elif flags.Input.ProjectName == "data16_hip5TeV":
433 doCalib = True
434 doTimeCalib = False
435 doTrigEff = False
436 elif flags.Input.ProjectName == "data16_hip8TeV":
437 doCalib = True
438 doTimeCalib = True
439 doTrigEff = False
440 elif flags.Input.ProjectName == "data18_hi":
441 doCalib = True
442 doTimeCalib = False
443 doTrigEff = False
444
445 acc.merge(ByteStreamReadCfg(flags, type_names=['xAOD::TriggerTowerContainer/ZdcTriggerTowers',
446 'xAOD::TriggerTowerAuxContainer/ZdcTriggerTowersAux.']))
447
448 acc.addEventAlgo(CompFactory.ZdcByteStreamRawDataV2())
449 acc.addEventAlgo(CompFactory.ZdcRecV3Decode())
450
451 anaTool = acc.popToolsAndMerge(ZdcAnalysisToolCfg(flags,2,config,doCalib,doFADCCorr,doNonLinCorr,doTimeCalib,doTrigEff))
452
453 acc.addEventAlgo(CompFactory.ZdcRecV3("ZdcRecV3",ZdcAnalysisTool=anaTool))
454
455 return acc
456

◆ ZdcRecRun3Cfg()

python.ZdcRecConfig.ZdcRecRun3Cfg ( flags)

Definition at line 457 of file ZdcRecConfig.py.

457def ZdcRecRun3Cfg(flags):
458
459 acc = ComponentAccumulator()
460 config = SetConfigTag(flags)
461 log.info ('ZdcRecConfig.py: Running with config tag %s', config)
462
463 doCalib = False
464 doTimeCalib = False
465 doTrigEff = False
466 doFADCCorr = False
467 doNonLinCorr = True #default for 2023
468 ForceCalibRun = -1
469 ForceCalibLB = 814
470 AuxSuffix = ""
471
472 if flags.Input.TriggerStream != "calibration_ZDCInjCalib" and flags.Input.TriggerStream != "calibration_DcmDummyProcessor":
473 if flags.Common.isOnline: # calibration file for ongoing run not available - copy calib file from eos & hard code the run + lb
474 doCalib = True
475 doTimeCalib = True
476 if flags.Input.ProjectName == "data24_5p36TeV" or flags.Input.ProjectName == "data24_refcomm":
477 ForceCalibRun = 488239
478 ForceCalibLB = 1
479 elif flags.Input.ProjectName == "data24_hi" or flags.Input.ProjectName == "data24_hicomm":
480 ForceCalibRun = 488980 # place holder available at point1 - replace with a 2024 run during data taking
481 ForceCalibLB = 80
482 else:
483 doCalib = False
484 doTimeCalib = False
485 elif flags.Input.ProjectName == "data23_comm":
486 doCalib = True
487 elif flags.Input.ProjectName == "data23_hi":
488 doCalib = True
489 doTimeCalib = True
490 elif flags.Input.ProjectName == "data24_hi":
491 doCalib = True
492 doTimeCalib = True
493 doFADCCorr = True
494 doNonLinCorr = False
495 elif flags.Input.ProjectName in ["data25_hip","data25_hipcomm"]:
496 doCalib = True
497 doTimeCalib = False
498 doFADCCorr = False
499 doNonLinCorr = False
500 elif flags.Input.ProjectName in ["data25_hicomm"]:
501 doCalib = False
502 doTimeCalib = False
503 doFADCCorr = False
504 doNonLinCorr = False
505 elif flags.Input.ProjectName in ["data25_hi"]:
506 doCalib = True
507 doTimeCalib = True
508 doFADCCorr = True
509 doNonLinCorr = False
510 elif flags.Input.ProjectName in ["data26_hicomm"]:
511 doCalib = True
512 doTimeCalib = False
513 doFADCCorr = False
514 doNonLinCorr = False
515 elif flags.Input.ProjectName in ["data26_hi"]:
516 doCalib = True
517 doTimeCalib = True
518 doFADCCorr = True
519 doNonLinCorr = False
520
521 # No calibration required (or exists) for MC
522 if flags.Input.isMC:
523 doCalib = False
524
525 doRPD = flags.Detector.EnableZDC_RPD
526
527 log.info('ZdcRecRun3Cfg: doCalib = '+str(doCalib)+' for project '+flags.Input.ProjectName)
528 log.info('RPD enable flag is '+str(doRPD))
529
530 zdcReproc = False
531 if "ZdcModules" in flags.Input.Collections:
532 log.info('ZdcRecConfig.py: found ZdcModules in input, reprocessing mode set')
533 AuxSuffix="RP"
534 zdcReproc = True
535
536 anaTool = acc.popToolsAndMerge(ZdcAnalysisToolCfg(flags,3,config,doCalib,doFADCCorr,doNonLinCorr,doTimeCalib,doTrigEff,ForceCalibRun,ForceCalibLB, AuxSuffix))
537
538
539 if (doRPD):
540 rpdAnaTool = acc.popToolsAndMerge(RPDAnalysisToolCfg(flags, config, AuxSuffix))
541 centroidTool = acc.popToolsAndMerge(RpdSubtractCentroidToolCfg(flags, config, AuxSuffix))
542
543 if flags.Input.isMC :
544 zdcTools = [anaTool] # expand list as needed
545 if doRPD:
546 zdcTools += [rpdAnaTool,centroidTool]
547 elif flags.Trigger.doZDC : # if doZDC flag is true we are in a trigger reprocessing -> no TrigValidTool
548 zdcTools = [anaTool] # expand list as needed
549 elif flags.Input.TriggerStream == "calibration_ZDCInjCalib" or flags.Input.TriggerStream == "calibration_DcmDummyProcessor":
550 zdcTools = [anaTool] # no trigger / RPD / centroid - either online or offline
551 elif flags.Common.isOnline: # running online + NOT injector pulse: with RPD + centroid but no trigger validation for now; may add later
552 zdcTools = [anaTool] # expand list as needed
553 if doRPD:
554 zdcTools += [rpdAnaTool,centroidTool]
555 elif (zdcReproc): # ZDC reprocessing (will take work to make it work for RPD)
556 zdcTools = [anaTool]
557 if doRPD:
558 zdcTools += [rpdAnaTool,centroidTool]
559 else: # default (not MC, not trigger repoc, not injector pulse, not online)
560 trigTool = acc.popToolsAndMerge(ZdcTrigValToolCfg(flags,config))
561 zdcTools = [anaTool,trigTool] # expand list as needed
562 if doRPD:
563 zdcTools += [rpdAnaTool,centroidTool]
564
565 if flags.Input.Format is Format.BS:
566 acc.addEventAlgo(CompFactory.ZdcByteStreamLucrodData())
567 acc.addEventAlgo(CompFactory.ZdcRecRun3Decode())
568
569 if flags.Input.isMC:
570 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
571 acc.merge(PoolReadCfg(flags))
572 acc.addEventAlgo(CompFactory.ZdcMCTruthAlg())
573
574 zdcAlg = CompFactory.ZdcRecRun3("ZdcRecRun3",ZdcAnalysisTools=zdcTools)
575 acc.addEventAlgo(zdcAlg, primary=True)
576
577 return acc
578

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

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

◆ ZdcTrigValToolCfg()

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

Definition at line 346 of file ZdcRecConfig.py.

346def ZdcTrigValToolCfg(flags, config = 'PbPb2023'):
347 acc = ComponentAccumulator()
348
349 acc.merge(TrigDecisionToolCfg(flags))
350
351 trigValTool = CompFactory.ZDC.ZdcTrigValidTool(
352 name = 'ZdcTrigValTool',
353 WriteAux = True,
354 AuxSuffix = '',
355 filepath_LUT = 'TrigT1ZDC/zdc_json_PbPb5.36TeV_2023.json') # changed on Oct 13 to accomodate Zdc 1n peak shift
356
357 trigValTool.TrigDecisionTool = acc.getPublicTool('TrigDecisionTool')
358
359 trigValTool.triggerList = [c for c in getL1MenuAccess(flags) if 'L1_ZDC_BIT' in c]
360
361 acc.setPrivateTools(trigValTool)
362
363 return acc
364

Variable Documentation

◆ acc

python.ZdcRecConfig.acc = MainServicesCfg(flags)

Definition at line 811 of file ZdcRecConfig.py.

◆ AODFileName

python.ZdcRecConfig.AODFileName

Definition at line 801 of file ZdcRecConfig.py.

◆ doWriteAOD

python.ZdcRecConfig.doWriteAOD

Definition at line 803 of file ZdcRecConfig.py.

◆ flags

python.ZdcRecConfig.flags = initConfigFlags()

Definition at line 793 of file ZdcRecConfig.py.

◆ HISTFileName

python.ZdcRecConfig.HISTFileName

Definition at line 802 of file ZdcRecConfig.py.

◆ isCalib

python.ZdcRecConfig.isCalib

Definition at line 805 of file ZdcRecConfig.py.

◆ isInj

python.ZdcRecConfig.isInj

Definition at line 805 of file ZdcRecConfig.py.

◆ isLED

python.ZdcRecConfig.isLED

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

◆ ProjectNamesLIS

list python.ZdcRecConfig.ProjectNamesLIS = ["data26_cos", "data26_900GeV", "data26_13p6TeV","data26_comm", "data_test"]

Definition at line 797 of file ZdcRecConfig.py.

◆ status

python.ZdcRecConfig.status = acc.run()

Definition at line 860 of file ZdcRecConfig.py.

◆ withDetails

python.ZdcRecConfig.withDetails

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