3 """ Configure egammaTruthAssociation
7 from MCTruthClassifier.MCTruthClassifierConfig
import (
8 MCTruthClassifierCaloTruthMatchCfg)
10 from AthenaCommon.Logging
import logging
11 from AthenaConfiguration.ComponentFactory
import CompFactory
12 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
19 seqkw = {
'sequence': sequenceName}
if sequenceName
else {}
20 acc = ComponentAccumulator (**seqkw)
22 if "MCTruthClassifier" not in kwargs:
23 kwargs[
"MCTruthClassifier"] = acc.popToolsAndMerge(
27 "ClusterContainerName",
28 flags.Egamma.Keys.Output.CaloClusters)
30 "ElectronContainerName",
31 flags.Egamma.Keys.Output.Electrons)
33 "PhotonContainerName",
34 flags.Egamma.Keys.Output.Photons)
36 "FwdElectronContainerName",
37 flags.Egamma.Keys.Output.ForwardElectrons)
39 "TruthEventContainerName",
40 flags.Egamma.Keys.Input.TruthEvents)
42 "TruthParticleContainerName",
43 flags.Egamma.Keys.Input.TruthParticles)
45 "EgammaTruthContainerName",
46 flags.Egamma.Keys.Output.TruthParticles)
48 "MatchForwardElectrons",
49 flags.Egamma.doForward)
54 egtruthAlg = CompFactory.egammaTruthAssociationAlg(name, **kwargs)
56 acc.addEventAlgo(egtruthAlg)
60 if __name__ ==
"__main__":
61 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
62 from AthenaConfiguration.TestDefaults
import defaultTestFiles
63 from AthenaConfiguration.ComponentAccumulator
import printProperties
64 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
66 flags.Input.Files = defaultTestFiles.RDO_RUN2
69 mlog = logging.getLogger(
"egammaTruthAssociationConfigTest")
70 mlog.info(
"Configuring egammaTruthAssociation: ")
73 acc.getEventAlgo(
"egammaTruthAssociation"),
76 with open(
"egammatruthassociation.pkl",
"wb")
as f: