3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory
import CompFactory
5 from AthenaCommon.Logging
import logging
6 from AthenaConfiguration.AccumulatorCache
import AccumulatorCache
13 from AthenaConfiguration.Enums
import Project
14 if flags.Sim.DoFullChain:
15 if flags.Common.Project
is Project.Athena:
16 if flags.Digitization.PileUp:
17 hardscatterSG =
"OriginalEvent_SG+"
19 msg = logging.getLogger(name)
20 msg.warning(
"Fast Chain running only supported in the Athena project.")
21 if flags.Detector.EnableBCM:
22 kwargs.setdefault(
"OutputBCMHits", hardscatterSG+
"BCMHits" )
23 kwargs.setdefault(
"OutputBLMHits", hardscatterSG+
"BLMHits" )
24 if flags.Detector.EnablePixel:
25 kwargs.setdefault(
"OutputPixelHits", hardscatterSG+
"PixelHits" )
26 if flags.Detector.EnableSCT:
27 kwargs.setdefault(
"OutputSCTHits", hardscatterSG+
"SCT_Hits" )
28 if flags.Detector.EnableTRT:
29 kwargs.setdefault(
"OutputTRTUncompressedHits", hardscatterSG+
"TRTUncompressedHits" )
31 if flags.Detector.EnableITkPixel:
32 kwargs.setdefault(
"OutputITkPixelHits", hardscatterSG+
"ITkPixelHits" )
33 if flags.Detector.EnableITkStrip:
34 kwargs.setdefault(
"OutputITkStripHits", hardscatterSG+
"ITkStripHits" )
35 if flags.Detector.EnablePLR:
36 kwargs.setdefault(
"OutputPLRHits", hardscatterSG+
"PLR_Hits" )
37 if flags.Detector.EnableHGTD:
38 kwargs.setdefault(
"OutputHGTDHits", hardscatterSG+
"HGTD_Hits" )
40 if flags.Detector.EnableLAr:
41 kwargs.setdefault(
"OutputLArEMBHits", hardscatterSG+
"LArHitEMB" )
42 kwargs.setdefault(
"OutputLArEMECHits", hardscatterSG+
"LArHitEMEC" )
43 kwargs.setdefault(
"OutputLArFCALHits", hardscatterSG+
"LArHitFCAL" )
44 kwargs.setdefault(
"OutputLArHECHits", hardscatterSG+
"LArHitHEC" )
46 if flags.Detector.EnableTile:
47 kwargs.setdefault(
"OutputTileHits", hardscatterSG+
"TileHitVec" )
48 if flags.Detector.EnableMBTS:
49 kwargs.setdefault(
"OutputMBTSHits", hardscatterSG+
"MBTSHits" )
51 if flags.Detector.EnableCSC:
52 kwargs.setdefault(
"OutputCSCHits", hardscatterSG+
"CSC_Hits" )
53 if flags.Detector.EnableMDT:
54 kwargs.setdefault(
"OutputMDTHits", hardscatterSG+
"MDT_Hits" )
55 if flags.Detector.EnableRPC:
56 kwargs.setdefault(
"OutputRPCHits", hardscatterSG+
"RPC_Hits" )
57 if flags.Detector.EnableTGC:
58 kwargs.setdefault(
"OutputTGCHits", hardscatterSG+
"TGC_Hits" )
59 if flags.Detector.EnablesTGC:
60 kwargs.setdefault(
"OutputsTGCHits", hardscatterSG+
"sTGC_Hits" )
61 if flags.Detector.EnableMM:
62 kwargs.setdefault(
"OutputMMHits", hardscatterSG+
"MM_Hits" )
63 return CompFactory.ISF.CollectionMerger(name, **kwargs)
68 mergeable_collection_suffix,
69 merger_input_property,
71 """Generates and returns a collection name that is also registered to
72 the ISF CollectionMerger algorithm.
74 :param bare_collection_name: name of the collection if no merging
76 :param mergeable_collection_suffix: suffix to the collection in
77 case merging is taking place.
78 :param merger_input_property: name of the Input* property in the
79 CollectionMerger algorithm to add the
80 mergeable collection to."""
83 from SimulationConfig.SimEnums
import LArParameterization
84 if (flags.Sim.ISFRun
or flags.Sim.LArParameterization
is LArParameterization.FastCaloSim)
and flags.Sim.ISF.HITSMergingRequired.get(region,
True):
85 mergeable_collection = f
'{bare_collection_name}{mergeable_collection_suffix}'
87 from ISF_Algorithms.CollectionMergerConfig
import ISFCollectionMergerCfg
89 if flags.Sim.ISF.ReSimulation:
90 result.addEventAlgo(algo,
'SimSequence')
92 result.addEventAlgo(algo)
94 input_attribute_name = f
'Input{merger_input_property}'
95 merger_input_collections = getattr(algo, input_attribute_name)
96 merger_input_collections.append(mergeable_collection)
98 mergeable_collection = bare_collection_name
99 return result, mergeable_collection