예제 #1
0
def getInput_GenericGenerator(name="ISF_Input_GenericGenerator", **kwargs):
    from G4AtlasApps.SimFlags import simFlags
    kwargs.setdefault('AtRndmGenSvc', simFlags.RandomSvc.get_Value())
    kwargs.setdefault('orders', sorted([]))

    athenaCommonFlags.PoolEvgenInput.set_Off()
    import AthenaCommon.AtlasUnixGeneratorJob
    from AthenaCommon.AlgSequence import AlgSequence
    topSequence = AlgSequence()

    from ParticleGenerator.ParticleGeneratorConf import ParticleGenerator
    algorithm = ParticleGenerator(name+'PG', **kwargs)
    topSequence += algorithm

    # No longer using this, as it's now set by StackFiller.GenEventManipulators
    #from VertexPositionGenerator.VertexPositionGeneratorConf import VertexPositionGenerator
    #topSequence += VertexPositionGenerator(name+'VPG')
    return algorithm
예제 #2
0
MuonDetectorTool.UseConditionDb = 1
MuonDetectorTool.OutputLevel=VERBOSE


## Run ParticleGenerator
import AthenaCommon.AtlasUnixGeneratorJob
spgorders = ['pdgcode: constant 13',
             'vertX: constant 0.0',
             'vertY: constant 0.0',
             'vertZ: constant 0.0',
             't: constant 0.0',
             'eta: flat -3.0 3.0',
             'phi: flat  0 6.283186',
             'e: constant 10000']
from ParticleGenerator.ParticleGeneratorConf import ParticleGenerator
topSeq += ParticleGenerator()
topSeq.ParticleGenerator.orders = sorted(spgorders)
from AthenaServices.AthenaServicesConf import AtRanluxGenSvc
ServiceMgr += AtRanluxGenSvc()
ServiceMgr.AtRanluxGenSvc.Seeds = ["SINGLE 2040160768 443921183"]


include("G4AtlasApps/G4Atlas.flat.configuration.py")

## Add G4 sim framework alg sequence
from AthenaCommon.CfgGetter import getAlgorithm
topSeq += getAlgorithm("G4AtlasAlg",tryDefaultConfigurable=True)
topSeq.G4AtlasAlg.InputTruthCollection = "GEN_EVENT"

#---  Output printout level ----------------------------------- 
#output threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL)
예제 #3
0
DetFlags.Muon_setOff()
DetFlags.Truth_setOn()

## Simulation flags
from G4AtlasApps.SimFlags import simFlags
## Enable the EtaPhi, VertexSpread and VertexRange checks
simFlags.EventFilter.set_On()

## AthenaCommon flags
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
athenaCommonFlags.PoolEvgenInput.set_Off()
athenaCommonFlags.SkipEvents.set_Off()

## Use single particle generator
import AthenaCommon.AtlasUnixGeneratorJob
spgorders = [
    'pdgcode: sequence 211 -211', 'vertX: constant 0.0', 'vertY: constant 0.0',
    'vertZ: constant 0.0', 't: constant 0.0', 'eta: flat -4.0 4.0',
    'phi: flat  0 6.28318', 'pt: constant 50000'
]
from ParticleGenerator.ParticleGeneratorConf import ParticleGenerator
## Algorithm sequence
from AthenaCommon.AlgSequence import AlgSequence
job = AlgSequence()
job += ParticleGenerator()
job.ParticleGenerator.orders = sorted(spgorders)
job.ParticleGenerator.AtRndmGenSvc = simFlags.RandomSvc.get_Value()

## Release GeoModel memory once sim is configured
simFlags.ReleaseGeoModel = False
예제 #4
0
if options.input is not None:
    athenaCommonFlags.PoolEvgenInput = options.input
else:
    ## Use single particle generator
    import AthenaCommon.AtlasUnixGeneratorJob
    spgorders = [
        'pdgcode: constant ' + options.pid, 'vertX: constant 0.0',
        'vertY: constant 0.0', 'vertZ: constant 0.0', 't: constant 0.0',
        'eta: flat ' + options.etaMin + ' ' + options.etaMax,
        'phi: flat 0 6.28318',
        'e: flat ' + options.energyMin + ' ' + options.energyMax
    ]

    athenaCommonFlags.PoolEvgenInput.set_Off()
    from ParticleGenerator.ParticleGeneratorConf import ParticleGenerator
    topSequence += ParticleGenerator()
    topSequence.ParticleGenerator.orders = sorted(spgorders)
"""
    from AthenaServices.AthenaServicesConf import AtRanluxGenSvc
    if not hasattr(ServiceMgr, 'AtRanluxGenSvc' ) :
        ServiceMgr += AtRanluxGenSvc()
    seed = "SINGLE "+str(randint(1,294967296))+" "+str(randint(1,294967296))
    ServiceMgr.AtRanluxGenSvc.Seeds += [seed]
"""

# get service manager
from AthenaCommon.AppMgr import ServiceMgr

from LArG4FastSimSvc.LArG4FastSimSvcInit import LArG4FastSimSvcInit

LArG4FastSimSvcInit()
예제 #5
0
evgenConfig.description = "Single pions with inv pt from 1 to 1000 GeV, |eta|<3 and special vertez"
evgenConfig.keywords = ["singleparticle", "pi"]

i  ## Common setup for ParticleGenerator
from ParticleGenerator.ParticleGeneratorConf import ParticleGenerator
topAlg += ParticleGenerator()
evgenConfig.generators = ["ParticleGenerator"]

topAlg.ParticleGenerator.orders = [
    "PDGcode: sequence -211 211", "invpt: flat 1.0e-6 1.3e-3",
    "eta: flat -3.0 3.0", "phi: flat -3.14159 3.14159",
    "targetip: flat -2.2 2.2", "vertZ: flat -120.0 120.0"
]