示例#1
0
def getParticleBrokerSvcNoOrdering(name="ISF_ParticleBrokerSvcNoOrdering", **kwargs):
    kwargs.setdefault('EntryLayerTool', 'ISF_EntryLayerTool')
    kwargs.setdefault('GeoIDSvc', 'ISF_GeoIDSvc')
    kwargs.setdefault('AlwaysUseGeoIDSvc', False)
    from ISF_Config.ISF_jobProperties import ISF_Flags
    kwargs.setdefault('ValidateGeoIDs', ISF_Flags.ValidationMode())
    kwargs.setdefault('ValidationOutput', ISF_Flags.ValidationMode())
    kwargs.setdefault('ValidationStreamName', "ParticleBroker")
    from G4AtlasApps.SimFlags import simFlags
    kwargs.setdefault('BarcodeService', simFlags.TruthStrategy.BarcodeServiceName())
    return CfgMgr.ISF__ParticleBrokerDynamicOnReadIn(name, **kwargs)
示例#2
0
def getFatrasMaterialEffectsEngine(name="ISF_FatrasMaterialEffectsEngine", **kwargs):
    from G4AtlasApps.SimFlags import simFlags
    kwargs.setdefault("RandomNumberService"         , simFlags.RandomSvc() )
    kwargs.setdefault("RandomStreamName"            , ISF_FatrasFlags.RandomStreamName())
    kwargs.setdefault("ParticleBroker"              , ISF_Flags.ParticleBroker())
    kwargs.setdefault("TruthRecordSvc"              , simFlags.TruthStrategy.TruthServiceName())
    kwargs.setdefault("ProcessSamplingTool"         , getPublicTool('ISF_FatrasProcessSamplingTool'))
    kwargs.setdefault("ParticleDecayHelper"         , getPublicTool('ISF_FatrasParticleDecayHelper'))
    # energy loss
    kwargs.setdefault("EnergyLoss"                  , True)
    kwargs.setdefault("EnergyLossSampler"           , getPublicTool('ISF_FatrasEnergyLossUpdator'))
    kwargs.setdefault("UseElectronSampler"          , True)
    kwargs.setdefault("ElectronEnergyLossSampler"   , getPublicTool('ISF_FatrasEnergyLossSamplerBetheHeitler'))
    kwargs.setdefault("CreateBremPhotons"           , True)    
    # multiple scattering
    kwargs.setdefault("MultipleScattering"          , True)
    kwargs.setdefault("MultipleScatteringSampler"   , getPublicTool('ISF_FatrasMultipleScatteringSamplerHighland'))
    # the properties given throuth the JobProperties interface
    kwargs.setdefault("MomentumCut"                 , FatrasTuningFlags.MomCutOffSec())
    kwargs.setdefault("MinimumBremPhotonMomentum"   , FatrasTuningFlags.MomCutOffSec())
    # MCTruth Process Code
    kwargs.setdefault("BremProcessCode"             , 3) # TODO: to be taken from central definition
    # the validation output
    kwargs.setdefault("ValidationMode"              , ISF_Flags.ValidationMode())
    kwargs.setdefault("PhysicsValidationTool"       , getPublicTool('ISF_FatrasPhysicsValidationTool'))
    kwargs.setdefault("OutputPrefix", '[McME] - ')
    kwargs.setdefault("OutputPostfix", ' - ')
    kwargs.setdefault("OutputLevel", ISF_FatrasFlags.OutputLevelGeneral())
    
    from ISF_FatrasTools.ISF_FatrasToolsConf import iFatras__McMaterialEffectsEngine
    return iFatras__McMaterialEffectsEngine(name, **kwargs )
示例#3
0
def getFatrasG4HadIntProcessor(name="ISF_FatrasG4HadIntProcessor", **kwargs):
    from G4AtlasApps.SimFlags import simFlags
    kwargs.setdefault("RandomNumberService" , simFlags.RandomSvc() )
    kwargs.setdefault("RandomStreamName"    , ISF_FatrasFlags.RandomStreamName())
    kwargs.setdefault("ParticleBroker"      , ISF_Flags.ParticleBroker())
    kwargs.setdefault("TruthRecordSvc"      , simFlags.TruthStrategy.TruthServiceName())
    kwargs.setdefault("PhysicsValidationTool"       , getPublicTool('ISF_FatrasPhysicsValidationTool'))
    kwargs.setdefault('ValidationMode'      , ISF_Flags.ValidationMode())
    kwargs.setdefault("MomentumCut"        , FatrasTuningFlags.MomCutOffSec())

    from ISF_FatrasToolsG4.ISF_FatrasToolsG4Conf import iFatras__G4HadIntProcessor
    return iFatras__G4HadIntProcessor(name, **kwargs )
示例#4
0
def getFatrasConversionCreator(name="ISF_FatrasConversionCreator", **kwargs):
    #   Fatras Hadronic Interaction Processor
    #   hadronic interaction creator
    from G4AtlasApps.SimFlags import simFlags
    kwargs.setdefault("RandomNumberService" , simFlags.RandomSvc() )
    kwargs.setdefault("RandomStreamName"    , ISF_FatrasFlags.RandomStreamName())
    kwargs.setdefault("ParticleBroker"  , ISF_Flags.ParticleBroker())
    kwargs.setdefault("TruthRecordSvc"  , simFlags.TruthStrategy.TruthServiceName())
    kwargs.setdefault("PhysicsValidationTool"       , getPublicTool('ISF_FatrasPhysicsValidationTool'))
    kwargs.setdefault("PhysicsProcessCode"              , 14) # TODO: to be taken from central definition
    kwargs.setdefault('ValidationMode'      , ISF_Flags.ValidationMode())

    from ISF_FatrasTools.ISF_FatrasToolsConf import iFatras__PhotonConversionTool
    return iFatras__PhotonConversionTool(name, **kwargs )
示例#5
0
def getFatrasParticleDecayHelper(name="ISF_FatrasParticleDecayHelper", **kwargs):
    from G4AtlasApps.SimFlags import simFlags
    if not simFlags.RandomSeedList.checkForExistingSeed( "FatrasG4" ):
      simFlags.RandomSeedList.addSeed( "FatrasG4" , 23491234, 23470291 )
    kwargs.setdefault("RandomNumberService" , simFlags.RandomSvc() )
    kwargs.setdefault("RandomStreamName"    , ISF_FatrasFlags.RandomStreamName())
    kwargs.setdefault("G4RandomStreamName"    , "FatrasG4") # TODO: read stream name "FatrasG4" from Fatras jobProperties
    kwargs.setdefault("ParticleBroker"  , ISF_Flags.ParticleBroker())
    kwargs.setdefault("ParticleTruthSvc", simFlags.TruthStrategy.TruthServiceName())
    kwargs.setdefault("PDGToG4ParticleConverter", getPublicTool('ISF_FatrasPdgG4Particle'))
    # the validation output
    kwargs.setdefault("ValidationMode"              , ISF_Flags.ValidationMode())
    kwargs.setdefault("PhysicsValidationTool"       , getPublicTool('ISF_FatrasPhysicsValidationTool'))
    #kwargs.setdefault("G4RunManagerHelper"  , getPublicTool('ISF_G4RunManagerHelper'))

    from ISF_FatrasToolsG4.ISF_FatrasToolsG4Conf import iFatras__G4ParticleDecayHelper
    return iFatras__G4ParticleDecayHelper(name, **kwargs )
示例#6
0
def getFatrasParametricHadIntProcessor(name="ISF_FatrasParametricHadIntProcessor", **kwargs):
    from G4AtlasApps.SimFlags import simFlags
    #   Fatras Hadronic Interaction Processor
    #   hadronic interaction creator
    kwargs.setdefault("RandomNumberService" , simFlags.RandomSvc() )
    kwargs.setdefault("RandomStreamName"    , ISF_FatrasFlags.RandomStreamName())
    kwargs.setdefault("ParticleBroker"      , ISF_Flags.ParticleBroker())
    kwargs.setdefault("TruthRecordSvc"      , simFlags.TruthStrategy.TruthServiceName())
    kwargs.setdefault("HadronicInteractionScaleFactor"  , FatrasTuningFlags.HadronicInteractionProbabilityScalor())
    kwargs.setdefault("MinimumHadronicInitialEnergy"    , FatrasTuningFlags.MomCutOffSec())
    kwargs.setdefault("MinimumHadronicOutEnergy"        , FatrasTuningFlags.MomCutOffSec())
    kwargs.setdefault("HadronicInteractionValidation"   , False)
    kwargs.setdefault("PhysicsProcessCode"              , 121) # TODO: to be taken from central definition
    kwargs.setdefault("PhysicsValidationTool"       , getPublicTool('ISF_FatrasPhysicsValidationTool'))
    kwargs.setdefault('ValidationMode'      , ISF_Flags.ValidationMode())


    from ISF_FatrasTools.ISF_FatrasToolsConf import iFatras__HadIntProcessorParametric
    return iFatras__HadIntProcessorParametric(name, **kwargs )
示例#7
0
def getFatrasProcessSamplingTool(name="ISF_FatrasProcessSamplingTool", **kwargs):

    # random number service
    from G4AtlasApps.SimFlags import simFlags
    kwargs.setdefault( "RandomNumberService", simFlags.RandomSvc())
    # truth record
    kwargs.setdefault("TruthRecordSvc"      , simFlags.TruthStrategy.TruthServiceName())
    # decays
    kwargs.setdefault("ParticleDecayHelper" , getPublicTool('ISF_FatrasParticleDecayHelper'))
    # photon conversion
    kwargs.setdefault("PhotonConversionTool"     , getPublicTool('ISF_FatrasConversionCreator'))
    # hadronic interactions
    kwargs.setdefault("HadronicInteraction"         , True)
    #kwargs.setdefault("HadronicInteractionProcessor", getPublicTool('ISF_FatrasParametricHadIntProcessor'))
    kwargs.setdefault("HadronicInteractionProcessor", getPublicTool('ISF_FatrasG4HadIntProcessor'))
    # the validation output
    kwargs.setdefault("ValidationMode"              , ISF_Flags.ValidationMode())
    kwargs.setdefault("PhysicsValidationTool"       , getPublicTool('ISF_FatrasPhysicsValidationTool'))

    from ISF_FatrasTools.ISF_FatrasToolsConf import iFatras__ProcessSamplingTool
    return iFatras__ProcessSamplingTool(name, **kwargs)
示例#8
0
def getFatrasSimEngine(name="ISF_FatrasSimEngine", **kwargs):
    kwargs.setdefault("SimHitCreatorID" , getPublicTool('ISF_FatrasSimHitCreatorID'))
    # TODO: G4 Tools can not be used at the same time as Geant4 inside ISF
    kwargs.setdefault("ParticleDecayHelper" , getPublicTool('ISF_FatrasParticleDecayHelper'))
    # the filter setup
    kwargs.setdefault("TrackFilter"         , getPublicTool('ISF_FatrasKinematicFilter'))
    kwargs.setdefault("NeutralFilter"       , getPublicTool('ISF_FatrasKinematicFilter'))
    kwargs.setdefault("PhotonFilter"        , getPublicTool('ISF_FatrasKinematicFilter'))
    # extrapolator - test setup
    kwargs.setdefault("Extrapolator"        , getPublicTool('ISF_FatrasExEngine'))
    #
    kwargs.setdefault("ProcessSamplingTool" , getPublicTool('ISF_FatrasProcessSamplingTool'))
    # set the output level
    # kwargs.setdefault("OutputLevel"         , ISF_FatrasFlags.OutputLevelGeneral())
    # the validation
    kwargs.setdefault("ValidationMode"              , ISF_Flags.ValidationMode())
    kwargs.setdefault("PhysicsValidationTool"       , getPublicTool('ISF_FatrasPhysicsValidationTool'))
    # random number service
    from G4AtlasApps.SimFlags import simFlags
    kwargs.setdefault( "RandomNumberService", simFlags.RandomSvc())

    from ISF_FatrasTools.ISF_FatrasToolsConf import iFatras__TransportEngine
    return iFatras__TransportEngine(name, **kwargs )
示例#9
0
def getFatrasMaterialUpdator(name="ISF_FatrasMaterialUpdator", **kwargs):
    from G4AtlasApps.SimFlags import simFlags
    from TrkDetDescrSvc.AtlasTrackingGeometrySvc import AtlasTrackingGeometrySvc
    kwargs.setdefault("RandomNumberService" , simFlags.RandomSvc() )
    kwargs.setdefault("RandomStreamName"    , ISF_FatrasFlags.RandomStreamName())
    kwargs.setdefault("ParticleBroker"              , ISF_Flags.ParticleBroker())
    kwargs.setdefault("TruthRecordSvc"              , simFlags.TruthStrategy.TruthServiceName())
    # hadronic interactions
    kwargs.setdefault("HadronicInteraction"         , True)
    #kwargs.setdefault("HadronicInteractionProcessor", getPublicTool('ISF_FatrasParametricHadIntProcessor'))
    kwargs.setdefault("HadronicInteractionProcessor", getPublicTool('ISF_FatrasG4HadIntProcessor'))
    # enrgy loss
    kwargs.setdefault("EnergyLoss"                  , True)
    kwargs.setdefault("EnergyLossUpdator"           , getPublicTool('ISF_FatrasEnergyLossUpdator'))
    # mutiple scattering
    kwargs.setdefault("MultipleScattering"          , True)
    kwargs.setdefault("MultipleScatteringUpdator"   , getPublicTool('ISF_FatrasMultipleScatteringUpdator'))
    # photon conversion
    kwargs.setdefault("PhotonConversionTool"        , getPublicTool('ISF_FatrasConversionCreator'))
    # the validation output
    kwargs.setdefault("ValidationMode"              , ISF_Flags.ValidationMode())
    kwargs.setdefault("BremPhotonValidation"        , False)
    kwargs.setdefault("EnergyDepositValidation"     , False)
    # the properties given throuth the JobProperties interface
    kwargs.setdefault("MomentumCut"                 , FatrasTuningFlags.MomCutOffSec())
    kwargs.setdefault("MinimumBremPhotonMomentum"   , FatrasTuningFlags.MomCutOffSec())
    #
    kwargs.setdefault("PhysicsValidationTool"       , getPublicTool('ISF_FatrasPhysicsValidationTool'))
    kwargs.setdefault("ProcessSamplingTool"         , getPublicTool('ISF_FatrasProcessSamplingTool'))
    kwargs.setdefault("ParticleDecayHelper"             , getPublicTool('ISF_FatrasParticleDecayHelper'))
    # MCTruth Process Code
    kwargs.setdefault("BremProcessCode"             , 3) # TODO: to be taken from central definition
    kwargs.setdefault("TrackingGeometrySvc"         , AtlasTrackingGeometrySvc)

    from ISF_FatrasTools.ISF_FatrasToolsConf import iFatras__McMaterialEffectsUpdator
    return iFatras__McMaterialEffectsUpdator(name, **kwargs )
示例#10
0
def getSimHitService(name="ISF_SimHitService", **kwargs):
    from ISF_Config.ISF_jobProperties import ISF_Flags
    kwargs.setdefault('ValidationOutput', ISF_Flags.ValidationMode())
    return CfgMgr.ISF__SimHitSvc(name, **kwargs)
示例#11
0
def getTruthService(name="ISF_TruthService", **kwargs):
    from ISF_Config.ISF_jobProperties import ISF_Flags
    if ISF_Flags.ValidationMode():
        return getValidationTruthService(name, **kwargs)
    else:
        return getMC12TruthService(name, **kwargs)
示例#12
0
from AthenaCommon.CfgGetter import getAlgorithm
topSeq += getAlgorithm("BeamEffectsAlg")

#--------------------------------------------------------------
# ISF kernel configuration
#--------------------------------------------------------------

# keep reference to collection merger algorithm to guarantee that
# any subsequent simulator configuration gets a reference to the same
# instance when calling confgetter's getAlgorithm
collection_merger_alg = getAlgorithm('ISF_CollectionMerger')

SimKernel = getAlgorithm(ISF_Flags.Simulator.KernelName())

if ISF_Flags.ValidationMode():
    topSeq += getAlgorithm("ISF_SimHitTreeCreator")

#--------------------------------------------------------------
# Setup the random number streams
#--------------------------------------------------------------
from G4AtlasApps.SimFlags import SimFlags, simFlags
if not athenaCommonFlags.PoolEvgenInput.statusOn:
    if not simFlags.RandomSeedList.checkForExistingSeed('SINGLE'):
        simFlags.RandomSeedList.addSeed("SINGLE", 43657613, 78935670)
if not simFlags.RandomSeedList.checkForExistingSeed('VERTEX'):
    simFlags.RandomSeedList.addSeed('VERTEX', 9123448, 829143)
simFlags.RandomSeedList.addtoService()
simFlags.RandomSeedList.printSeeds()

#--------------------------------------------------------------