Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Functions
python.CommonSimulationSteering Namespace Reference

Functions

def specialConfigPreInclude (flags)
 
def specialConfigPostInclude (flags, cfg)
 
def CommonSimulationCfg (flags, log)
 

Function Documentation

◆ CommonSimulationCfg()

def python.CommonSimulationSteering.CommonSimulationCfg (   flags,
  log 
)

Definition at line 35 of file CommonSimulationSteering.py.

35 def CommonSimulationCfg(flags, log):
36  # Configure main services and input reading (if required)
37  if not flags.Input.Files:
38  # Cases 3a, 3b
39  from AthenaConfiguration.MainServicesConfig import MainEvgenServicesCfg
40  cfg = MainEvgenServicesCfg(flags)
41  # Make sure we get xAOD::EventInfo
42  from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoCnvAlgCfg
43  cfg.merge(EventInfoCnvAlgCfg(flags, name="xAODMaker::EventInfoCnvAlg", disableBeamSpot = True))
44 
45  # For Simulation we need to override the RunNumber to pick up
46  # the right conditions. These next two lines are required for
47  # this to work.
48  cfg.getService("EventSelector").FirstLB = flags.Input.LumiBlockNumbers[0]
49  cfg.getService("EventSelector").OverrideRunNumber = True
50  from AthenaKernel.EventIdOverrideConfig import EvtIdModifierSvcCfg
51  cfg.merge(EvtIdModifierSvcCfg(flags))
52  if flags.Beam.Type is BeamType.Cosmics:
53  # Case 3b: Configure the cosmic Generator
54  from CosmicGenerator.CosmicGeneratorConfig import CosmicGeneratorCfg
55  cfg.merge(CosmicGeneratorCfg(flags))
56  else:
57  # Case 3a: Configure ParticleGun
58  fragment = flags.Sim.GenerationConfiguration
59  if fragment and fragment != 'NONE':
60  executeFromFragment(fragment, flags, cfg)
61  log.info("On-the-fly generation using ParticleGun!")
62  else:
63  log.error("No input file or on-the-fly generation configuration provided!")
64  else:
65  # Cases 1, 2a, 2b, 2c, 4
66  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
67  cfg = MainServicesCfg(flags)
68  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
69  cfg.merge(PoolReadCfg(flags))
70  if flags.Sim.ReadTR or flags.Sim.CavernBackground is CavernBackground.Read:
71  # Cases 2a, 2b, 2c
72  from TrackRecordGenerator.TrackRecordGeneratorConfig import Input_TrackRecordGeneratorCfg
73  cfg.merge(Input_TrackRecordGeneratorCfg(flags))
74  if flags.Sim.ISF.ReSimulation:
75  # Case 4
76  if "xAOD::EventInfo#EventInfo" not in flags.Input.TypedCollections:
77  from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoCnvAlgCfg
78  cfg.merge(EventInfoCnvAlgCfg(flags))
79  else:
80  from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoUpdateFromContextAlgCfg
81  cfg.merge(EventInfoUpdateFromContextAlgCfg(flags))
82  from McEventCollectionFilter.McEventCollectionFilterConfig import TruthResetAlgCfg
83  cfg.merge(TruthResetAlgCfg(flags))
84  cfg.addSequence(CompFactory.AthSequencer('SimSequence'), parentName='AthAlgSeq')
85  cfg.addSequence(CompFactory.AthSequencer('CopyHitSequence'), parentName='AthAlgSeq')
86 
87  if flags.Sim.ISF.ReSimulation:
88  # Case 4
89  from ISF_Algorithms.ISF_AlgorithmsConfig import SimEventFilterCfg, InvertedSimEventFilterCfg, RenameHitCollectionsCfg
90  cfg.merge(SimEventFilterCfg(flags, sequenceName='SimSequence'))
91  cfg.merge(InvertedSimEventFilterCfg(flags, sequenceName='CopyHitSequence'))
92  cfg.merge(RenameHitCollectionsCfg(flags, sequenceName='CopyHitSequence'))
93  else:
94  #Cases 1, 2, 3
95  # add BeamEffectsAlg
96  from BeamEffects.BeamEffectsAlgConfig import BeamEffectsAlgCfg
97  cfg.merge(BeamEffectsAlgCfg(flags))
98  if flags.Input.Files:
99  #Cases 1, 2
100  if "xAOD::EventInfo#EventInfo" not in flags.Input.TypedCollections:
101  from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoCnvAlgCfg
102  cfg.merge(EventInfoCnvAlgCfg(flags))
103  else:
104  from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoUpdateFromContextAlgCfg
105  cfg.merge(EventInfoUpdateFromContextAlgCfg(flags))
106  else:
107  #Case 3: xAOD::EventInfo#EventInfo will have already been created
108  pass
109 
110  if flags.Beam.Type is BeamType.TestBeam:
111  from TBDetDescrAlg.TBDetDescrAlgConfig import TBDetDescrLoaderCfg
112  cfg.merge(TBDetDescrLoaderCfg(flags))
113  AcceptAlgNames=[]
114  if flags.Sim.ISFRun:
115  # add the ISF_MainConfig
116  from ISF_Config.ISF_MainConfig import ISF_KernelCfg
117  cfg.merge(ISF_KernelCfg(flags))
118  AcceptAlgNames = ['ISF_Kernel_' + flags.Sim.ISF.Simulator.value]
119  if flags.Sim.ISF.ReSimulation:
120  AcceptAlgNames += ['RenameHitCollections']
121  else:
122  AcceptAlgNames = ['G4AtlasAlg']
123  #add the G4AtlasAlg
124  from G4AtlasAlg.G4AtlasAlgConfig import G4AtlasAlgCfg
125  cfg.merge(G4AtlasAlgCfg(flags))
126  from SimulationConfig.SimEnums import LArParameterization
127  if flags.Sim.LArParameterization is LArParameterization.FastCaloSim:
128  cfg.getEventAlgo("ISF_CollectionMerger").InputLArEMBHits.data.sort() # temporary workaround
129  cfg.getEventAlgo("ISF_CollectionMerger").InputLArEMECHits.data.sort() # temporary workaround
130  cfg.getEventAlgo("ISF_CollectionMerger").InputLArFCALHits.data.sort() # temporary workaround
131  cfg.getEventAlgo("ISF_CollectionMerger").InputLArHECHits.data.sort() # temporary workaround
132  cfg.getEventAlgo("ISF_CollectionMerger").InputTileHits.data.sort() # temporary workaround
133  cfg.getEventAlgo("ISF_CollectionMerger").InputMBTSHits.data.sort() # temporary workaround
134 
135  from SimulationConfig.SimEnums import CalibrationRun
136  if flags.Sim.CalibrationRun in [CalibrationRun.LAr, CalibrationRun.LArTile, CalibrationRun.LArTileZDC]:
137  from LArG4SD.LArG4SDToolConfig import DeadMaterialCalibrationHitMergerCfg
138  cfg.merge(DeadMaterialCalibrationHitMergerCfg(flags))
139 
140  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg, outputStreamName
141  from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
142 
143  if flags.Output.HITSFileName:
144  from SimuJobTransforms.SimOutputConfig import getStreamHITS_ItemList
145  cfg.merge( OutputStreamCfg(flags,"HITS", ItemList=getStreamHITS_ItemList(flags), disableEventTag=False, AcceptAlgs=AcceptAlgNames) )
146  cfg.merge(SetupMetaDataForStreamCfg(flags, "HITS", AcceptAlgs=AcceptAlgNames, createMetadata=[MetadataCategory.IOVMetaData]))
147  if flags.Sim.ISF.ReSimulation:
148  cfg.getEventAlgo(outputStreamName("HITS")).TakeItemsFromInput=False
149 
150  if flags.Output.EVNT_TRFileName:
151  from SimuJobTransforms.SimOutputConfig import getStreamEVNT_TR_ItemList
152  cfg.merge( OutputStreamCfg(flags,"EVNT_TR", ItemList=getStreamEVNT_TR_ItemList(flags), disableEventTag=True, AcceptAlgs=AcceptAlgNames) )
153  cfg.merge(SetupMetaDataForStreamCfg(flags, "EVNT_TR", AcceptAlgs=AcceptAlgNames, createMetadata=[MetadataCategory.IOVMetaData]))
154 
155  # Add MT-safe PerfMon
156  if flags.PerfMon.doFastMonMT or flags.PerfMon.doFullMonMT:
157  from PerfMonComps.PerfMonCompsConfig import PerfMonMTSvcCfg
158  cfg.merge(PerfMonMTSvcCfg(flags))
159 
160  return cfg

◆ specialConfigPostInclude()

def python.CommonSimulationSteering.specialConfigPostInclude (   flags,
  cfg 
)

Definition at line 29 of file CommonSimulationSteering.py.

29 def specialConfigPostInclude(flags, cfg):
30  fragment = flags.Input.SpecialConfiguration.get("postInclude", None)
31  if fragment and fragment != 'NONE':
32  executeFromFragment(fragment, flags, cfg) #FIXME assumes only one fragment?
33 
34 

◆ specialConfigPreInclude()

def python.CommonSimulationSteering.specialConfigPreInclude (   flags)

Definition at line 23 of file CommonSimulationSteering.py.

23 def specialConfigPreInclude(flags):
24  fragment = flags.Input.SpecialConfiguration.get("preInclude", None)
25  if fragment and fragment != 'NONE':
26  executeFromFragment(fragment, flags) #FIXME assumes only one fragment?
27 
28 
AthenaPoolExample_WriteCond.outputStreamName
string outputStreamName
Definition: AthenaPoolExample_WriteCond.py:21
G4AtlasAlgConfig.G4AtlasAlgCfg
def G4AtlasAlgCfg(flags, name="G4AtlasAlg", **kwargs)
Definition: G4AtlasAlgConfig.py:12
ISF_AlgorithmsConfig.RenameHitCollectionsCfg
def RenameHitCollectionsCfg(flags, name="RenameHitCollections", sequenceName='CopyHitSequence', **kwargs)
Definition: ISF_AlgorithmsConfig.py:27
python.OutputStreamConfig.OutputStreamCfg
def OutputStreamCfg(flags, streamName, ItemList=[], MetadataItemList=[], disableEventTag=False, trigNavThinningSvc=None, takeItemsFromInput=False, extendProvenanceRecord=True, keepProvenanceTagsRegEx=None, AcceptAlgs=[], HelperTools=[])
Definition: OutputStreamConfig.py:16
BeamEffectsAlgConfig.BeamEffectsAlgCfg
def BeamEffectsAlgCfg(flags, name="BeamEffectsAlg", **kwargs)
Definition: BeamEffectsAlgConfig.py:106
python.CommonSimulationSteering.CommonSimulationCfg
def CommonSimulationCfg(flags, log)
Definition: CommonSimulationSteering.py:35
python.xAODEventInfoCnvConfig.EventInfoUpdateFromContextAlgCfg
def EventInfoUpdateFromContextAlgCfg(flags, name="EventInfoUpdateFromContextAlg", **kwargs)
Definition: xAODEventInfoCnvConfig.py:110
python.PerfMonCompsConfig.PerfMonMTSvcCfg
def PerfMonMTSvcCfg(flags, **kwargs)
A minimal new-style configuration for PerfMonMTSvc.
Definition: PerfMonCompsConfig.py:10
python.MainServicesConfig.MainEvgenServicesCfg
def MainEvgenServicesCfg(flags, LoopMgr="AthenaEventLoopMgr", withSequences=True)
Definition: MainServicesConfig.py:353
TrackRecordGeneratorConfig.Input_TrackRecordGeneratorCfg
def Input_TrackRecordGeneratorCfg(ConfigFlags, name="TrackRecordGenerator", **kwargs)
Input: Reading Particles from TrackRecord Input File ###############.
Definition: TrackRecordGeneratorConfig.py:4
python.CommonSimulationSteering.specialConfigPostInclude
def specialConfigPostInclude(flags, cfg)
Definition: CommonSimulationSteering.py:29
McEventCollectionFilterConfig.TruthResetAlgCfg
def TruthResetAlgCfg(flags, **kwargs)
Definition: McEventCollectionFilterConfig.py:226
LArG4SDToolConfig.DeadMaterialCalibrationHitMergerCfg
def DeadMaterialCalibrationHitMergerCfg(flags, name="DeadMaterialCalibrationHitMerger", **kwargs)
Definition: LArG4SDToolConfig.py:431
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
python.ISF_MainConfig.ISF_KernelCfg
def ISF_KernelCfg(flags)
Definition: ISF_MainConfig.py:368
TBDetDescrAlgConfig.TBDetDescrLoaderCfg
def TBDetDescrLoaderCfg(flags, **kwargs)
Definition: TBDetDescrAlgConfig.py:6
ISF_AlgorithmsConfig.SimEventFilterCfg
def SimEventFilterCfg(flags, name="ISF_SimEventFilter", sequenceName='SimSequence', **kwargs)
Definition: ISF_AlgorithmsConfig.py:9
python.SimOutputConfig.getStreamEVNT_TR_ItemList
def getStreamEVNT_TR_ItemList(flags)
Definition: SimOutputConfig.py:5
python.CommonSimulationSteering.specialConfigPreInclude
def specialConfigPreInclude(flags)
Definition: CommonSimulationSteering.py:23
python.TransformUtils.executeFromFragment
def executeFromFragment(fragment_string, flags, cfg=None)
Definition: Tools/PyJobTransforms/python/TransformUtils.py:6
ISF_AlgorithmsConfig.InvertedSimEventFilterCfg
def InvertedSimEventFilterCfg(flags, name="ISF_InvertedSimEventFilter", sequenceName='CopyHitSequence', **kwargs)
Definition: ISF_AlgorithmsConfig.py:22
CosmicGeneratorConfig.CosmicGeneratorCfg
def CosmicGeneratorCfg(flags, name="CosmicGenerator", **kwargs)
Note that in this coordinate frame the y-axis points upward such that the cosmics arrive from upward ...
Definition: CosmicGeneratorConfig.py:147
python.EventIdOverrideConfig.EvtIdModifierSvcCfg
def EvtIdModifierSvcCfg(flags, name="EvtIdModifierSvc", **kwargs)
Definition: EventIdOverrideConfig.py:140
python.xAODEventInfoCnvConfig.EventInfoCnvAlgCfg
def EventInfoCnvAlgCfg(flags, name="EventInfoCnvAlg", inputKey="McEventInfo", outputKey="EventInfo", disableBeamSpot=False, **kwargs)
Definition: xAODEventInfoCnvConfig.py:11
InfileMetaDataConfig.SetupMetaDataForStreamCfg
def SetupMetaDataForStreamCfg(flags, streamName="", AcceptAlgs=None, createMetadata=None, propagateMetadataFromInput=True, *args, **kwargs)
Definition: InfileMetaDataConfig.py:222
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69
python.FilterHit_Skeleton.getStreamHITS_ItemList
def getStreamHITS_ItemList(flags)
Definition: FilterHit_Skeleton.py:12