예제 #1
0
 def initialize(self, reinit=False):
     Helper.service(theApp._svcloc, 'HistogramDataSvc', True)
     from CTB_G4Sim.CtbPhotonESpectrum import Photon_Energy_spectrum
     p = Photon_Energy_spectrum(SimFlags.RunNumber())
     p.build_efunction(theApp)
     h2 = p.build_spectrum(theApp)
     return True
예제 #2
0
#set the max number of events
from OverlayCommonAlgs.OverlayFlags import overlayFlags
fname = overlayFlags.EventIDTextFile()
num_lines = 0
with open(fname, 'r') as f:
    for line in f:
        num_lines += 1
printfunc ("Number of lines in events.txt is "+str(num_lines))
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
athenaCommonFlags.EvtMax.unlock()
athenaCommonFlags.EvtMax.set_Value_and_Lock(num_lines)

#use this for the run/event numbers to look up in the vertexoverridefile, if we are overriding vertices
#job.VertexPositionGenerator.VertexOverrideEventFile = "events.txt" #old MC11 way

#new MC12 way, should be a preInclude
from G4AtlasApps.SimFlags import SimFlags
SimFlags.load_atlas_flags()
SimFlags.VertexOverrideEventFile.set_Value_and_Lock(fname)

else :
    print "No condition tag specified.\nThere is no use in validating FS with some arbitrary condition tag.\n Please, specify one."
    import sys
    sys.exit(1)


from AthenaCommon.AthenaCommonFlags import athenaCommonFlags

athenaCommonFlags.PoolHitsOutput=options.output + '.HITS.pool.root'

athenaCommonFlags.EvtMax=options.nevents


#--- Simulation flags -----------------------------------------
from G4AtlasApps.SimFlags import SimFlags
SimFlags.load_atlas_flags()
SimFlags.CalibrationRun.set_Off()

# Random seeds get random values
from random import randint
SimFlags.RandomSeedOffset = randint(1,1000000000)

if len(options.geometry) > 0 :
    SimFlags.SimLayout = options.geometry
else :
    SimFlags.SimLayout.set_On()

if len(options.physlist) > 0 :
    SimFlags.PhysicsList = options.physlist

if options.input is not None:
예제 #4
0
from AthenaCommon.DetFlags import DetFlags
# - Select detectors 
DetFlags.ID_setOff()
DetFlags.Calo_setOn()
DetFlags.LAr_setOff()
DetFlags.Muon_setOff()
#
#DetFlags.simulate.Truth_setOn()
#--- AthenaCommon flags ---------------------------------------
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
athenaCommonFlags.PoolHitsOutput='atlas_MyOutputFile.root'
athenaCommonFlags.EvtMax=0

#--- Simulation flags -----------------------------------------
from G4AtlasApps.SimFlags import SimFlags
SimFlags.import_JobProperties('G4AtlasApps.atlas_flags')
SimFlags.SimLayout='ATLAS-CSC-05-00-00' # specific value 
#SimFlags.SimLayout.set_On()              # uses the default value 

#from GeoModelSvc.GeoModelSvcConf import GeoModelSvc
#GeoModelSvc = GeoModelSvc()
#GeoModelSvc.TileVersionOverride = 'TileCal-CSC-03'

SimFlags.PhysicsList.set_Value("Fast_Physics")

# - uses single particle generator
SimFlags.KinematicsMode='SingleParticle'
SimFlags.ParticlePDG='11'
#   set energy constant to 10 GeV
SimFlags.Energy=10000
예제 #5
0
athenaCommonFlags.EvtMax = EvtMax

# explicitly switch off evgen reading
athenaCommonFlags.PoolEvgenInput.set_Off()

#--- DetDescr flag
from AthenaCommon.GlobalFlags import globalflags
globalflags.DetDescrVersion.set_Value_and_Lock('ATLAS-H6-2004-00')
DetDescrVersion = 'ATLAS-H6-2004-00'
from AthenaCommon.JobProperties import jobproperties
jobproperties.Global.DetDescrVersion = "ATLAS-H6-2004-00"

#--- Simulation flags -----------------------------------------
# Choose H6 2004 (Emec/HEC/FCAL) testbeam layout
from G4AtlasApps.SimFlags import SimFlags
SimFlags.load_atlas_flags()
SimFlags.SimLayout = 'tb_LArH6_2004'
SimFlags.load_tbLArH6_flags()

#--- Conditions global  tag ------
from AthenaCommon.GlobalFlags import globalflags
globalflags.ConditionsTag = "OFLCOND-CSC-00-00-00"

include.block("CaloConditions/LArTTCellMap_ATLAS_jobOptions.py")
include.block("CaloConditions/CaloTTIdMap_ATLAS_jobOptions.py")
#include("LArDetDescr/LArDetDescr_H6_joboptions.py")

# Set the cryostat and table at their (0,0) position:
SimFlags.LArTB_H1CryoXPos.set_Value_and_Lock(CryoXPos)
SimFlags.LArTB_H1TableYPos.set_Value_and_Lock(TableYPos)
SimFlags.LArTB_H1XSmear.set_Value_and_Lock(35.)
예제 #6
0
DetFlags.Calo_setOn()
DetFlags.LAr_setOn()
DetFlags.em_setOn()
DetFlags.Tile_setOn()
DetFlags.Muon_setOff()  # muons are not supported in >=13.0.0
# - MCTruth
DetFlags.simulate.Truth_setOn()

#--- AthenaCommon flags ---------------------------------------
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
athenaCommonFlags.PoolHitsOutput = 'ctb_MyOutputFile.root'
athenaCommonFlags.EvtMax = 3

#--- Simulation flags -----------------------------------------
from G4AtlasApps.SimFlags import SimFlags
SimFlags.import_JobProperties('G4AtlasApps.ctb_flags')  # - specfic CTB flags

# - Option1: run using specfic CTB flags for combined layout
# ----------
#SimFlags.SimLayout.set_Value('ctbh8_combined')
#SimFlags.LArEMBenergyCor.set_On()
##SimFlags.CalibrationRun.set_Value('LAr+Tile')  # Calibration runs
#SimFlags.Eta.set_Value(0.2)              # Sets eta value
#SimFlags.MagnetMBPSIDBz.set_Value(-1.4)  # Constant fields

# - Option2: run using run-conditions for the CTB runs,
#----------- only few runs availble (example with run 2345)
SimFlags.LArEMBenergyCor.set_On()
SimFlags.RunConditions.set_Value('CTB_G4Sim.CtbRunConditionsData')
SimFlags.RunNumber.set_Value(2345)
예제 #7
0
DetFlags.Calo_setOn()
DetFlags.LAr_setOn()
DetFlags.em_setOn()
DetFlags.Tile_setOn()
DetFlags.Muon_setOff()  # muons are not supported in >=13.0.0
# - MCTruth
DetFlags.simulate.Truth_setOn()

#--- AthenaCommon flags ---------------------------------------
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
athenaCommonFlags.PoolHitsOutput = 'ctb_MyOutputFile.root'
athenaCommonFlags.EvtMax = 3

#--- Simulation flags -----------------------------------------
from G4AtlasApps.SimFlags import SimFlags
SimFlags.import_JobProperties('G4AtlasApps.ctb_flags')  # - specfic CTB flags

# - Option: run using run-conditions for the CTB runs,
#----------- only few runs available (make sure is a photon-run)
SimFlags.LArEMBenergyCor.set_On()
SimFlags.RunConditions.set_Value('CTB_G4Sim.CtbRunConditionsData')
# This is the photon run number
SimFlags.RunNumber.set_Value(2777)

#--- Generator flags ------------------------------------------
SimFlags.Seeds.set_Value('SINGLE 2000160768 643921183')
# Here we set the photon the electron must be generated by the
# ParticleGenerator with an energy = 180 Gev - photon-energy
SimFlags.ParticlePDG.set_Value('22')
#
# - Option:  we reduce the beam spot for all the photon runs
예제 #8
0
DetFlags.Calo_setOn()
DetFlags.LAr_setOn()
DetFlags.em_setOn()
DetFlags.Tile_setOn()
DetFlags.Muon_setOff() # muons are not supported in >=13.0.0
# - MCTruth
DetFlags.simulate.Truth_setOn()

#--- AthenaCommon flags ---------------------------------------
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
athenaCommonFlags.PoolHitsOutput='ctb_MyOutputFile.root'
athenaCommonFlags.EvtMax=3

#--- Simulation flags -----------------------------------------
from G4AtlasApps.SimFlags import SimFlags
SimFlags.import_JobProperties('G4AtlasApps.ctb_flags') # - specfic CTB flags

SimFlags.LArEMBenergyCor.set_On()
SimFlags.RunConditions.set_Value('CTB_G4Sim.CtbRunConditionsData')
SimFlags.RunNumber.set_Value(2107)
# If we want to use Beam conditions per run instead the standard 
# flat 3x3 spot  
#SimFlags.BeamConditions.set_Value(True)

#  set the following to True to activate 0.15 X0 of far upstream 
# material (requested by LAr)
SimFlags.LArFarUpstreamMaterial.set_Value(False)
# set the following to 'LAr', 'Tile' or 'LAr+Tile' to activate
# calibration hits
SimFlags.CalibrationRun.set_Value('')
예제 #9
0
# Atlas+Cavern cosmic simulation
#
#==============================================================

#--- Detector flags -------------------------------------------
from AthenaCommon.DetFlags import DetFlags
# - Select detectors
DetFlags.ID_setOff()
DetFlags.Calo_setOn()
DetFlags.Muon_setOff()
#
DetFlags.simulate.Truth_setOn()

#--- Simulation flags -----------------------------------------
from G4AtlasApps.SimFlags import SimFlags
SimFlags.import_Flags('atlas_flags')

SimFlags.MagneticField.set_Value(False)

# SimFlags.WriteTTR.StatusOn  = True

SimFlags.SimLayout.set_Value('Commissioning-1')
SimFlags.PersistencyHit.set_Value('atlas_MyOutputFile.root')

# - uses a given generator
SimFlags.KinematicsMode.set_Value('EventGenerator')
SimFlags.GeneratorPath.set_Value('G4AtlasApps/CosmicGenerator.py')

#--- Event related parameters ---------------------------------
# Number of events to be processed (default is 10)
theApp.EvtMax = 1000