Esempio n. 1
0
include("GeneratorUtils/StdEvgenSetup.py")
theApp.EvtMax = 100

import ParticleGun as PG
pg = PG.ParticleGun()
pg.sampler.pid = 999
pg.sampler.mom = PG.EEtaMPhiSampler(energy=10000, eta=[-6., 6.])
topSeq += pg

simFlags.RandomSeedOffset = myRandomOffset
simFlags.RandomSeedList.addSeed("SINGLE", myRandomSeed1, myRandomSeed2)

from RngComps.RngCompsConf import AtRndmGenSvc
myAtRndmGenSvc = AtRndmGenSvc()
myAtRndmGenSvc.Seeds = [
    "SINGLE " + str(myRandomSeed1) + " " + str(myRandomSeed2)
]
myAtRndmGenSvc.OutputLevel = VERBOSE
myAtRndmGenSvc.EventReseeding = False
ServiceMgr += myAtRndmGenSvc

## add the material step recording action
SimFlags.OptionalUserActionList.addAction('G4UA::MaterialStepRecorderTool',
                                          ['Run', 'Event', 'Step'])

############### The Material hit collection ##################

from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
# --- check dictionary
ServiceMgr.AthenaSealSvc.CheckDictionary = True
# --- commit interval (test)
Esempio n. 2
0
include("GeneratorUtils/StdEvgenSetup.py")
theApp.EvtMax = 50000

import ParticleGun as PG
pg = PG.ParticleGun()
pg.sampler.pid = (-13, 13)
pg.sampler.mom = PG.PtEtaMPhiSampler(pt=5000, eta=[-3.5, 3.5])
topSeq += pg

simFlags.RandomSeedOffset = myRandomOffset
simFlags.RandomSeedList.addSeed("ParticleGun", myRandomSeed1, myRandomSeed2)

from RngComps.RngCompsConf import AtRndmGenSvc
myAtRndmGenSvc = AtRndmGenSvc()
myAtRndmGenSvc.Seeds = [
    "ParticleGun " + str(myRandomSeed1) + " " + str(myRandomSeed2)
]
myAtRndmGenSvc.OutputLevel = VERBOSE
myAtRndmGenSvc.EventReseeding = False
ServiceMgr += myAtRndmGenSvc

############### The Material hit collection ##################

if not hasattr(ServiceMgr, 'THistSvc'):
    from GaudiSvc.GaudiSvcConf import THistSvc
    ServiceMgr += THistSvc()
# add the G4 validation output stream
ServiceMgr.THistSvc.Output += [
    "val DATAFILE='/tmp/salzburg/EnergyLossRecorder.root' TYPE='ROOT' OPT='RECREATE'"
]