ATLAS Offline Software
run_Egamma1BDT.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_Egamma1BDT_only')
11  logger.setLevel(DEBUG)
12 
13 
14  from AthenaConfiguration.AllConfigFlags import initConfigFlags
15  flags = initConfigFlags()
16  parser = flags.getArgumentParser()
17 
18  parser.add_argument(
19  "-ifex",
20  "--doCaloInput",
21  action="store_true",
22  dest="doCaloInput",
23  help="Decoding L1Calo inputs",
24  default=False,
25  required=False)
26 
27  args, _ = parser.parse_known_args()
28 
29  from AthenaConfiguration.TestDefaults import defaultTestFiles, defaultGeometryTags, defaultConditionsTags
30  # Default to the current data test file for Run-3
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  flags.Output.AODFileName = 'AOD.pool.root'
37  flags.Concurrency.NumThreads = 1
38  flags.Concurrency.NumConcurrentEvents = 1
39  flags.Trigger.doLVL1 = True
40 
41  flags.Scheduler.ShowDataDeps = True
42  flags.Scheduler.CheckDependencies = True
43  flags.Scheduler.ShowDataFlow = True
44  flags.Trigger.EDMVersion = 3
45  flags.Trigger.enableL1CaloPhase1 = True
46 
47  flags.fillFromArgs(parser=parser)
48 
49  # Enable only calo for this test
50  from AthenaConfiguration.DetectorConfigFlags import setupDetectorFlags
51 
52  setupDetectorFlags(flags, ['LAr','Tile','MBTS'], toggle_geometry=True)
53 
54  flags.lock()
55  flags.dump()
56 
57  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
58  acc = MainServicesCfg(flags)
59 
60  from AthenaConfiguration.Enums import Format
61  if flags.Input.Format == Format.POOL:
62  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
63  acc.merge(PoolReadCfg(flags))
64 
65  from TrigCaloRec.TrigCaloRecConfig import hltCaloCellSeedlessMakerCfg
66  acc.merge(hltCaloCellSeedlessMakerCfg(flags, roisKey=''))
67 
68  else:
69  subsystems = ('eFex',)
70  acc.merge(add_subsystems(flags, subsystems, args, OutputLevel=DEBUG))
71 
72  from TriggerJobOpts.TriggerByteStreamConfig import ByteStreamReadCfg
73  acc.merge(ByteStreamReadCfg(flags))
74 
75  from TrigCaloRec.TrigCaloRecConfig import hltCaloCellSeedlessMakerCfg
76  acc.merge(hltCaloCellSeedlessMakerCfg(flags, roisKey=''))
77 
78  # add in the Algortihm to build a LArStrip Neighborhood container
79  from GlobalSimulation.Egamma1_LArStrip_FexCfg import (
80  Egamma1_LArStrip_FexCfg,
81  )
82  acc.merge(Egamma1_LArStrip_FexCfg(flags,
83  OutputLevel=DEBUG,
84  makeCaloCellContainerChecks=False,
85  dump=True,
86  dumpTerse=True))
87 
88  # add in the EgammaBDT Algorithm to be run
89  from GlobalSimulation.GlobalSimAlgCfg_Egamma1BDT import GlobalSimulationAlgCfg
90  acc.merge(GlobalSimulationAlgCfg(flags,
91  OutputLevel=DEBUG,
92  dump=True))
93 
94  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
95  acc.merge(OutputStreamCfg(flags, 'AOD', ["IOBitwise::IeEmEg1BDTTOBContainer#BDTResult"]))
96 
97  if acc.run().isFailure():
98  import sys
99  sys.exit(1)
100 
101 
python.OutputStreamConfig.OutputStreamCfg
def OutputStreamCfg(flags, streamName, ItemList=None, MetadataItemList=None, disableEventTag=False, trigNavThinningSvc=None, takeItemsFromInput=False, extendProvenanceRecord=True, keepProvenanceTagsRegEx=None, AcceptAlgs=None, HelperTools=None)
Definition: OutputStreamConfig.py:13
python.ByteStreamConfig.ByteStreamReadCfg
def ByteStreamReadCfg(flags, type_names=None)
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:25
add_subsystems
Definition: add_subsystems.py:1
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:310
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
Egamma1_LArStrip_FexCfg
Definition: Egamma1_LArStrip_FexCfg.py:1
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
GlobalSimAlgCfg_Egamma1BDT.GlobalSimulationAlgCfg
def GlobalSimulationAlgCfg(flags, name="GlobalSimEgamma1BDTAlg", OutputLevel=DEBUG, dump=False)
Definition: GlobalSimAlgCfg_Egamma1BDT.py:10
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:71