def fatrasG4HadIntProcessorCfg(flags, name="ISF_FatrasG4HadIntProcessor", **kwargs): mlog = logging.getLogger(name) mlog.debug('Start configuration') result = ComponentAccumulator() result.merge(RNG(flags.Random.Engine)) kwargs.setdefault("RandomNumberService", result.getService("AthRNGSvc")) kwargs.setdefault("RandomStreamName", flags.Sim.Fatras.RandomStreamName) result.merge(ParticleBrokerSvcCfg(flags)) kwargs.setdefault("ParticleBroker", result.getService("ISF_ParticleBrokerSvc")) acc = TruthServiceCfg(flags) kwargs.setdefault("TruthRecordSvc", acc.getPrimary()) result.merge(acc) result.merge(fatrasPhysicsValidationToolCfg(flags)) phys_val_cfg = acc.getPublicTool('ISF_FatrasPhysicsValidationTool') kwargs.setdefault("PhysicsValidationTool", phys_val_cfg) kwargs.setdefault("ValidationMode", flags.Sim.ISF.ValidationMode) kwargs.setdefault("MomentumCut", flags.Sim.Fatras.MomCutOffSec) iFatras__G4HadIntProcessor = CompFactory.iFatras.G4HadIntProcessor result.addPublicTool(iFatras__G4HadIntProcessor(name=name, **kwargs)) return result
def fatrasConversionCreatorCfg(flags, name="ISF_FatrasConversionCreator", **kwargs): mlog = logging.getLogger(name) mlog.debug('Start configuration') result = ComponentAccumulator() result.merge(RNG(flags.Random.Engine)) kwargs.setdefault("RandomNumberService", result.getService("AthRNGSvc")) kwargs.setdefault("RandomStreamName", flags.Sim.Fatras.RandomStreamName) result.merge(ParticleBrokerSvcCfg(flags)) kwargs.setdefault("ParticleBroker", result.getService("ISF_ParticleBrokerSvc")) acc = fatrasPhysicsValidationToolCfg(flags) phys_val_cfg = acc.getPublicTool('ISF_FatrasPhysicsValidationTool') result.merge(acc) kwargs.setdefault("PhysicsValidationTool", phys_val_cfg) kwargs.setdefault("PhysicsProcessCode", 14) # TODO: to be taken from central definition kwargs.setdefault("ValidationMode", flags.Sim.ISF.ValidationMode) iFatras__PhotonConversionTool = CompFactory.iFatras.PhotonConversionTool result.addPublicTool(iFatras__PhotonConversionTool(name=name, **kwargs)) return result
def TrackProcessorUserActionToolCfg(flags, name="ISFG4TrackProcessorUserActionTool", **kwargs): result = ParticleBrokerSvcCfg(flags) kwargs.setdefault("ParticleBroker", result.getService("ISF_ParticleBrokerSvc")) result.merge(GeoIDSvcCfg(flags)) kwargs.setdefault("GeoIDSvc", result.getService("ISF_GeoIDSvc")) result.setPrivateTools( CompFactory.G4UA.iGeant4.TrackProcessorUserActionPassBackTool( name, **kwargs)) return result
def fatrasParametricHadIntProcessorCfg( flags, name="ISF_FatrasParametricHadIntProcessor", **kwargs): mlog = logging.getLogger(name) mlog.debug('Start configuration') result = ComponentAccumulator() result.merge(RNG(flags.Random.Engine)) kwargs.setdefault("RandomNumberService", result.getService("AthRNGSvc")) kwargs.setdefault("RandomStreamName", flags.Sim.Fatras.RandomStreamName) result.merge(ParticleBrokerSvcCfg(flags)) kwargs.setdefault("ParticleBroker", result.getService("ISF_ParticleBrokerSvc")) acc = TruthServiceCfg(flags) kwargs.setdefault("TruthRecordSvc", acc.getPrimary()) result.merge(acc) kwargs.setdefault("HadronicInteractionScaleFactor", flags.Sim.Fatras.HadronIntProb) kwargs.setdefault("MinimumHadronicInitialEnergy", flags.Sim.Fatras.MomCutOffSec) kwargs.setdefault("MinimumHadronicOutEnergy", flags.Sim.Fatras.MomCutOffSec) kwargs.setdefault("HadronicInteractionValidation", False) kwargs.setdefault("PhysicsProcessCode", 121) # TODO: to be taken from central definition result.merge(fatrasPhysicsValidationToolCfg(flags)) phys_val_cfg = acc.getPublicTool('ISF_FatrasPhysicsValidationTool') kwargs.setdefault("PhysicsValidationTool", phys_val_cfg) kwargs.setdefault("ValidationMode", flags.Sim.ISF.ValidationMode) iFatras__HadIntProcessorParametric = CompFactory.iFatras.HadIntProcessorParametric result.setPrivateTools(iFatras__HadIntProcessorParametric(name, **kwargs)) return result
def fatrasParticleDecayHelperCfg(flags, name="ISF_FatrasParticleDecayHelper", **kwargs): mlog = logging.getLogger(name) mlog.debug('Start configuration') result = ComponentAccumulator() result.merge(RNG(flags.Random.Engine)) kwargs.setdefault("RandomNumberService", result.getService("AthRNGSvc")) kwargs.setdefault("RandomStreamName", flags.Sim.Fatras.RandomStreamName) kwargs.setdefault("G4RandomStreamName", flags.Sim.Fatras.G4RandomStreamName) kwargs.setdefault("ValidationMode", flags.Sim.ISF.ValidationMode) result.merge(ParticleBrokerSvcCfg(flags)) kwargs.setdefault("ParticleBroker", result.getService("ISF_ParticleBrokerSvc")) acc = fatrasPdgG4ParticleCfg(flags) pdg_g4part_cfg = acc.getPublicTool('ISF_FatrasPdgG4Particle') result.merge(acc) kwargs.setdefault("PDGToG4ParticleConverter", pdg_g4part_cfg) acc = fatrasPhysicsValidationToolCfg(flags) phys_val_cfg = acc.getPublicTool('ISF_FatrasPhysicsValidationTool') result.merge(acc) kwargs.setdefault("PhysicsValidationTool", phys_val_cfg) acc = G4RunManagerHelperCfg(flags) g4run_man_cfg = acc.getPublicTool('ISF_G4RunManagerHelper') result.merge(acc) kwargs.setdefault("G4RunManagerHelper", g4run_man_cfg) iFatras__G4ParticleDecayHelper = CompFactory.iFatras.G4ParticleDecayHelper result.addPublicTool(iFatras__G4ParticleDecayHelper(name=name, **kwargs)) return result
def Kernel_GenericSimulatorCfg(flags, name="ISF_Kernel_GenericSimulator", **kwargs): acc = ComponentAccumulator() acc.merge(InputConverterCfg(flags)) kwargs.setdefault("InputConverter", acc.getService("ISF_InputConverter")) acc.merge(ParticleBrokerSvcCfg(flags)) kwargs.setdefault("ParticleBroker", acc.getService("ISF_ParticleBrokerSvc")) truthacc = TruthServiceCfg(flags) kwargs.setdefault("TruthRecordService", truthacc.getPrimary()) acc.merge(truthacc) tool = acc.popToolsAndMerge(MemoryMonitorToolCfg(flags)) kwargs.setdefault("MemoryMonitoringTool", tool) kwargs.setdefault("DoCPUMonitoring", flags.Sim.ISF.DoTimeMonitoring) kwargs.setdefault("DoMemoryMonitoring", flags.Sim.ISF.DoMemoryMonitoring) kwargs.setdefault("InputHardScatterCollection", "BeamTruthEvent") kwargs.setdefault("OutputHardScatterTruthCollection", "TruthEvent") acc.addEventAlgo(CompFactory.ISF.SimKernelCfg(name, **kwargs)) return acc
def fatrasMaterialEffectsEngineCfg(flags, name="ISF_FatrasMaterialEffectsEngine", **kwargs): mlog = logging.getLogger(name) mlog.debug('Start configuration') result = ComponentAccumulator() result.merge(RNG(flags.Random.Engine)) kwargs.setdefault("RandomNumberService", result.getService("AthRNGSvc")) kwargs.setdefault("RandomStreamName", flags.Sim.Fatras.RandomStreamName) result.merge(ParticleBrokerSvcCfg(flags)) kwargs.setdefault("ParticleBroker", result.getService("ISF_ParticleBrokerSvc")) acc = TruthServiceCfg(flags) kwargs.setdefault("TruthRecordSvc", acc.getPrimary()) result.merge(acc) result.merge(fatrasProcessSamplingToolCfg(flags)) kwargs.setdefault("ProcessSamplingTool", result.getPublicTool("ISF_FatrasProcessSamplingTool")) result.merge(fatrasParticleDecayHelperCfg(flags)) kwargs.setdefault("ParticleDecayHelper", result.getPublicTool("ISF_FatrasParticleDecayHelper")) # energy loss result.merge(fatrasEnergyLossUpdatorCfg(flags)) kwargs.setdefault("EnergyLossSampler", result.getPublicTool("ISF_FatrasEnergyLossUpdator")) kwargs.setdefault("EnergyLoss", True) result.merge(fatrasEnergyLossSamplerBetheHeitlerCfg(flags)) tool = result.getPublicTool("ISF_FatrasEnergyLossSamplerBetheHeitler") kwargs.setdefault("ElectronEnergyLossSampler", tool) kwargs.setdefault("UseElectronSampler", True) kwargs.setdefault("CreateBremPhotons", True) # multiple scattering result.merge(fatrasMultipleScatteringSamplerHighlandCfg(flags)) tool = result.getPublicTool("ISF_MultipleScatteringSamplerHighland") kwargs.setdefault("MultipleScatteringSampler", tool) kwargs.setdefault("MultipleScattering", True) # the properties given throuth the JobProperties interface kwargs.setdefault("MomentumCut", flags.Sim.Fatras.MomCutOffSec) kwargs.setdefault("MinimumBremPhotonMomentum", flags.Sim.Fatras.MomCutOffSec) # MCTruth Process Code kwargs.setdefault("BremProcessCode", 3) # TODO: to be taken from central definition # the validation output result.merge(fatrasPhysicsValidationToolCfg(flags)) tool = acc.getPublicTool('ISF_FatrasPhysicsValidationTool') kwargs.setdefault("PhysicsValidationTool", tool) kwargs.setdefault("ValidationMode", flags.Sim.ISF.ValidationMode) kwargs.setdefault("OutputPrefix", "[McME] - ") kwargs.setdefault("OutputPostfix", " - ") kwargs.setdefault("OutputLevel", flags.Exec.OutputLevel) iFatras__McMaterialEffectsEngine = CompFactory.iFatras.McMaterialEffectsEngine result.setPublicTool(iFatras__McMaterialEffectsEngine(name, **kwargs)) return result