3 from AthenaConfiguration.ComponentFactory
import CompFactory
4 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
5 from AthenaCommon.Logging
import logging
6 _log = logging.getLogger(__name__)
10 histSvc = CompFactory.THistSvc(Output=[name +
" DATAFILE='"+name+
".root' OPT='RECREATE'"])
13 result.addService(histSvc)
15 alg = CompFactory.EFTrackingSmearingAlg(
17 RootStreamName = name,
18 RootDirName =
"/EFTSmearing/",
22 sf_str=
str(kwargs[
'SmearingScaleFactor']).
replace(
".",
"p")
23 if kwargs[
'SmearTruthParticle']:
24 alg.OutputTruthParticleContainer =
"TruthParticle_smeared_SF"+sf_str
26 alg.OutputTrackParticleContainer =
"InDetTrackParticles_smeared_SF"+sf_str
28 result.addEventAlgo(alg)
34 if __name__ ==
"__main__":
36 from AthenaConfiguration.TestDefaults
import defaultTestFiles
37 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
40 flags.Input.Files = defaultTestFiles.AOD_RUN3_MC
42 flags.Exec.MaxEvents = 5
46 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
48 acc.getService(
"MessageSvc").debugLimit = 100000
50 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
54 from InDetPhysValMonitoring.InDetPhysValDecorationConfig
import AddDecoratorCfg
58 TestEfficiencyFactor=1
63 InputTrackParticleContainer =
"InDetTrackParticles",
64 OutputTracksPtCutGeV = 1,
65 SmearingScaleFactor = TestsmearFactor,
66 SmearedTrackEfficiency = TestEfficiencyFactor,
67 ParameterizedTrackEfficiency =
False,
68 SmearTruthParticle =
False,
69 EnableMonitoring =
True,
71 acc.merge(smearerTrack)
78 InputTruthParticleContainer =
"TruthParticles",
79 OutputTracksPtCutGeV = 1,
80 SmearingScaleFactor = TestsmearFactor,
81 SmearedTrackEfficiency = TestEfficiencyFactor,
82 ParameterizedTrackEfficiency =
False,
83 SmearTruthParticle =
True,
84 ParameterizedTrackEfficiency_LRT =
True,
85 SmearedTrackEfficiency_d0low_LRT = .001,
86 SmearedTrackEfficiency_d0high_LRT = 400.,
87 EnableMonitoring =
True,
89 acc.merge(smearerTruth)
93 validationAlg = CompFactory.EFTrackingSmearMonAlg(
94 name =
"EFTrakingSmearMonAlg",
96 InputTrackParticleContainer =
"InDetTrackParticles",
97 InputTruthParticleContainer =
"TruthParticles",
98 SmearedTrackParticleContainer =
"InDetTrackParticles_smeared_SF"+
str(TestsmearFactor),
99 SmearedTruthParticleContainer =
"TruthParticle_smeared_SF"+
str(TestsmearFactor),)
100 acc.addEventAlgo(validationAlg)
105 acc.printConfig(withDetails=
True, summariseProps=
True)
114 sys.exit(
not status.isSuccess())