37 if not flags.Input.Files:
39 from AthenaConfiguration.MainServicesConfig
import MainEvgenServicesCfg
42 from xAODEventInfoCnv.xAODEventInfoCnvConfig
import EventInfoCnvAlgCfg
43 cfg.merge(
EventInfoCnvAlgCfg(flags, name=
"xAODMaker::EventInfoCnvAlg", disableBeamSpot =
True))
48 cfg.getService(
"EventSelector").FirstLB = flags.Input.LumiBlockNumbers[0]
49 cfg.getService(
"EventSelector").OverrideRunNumber =
True
50 from AthenaKernel.EventIdOverrideConfig
import EvtIdModifierSvcCfg
52 if flags.Beam.Type
is BeamType.Cosmics:
54 from CosmicGenerator.CosmicGeneratorConfig
import CosmicGeneratorCfg
58 fragment = flags.Sim.GenerationConfiguration
59 if fragment
and fragment !=
'NONE':
61 log.info(
"On-the-fly generation using ParticleGun!")
63 log.error(
"No input file or on-the-fly generation configuration provided!")
66 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
68 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
70 if flags.Sim.ReadTR
or flags.Sim.CavernBackground
is CavernBackground.Read:
72 from TrackRecordGenerator.TrackRecordGeneratorConfig
import Input_TrackRecordGeneratorCfg
74 if flags.Sim.ISF.ReSimulation:
76 if "xAOD::EventInfo#EventInfo" not in flags.Input.TypedCollections:
77 from xAODEventInfoCnv.xAODEventInfoCnvConfig
import EventInfoCnvAlgCfg
80 from xAODEventInfoCnv.xAODEventInfoCnvConfig
import EventInfoUpdateFromContextAlgCfg
82 from McEventCollectionFilter.McEventCollectionFilterConfig
import TruthResetAlgCfg
84 cfg.addSequence(CompFactory.AthSequencer(
'SimSequence'), parentName=
'AthAlgSeq')
85 cfg.addSequence(CompFactory.AthSequencer(
'CopyHitSequence'), parentName=
'AthAlgSeq')
87 if flags.Sim.ISF.ReSimulation:
89 from ISF_Algorithms.ISF_AlgorithmsConfig
import SimEventFilterCfg, InvertedSimEventFilterCfg, RenameHitCollectionsCfg
96 from BeamEffects.BeamEffectsAlgConfig
import BeamEffectsAlgCfg
100 if "xAOD::EventInfo#EventInfo" not in flags.Input.TypedCollections:
101 from xAODEventInfoCnv.xAODEventInfoCnvConfig
import EventInfoCnvAlgCfg
104 from xAODEventInfoCnv.xAODEventInfoCnvConfig
import EventInfoUpdateFromContextAlgCfg
110 if flags.Beam.Type
is BeamType.TestBeam:
111 from TBDetDescrAlg.TBDetDescrAlgConfig
import TBDetDescrLoaderCfg
116 from ISF_Config.ISF_MainConfig
import ISF_KernelCfg
118 AcceptAlgNames = [
'ISF_Kernel_' + flags.Sim.ISF.Simulator.value]
119 if flags.Sim.ISF.ReSimulation:
120 AcceptAlgNames += [
'RenameHitCollections']
122 AcceptAlgNames = [
'G4AtlasAlg']
124 from G4AtlasAlg.G4AtlasAlgConfig
import G4AtlasAlgCfg
126 from SimulationConfig.SimEnums
import LArParameterization
127 if flags.Sim.LArParameterization
is LArParameterization.FastCaloSim:
128 cfg.getEventAlgo(
"ISF_CollectionMerger").InputLArEMBHits.data.sort()
129 cfg.getEventAlgo(
"ISF_CollectionMerger").InputLArEMECHits.data.sort()
130 cfg.getEventAlgo(
"ISF_CollectionMerger").InputLArFCALHits.data.sort()
131 cfg.getEventAlgo(
"ISF_CollectionMerger").InputLArHECHits.data.sort()
132 cfg.getEventAlgo(
"ISF_CollectionMerger").InputTileHits.data.sort()
133 cfg.getEventAlgo(
"ISF_CollectionMerger").InputMBTSHits.data.sort()
135 from SimulationConfig.SimEnums
import CalibrationRun
136 if flags.Sim.CalibrationRun
in [CalibrationRun.LAr, CalibrationRun.LArTile, CalibrationRun.LArTileZDC]:
137 from LArG4SD.LArG4SDToolConfig
import DeadMaterialCalibrationHitMergerCfg
140 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg, outputStreamName
141 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
143 if flags.Output.HITSFileName:
144 from SimuJobTransforms.SimOutputConfig
import getStreamHITS_ItemList
146 cfg.merge(
SetupMetaDataForStreamCfg(flags,
"HITS", AcceptAlgs=AcceptAlgNames, createMetadata=[MetadataCategory.IOVMetaData]))
147 if flags.Sim.ISF.ReSimulation:
150 if flags.Output.EVNT_TRFileName:
151 from SimuJobTransforms.SimOutputConfig
import getStreamEVNT_TR_ItemList
153 cfg.merge(
SetupMetaDataForStreamCfg(flags,
"EVNT_TR", AcceptAlgs=AcceptAlgNames, createMetadata=[MetadataCategory.IOVMetaData]))
156 if flags.PerfMon.doFastMonMT
or flags.PerfMon.doFullMonMT:
157 from PerfMonComps.PerfMonCompsConfig
import PerfMonMTSvcCfg