4 Tool configuration to instantiate MCTruthClassifier
5 with default configurations."""
10 This is the default configuration allowing all options.
11 By default, it does not do calo truth matching.
13 kwargs.setdefault(
"ParticleCaloExtensionTool",
"")
14 kwargs.setdefault(
"CaloDetDescrManager",
"")
20 This is the default configuration allowing all options.
21 By default, it does calo truth matching using a
22 dedicated instance of the ParticleCaloExtensionTool
24 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
25 from AthenaConfiguration.Enums
import LHCPeriod
29 if "ParticleCaloExtensionTool" not in kwargs:
31 from TrkConfig.AtlasExtrapolatorConfig
import (
32 MCTruthClassifierExtrapolatorCfg)
33 extrapolator = acc.popToolsAndMerge(
36 from TrackToCalo.TrackToCaloConfig
import (
37 EMParticleCaloExtensionToolCfg)
39 flags, Extrapolator=extrapolator)
40 kwargs[
"ParticleCaloExtensionTool"] = acc.popToolsAndMerge(extension)
42 kwargs.setdefault(
"CaloDetDescrManager",
"CaloDetDescrManager")
44 if flags.GeoModel.Run >= LHCPeriod.Run4:
45 kwargs.setdefault(
"FwdElectronUseG4Sel",
False)
47 from AthenaConfiguration.ComponentFactory
import CompFactory
48 acc.setPrivateTools(CompFactory.MCTruthClassifier(**kwargs))
52 if __name__ ==
"__main__":
54 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
55 from AthenaConfiguration.TestDefaults
import defaultTestFiles
56 from AthenaCommon.Logging
import logging
58 from AthenaConfiguration.ComponentAccumulator
import (
59 ComponentAccumulator, printProperties)
62 flags.Input.isMC =
True
63 flags.Input.Files = defaultTestFiles.RDO_RUN2
66 mlog = logging.getLogger(
"MCTruthClassifierConfigTest")
70 mlog.info(
"Configuring standard MCTruthClassifier")
72 cfg.getPrimaryAndMerge(
77 mlog.info(
"Configuring MCTruthClassifier with calo truth matching")
79 cfg.getPrimaryAndMerge(
84 f =
open(
"mctruthclassifer.pkl",
"wb")