ATLAS Offline Software
Loading...
Searching...
No Matches
ThinTRTStandaloneConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2
3__doc__ = """
4 Instantiate the TRT Standalone Thinning
5 """
6
7from AthenaCommon.Logging import logging
8from AthenaConfiguration.ComponentFactory import CompFactory
9from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
10
11
12def ThinTRTStandaloneCfg(flags, name="ThinTRTStandaloneAlg", **kwargs):
13
14 mlog = logging.getLogger(name)
15 mlog.info("Starting TRT standalone Thinning configuration")
16 acc = ComponentAccumulator()
17 kwargs.setdefault("StreamName", "StreamAOD")
18 kwargs.setdefault(
19 "doElectron", flags.Reco.EnableEgamma and flags.Egamma.doTracking
20 )
21 kwargs.setdefault(
22 "doPhoton", flags.Reco.EnableEgamma and flags.Egamma.doTracking
23 )
24 kwargs.setdefault("doTau", flags.Reco.EnableTau)
25 kwargs.setdefault("doTauEleRM", flags.Reco.EnableTau and flags.Tau.doTauEleRMRec)
26 kwargs.setdefault("doMuon", flags.Reco.EnableCombinedMuon)
27 acc.addEventAlgo(CompFactory.ThinTRTStandaloneTrackAlg(name, **kwargs))
28 mlog.info("TRT Alone Thinning configured")
29 return acc
30
31
32if __name__ == "__main__":
33 from AthenaConfiguration.AllConfigFlags import initConfigFlags
34 from AthenaConfiguration.TestDefaults import defaultTestFiles
35 from AthenaConfiguration.ComponentAccumulator import printProperties
36 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
37 flags = initConfigFlags()
38 flags.Input.Files = defaultTestFiles.RDO_RUN2
39 flags.Output.doWriteAOD = True # To test the AOD parts
40 flags.lock()
41 acc = MainServicesCfg(flags)
42 acc.merge(ThinTRTStandaloneCfg(flags))
43 mlog = logging.getLogger("ThinTRTStandaloneConfigTest")
44 printProperties(
45 mlog,
46 acc.getEventAlgo("ThinTRTStandaloneAlg"),
47 nestLevel=1,
48 printDefaults=True,
49 )
50
51 with open("thintrtstandalonecfg.pkl", "wb") as f:
52 acc.store(f)
ThinTRTStandaloneCfg(flags, name="ThinTRTStandaloneAlg", **kwargs)