1 """ComponentAccumulator service configuration for ISF_FastCaloSimServices
3 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
5 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
6 from AthenaConfiguration.ComponentFactory
import CompFactory
7 from RngComps.RngCompsConfig
import AthRNGSvcCfg
8 from ISF_Services.ISF_ServicesConfig
import TruthServiceCfg
9 from ISF_FastCaloSimParametrization.ISF_FastCaloSimParametrizationConfig
import FastCaloSimCaloExtrapolationCfg
12 def PunchThroughClassifierCfg(flags, name="ISF_PunchThroughClassifier", **kwargs):
14 kwargs.setdefault(
"ScalerConfigFileName" ,
"FastCaloSim/MC23/TFCSparam_mpt_classScaler_v04.xml" )
15 kwargs.setdefault(
"NetworkConfigFileName" ,
"FastCaloSim/MC23/TFCSparam_mpt_classNet_v04.json" )
16 kwargs.setdefault(
"CalibratorConfigFileName" ,
"FastCaloSim/MC23/TFCSparam_mpt_classCalib_v04.xml")
17 acc.setPrivateTools(CompFactory.ISF.PunchThroughClassifier(name, **kwargs))
22 from SubDetectorEnvelopes.SubDetectorEnvelopesConfig
import EnvelopeDefSvcCfg
24 if "PunchThroughClassifier" not in kwargs:
25 kwargs.setdefault(
"PunchThroughClassifier", acc.addPublicTool(acc.popToolsAndMerge(PunchThroughClassifierCfg(flags))))
27 kwargs.setdefault(
"FilenameLookupTable" ,
"FastCaloSim/MC23/TFCSparam_mpt_v07.root")
28 kwargs.setdefault(
"FilenameInverseCdf" ,
"FastCaloSim/MC23/TFCSparam_mpt_inverseCdf_v07.xml")
29 kwargs.setdefault(
"FilenameInversePca" ,
"FastCaloSim/MC23/TFCSparam_mpt_inversePca_v07.xml")
30 kwargs.setdefault(
"EnergyFactor" , [ 0.98, 0.831, 0.896, 0.652, 0.717, 1., 0.877, 0.858, 0.919 ] )
31 kwargs.setdefault(
"DoAntiParticles" , [ 0, 1, 0, 1, 1, 0, 0, 0, 0 ] )
32 kwargs.setdefault(
"PunchThroughInitiators" , [ 211, 321, 311, 310, 130, 2212, 2112] )
33 kwargs.setdefault(
"InitiatorsMinEnergy" , [ 65536, 65536, 65536, 65536, 65536, 65536, 65536] )
34 kwargs.setdefault(
"InitiatorsEtaRange" , [ -3.2, 3.2 ] )
35 kwargs.setdefault(
"PunchThroughParticles" , [ 2212, 211, 22, 11, 13, 2112, 321, 310, 130 ] )
36 kwargs.setdefault(
"PunchThroughParticles" , [ 2212, 211, 22, 11, 13, 2112, 321, 310, 130 ] )
37 kwargs.setdefault(
"CorrelatedParticle" , [] )
38 kwargs.setdefault(
"FullCorrelationEnergy" , [ 100000., 100000., 100000., 100000., 0., 100000., 100000., 100000., 100000.] )
39 kwargs.setdefault(
"MinEnergy" , [ 938.3, 135.6, 50., 50., 105.7, 939.6, 493.7, 497.6, 497.6 ] )
40 kwargs.setdefault(
"MaxNumParticles" , [ -1, -1, -1, -1, -1, -1, -1, -1, -1 ] )
41 kwargs.setdefault(
"EnvelopeDefSvc", acc.getPrimaryAndMerge(
EnvelopeDefSvcCfg(flags)).name)
42 kwargs.setdefault(
"BeamPipeRadius", 500.)
43 acc.setPrivateTools(CompFactory.ISF.PunchThroughTool(name, **kwargs))
49 acc.setPrivateTools(CompFactory.EmptyCellBuilderTool(name, **kwargs))
54 from ISF_Algorithms.CollectionMergerConfig
import CollectionMergerCfg
57 mergeable_collection_suffix =
"_FastCaloSim"
60 EMB_hits_bare_collection_name =
"LArHitEMB"
61 EMB_hits_merger_input_property =
"LArEMBHits"
64 EMB_hits_bare_collection_name,
65 mergeable_collection_suffix,
66 EMB_hits_merger_input_property,
70 EMEC_hits_bare_collection_name =
"LArHitEMEC"
71 EMEC_hits_merger_input_property =
"LArEMECHits"
74 EMEC_hits_bare_collection_name,
75 mergeable_collection_suffix,
76 EMEC_hits_merger_input_property,
80 FCAL_hits_bare_collection_name =
"LArHitFCAL"
81 FCAL_hits_merger_input_property =
"LArFCALHits"
84 FCAL_hits_bare_collection_name,
85 mergeable_collection_suffix,
86 FCAL_hits_merger_input_property,
90 HEC_hits_bare_collection_name =
"LArHitHEC"
91 HEC_hits_merger_input_property =
"LArHECHits"
94 HEC_hits_bare_collection_name,
95 mergeable_collection_suffix,
96 HEC_hits_merger_input_property,
100 tile_hits_bare_collection_name =
"TileHitVec"
101 tile_hits_merger_input_property =
"TileHits"
104 tile_hits_bare_collection_name,
105 mergeable_collection_suffix,
106 tile_hits_merger_input_property,
110 kwargs.setdefault(
"embHitContainername", EMB_hits_collection_name)
111 kwargs.setdefault(
"emecHitContainername", EMEC_hits_collection_name)
112 kwargs.setdefault(
"fcalHitContainername", FCAL_hits_collection_name)
113 kwargs.setdefault(
"hecHitContainername", HEC_hits_collection_name)
115 from TileConditions.TileCablingSvcConfig
import TileCablingSvcCfg
118 from TileConditions.TileSamplingFractionConfig
import TileSamplingFractionCondAlgCfg
121 kwargs.setdefault(
"tileHitContainername", tile_hits_collection_name)
123 acc.setPrivateTools(CompFactory.FastHitConvertTool(name, **kwargs))
129 acc.setPrivateTools(CompFactory.CaloCellContainerFinalizerTool(name, **kwargs))
135 acc.setPrivateTools(CompFactory.CaloCellContainerFCSFinalizerTool(name, **kwargs))
142 kwargs.setdefault(
"CaloCellsOutputName", flags.Sim.FastCalo.CaloCellsName)
143 kwargs.setdefault(
"CaloCellMakerTools_setup", [acc.addPublicTool(acc.popToolsAndMerge(
EmptyCellBuilderToolCfg(flags)))])
148 kwargs.setdefault(
"RandomSvc", acc.getPrimaryAndMerge(
AthRNGSvcCfg(flags)).name)
149 kwargs.setdefault(
"RandomStream",
"FastCaloSimRnd")
151 if "PunchThroughTool" not in kwargs:
154 if "ParticleTruthSvc" not in kwargs:
155 kwargs.setdefault(
"ParticleTruthSvc", acc.getPrimaryAndMerge(
TruthServiceCfg(flags)).name)
157 acc.setPrivateTools(CompFactory.ISF.FastCaloSimV2Tool(name, **kwargs))
166 kwargs.setdefault(
"ParamsInputFilename", flags.Sim.FastCalo.ParamsInputFilename)
167 kwargs.setdefault(
"RunOnGPU", flags.Sim.FastCalo.RunOnGPU)
168 kwargs.setdefault(
"ParamsInputObject",
"SelPDGID")
169 acc.addService(CompFactory.ISF.FastCaloSimV2ParamSvc(name, **kwargs), primary =
True)
175 kwargs.setdefault(
"SimulatorTool", acc.addPublicTool(acc.popToolsAndMerge(
FastCaloSimV2ToolCfg(flags))))
176 kwargs.setdefault(
"Identifier",
"FastCaloSim")
177 acc.addService(CompFactory.ISF.LegacySimSvc(name, **kwargs), primary =
True)
183 kwargs.setdefault(
"CaloCellsOutputName", flags.Sim.FastCalo.CaloCellsName)
184 kwargs.setdefault(
"CaloCellMakerTools_setup", [acc.addPublicTool(acc.popToolsAndMerge(
EmptyCellBuilderToolCfg(flags)))])
187 kwargs.setdefault(
"ParamsInputFilename", flags.Sim.FastCalo.ParamsInputFilename)
189 kwargs.setdefault(
"RandomStream",
"FastCaloSimRnd")
190 kwargs.setdefault(
"RandomSvc",
193 acc.addService(CompFactory.ISF.DNNCaloSimSvc(name, **kwargs), primary =
True)