ATLAS Offline Software
run_Egamma1Baseline.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2025 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_Egamma1Baseline_only')
11  logger.setLevel(DEBUG)
12 
13  from AthenaConfiguration.AllConfigFlags import initConfigFlags
14  flags = initConfigFlags()
15  parser = flags.getArgumentParser()
16 
17  parser.add_argument(
18  "-ifex",
19  "--doCaloInput",
20  action="store_true",
21  dest="doCaloInput",
22  help="Decoding L1Calo inputs",
23  default=False,
24  required=False)
25 
26  args, _ = parser.parse_known_args()
27 
28  from AthenaConfiguration.TestDefaults import defaultTestFiles, defaultGeometryTags, defaultConditionsTags
29  # if --filesInput was specified as well (!) this will override
30  # This does not work, I get an
31  if not args.filesInput:
32  flags.Input.Files = defaultTestFiles.RAW_RUN3_DATA24
33  flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3
34  flags.IOVDb.GlobalTag = defaultConditionsTags.RUN3_DATA24
35 
36 
37  flags.Output.AODFileName = 'AOD.pool.root'
38  flags.Concurrency.NumThreads = 1
39  flags.Concurrency.NumConcurrentEvents = 1
40  flags.Trigger.doLVL1 = True
41 
42  flags.Scheduler.ShowDataDeps = True
43  flags.Scheduler.CheckDependencies = True
44  flags.Scheduler.ShowDataFlow = True
45  flags.Trigger.EDMVersion = 3
46  flags.Trigger.enableL1CaloPhase1 = True
47 
48  flags.fillFromArgs(parser=parser)
49 
50  # Enable only calo for this test
51  from AthenaConfiguration.DetectorConfigFlags import setupDetectorFlags
52 
53  setupDetectorFlags(flags, ['LAr','Tile','MBTS'], toggle_geometry=True)
54 
55  flags.lock()
56  flags.dump()
57 
58  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
59  acc = MainServicesCfg(flags)
60 
61 
62  # Generate run3 L1 menu
63  #from TrigConfigSvc.TrigConfigSvcCfg import L1ConfigSvcCfg, generateL1Menu
64  #acc.merge(L1ConfigSvcCfg(flags))
65  #generateL1Menu(flags)
66 
67  from AthenaConfiguration.Enums import Format
68  if flags.Input.Format == Format.POOL:
69  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
70  acc.merge(PoolReadCfg(flags))
71 
72  from TrigCaloRec.TrigCaloRecConfig import hltCaloCellSeedlessMakerCfg
73  acc.merge(hltCaloCellSeedlessMakerCfg(flags, roisKey=''))
74 
75  else:
76  subsystems = ('eFex',)
77  acc.merge(add_subsystems(flags, subsystems, args, OutputLevel=DEBUG))
78 
79  from TriggerJobOpts.TriggerByteStreamConfig import ByteStreamReadCfg
80  acc.merge(ByteStreamReadCfg(flags))
81 
82  from TrigCaloRec.TrigCaloRecConfig import hltCaloCellSeedlessMakerCfg
83  acc.merge(hltCaloCellSeedlessMakerCfg(flags, roisKey=''))
84 
85  # add in the Algortihm to build a LArStrip Neighborhood container
86  from GlobalSimulation.Egamma1_LArStrip_Fex_RowAwareCfg import (
87  Egamma1_LArStrip_Fex_RowAwareCfg,
88  )
89  acc.merge(Egamma1_LArStrip_Fex_RowAwareCfg(flags,
90  OutputLevel=DEBUG,
91  makeCaloCellContainerChecks=False,
92  dump=False,
93  dumpTerse=False))
94 
95  # add in the EgammaBaseline Algorithm to be run
96  from GlobalSimulation.GlobalSimAlgCfg_Egamma1Baseline import GlobalSimulationAlgCfg
97  acc.merge(GlobalSimulationAlgCfg(flags,
98  OutputLevel=DEBUG,
99  dump=True))
100 
101  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
102  acc.merge(OutputStreamCfg(flags, 'AOD', ["std::vector<int>#phimax"]))
103 
104  acc.merge(OutputStreamCfg(flags, 'AOD', ["std::vector<float>#eRatio"]))
105 
106  acc.merge(OutputStreamCfg(flags, 'AOD', ["std::vector<float>#eRatioSimple"]))
107 
108  if acc.run().isFailure():
109  import sys
110  sys.exit(1)
111 
112 
python.OutputStreamConfig.OutputStreamCfg
def OutputStreamCfg(flags, streamName, ItemList=[], MetadataItemList=[], disableEventTag=False, trigNavThinningSvc=None, takeItemsFromInput=False, extendProvenanceRecord=True, keepProvenanceTagsRegEx=None, AcceptAlgs=[], HelperTools=[])
Definition: OutputStreamConfig.py:16
python.ByteStreamConfig.ByteStreamReadCfg
def ByteStreamReadCfg(flags, type_names=None)
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:25
GlobalSimAlgCfg_Egamma1Baseline.GlobalSimulationAlgCfg
def GlobalSimulationAlgCfg(flags, name="GlobalSimEgamma1Baseline", OutputLevel=DEBUG, dump=False)
Definition: GlobalSimAlgCfg_Egamma1Baseline.py:10
Egamma1_LArStrip_Fex_RowAwareCfg
Definition: Egamma1_LArStrip_Fex_RowAwareCfg.py:1
add_subsystems
Definition: add_subsystems.py:1
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:312
TrigCaloRecConfig.hltCaloCellSeedlessMakerCfg
def hltCaloCellSeedlessMakerCfg(flags, roisKey='UNSPECIFIED', sequenceName=None)
Definition: TrigCaloRecConfig.py:104
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:292
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:71