ATLAS Offline Software
run_ERatio_only.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 if __name__ == '__main__':
4 
5  from AthenaCommon.Logging import logging
6  from AthenaCommon.Constants import DEBUG
7 
8  from add_subsystems import add_subsystems
9 
10  logger = logging.getLogger('run_Egamma1_ERatio_only')
11  logger.setLevel(DEBUG)
12 
13 
14  import argparse
15  from argparse import RawTextHelpFormatter
16 
17 
18  parser = argparse.ArgumentParser(
19  "Running GlobalSim Egamma1_ERatio_only",
20  formatter_class=RawTextHelpFormatter)
21 
22 
23 
24  parser.add_argument(
25  "-i",
26  "--inputs",
27  nargs='*',
28  action="store",
29  dest="inputFiles",
30  help="files to process",
31  required=True)
32 
33 
34  parser.add_argument(
35  "-n",
36  "--nevent",
37  type=int,
38  action="store",
39  dest="nevent",
40  help="Maximum number of events will be executed.",
41  default=0,
42  required=False)
43 
44  parser.add_argument(
45  "-s",
46  "--skipEvents",
47  type=int,
48  action="store",
49  dest="skipEvents",
50  help="Number of events to skip.",
51  default=0,
52  required=False)
53 
54 
55  parser.add_argument(
56  "-ifex",
57  "--doCaloInput",
58  action="store_true",
59  dest="doCaloInput",
60  help="Decoding L1Calo inputs",
61  default=False,
62  required=False)
63 
64 
65  args = parser.parse_args()
66 
67  logger.debug('args:')
68 
69  logger.debug(args)
70 
71 
72  from AthenaConfiguration.AllConfigFlags import initConfigFlags
73  flags = initConfigFlags()
74 
75  if(args.nevent > 0):
76  flags.Exec.MaxEvents = args.nevent
77 
78  if args.inputFiles:
79  flags.Input.Files = args.inputFiles
80  else:
81  flags.Input.Files = ['/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CampaignInputs/data23/RAW/data23_13p6TeV.00452463.physics_Main.daq.RAW/540events.data23_13p6TeV.00452463.physics_Main.daq.RAW._lb0514._SFO-16._0004.data']
82 
83 
84  flags.Output.AODFileName = 'AOD.pool.root'
85  flags.Common.isOnline = not flags.Input.isMC
86  flags.Concurrency.NumThreads = 1
87  flags.Concurrency.NumConcurrentEvents = 1
88  flags.Trigger.doLVL1 = True
89 
90 
91  flags.Concurrency.NumThreads = 1
92  flags.Concurrency.NumConcurrentEvents = 1
93 
94  flags.GeoModel.AtlasVersion="ATLAS-R3S-2021-03-01-00"
95 
96  flags.Scheduler.ShowDataDeps = True
97  flags.Scheduler.CheckDependencies = True
98  flags.Scheduler.ShowDataFlow = True
99  flags.Trigger.EDMVersion = 3
100  flags.Trigger.doLVL1 = True
101  flags.Trigger.enableL1CaloPhase1 = True
102 
103 
104  # Enable only calo for this test
105  from AthenaConfiguration.DetectorConfigFlags import setupDetectorFlags
106 
107  setupDetectorFlags(flags, ['LAr','Tile','MBTS'], toggle_geometry=True)
108 
109  flags.lock()
110  flags.dump()
111 
112  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
113  acc = MainServicesCfg(flags)
114 
115 
116  # Generate run3 L1 menu
117  from TrigConfigSvc.TrigConfigSvcCfg import L1ConfigSvcCfg, generateL1Menu
118  acc.merge(L1ConfigSvcCfg(flags))
119  generateL1Menu(flags)
120 
121  from AthenaConfiguration.Enums import Format
122  if flags.Input.Format == Format.POOL:
123  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
124  acc.merge(PoolReadCfg(flags))
125 
126  from TrigCaloRec.TrigCaloRecConfig import hltCaloCellSeedlessMakerCfg
127  acc.merge(hltCaloCellSeedlessMakerCfg(flags, roisKey=''))
128 
129  else:
130  subsystems = ('eFex',)
131  acc.merge(add_subsystems(flags, subsystems, args, OutputLevel=DEBUG))
132 
133  from TriggerJobOpts.TriggerByteStreamConfig import ByteStreamReadCfg
134  acc.merge(ByteStreamReadCfg(flags))
135 
136  from TrigCaloRec.TrigCaloRecConfig import hltCaloCellSeedlessMakerCfg
137  acc.merge(hltCaloCellSeedlessMakerCfg(flags, roisKey=''))
138 
139  # add in the Algortihm to build a LArStrip Neighborhood container
140  from Egamma1_LArStrip_FexCfg import Egamma1_LArStrip_FexCfg
141  acc.merge(Egamma1_LArStrip_FexCfg(flags,
142  OutputLevel=DEBUG,
143  makeCaloCellContainerChecks=False,
144  dump=True,
145  dumpTerse=True))
146 
147  # add in the ERatio Algorithm to be run
148  from GlobalSimAlgCfg_ERatio import GlobalSimulationAlgCfg
149  acc.merge(GlobalSimulationAlgCfg(flags,
150  OutputLevel=DEBUG,
151  dump=True))
152 
153 
154  if acc.run().isFailure():
155  import sys
156  sys.exit(1)
157 
158 
GlobalSimAlgCfg_ERatio.GlobalSimulationAlgCfg
def GlobalSimulationAlgCfg(flags, name="GlobalSimEratioAlg", OutputLevel=DEBUG, dump=False)
Definition: GlobalSimAlgCfg_ERatio.py:11
python.TrigConfigSvcCfg.generateL1Menu
def generateL1Menu(flags)
Definition: TrigConfigSvcCfg.py:184
python.ByteStreamConfig.ByteStreamReadCfg
def ByteStreamReadCfg(flags, type_names=None)
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:25
TrigCaloRecConfig.hltCaloCellSeedlessMakerCfg
def hltCaloCellSeedlessMakerCfg(flags, roisKey='UNSPECIFIED')
Definition: TrigCaloRecConfig.py:102
add_subsystems
Definition: add_subsystems.py:1
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
Constants
some useful constants -------------------------------------------------—
python.DetectorConfigFlags.setupDetectorFlags
def setupDetectorFlags(flags, custom_list=None, use_metadata=False, toggle_geometry=False, validate_only=False, keep_beampipe=False)
Definition: DetectorConfigFlags.py:289
Egamma1_LArStrip_FexCfg
Definition: Egamma1_LArStrip_FexCfg.py:1
python.TrigConfigSvcCfg.L1ConfigSvcCfg
def L1ConfigSvcCfg(flags)
Definition: TrigConfigSvcCfg.py:198
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69