Esempio n. 1
0
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
Esempio n. 2
0
def MCTruthUserActionToolCfg(flags, name="ISFMCTruthUserActionTool", **kwargs):
    result = ComponentAccumulator()
    truthacc = TruthServiceCfg(flags)
    kwargs.setdefault("TruthRecordSvc", truthacc.getPrimary())
    result.merge(truthacc)
    result.setPrivateTools(
        CompFactory.G4UA.iGeant4.MCTruthUserActionTool(name, **kwargs))
    return result
Esempio n. 3
0
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
Esempio n. 4
0
def Kernel_GenericSimulatorMTCfg(flags, name="ISF_Kernel_GenericSimulatorMT", **kwargs):
    acc = ComponentAccumulator()

    tool = acc.popToolsAndMerge(ParticleKillerToolCfg(flags))
    kwargs.setdefault("ParticleKillerTool", tool)

    acc.merge(GeoIDSvcCfg(flags))
    kwargs.setdefault("GeoIDSvc", acc.getService("ISF_GeoIDSvc"))
    acc.merge(InputConverterCfg(flags))

    kwargs.setdefault("InputConverter", acc.getService("ISF_InputConverter"))

    truthacc = TruthServiceCfg(flags)
    kwargs.setdefault("TruthRecordService", truthacc.getPrimary())
    acc.merge(truthacc)

    kwargs.setdefault("Cardinality", flags.Concurrency.NumThreads)
    kwargs.setdefault("OutputLevel", 1)
    kwargs.setdefault("InputEvgenCollection", "BeamTruthEvent")
    kwargs.setdefault("OutputTruthCollection", "TruthEvent")

    acc.addEventAlgo(CompFactory.ISF.SimKernelMT(name, **kwargs))
    return acc
Esempio n. 5
0
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
Esempio n. 6
0
def fatrasProcessSamplingToolCfg(flags,
                                 name="ISF_FatrasProcessSamplingTool",
                                 **kwargs):
    mlog = logging.getLogger(name)
    mlog.debug('Start configuration')

    result = ComponentAccumulator()

    result.merge(RNG(flags.Random.Engine))
    kwargs.setdefault("RandomNumberService", result.getService("AthRNGSvc"))

    # truth record
    acc = TruthServiceCfg(flags)
    kwargs.setdefault("TruthRecordSvc", acc.getPrimary())
    result.merge(acc)

    # decays
    acc = fatrasParticleDecayHelperCfg(flags)
    pd_helper_cfg = acc.getPublicTool('ISF_FatrasParticleDecayHelper')
    result.merge(acc)
    kwargs.setdefault("ParticleDecayHelper", pd_helper_cfg)

    # photon conversion
    acc = fatrasConversionCreatorCfg(flags)
    ph_conv_cfg = acc.getPublicTool('ISF_FatrasConversionCreator')
    result.merge(acc)
    kwargs.setdefault("PhotonConversionTool", ph_conv_cfg)

    # Hadronic interactions
    acc = fatrasG4HadIntProcessorCfg(flags)
    g4had_proc_cfg = acc.getPublicTool('ISF_FatrasG4HadIntProcessor')
    result.merge(acc)
    kwargs.setdefault("HadronicInteractionProcessor", g4had_proc_cfg)
    kwargs.setdefault("HadronicInteraction", True)

    # Validation Tool
    acc = fatrasPhysicsValidationToolCfg(flags)
    phys_val_cfg = acc.getPublicTool('ISF_FatrasPhysicsValidationTool')
    result.merge(acc)
    kwargs.setdefault("PhysicsValidationTool", phys_val_cfg)
    kwargs.setdefault("ValidationMode", flags.Sim.ISF.ValidationMode)

    iFatras__ProcessSamplingTool = CompFactory.iFatras.ProcessSamplingTool
    result.addPublicTool(iFatras__ProcessSamplingTool(name=name, **kwargs))

    return result
Esempio n. 7
0
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