ATLAS Offline Software
Loading...
Searching...
No Matches
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
3if __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 GlobalSimulation.Egamma1_LArStrip_FexCfg import (
141 Egamma1_LArStrip_FexCfg,
142 )
143 acc.merge(Egamma1_LArStrip_FexCfg(flags,
144 OutputLevel=DEBUG,
145 makeCaloCellContainerChecks=False,
146 dump=True,
147 dumpTerse=True))
148
149 # add in the ERatio Algorithm to be run
150 from GlobalSimulation.GlobalSimAlgCfg_ERatio import GlobalSimulationAlgCfg
151 acc.merge(GlobalSimulationAlgCfg(flags,
152 OutputLevel=DEBUG,
153 dump=True))
154
155
156 if acc.run().isFailure():
157 import sys
158 sys.exit(1)
159
160
if(febId1==febId2)