4 Instantiate the TRT Standalone Thinning
7from AthenaCommon.Logging
import logging
8from AthenaConfiguration.ComponentFactory
import CompFactory
9from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
10from AthenaConfiguration.Enums
import LHCPeriod
14 mlog = logging.getLogger(name)
15 mlog.info(
"Starting Geant4 Truth Thinning configuration")
16 acc = ComponentAccumulator()
17 kwargs.setdefault(
"StreamName",
"StreamAOD")
18 kwargs.setdefault(
"keepEGamma", flags.Reco.EnableEgamma)
19 kwargs.setdefault(
"keepMuons", flags.Reco.EnableCombinedMuon)
20 if flags.GeoModel.Run >= LHCPeriod.Run4:
21 kwargs.setdefault(
"EtaMaxEGammaTruth", 4.1)
22 kwargs.setdefault(
"FwdElectronsKey",
"ForwardElectrons")
24 acc.addEventAlgo(CompFactory.ThinGeantTruthAlg(name, **kwargs))
25 mlog.info(
"Geant4 Truth Thinning configured")
29if __name__ ==
"__main__":
30 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
31 from AthenaConfiguration.TestDefaults
import defaultTestFiles
32 from AthenaConfiguration.ComponentAccumulator
import printProperties
33 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
34 flags = initConfigFlags()
35 flags.Input.Files = defaultTestFiles.RDO_RUN2
36 flags.Output.doWriteAOD =
True
38 acc = MainServicesCfg(flags)
40 mlog = logging.getLogger(
"ThinGeantTruthConfigTest")
43 acc.getEventAlgo(
"ThinGeantTruthAlg"),
48 with open(
"thingeanttruchcfg.pkl",
"wb")
as f:
ThinGeantTruthCfg(flags, name="ThinGeantTruthAlg", **kwargs)