Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
ZdcRecConfig.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 #
3 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
4 #
5 
6 from AthenaConfiguration.ComponentFactory import CompFactory
7 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
8 from AthenaConfiguration.Enums import Format
9 from AthenaConfiguration.Enums import LHCPeriod
10 
11 from OutputStreamAthenaPool.OutputStreamConfig import addToAOD
12 from OutputStreamAthenaPool.OutputStreamConfig import addToESD
13 
14 from TriggerJobOpts.TriggerByteStreamConfig import ByteStreamReadCfg
15 
16 from ZdcNtuple.ZdcNtupleConfig import ZdcNtupleCfg
17 
18 # FIXME: removing for MC
19 from TrigConfigSvc.TriggerConfigAccess import getL1MenuAccess
20 # added getRun3NavigationContainerFromInput as per Tim Martin's suggestions
21 from TrigDecisionTool.TrigDecisionToolConfig import TrigDecisionToolCfg, getRun3NavigationContainerFromInput
22 
23 zdcConfigMap = {}
24 
26 
27  zdcConfigMap['data15_hi'] = {}
28  zdcConfigMap['data16_hip'] = {}
29  zdcConfigMap['data17_13TeV'] = {}
30  zdcConfigMap['data18_hi'] = {}
31  zdcConfigMap['data22_13p6TeV'] = {}
32  zdcConfigMap['data23_5p36TeV'] = {}
33  zdcConfigMap['data23_13p6TeV'] = {}
34  zdcConfigMap['data23_hi'] = {}
35  zdcConfigMap['data23_comm'] = {}
36  zdcConfigMap['data23_5p36TeV'] = {}
37  zdcConfigMap['data24_900GeV'] = {}
38 
39  zdcConfigMap['data24_13p6TeV'] = {}
40  zdcConfigMap['data24_13p6TeV']['default'] = 'pp2024'
41 
42  zdcConfigMap['data24_refcomm'] = {}
43  zdcConfigMap['data24_refcomm']['default'] = 'pp2024'
44  zdcConfigMap['data24_refcomm']['calibration_ZdcInjCalib'] = 'Injectorpp2024'
45 
46  zdcConfigMap['data24_hicomm'] = {}
47  zdcConfigMap['data24_hicomm']['default'] = 'PbPb2024'
48  zdcConfigMap['data24_hicomm']['calibration_ZdcInjCalib'] = 'InjectorPbPb2024'
49 
50  zdcConfigMap['data24_hi'] = {}
51  zdcConfigMap['data24_hi']['default']="PbPb2024"
52  zdcConfigMap['data24_hi']['calibration_ZdcInjCalib']="InjectorPbPb2024"
53 
54 def SetConfigTag(flags):
55 
56  if 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
57  config = "Injectorpp2024" # default config tag for injector pulse
58 
59  if flags.Input.ProjectName == "data24_hi" or flags.Input.ProjectName == "data24_hicomm":
60  config = "InjectorPbPb2024"
61  else:
62  config = "PbPb2023" # default config tag
63 
64  run = flags.GeoModel.Run
65  if (run == LHCPeriod.Run3):
66  if flags.Input.isMC:
67  config = "MonteCarloPbPb2023"
68  elif flags.Input.ProjectName == "data22_13p6TeV":
69  config = "LHCf2022"
70  elif flags.Input.ProjectName == "data23_5p36TeV" or flags.Input.ProjectName == "data23_900GeV" or flags.Input.ProjectName == "data23_13p6TeV":
71  config = "pp2023"
72  elif flags.Input.ProjectName == "data23_hi" or flags.Input.ProjectName == "data23_comm":
73  config = "PbPb2023"
74  elif flags.Input.ProjectName == "data24_5p36TeV" or flags.Input.ProjectName == "data24_900GeV" or flags.Input.ProjectName == "data24_13p6TeV" or flags.Input.ProjectName == "data24_refcomm":
75  config = "pp2024"
76  elif flags.Input.ProjectName == "data24_hi" or flags.Input.ProjectName == "data24_hicomm":
77  config = "PbPb2024"
78  elif (run == LHCPeriod.Run2):
79  if flags.Input.ProjectName == "data15_hi":
80  config = "PbPb2015"
81  elif flags.Input.ProjectName == "data17_13TeV":
82  config = "PbPb2015"
83  elif flags.Input.ProjectName == "data16_hip":
84  config = "pPb2016"
85  elif flags.Input.ProjectName == "data18_hi":
86  config = "PbPb2018"
87 
88  return config
89 
90 def ZdcRecOutputCfg(flags):
91 
92  acc = ComponentAccumulator()
93 
94  ZDC_ItemList=[]
95  if flags.Input.Format is Format.BS:
96  ZDC_ItemList.append("xAOD::ZdcModuleContainer#ZdcModules")
97  ZDC_ItemList.append("xAOD::ZdcModuleAuxContainer#ZdcModulesAux.")
98  ZDC_ItemList.append("xAOD::ZdcModuleContainer#ZdcSums")
99  ZDC_ItemList.append("xAOD::ZdcModuleAuxContainer#ZdcSumsAux.")
100 
101  acc.merge(addToESD(flags,ZDC_ItemList))
102  acc.merge(addToAOD(flags,ZDC_ItemList))
103 
104  from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
105  acc.merge(SetupMetaDataForStreamCfg(flags,streamName="AOD"))
106 
107 
108  return acc
109 
110 
111 def ZdcAnalysisToolCfg(flags, run, config="PbPb2023", DoCalib=False, DoFADCCorr=False, DoNonLinCorr=False, DoTimeCalib=False, DoTrigEff=False, ForceCalibRun=-1, ForceCalibLB=814):
112  acc = ComponentAccumulator()
113 
114  print('ZdcAnalysisToolCfg: setting up ZdcAnalysisTool with config='+config)
115 
116  acc.setPrivateTools(CompFactory.ZDC.ZdcAnalysisTool(
117  name = 'ZdcAnalysisTool'+config,
118  Configuration = config,
119  DoCalib = DoCalib,
120  DoFADCCorr = DoFADCCorr,
121  DoNonLinCorr = DoNonLinCorr,
122  DoTimeCalib = DoTimeCalib,
123  DoTrigEff = DoTrigEff,
124  ForceCalibRun = ForceCalibRun,
125  ForceCalibLB = ForceCalibLB,
126  LHCRun = run ))
127  return acc
128 
129 def ZdcLEDAnalysisToolCfg(flags, config = 'ppPbPb2023', DoFADCCorr = True):
130  acc = ComponentAccumulator()
131 
132  print('ZdcAnalysisToolCfg: setting up ZdcAnalysisTool with config='+config)
133  acc.setPrivateTools(CompFactory.ZDC.ZdcLEDAnalysisTool(name = 'ZdcLEDAnalysisTool'+config,
134  Configuration = config,
135  DoFADCCorr = DoFADCCorr))
136  return acc
137 
138 
139 def ZdcTrigValToolCfg(flags, config = 'PbPb2023'):
140  acc = ComponentAccumulator()
141 
142  acc.merge(TrigDecisionToolCfg(flags))
143 
144  trigValTool = CompFactory.ZDC.ZdcTrigValidTool(
145  name = 'ZdcTrigValTool',
146  WriteAux = True,
147  AuxSuffix = '',
148  filepath_LUT = 'TrigT1ZDC/zdc_json_PbPb5.36TeV_2023.json') # changed on Oct 13 to accomodate Zdc 1n peak shift
149 
150  trigValTool.TrigDecisionTool = acc.getPublicTool('TrigDecisionTool')
151 
152  trigValTool.triggerList = [c for c in getL1MenuAccess(flags) if 'L1_ZDC_BIT' in c]
153 
154  acc.setPrivateTools(trigValTool)
155 
156  return acc
157 
158 def RPDAnalysisToolCfg(flags, config: str):
159  acc = ComponentAccumulator()
160  acc.setPrivateTools(
161  CompFactory.ZDC.RPDAnalysisTool(
162  name="RPDAnalysisTool",
163  Configuration=config
164  )
165  )
166  return acc
167 
168 def RpdSubtractCentroidToolCfg(flags, config: str):
169  acc = ComponentAccumulator()
170  acc.setPrivateTools(
171  CompFactory.ZDC.RpdSubtractCentroidTool(
172  name="RpdSubtractCentroidTool",
173  Configuration=config
174  )
175  )
176  return acc
177 
178 def ZdcRecRun2Cfg(flags):
179  acc = ComponentAccumulator()
180  config = SetConfigTag(flags)
181  print ('ZdcRecConfig.py: Running with config tag ', config)
182 
183  doCalib = False
184  doTimeCalib = False
185  doTrigEff = False
186  doNonLinCorr = False
187  doFADCCorr = False
188 
189  if flags.Input.ProjectName == "data15_hi":
190  doCalib = True
191  doTimeCalib = True
192  doTrigEff = True
193  elif flags.Input.ProjectName == "data17_13TeV":
194  doCalib = False
195  doTimeCalib = False
196  doTrigEff = False
197  elif flags.Input.ProjectName == "data16_hip":
198  doCalib = True
199  doTimeCalib = False
200  doTrigEff = False
201  elif flags.Input.ProjectName == "data18_hi":
202  doCalib = True
203  doTimeCalib = False
204  doTrigEff = False
205 
206  acc.merge(ByteStreamReadCfg(flags, type_names=['xAOD::TriggerTowerContainer/ZdcTriggerTowers',
207  'xAOD::TriggerTowerAuxContainer/ZdcTriggerTowersAux.']))
208 
209  acc.addEventAlgo(CompFactory.ZdcByteStreamRawDataV2())
210  acc.addEventAlgo(CompFactory.ZdcRecV3Decode())
211 
212  anaTool = acc.popToolsAndMerge(ZdcAnalysisToolCfg(flags,2,config,doCalib,doFADCCorr,doNonLinCorr,doTimeCalib,doTrigEff))
213 
214  acc.addEventAlgo(CompFactory.ZdcRecV3("ZdcRecV3",ZdcAnalysisTool=anaTool))
215 
216  return acc
217 
218 def ZdcRecRun3Cfg(flags):
219 
220  acc = ComponentAccumulator()
221  config = SetConfigTag(flags)
222  print ('ZdcRecConfig.py: Running with config tag ', config)
223 
224  doCalib = False
225  doTimeCalib = False
226  doTrigEff = False
227  doFADCCorr = False
228  doNonLinCorr = True #default for 2023
229  ForceCalibRun = -1
230  ForceCalibLB = 814
231 
232  if flags.Input.TriggerStream != "calibration_ZDCInjCalib" and flags.Input.TriggerStream != "calibration_DcmDummyProcessor":
233  if flags.Common.isOnline: # calibration file for ongoing run not available - copy calib file from eos & hard code the run + lb
234  doCalib = True
235  doTimeCalib = True
236  if flags.Input.ProjectName == "data24_5p36TeV" or flags.Input.ProjectName == "data24_refcomm":
237  ForceCalibRun = 488239
238  ForceCalibLB = 1
239  elif flags.Input.ProjectName == "data24_hi" or flags.Input.ProjectName == "data24_hicomm":
240  ForceCalibRun = 488980 # place holder available at point1 - replace with a 2024 run during data taking
241  ForceCalibLB = 80
242  else:
243  doCalib = False
244  doTimeCalib = False
245  elif flags.Input.ProjectName == "data23_comm":
246  doCalib = True
247  elif flags.Input.ProjectName == "data23_hi": # for "data24_hi" or "data24_5p36TeV," need to also check flags.Input.TriggerStream != "calibration_ZDCInjCalib"
248  doCalib = True
249  doTimeCalib = True
250  elif flags.Input.ProjectName == "data24_hi": # for "data24_hi" or "data24_5p36TeV," need to also check flags.Input.TriggerStream != "calibration_ZDCInjCalib"
251  doCalib = True
252  doTimeCalib = True
253  doFADCCorr = True
254  doNonLinCorr = False
255 
256  doRPD = flags.Detector.EnableZDC_RPD
257 
258  print('ZdcRecRun3Cfg: doCalib = '+str(doCalib)+' for project '+flags.Input.ProjectName)
259  print('RPD enable flag is '+str(doRPD))
260 
261  anaTool = acc.popToolsAndMerge(ZdcAnalysisToolCfg(flags,3,config,doCalib,doFADCCorr,doNonLinCorr,doTimeCalib,doTrigEff,ForceCalibRun,ForceCalibLB))
262 
263  if (doRPD):
264  rpdAnaTool = acc.popToolsAndMerge(RPDAnalysisToolCfg(flags, config))
265  centroidTool = acc.popToolsAndMerge(RpdSubtractCentroidToolCfg(flags, config))
266 
267  if ( flags.Input.isMC ):
268  zdcTools = [anaTool] # expand list as needed
269  if doRPD:
270  zdcTools += [rpdAnaTool,centroidTool]
271  elif ( flags.Trigger.doZDC ): # if doZDC flag is true we are in a trigger reprocessing -> no TrigValidTool
272  zdcTools = [anaTool] # expand list as needed
273  elif flags.Input.TriggerStream == "calibration_ZDCInjCalib" or flags.Input.TriggerStream == "calibration_DcmDummyProcessor":
274  zdcTools = [anaTool] # no trigger / RPD / centroid - either online or offline
275  elif (flags.Common.isOnline): # running online + NOT injector pulse: with RPD + centroid but no trigger validation for now; may add later
276  zdcTools = [anaTool] # expand list as needed
277  if doRPD:
278  zdcTools += [rpdAnaTool,centroidTool]
279  else: # default (not MC, not trigger repoc, not injector pulse, not online)
280  trigTool = acc.popToolsAndMerge(ZdcTrigValToolCfg(flags,config))
281  zdcTools = [anaTool,trigTool] # expand list as needed
282  if doRPD:
283  zdcTools += [rpdAnaTool,centroidTool]
284 
285  if flags.Input.Format is Format.BS:
286  acc.addEventAlgo(CompFactory.ZdcByteStreamLucrodData())
287  acc.addEventAlgo(CompFactory.ZdcRecRun3Decode())
288  if flags.Input.isMC:
289  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
290  acc.merge(PoolReadCfg(flags))
291  acc.addEventAlgo(CompFactory.ZdcMCTruthAlg())
292 
293  zdcAlg = CompFactory.ZdcRecRun3("ZdcRecRun3",ZdcAnalysisTools=zdcTools)
294  acc.addEventAlgo(zdcAlg, primary=True)
295 
296  return acc
297 
298 def ZdcNtupleLocalCfg(flags):
299 
300  acc = ComponentAccumulator()
301  run = flags.GeoModel.Run
302 
303  if (run == LHCPeriod.Run2):
304  print ('ZdcRecConfig.py: setting up Run 2 ntuple!')
305  acc.merge(ZdcNtupleRun2Cfg(flags))
306  elif (run == LHCPeriod.Run3):
307  print ('ZdcRecConfig.py: setting up Run 3 ntuples!')
308  acc.merge(ZdcNtupleRun3Cfg(flags))
309  else:
310  print ('ZdcRecConfig.py: setting up no ntuple!')
311 
312  return acc
313 
314 def ZdcNtupleRun2Cfg(flags,**kwargs):
315 
316  acc = ComponentAccumulator()
317  acc.merge(ZdcNtupleCfg(flags,
318  useGRL = False,
319  zdcOnly = True,
320  enableTrigger = False,
321  enableOutputSamples = True,
322  enableOutputTree = True,
323  writeOnlyTriggers = False,
324  nsamplesZdc = 7,
325  **kwargs))
326 
327  acc.addService(CompFactory.THistSvc(Output = ["ANALYSIS DATAFILE='zdctree.root' OPT='RECREATE'"]))
328 # acc.setAppProperty("HistogramPersistency","ROOT")
329  return acc
330 
331 def ZdcNtupleRun3Cfg(flags,**kwargs):
332 
333  acc = ComponentAccumulator()
334  acc.merge(ZdcNtupleCfg(flags,
335  useGRL = False,
336  zdcOnly = True,
337  lhcf2022 = False,
338  lhcf2022zdc = False,
339  lhcf2022afp = False,
340  enableTrigger = not flags.Input.isMC,
341  enableOutputSamples = True,
342  enableOutputTree = True,
343  writeOnlyTriggers = False,
344  enableRPD = flags.Detector.EnableZDC_RPD,
345  enableCentroid = flags.Detector.EnableZDC_RPD,
346  reprocZdc = False,
347  **kwargs))
348 
349  acc.addService(CompFactory.THistSvc(Output = ["ANALYSIS DATAFILE='NTUP.root' OPT='RECREATE'"]))
350  #acc.setAppProperty("HistogramPersistency","ROOT")
351  return acc
352 
353 def ZdcInjNtupleCfg(flags,**kwargs):
354 
355  acc = ComponentAccumulator()
356  acc.merge(ZdcNtupleCfg(flags,
357  useGRL = False,
358  zdcOnly = True,
359  zdcInj = True,
360  lhcf2022 = False,
361  lhcf2022zdc = False,
362  lhcf2022afp = False,
363  enableTrigger = False,
364  enableOutputSamples = True,
365  enableOutputTree = True,
366  writeOnlyTriggers = False,
367  enableRPD = False,
368  enableCentroid = False,
369  reprocZdc = False,
370  **kwargs))
371 
372  acc.addService(CompFactory.THistSvc(Output = ["ANALYSIS DATAFILE='NTUP.root' OPT='RECREATE'"]))
373  #acc.setAppProperty("HistogramPersistency","ROOT")
374  return acc
375 
376 def ZdcLEDNtupleCfg(flags):
377  acc = ComponentAccumulator()
378  zdcLEDNtuple = CompFactory.ZdcLEDNtuple("ZdcLEDNtuple")
379  zdcLEDNtuple.enableOutputTree = True
380  acc.addEventAlgo(zdcLEDNtuple)
381  acc.addService(CompFactory.THistSvc(Output = ["ANALYSIS DATAFILE='NTUP.root' OPT='RECREATE'"]))
382  return acc
383 
384 def ZdcLEDRecCfg(flags):
385 
386  acc = ComponentAccumulator()
387 
388  if flags.Input.Format is Format.BS:
389  run = flags.GeoModel.Run
390 
391  # debugging message since the metadata isn't working for calibration files yet
392  print ("ZdcRecConfig.py: run = "+run.name)
393 
394  config = 'ppPbPb2023'
395  #config = 'ppALFA2023'
396  doFADCCorr = False
397 
398  if (flags.GeoModel.Run == LHCPeriod.Run3):
399  doFADCCorr = True
400 
401  acc.addEventAlgo(CompFactory.ZdcByteStreamLucrodData())
402  acc.addEventAlgo(CompFactory.ZdcRecRun3Decode())
403 
404  anaTool = acc.popToolsAndMerge(ZdcLEDAnalysisToolCfg(flags, config, DoFADCCorr = doFADCCorr)) #anatool for zdcLED calibration
405 
406  zdcTools = []
407  zdcTools += [anaTool] # add trigTool after deocration migration
408 
409  # FIXME these are dependent on !65768
410  zdcAlg = CompFactory.ZdcRecRun3("ZdcRecRun3",DAQMode=2, ForcedEventType=2, ZdcAnalysisTools=zdcTools) # DAQMode set to PhysicsPEB, event type set to ZdcEventLED
411  acc.addEventAlgo(zdcAlg, primary=True)
412 
413  if flags.Output.doWriteESD or flags.Output.doWriteAOD:
414  acc.merge(ZdcRecOutputCfg(flags))
415 
416  return acc
417 
418 def ZdcLEDTrigCfg(flags):
419 
420  acc = ComponentAccumulator()
421 
422  # suggested by Tim Martin
423  tdmv = CompFactory.TrigDec.TrigDecisionMakerValidator()
424  tdmv.errorOnFailure = True
425  tdmv.TrigDecisionTool = acc.getPrimaryAndMerge(TrigDecisionToolCfg(flags))
426  tdmv.NavigationKey = getRun3NavigationContainerFromInput(flags)
427  acc.addEventAlgo( tdmv )
428  # end of Tim's suggestions
429  return acc
430 
431 def ZdcRecCfg(flags):
432  """Configure Zdc analysis alg
433  Additional arguments are useful in calibration runs
434  """
435 
436  acc = ComponentAccumulator()
437 
438  run = flags.GeoModel.Run
439 
440  # debugging message since the metadata isn't working for calibration files yet
441  print ("ZdcRecConfig.py: run = "+run.name)
442 
443  if (run == LHCPeriod.Run2):
444  print ('ZdcRecConfig.py: setting up Run 2!')
445  acc.merge(ZdcRecRun2Cfg(flags))
446  elif (run == LHCPeriod.Run3):
447  print ('ZdcRecConfig.py: setting up Run 3!')
448  acc.merge(ZdcRecRun3Cfg(flags))
449  else:
450  print ('ZdcRecConfig.py: setting up nothing (problem)!')
451 
452  if flags.Output.doWriteESD or flags.Output.doWriteAOD:
453  acc.merge(ZdcRecOutputCfg(flags))
454 
455  return acc
456 
457 
458 if __name__ == '__main__':
459 
460  """ This is selftest & ZDC calibration transform at the same time"""
461  from AthenaConfiguration.AllConfigFlags import initConfigFlags
462  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
463  from AthenaConfiguration.TestDefaults import defaultConditionsTags, defaultGeometryTags
464 
465  flags = initConfigFlags()
466 
467  flags.Scheduler.CheckDependencies = True
468  flags.Scheduler.ShowDataDeps = True
469  flags.Scheduler.ShowDataFlow = True
470  flags.Scheduler.ShowControlFlow = True
471  flags.Scheduler.EnableVerboseViews = True
472 
473  flags.Detector.GeometryZDC=True
474  flags.Detector.GeometryAFP=False
475  flags.Detector.GeometryALFA=False
476  flags.Detector.GeometryLucid=False
477  flags.Detector.GeometryMDT=False
478  flags.Detector.GeometryMM=False
479  flags.Detector.GeometryMuon=False
480  flags.Trigger.decodeHLT=False
481  flags.Trigger.enableL1MuonPhase1=False
482  flags.Trigger.L1.doMuon=False
483  flags.Trigger.L1.doCalo=False
484  flags.Trigger.L1.doTopo=False
485  #flags.Reco.EnableTrigger = False
486 
487  # This does not work in this context
488  # run = flags.GeoModel.Run
489  # The EDM Version should be auto configured, but is not working at the moment, so is set by hand
490 
491  flags.Output.AODFileName="AOD.pool.root"
492  flags.Output.HISTFileName="HIST.root"
493  flags.Output.doWriteAOD=True
494 
495  parser = flags.getArgumentParser()
496  parser.add_argument('--runCalibForStandaloneData',default="Calib",help="indicate if we run calib/LED reconstruction for standalone data: Calib (default) --> run calib reconstruction for injector-pulse events; LED --> run LED reconstruction for LED events")
497  args = flags.fillFromArgs(parser=parser)
498 
499  # check for LED / calibration data running, and configure appropriately
500  isLED = (flags.Input.TriggerStream == "calibration_ZDCLEDCalib")
501  isInj = (flags.Input.TriggerStream == "calibration_ZDCInjCalib")
502  isCalib = (flags.Input.TriggerStream == "calibration_ZDCCalib" or flags.Input.TriggerStream == "physics_MinBias" or flags.Input.TriggerStream == "express_express" or flags.Input.TriggerStream == "physics_UCC")
503  if flags.Input.TriggerStream == "calibration_DcmDummyProcessor": # standalone data: do we want to run calibration or LED?
504  if args.runCalibForStandaloneData == "Calib" or args.runCalibForStandaloneData == "calib":
505  isCalib = True
506  elif args.runCalibForStandaloneData == "LED" or args.runCalibForStandaloneData == "led":
507  isLED = True
508  else:
509  print('WARNING: The value for the argument runCalibForStandaloneData is invalid')
510  print('Running nominal reconstruction (injector-pulse) by default')
511  isCalib = True
512 
513  if (isLED):
514  print('ZdcRecConfig: Running LED data!')
515  if (isInj):
516  print('ZdcRecConfig: Running Injected pulse data!')
517  if (isCalib):
518  print('ZdcRecConfig: Running ZDC calibration data!')
519  if (flags.Input.isMC):
520  print('ZdcRecConfig: Running over MC Samples')
521  flags.Input.ProjectName = "data23_hi"
522 
523  # supply missing metadata based on project name
524  pn = flags.Input.ProjectName
525  if not pn:
526  raise ValueError('Unknown project name')
527 
528  if (isInj or isLED or isInj or pn == 'data_test'):
529  flags.Trigger.EDMVersion=3
530  flags.GeoModel.Run = LHCPeriod.Run3
531  flags.GeoModel.AtlasVersion=defaultGeometryTags.RUN3
532  flags.IOVDb.GlobalTag=defaultConditionsTags.RUN3_DATA
533  else:
534  year = int(pn.split('_')[0].split('data')[1])
535  if (year < 20):
536  flags.Trigger.EDMVersion=2
537  flags.GeoModel.Run = LHCPeriod.Run2
538  flags.IOVDb.GlobalTag=defaultConditionsTags.RUN2_DATA
539  elif (year > 20):
540  flags.Trigger.EDMVersion=3
541  flags.GeoModel.Run = LHCPeriod.Run3
542  flags.GeoModel.AtlasVersion=defaultGeometryTags.RUN3
543  flags.IOVDb.GlobalTag=defaultConditionsTags.RUN3_DATA
544 
545  if (flags.Input.isMC):
546  print('ZdcRecConfig: Overriding MC run to be Run 3!')
547  flags.GeoModel.Run = LHCPeriod.Run3
548 
549  if (isInj
550  or flags.Input.TriggerStream == "calibration_DcmDummyProcessor"
551  or pn == "data22_13p6TeV"):
552  flags.Detector.EnableZDC_RPD = False # disable RPD for injector, LHCf
553 
554  if flags.Input.TriggerStream == "calibration_DcmDummyProcessor": # standalone data: no trigger info available
555  flags.DQ.useTrigger = False
556  flags.DQ.triggerDataAvailable = False
557 
558  flags.lock()
559  # flags.dump(evaluate=True) # uncomment this line if needed for testing
560 
561  acc=MainServicesCfg(flags)
562 
563  from AtlasGeoModel.ForDetGeoModelConfig import ForDetGeometryCfg
564  acc.merge(ForDetGeometryCfg(flags))
565 
566  if not flags.Input.isMC and pn != 'data_test': # trigger reco config not existing for MC or standalone
567  from TriggerJobOpts.TriggerRecoConfig import TriggerRecoCfgData
568  acc.merge(TriggerRecoCfgData(flags))
569 
570  if isLED:
571  #acc.merge(ZdcLEDTrigCfg(flags))
572  acc.merge(ZdcLEDRecCfg(flags))
573  if isCalib: # should be able to run both if in standalone data
574  acc.merge(ZdcRecCfg(flags))
575  if isInj: # should be able to run both if in standalone data
576  acc.merge(ZdcRecCfg(flags))
577 
578  if not flags.Input.isMC:
579  if (isLED):
580  from ZdcMonitoring.ZdcLEDMonitorAlgorithm import ZdcLEDMonitoringConfig
581  acc.merge(ZdcLEDMonitoringConfig(flags,'ppPbPb2023'))
582  acc.merge(ZdcLEDNtupleCfg(flags))
583 
584  if (isCalib):
585  from ZdcMonitoring.ZdcMonitorAlgorithm import ZdcMonitoringConfig
586  zdcMonitorAcc = ZdcMonitoringConfig(flags)
587  acc.merge(zdcMonitorAcc)
588  # zdcMonitorAcc.getEventAlgo('ZdcMonAlg').OutputLevel = 2 # turn on DEBUG messages
589  if (flags.Input.TriggerStream != "calibration_DcmDummyProcessor"): #after ntuple works for standalone data, take this line out
590  acc.merge(ZdcNtupleLocalCfg(flags))
591 
592  if (isInj):
593  from ZdcMonitoring.ZdcMonitorAlgorithm import ZdcMonitoringConfig
594  zdcMonitorAcc = ZdcMonitoringConfig(flags)
595  acc.merge(zdcMonitorAcc)
596  # zdcMonitorAcc.getEventAlgo('ZdcMonAlg').OutputLevel = 2 # turn on DEBUG messages
597  acc.merge(ZdcInjNtupleCfg(flags))
598  else:
599  acc.merge(ZdcNtupleLocalCfg(flags))
600 
601  acc.printConfig(withDetails=True)
602 
603  with open("config.pkl", "wb") as f:
604  acc.store(f)
605  status = acc.run()
606  if status.isFailure():
607  import sys
608  sys.exit(-1)
609 
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
python.ZdcRecConfig.ZdcRecRun2Cfg
def ZdcRecRun2Cfg(flags)
Definition: ZdcRecConfig.py:178
ZdcLEDMonitorAlgorithm.ZdcLEDMonitoringConfig
def ZdcLEDMonitoringConfig(inputFlags, run_type)
Definition: ZdcLEDMonitorAlgorithm.py:14
python.ZdcRecConfig.ZdcNtupleRun2Cfg
def ZdcNtupleRun2Cfg(flags, **kwargs)
Definition: ZdcRecConfig.py:314
python.ForDetGeoModelConfig.ForDetGeometryCfg
def ForDetGeometryCfg(flags)
Definition: ForDetGeoModelConfig.py:33
python.ZdcRecConfig.ZdcNtupleRun3Cfg
def ZdcNtupleRun3Cfg(flags, **kwargs)
Definition: ZdcRecConfig.py:331
python.ZdcRecConfig.ZdcTrigValToolCfg
def ZdcTrigValToolCfg(flags, config='PbPb2023')
Definition: ZdcRecConfig.py:139
python.TriggerRecoConfig.TriggerRecoCfgData
def TriggerRecoCfgData(flags)
Definition: TriggerRecoConfig.py:23
python.ByteStreamConfig.ByteStreamReadCfg
def ByteStreamReadCfg(flags, type_names=None)
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:25
python.ZdcRecConfig.ZdcInjNtupleCfg
def ZdcInjNtupleCfg(flags, **kwargs)
Definition: ZdcRecConfig.py:353
python.ZdcRecConfig.ZdcRecCfg
def ZdcRecCfg(flags)
Definition: ZdcRecConfig.py:431
python.ZdcRecConfig.ZdcRecRun3Cfg
def ZdcRecRun3Cfg(flags)
Definition: ZdcRecConfig.py:218
python.ZdcRecConfig.RpdSubtractCentroidToolCfg
def RpdSubtractCentroidToolCfg(flags, str config)
Definition: ZdcRecConfig.py:168
python.TriggerConfigAccess.getL1MenuAccess
L1MenuAccess getL1MenuAccess(flags=None)
Definition: TriggerConfigAccess.py:129
python.ZdcRecConfig.GenerateConfigTagDict
def GenerateConfigTagDict()
Definition: ZdcRecConfig.py:25
python.TrigDecisionToolConfig.getRun3NavigationContainerFromInput
def getRun3NavigationContainerFromInput(flags)
Definition: TrigDecisionToolConfig.py:63
python.ZdcRecConfig.ZdcLEDRecCfg
def ZdcLEDRecCfg(flags)
Definition: ZdcRecConfig.py:384
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
python.OutputStreamConfig.addToESD
def addToESD(flags, itemOrList, **kwargs)
Definition: OutputStreamConfig.py:127
python.ZdcRecConfig.RPDAnalysisToolCfg
def RPDAnalysisToolCfg(flags, str config)
Definition: ZdcRecConfig.py:158
python.TriggerInterface.TrigDecisionToolCfg
def TrigDecisionToolCfg(flags)
Definition: TriggerInterface.py:14
Trk::open
@ open
Definition: BinningType.h:40
python.ZdcRecConfig.ZdcLEDAnalysisToolCfg
def ZdcLEDAnalysisToolCfg(flags, config='ppPbPb2023', DoFADCCorr=True)
Definition: ZdcRecConfig.py:129
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.OutputStreamConfig.addToAOD
def addToAOD(flags, itemOrList, **kwargs)
Definition: OutputStreamConfig.py:142
python.ZdcRecConfig.ZdcRecOutputCfg
def ZdcRecOutputCfg(flags)
Definition: ZdcRecConfig.py:90
ZdcMonitorAlgorithm.ZdcMonitoringConfig
def ZdcMonitoringConfig(inputFlags)
Definition: ZdcMonitorAlgorithm.py:87
python.ZdcRecConfig.ZdcLEDNtupleCfg
def ZdcLEDNtupleCfg(flags)
Definition: ZdcRecConfig.py:376
str
Definition: BTagTrackIpAccessor.cxx:11
python.ZdcRecConfig.ZdcLEDTrigCfg
def ZdcLEDTrigCfg(flags)
Definition: ZdcRecConfig.py:418
python.ZdcRecConfig.ZdcNtupleLocalCfg
def ZdcNtupleLocalCfg(flags)
Definition: ZdcRecConfig.py:298
python.ZdcRecConfig.SetConfigTag
def SetConfigTag(flags)
Definition: ZdcRecConfig.py:54
InfileMetaDataConfig.SetupMetaDataForStreamCfg
def SetupMetaDataForStreamCfg(flags, streamName="", AcceptAlgs=None, createMetadata=None, propagateMetadataFromInput=True, *args, **kwargs)
Definition: InfileMetaDataConfig.py:222
ZdcNtupleConfig.ZdcNtupleCfg
def ZdcNtupleCfg(flags, name="AnalysisAlg", **kwargs)
Definition: ZdcNtupleConfig.py:7
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69
python.ZdcRecConfig.ZdcAnalysisToolCfg
def ZdcAnalysisToolCfg(flags, run, config="PbPb2023", DoCalib=False, DoFADCCorr=False, DoNonLinCorr=False, DoTimeCalib=False, DoTrigEff=False, ForceCalibRun=-1, ForceCalibLB=814)
Definition: ZdcRecConfig.py:111
Trk::split
@ split
Definition: LayerMaterialProperties.h:38