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

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

LISAnalysisToolCfg ( flags,
str config )

Definition at line 389 of file ZdcRecConfig.py.

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

◆ LisRecCfg()

LisRecCfg ( flags)

Definition at line 717 of file ZdcRecConfig.py.

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

◆ RPDAnalysisToolCfg()

RPDAnalysisToolCfg ( flags,
str config,
AuxSuffix = "" )

Definition at line 367 of file ZdcRecConfig.py.

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

◆ RpdSubtractCentroidToolCfg()

RpdSubtractCentroidToolCfg ( flags,
str config,
AuxSuffix = "" )

Definition at line 378 of file ZdcRecConfig.py.

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

◆ SetConfigTag()

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"]:
118 if (aa_type == 8 or aa_type == 10):
119 config = "InjectorpOOONeNe2025"
120 if (aa_type == 82):
121 config = "configZDC_PbPb2025.inj.v2a.json"
122 if flags.Input.ProjectName in ["data26_hi","data26_hicomm"] :
123 config = "configZDC_PbPb2026.inj.v3.json"
124
125 else:
126 config = "PbPb2023" # default config tag
127
128 run = flags.GeoModel.Run
129 if run == LHCPeriod.Run3:
130 if flags.Input.isMC:
131 config = "MonteCarloPbPb2023"
132 elif flags.Input.ProjectName == "data22_13p6TeV":
133 config = "LHCf2022"
134 elif flags.Input.ProjectName in ["data23_5p36TeV", "data23_900GeV", "data23_13p6TeV"]:
135 config = "pp2023"
136 elif flags.Input.ProjectName in ["data23_hi", "data23_comm"]:
137 config = "PbPb2023"
138 elif flags.Input.ProjectName in ["data24_5p36TeV", "data24_900GeV", "data24_13p6TeV", "data24_refcomm"]:
139 config = "pp2024"
140 elif flags.Input.ProjectName in ["data24_hi", "data24_hicomm"]:
141 config = "configZDC_PbPb2024.v6.json"
142 elif flags.Input.ProjectName in ["data25_hipcomm"]:
143 config = "pO2025"
144 elif flags.Input.ProjectName in ["data25_hip"]:
145 config = "pO2025B"
146 elif flags.Input.ProjectName in ["data25_hi","data25_hicomm"]:
147 if (aa_type == 8 or aa_type == 10):
148 config = "OONeNe2025"
149 if (aa_type == 82):
150 config = "configZDC_PbPb2025_fitConfig_HGLG_period_handLGTau2.json"
151 elif flags.Input.ProjectName in ["data26_comm", "data26_cos", "data26_900GeV", "data26_13p6TeV"]:
152 config = "configZDC_PbPb2026.v2.json"
153 elif flags.Input.ProjectName in ["data26_hi","data26_hicomm"]:
154 config = "configZDC_PbPb2026.v2.json"
155
156 elif run == LHCPeriod.Run2:
157 if flags.Input.ProjectName == "data15_hi":
158 config = "PbPb2015"
159 elif flags.Input.ProjectName == "data17_13TeV":
160 config = "PbPb2015"
161 elif flags.Input.ProjectName == "data16_hip5TeV":
162 config = "pPb2016"
163 elif flags.Input.ProjectName == "data16_hip8TeV":
164 if(aa_type == 1):
165 config = "configZDC_pPb2016.v2.json"
166 if(aa_type == 82):
167 config = "configZDC_Pbp2016.v2.json"
168 elif flags.Input.ProjectName == "data18_hi":
169 config = "PbPb2018"
170
171 return config
172
173
if(pathvar)
void print(char *figname, TCanvas *c1)

◆ ZdcAnalysisToolCfg()

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

Definition at line 309 of file ZdcRecConfig.py.

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

◆ ZdcGenericFlagSetting()

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

Definition at line 174 of file ZdcRecConfig.py.

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

◆ zdcGeometry()

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

ZdcInjNtupleCfg ( flags,
** kwargs )

Definition at line 638 of file ZdcRecConfig.py.

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

◆ ZdcLEDAnalysisToolCfg()

ZdcLEDAnalysisToolCfg ( flags,
config = 'ppPbPb2023',
DoFADCCorr = True )

Definition at line 338 of file ZdcRecConfig.py.

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

◆ ZdcLEDNtupleCfg()

ZdcLEDNtupleCfg ( flags)

Definition at line 662 of file ZdcRecConfig.py.

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

◆ ZdcLEDRecCfg()

ZdcLEDRecCfg ( flags)

Definition at line 670 of file ZdcRecConfig.py.

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

◆ ZdcLEDTrigCfg()

ZdcLEDTrigCfg ( flags)

Definition at line 704 of file ZdcRecConfig.py.

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

◆ ZdcLisNtupleCfg()

ZdcLisNtupleCfg ( flags,
lisInj = False,
lisLED = False,
enableTrigger = True )

Definition at line 404 of file ZdcRecConfig.py.

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

◆ ZdcNtupleLocalCfg()

ZdcNtupleLocalCfg ( flags)

Definition at line 581 of file ZdcRecConfig.py.

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

◆ ZdcNtupleRun2Cfg()

ZdcNtupleRun2Cfg ( flags,
** kwargs )

Definition at line 597 of file ZdcRecConfig.py.

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

◆ ZdcNtupleRun3Cfg()

ZdcNtupleRun3Cfg ( flags,
** kwargs )

Definition at line 613 of file ZdcRecConfig.py.

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

◆ ZdcRecCfg()

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

Definition at line 757 of file ZdcRecConfig.py.

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

◆ ZdcRecOutputCfg()

ZdcRecOutputCfg ( flags)

Definition at line 288 of file ZdcRecConfig.py.

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

◆ ZdcRecRun2Cfg()

ZdcRecRun2Cfg ( flags)

Definition at line 415 of file ZdcRecConfig.py.

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

◆ ZdcRecRun3Cfg()

ZdcRecRun3Cfg ( flags)

Definition at line 459 of file ZdcRecConfig.py.

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

◆ ZdcStreamDependentFlagSetting()

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

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

◆ ZdcTrigValToolCfg()

ZdcTrigValToolCfg ( flags,
config = 'PbPb2023' )

Definition at line 348 of file ZdcRecConfig.py.

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

Variable Documentation

◆ acc

python.ZdcRecConfig.acc = MainServicesCfg(flags)

Definition at line 813 of file ZdcRecConfig.py.

◆ AODFileName

python.ZdcRecConfig.AODFileName

Definition at line 803 of file ZdcRecConfig.py.

◆ doWriteAOD

python.ZdcRecConfig.doWriteAOD

Definition at line 805 of file ZdcRecConfig.py.

◆ flags

python.ZdcRecConfig.flags = initConfigFlags()

Definition at line 795 of file ZdcRecConfig.py.

◆ HISTFileName

python.ZdcRecConfig.HISTFileName

Definition at line 804 of file ZdcRecConfig.py.

◆ isCalib

python.ZdcRecConfig.isCalib

Definition at line 807 of file ZdcRecConfig.py.

◆ isInj

python.ZdcRecConfig.isInj

Definition at line 807 of file ZdcRecConfig.py.

◆ isLED

python.ZdcRecConfig.isLED

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

◆ ProjectNamesLIS

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

Definition at line 799 of file ZdcRecConfig.py.

◆ status

python.ZdcRecConfig.status = acc.run()

Definition at line 862 of file ZdcRecConfig.py.

◆ withDetails

python.ZdcRecConfig.withDetails

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