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 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

◆ LISAnalysisToolCfg()

python.ZdcRecConfig.LISAnalysisToolCfg ( flags,
str config )

Definition at line 381 of file ZdcRecConfig.py.

381def LISAnalysisToolCfg(flags, config: str):
382 acc = ComponentAccumulator()
383 acc.setPrivateTools(
384 CompFactory.ZDC.LISAnalysisTool(
385 name="LISAnalysisTool",
386 Configuration=config,
387 BaselineStart=0,
388 BaselineEnd=5,
389 PulseStart=6,
390 PulseEnd=12,
391 ChannelPedestals=[100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]
392 )
393 )
394 return acc
395

◆ LisRecCfg()

python.ZdcRecConfig.LisRecCfg ( flags)

Definition at line 696 of file ZdcRecConfig.py.

696def LisRecCfg(flags):
697
698 acc = ComponentAccumulator()
699
700 run = flags.GeoModel.Run
701
702 # debugging message since the metadata isn't working for calibration files yet
703 log.info ("LisRecConfig.py: run = "+run.name)
704 config = SetConfigTag(flags)
705
706 DecodeRunMode = 1 # LIS run mode
707
708 if flags.Input.ProjectName in ["data26_comm", "data26_900GeV", "data26_13p6TeV", "data26_cos"]:
709 DecodeRunMode = 1 # LIS run mode
710 elif flags.Input.ProjectName in []: #special run mode for 7 lucrod - not currently used
711 DecodeRunMode = 2 # 7 lucrod run mode, 2026 jan M week
712
713 # LIS processing
714
715 isLED = (flags.Input.TriggerStream == "calibration_ZDCLEDCalib")
716
717 anaTool = acc.popToolsAndMerge(LISAnalysisToolCfg(flags,config))
718 zdcTools = [anaTool]
719
720 if flags.Input.Format is Format.BS:
721 acc.merge(ByteStreamReadCfg(flags))
722 acc.addEventAlgo(CompFactory.ZdcByteStreamLucrodData())
723 acc.addEventAlgo(CompFactory.ZdcRecRun3Decode( DecodeRunMode = DecodeRunMode ))
724
725 evtType = 2 if isLED else 1 # event type set to ZdcEventLED for LED, otherwise default to normal data/MC event type
726 DAQMode = 2 if isLED else 3 # DAQMode set to PhysicsPEB for LED, otherwise default to normal data/MC run mode
727
728 zdcAlg = CompFactory.ZdcRecRun3("ZdcRecRun3",DAQMode=DAQMode, ForcedEventType=evtType, ZdcAnalysisTools=zdcTools) # DAQMode set to PhysicsPEB, event type set to ZdcEventLED
729 acc.addEventAlgo(zdcAlg, primary=True)
730
731 if flags.Output.doWriteESD or flags.Output.doWriteAOD:
732 acc.merge(ZdcRecOutputCfg(flags))
733
734 return acc
735

◆ RPDAnalysisToolCfg()

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

Definition at line 359 of file ZdcRecConfig.py.

359def RPDAnalysisToolCfg(flags, config: str, AuxSuffix=""):
360 acc = ComponentAccumulator()
361 acc.setPrivateTools(
362 CompFactory.ZDC.RPDAnalysisTool(
363 name="RPDAnalysisTool",
364 Configuration=config,
365 AuxSuffix = AuxSuffix
366 )
367 )
368 return acc
369

◆ RpdSubtractCentroidToolCfg()

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

Definition at line 370 of file ZdcRecConfig.py.

370def RpdSubtractCentroidToolCfg(flags, config: str, AuxSuffix=""):
371 acc = ComponentAccumulator()
372 acc.setPrivateTools(
373 CompFactory.ZDC.RpdSubtractCentroidTool(
374 name="RpdSubtractCentroidTool",
375 Configuration=config,
376 AuxSuffix = AuxSuffix
377 )
378 )
379 return acc
380

◆ 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 # 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 flags.Input.ProjectName in ["data26_comm", "data26_cos", "data26_900GeV", "data26_13p6TeV"]:
146 config = "configZDC_PbPb2025.v1.json" # assume same config for 2026 pp as for PbPb for 2025 run
147
148 elif run == LHCPeriod.Run2:
149 if flags.Input.ProjectName == "data15_hi":
150 config = "PbPb2015"
151 elif flags.Input.ProjectName == "data17_13TeV":
152 config = "PbPb2015"
153 elif flags.Input.ProjectName == "data16_hip5TeV":
154 config = "pPb2016"
155 elif flags.Input.ProjectName == "data16_hip8TeV":
156 if(aa_type == 1):
157 config = "configZDC_pPb2016.v1.json"
158 if(aa_type == 82):
159 config = "configZDC_Pbp2016.v1.json"
160 elif flags.Input.ProjectName == "data18_hi":
161 config = "PbPb2018"
162
163 return config
164
165
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 301 of file ZdcRecConfig.py.

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

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

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

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

618def ZdcInjNtupleCfg(flags,**kwargs):
619
620 acc = ComponentAccumulator()
621 acc.merge(ZdcNtupleCfg(flags,
622 useGRL = False,
623 zdcOnly = True,
624 zdcInj = True,
625 lhcf2022 = False,
626 lhcf2022zdc = False,
627 lhcf2022afp = False,
628 enableTrigger = False,
629 enableOutputSamples = True,
630 enableOutputTree = True,
631 writeOnlyTriggers = False,
632 enableRPD = False,
633 enableCentroid = False,
634 reprocZdc = False,
635 **kwargs))
636
637 acc.addService(CompFactory.THistSvc(Output = ["ANALYSIS DATAFILE='NTUP.root' OPT='RECREATE'"]))
638 #acc.setAppProperty("HistogramPersistency","ROOT")
639 return acc
640

◆ ZdcLEDAnalysisToolCfg()

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

Definition at line 330 of file ZdcRecConfig.py.

330def ZdcLEDAnalysisToolCfg(flags, config = 'ppPbPb2023', DoFADCCorr = True):
331 acc = ComponentAccumulator()
332
333 log.info('ZdcAnalysisToolCfg: setting up ZdcAnalysisTool with config='+config)
334 acc.setPrivateTools(CompFactory.ZDC.ZdcLEDAnalysisTool(name = 'ZdcLEDAnalysisTool'+config,
335 Configuration = config,
336 DoFADCCorr = DoFADCCorr))
337 return acc
338
339

◆ ZdcLEDNtupleCfg()

python.ZdcRecConfig.ZdcLEDNtupleCfg ( flags)

Definition at line 641 of file ZdcRecConfig.py.

641def ZdcLEDNtupleCfg(flags):
642 acc = ComponentAccumulator()
643 zdcLEDNtuple = CompFactory.ZdcLEDNtuple("ZdcLEDNtuple")
644 zdcLEDNtuple.enableOutputTree = True
645 acc.addEventAlgo(zdcLEDNtuple)
646 acc.addService(CompFactory.THistSvc(Output = ["ANALYSIS DATAFILE='NTUP.root' OPT='RECREATE'"]))
647 return acc
648

◆ ZdcLEDRecCfg()

python.ZdcRecConfig.ZdcLEDRecCfg ( flags)

Definition at line 649 of file ZdcRecConfig.py.

649def ZdcLEDRecCfg(flags):
650
651 acc = ComponentAccumulator()
652
653 if flags.Input.Format is Format.BS:
654 run = flags.GeoModel.Run
655
656 # debugging message since the metadata isn't working for calibration files yet
657 log.info ("ZdcRecConfig.py: run = "+run.name)
658
659 config = 'ppPbPb2023'
660 #config = 'ppALFA2023'
661 doFADCCorr = False
662
663 if flags.Input.ProjectName in ["data24_hi","data25_hip","data25_hi"]:
664 doFADCCorr = True
665
666 acc.addEventAlgo(CompFactory.ZdcByteStreamLucrodData())
667 acc.addEventAlgo(CompFactory.ZdcRecRun3Decode())
668
669 anaTool = acc.popToolsAndMerge(ZdcLEDAnalysisToolCfg(flags, config, DoFADCCorr = doFADCCorr)) #anatool for zdcLED calibration
670
671 zdcTools = []
672 zdcTools += [anaTool] # add trigTool after deocration migration
673
674 # FIXME these are dependent on !65768
675 zdcAlg = CompFactory.ZdcRecRun3("ZdcRecRun3",DAQMode=2, ForcedEventType=2, ZdcAnalysisTools=zdcTools) # DAQMode set to PhysicsPEB, event type set to ZdcEventLED
676 acc.addEventAlgo(zdcAlg, primary=True)
677
678 if flags.Output.doWriteESD or flags.Output.doWriteAOD:
679 acc.merge(ZdcRecOutputCfg(flags))
680
681 return acc
682

◆ ZdcLEDTrigCfg()

python.ZdcRecConfig.ZdcLEDTrigCfg ( flags)

Definition at line 683 of file ZdcRecConfig.py.

683def ZdcLEDTrigCfg(flags):
684
685 acc = ComponentAccumulator()
686
687 # suggested by Tim Martin
688 tdmv = CompFactory.TrigDec.TrigDecisionMakerValidator()
689 tdmv.errorOnFailure = True
690 tdmv.TrigDecisionTool = acc.getPrimaryAndMerge(TrigDecisionToolCfg(flags))
691 tdmv.NavigationKey = getRun3NavigationContainerFromInput(flags)
692 acc.addEventAlgo( tdmv )
693 # end of Tim's suggestions
694 return acc
695

◆ ZdcLisNtupleCfg()

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

Definition at line 396 of file ZdcRecConfig.py.

396def ZdcLisNtupleCfg(flags, lisInj=False, lisLED=False, enableTrigger=True):
397 acc = ComponentAccumulator()
398 LisNtuple = CompFactory.LisNtuple("LisNtuple")
399 LisNtuple.enableOutputTree = True
400 LisNtuple.lisInj = lisInj
401 LisNtuple.lisLED = lisLED
402 LisNtuple.enableTrigger = enableTrigger
403 acc.addEventAlgo(LisNtuple)
404 acc.addService(CompFactory.THistSvc(Output = ["ANALYSIS DATAFILE='NTUP.root' OPT='RECREATE'"]))
405 return acc
406

◆ ZdcNtupleLocalCfg()

python.ZdcRecConfig.ZdcNtupleLocalCfg ( flags)

Definition at line 563 of file ZdcRecConfig.py.

563def ZdcNtupleLocalCfg(flags):
564
565 acc = ComponentAccumulator()
566 run = flags.GeoModel.Run
567
568 if run == LHCPeriod.Run2:
569 log.info ('ZdcRecConfig.py: setting up Run 2 ntuple!')
570 acc.merge(ZdcNtupleRun2Cfg(flags))
571 elif run == LHCPeriod.Run3:
572 log.info ('ZdcRecConfig.py: setting up Run 3 ntuples!')
573 acc.merge(ZdcNtupleRun3Cfg(flags))
574 else:
575 log.info ('ZdcRecConfig.py: setting up no ntuple!')
576
577 return acc
578

◆ ZdcNtupleRun2Cfg()

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

Definition at line 579 of file ZdcRecConfig.py.

579def ZdcNtupleRun2Cfg(flags,**kwargs):
580
581 acc = ComponentAccumulator()
582 acc.merge(ZdcNtupleCfg(flags,
583 useGRL = False,
584 zdcOnly = True,
585 enableTrigger = False,
586 enableOutputSamples = True,
587 enableOutputTree = True,
588 writeOnlyTriggers = False,
589 nsamplesZdc = 7,
590 **kwargs))
591
592 acc.addService(CompFactory.THistSvc(Output = ["ANALYSIS DATAFILE='NTUP.root' OPT='RECREATE'"]))
593 return acc
594

◆ ZdcNtupleRun3Cfg()

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

Definition at line 595 of file ZdcRecConfig.py.

595def ZdcNtupleRun3Cfg(flags,**kwargs):
596
597 acc = ComponentAccumulator()
598 acc.merge(ZdcNtupleCfg(flags,
599 useGRL = False,
600 zdcOnly = True,
601 lhcf2022 = False,
602 lhcf2022zdc = False,
603 lhcf2022afp = False,
604 isMC = flags.Input.isMC,
605 enableTrigger = not flags.Input.isMC,
606 enableOutputSamples = True,
607 enableOutputTree = True,
608 writeOnlyTriggers = False,
609 enableRPD = flags.Detector.EnableZDC_RPD,
610 enableCentroid = flags.Detector.EnableZDC_RPD,
611 reprocZdc = False,
612 **kwargs))
613
614 acc.addService(CompFactory.THistSvc(Output = ["ANALYSIS DATAFILE='NTUP.root' OPT='RECREATE'"]))
615 #acc.setAppProperty("HistogramPersistency","ROOT")
616 return acc
617

◆ ZdcRecCfg()

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

Definition at line 736 of file ZdcRecConfig.py.

736def ZdcRecCfg(flags):
737 """Configure Zdc analysis alg
738 Additional arguments are useful in calibration runs
739 """
740
741 acc = ComponentAccumulator()
742
743 run = flags.GeoModel.Run
744
745 # debugging message since the metadata isn't working for calibration files yet
746 log.info ("ZdcRecConfig.py: run = "+run.name)
747
748 if run == LHCPeriod.Run2:
749 log.info ('ZdcRecConfig.py: setting up Run 2!')
750 acc.merge(ZdcRecRun2Cfg(flags))
751 elif run == LHCPeriod.Run3:
752 log.info ('ZdcRecConfig.py: setting up Run 3!')
753 acc.merge(ZdcRecRun3Cfg(flags))
754 else:
755 log.warning ('ZdcRecConfig.py: setting up nothing (problem)!')
756
757 if flags.Output.doWriteESD or flags.Output.doWriteAOD:
758 acc.merge(ZdcRecOutputCfg(flags))
759
760 return acc
761
762

◆ ZdcRecOutputCfg()

python.ZdcRecConfig.ZdcRecOutputCfg ( flags)

Definition at line 280 of file ZdcRecConfig.py.

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

◆ ZdcRecRun2Cfg()

python.ZdcRecConfig.ZdcRecRun2Cfg ( flags)

Definition at line 407 of file ZdcRecConfig.py.

407def ZdcRecRun2Cfg(flags):
408 acc = ComponentAccumulator()
409 config = SetConfigTag(flags)
410 log.info ('ZdcRecConfig.py: Running with config tag%s', config)
411
412 doCalib = False
413 doTimeCalib = False
414 doTrigEff = False
415 doNonLinCorr = False
416 doFADCCorr = False
417
418 if flags.Input.ProjectName == "data15_hi":
419 doCalib = True
420 doTimeCalib = True
421 doTrigEff = True
422 elif flags.Input.ProjectName == "data17_13TeV":
423 doCalib = False
424 doTimeCalib = False
425 doTrigEff = False
426 elif flags.Input.ProjectName == "data16_hip5TeV":
427 doCalib = True
428 doTimeCalib = False
429 doTrigEff = False
430 elif flags.Input.ProjectName == "data16_hip8TeV":
431 doCalib = True
432 doTimeCalib = True
433 doTrigEff = False
434 elif flags.Input.ProjectName == "data18_hi":
435 doCalib = True
436 doTimeCalib = False
437 doTrigEff = False
438
439 acc.merge(ByteStreamReadCfg(flags, type_names=['xAOD::TriggerTowerContainer/ZdcTriggerTowers',
440 'xAOD::TriggerTowerAuxContainer/ZdcTriggerTowersAux.']))
441
442 acc.addEventAlgo(CompFactory.ZdcByteStreamRawDataV2())
443 acc.addEventAlgo(CompFactory.ZdcRecV3Decode())
444
445 anaTool = acc.popToolsAndMerge(ZdcAnalysisToolCfg(flags,2,config,doCalib,doFADCCorr,doNonLinCorr,doTimeCalib,doTrigEff))
446
447 acc.addEventAlgo(CompFactory.ZdcRecV3("ZdcRecV3",ZdcAnalysisTool=anaTool))
448
449 return acc
450

◆ ZdcRecRun3Cfg()

python.ZdcRecConfig.ZdcRecRun3Cfg ( flags)

Definition at line 451 of file ZdcRecConfig.py.

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

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

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

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

Variable Documentation

◆ acc

python.ZdcRecConfig.acc = MainServicesCfg(flags)

Definition at line 792 of file ZdcRecConfig.py.

◆ AODFileName

python.ZdcRecConfig.AODFileName

Definition at line 782 of file ZdcRecConfig.py.

◆ doWriteAOD

python.ZdcRecConfig.doWriteAOD

Definition at line 784 of file ZdcRecConfig.py.

◆ flags

python.ZdcRecConfig.flags = initConfigFlags()

Definition at line 774 of file ZdcRecConfig.py.

◆ HISTFileName

python.ZdcRecConfig.HISTFileName

Definition at line 783 of file ZdcRecConfig.py.

◆ isCalib

python.ZdcRecConfig.isCalib

Definition at line 786 of file ZdcRecConfig.py.

◆ isInj

python.ZdcRecConfig.isInj

Definition at line 786 of file ZdcRecConfig.py.

◆ isLED

python.ZdcRecConfig.isLED

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

◆ ProjectNamesLIS

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

Definition at line 778 of file ZdcRecConfig.py.

◆ status

python.ZdcRecConfig.status = acc.run()

Definition at line 841 of file ZdcRecConfig.py.

◆ withDetails

python.ZdcRecConfig.withDetails

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