# Set up particle gun from Gaudi.Configuration import * from Configurables import ParticleGun from GaudiKernel.SystemOfUnits import * partgun = ParticleGun("ParticleGun") # Event type is set as described in LHCb-2005-034 : G=5! (Def = 0) partgun.EventType = 53210205; # Add the beamshape gun from Configurables import BeamShape partgun.addTool(BeamShape, name="BeamShape") partgun.ParticleGunTool = "BeamShape" guntool = partgun.BeamShape # Beam centroid guntool.xCenter = 0*mm # Beam position guntool.yCenter = 0*mm # Beam position guntool.zCenter = -1000*mm # Generation point guntool.BeamDirection = 1 # Beam 1: 1, Beam 2: -1 guntool.ThetaCenter = 0*rad # Inclination angle (angle to z) guntool.PhiCenter = 0*rad # Azimuth angle # Beam parameters guntool.Momentum = 450*GeV # Beam particle momentum guntool.PdgCode = 2212 # Particle PDG ID guntool.xEmmitance = 7.82e-9*m # Transverse emmitance guntool.yEmmitance = 7.82e-9*m # Transverse emmitance guntool.xBeta = 10.0*m # Optical beta function guntool.yBeta = 10.0*m # Optical beta function
############################################################################## #from Gaudi.Configuration import * from Configurables import ParticleGun from GaudiKernel.SystemOfUnits import * # Set up ParticleGun ParticleGun = ParticleGun("ParticleGun") # Control of the ParticleGun # Event type is set as described in LHCb-2005-034 : G=5! (Def = 0) ParticleGun.EventType = 53210205 # Pick the type of particle gun generator from Configurables import MaterialEval ParticleGun.addTool(MaterialEval, name="MaterialEval") ParticleGun.ParticleGunTool = "MaterialEval" # Set fixed number of particles to produce in an event (default = 10) and # their PDG code (default = 2221111) from Configurables import FlatNParticles ParticleGun.addTool(FlatNParticles, name="FlatNParticles") ParticleGun.NumberOfParticlesTool = "FlatNParticles" ParticleGun.FlatNParticles.MinNParticles = 100 ParticleGun.FlatNParticles.MaxNParticles = 100 ParticleGun.MaterialEval.PdgCode = -2212 # The vertex of each particle gun is produced in a single point of given # coordinates. Default is 0.0*mm for all. # distribution within the given limits, when min=max the vertex is in the # given point.
from Configurables import ParticleGun pgun = ParticleGun("ParticleGun") pgun.SignalPdgCode = 521 from Configurables import ToolSvc from Configurables import EvtGenDecay ToolSvc().addTool(EvtGenDecay) ToolSvc( ).EvtGenDecay.UserDecayFile = "$DECFILESROOT/dkfiles/Bu_Kee=MS,DecProdCut.dec" pgun.DecayTool = "EvtGenDecay" pgun.GenCutTool = "DaughtersInLHCb" from Configurables import FlatNParticles pgun.NumberOfParticlesTool = "FlatNParticles" pgun.addTool(FlatNParticles, name="FlatNParticles") from Configurables import MomentumSpectrum pgun.ParticleGunTool = "MomentumSpectrum" pgun.addTool(MomentumSpectrum, name="MomentumSpectrum") pgun.MomentumSpectrum.PdgCodes = [521, -521] pgun.MomentumSpectrum.InputFile = "$PGUNSDATAROOT/data/Ebeam6500GeV/MomentumSpectrum_521.root" pgun.MomentumSpectrum.BinningVariables = "pteta" pgun.MomentumSpectrum.HistogramPath = "h_pteta" from Configurables import BeamSpotSmearVertex pgun.addTool(BeamSpotSmearVertex, name="BeamSpotSmearVertex") pgun.VertexSmearingTool = "BeamSpotSmearVertex" pgun.EventType = 12123002
def setup_Targets_pguns(projID, projEng, targMat, targThick): from Configurables import ParticleGun from GaudiKernel.SystemOfUnits import mm, GeV, rad # Set up ParticleGun ParticleGun = ParticleGun("ParticleGun") # Control of the ParticleGun # Event type is set as described in LHCb-2005-034 : G=5! (Def = 0) ParticleGun.EventType = 53210205 # Pick the type of particle gun generator from Configurables import MaterialEval ParticleGun.addTool(MaterialEval, name="MaterialEval") ParticleGun.ParticleGunTool = "MaterialEval" # Set fixed number of particles to produce in an event (default = 10) and # their PDG code (default = 2221111) from Configurables import FlatNParticles ParticleGun.addTool(FlatNParticles, name="FlatNParticles") ParticleGun.NumberOfParticlesTool = "FlatNParticles" ParticleGun.FlatNParticles.MinNParticles = 1 ParticleGun.FlatNParticles.MaxNParticles = 1 ParticleGun.MaterialEval.PdgCode = particles[projID] # The vertex of each particle gun is produced in a single point of given # coordinates. Default is 0.0*mm for all. # distribution within the given limits, when min=max the vertex is in the # given point. #ParticleGun.MaterialEval.Xorig = 0*mm #ParticleGun.MaterialEval.Yorig = 0*mm ParticleGun.MaterialEval.Zorig = Zorig[targMat][targThick] * mm # The abs(P) of the particle if fixed at the given value (default = 500 GeV) ParticleGun.MaterialEval.ModP = projEng * GeV # The particle can be generated uniformly (randomly or in a grid) in eta-phi # rather than x-y (default is false, i.e. x-y) ParticleGun.MaterialEval.EtaPhi = True # The boundary limits of the x-y or eta-phi planes have to given. # # The following options are for the x-y plane, to specify the position # and size of the "target rectangle". The default plane is at z = 10*m, # with -3.2*m < x < 3.2*m and -2.6*m < y < -2.6*m, i.e. a little more # than the LHCb acceptance ParticleGun.MaterialEval.ZPlane = Zplane[targMat][targThick] * mm #ParticleGun.MaterialEval.Xmin = -15*m #ParticleGun.MaterialEval.Ymin = -15*m #ParticleGun.MaterialEval.Xmax = 15*m #ParticleGun.MaterialEval.Ymax = 15*m # The follwing control the parameters for the generation in eta-phi. # The defaults are 2.1 < eta < 4.9 and phi over 2pi, i.e. a little more # than scanning the LHCb acceptance ParticleGun.MaterialEval.MinEta = 10. ParticleGun.MaterialEval.MaxEta = 10. ParticleGun.MaterialEval.MinPhi = 0.0 * rad ParticleGun.MaterialEval.MaxPhi = 0.0 * rad # A regular grid of given steps can be used instead of a randomly uniform # distribution (default = false) ParticleGun.MaterialEval.UseGrid = False
############################################# from Gauss.Configuration import * Gauss().Production = 'PGUN' Gauss().DatasetName = "test" Gauss().Phases = ["Generator","GenToMCTree"] ##################################################################### from Configurables import ParticleGun, FlatNParticles, MomentumSpectrum pgun = ParticleGun() pgun.ParticleGunTool = "MomentumSpectrum" pgun.addTool( MomentumSpectrum , name = "MomentumSpectrum" ) pgun.MomentumSpectrum.PdgCodes = [ 511 , -511 ] pgun.MomentumSpectrum.InputFile = "BSpectrum.root" pgun.MomentumSpectrum.HistogramPath = "BSpectrum" pgun.MomentumSpectrum.OutputLevel = 3 pgun.NumberOfParticlesTool = "FlatNParticles" pgun.addTool( FlatNParticles , name = "FlatNParticles" )
from Gaudi.Configuration import * from Configurables import ParticleGun from GaudiKernel.SystemOfUnits import * # Set up ParticleGun ParticleGun = ParticleGun("ParticleGun") # Control of the ParticleGun # Event type is set as described in LHCb-2005-034 : G=5! (Def = 0) ParticleGun.EventType = 53210205 # GunMode flag: # if = MomentumRange uses parameters below within random values generated # if = FixedMomentum need to set fix values of px, py, pz via specific properties from Configurables import MomentumRange ParticleGun.addTool(MomentumRange, name="MomentumRange") ParticleGun.ParticleGunTool = "MomentumRange" #from Configurables import FixedMomentum #ParticleGun.addTool(FixedMomentum, name="FixedMomentum") #ParticleGun.ParticleGunTool = "FixedMomentum" # Set min and max number of particles to produce in an event # defaults are = 1, i.e. always one particle from Configurables import FlatNParticles ParticleGun.addTool(FlatNParticles, name="FlatNParticles") ParticleGun.NumberOfParticlesTool = "FlatNParticles" #ParticleGun.FlatNParticles.MinNParticles = 1 #ParticleGun.FlatNParticles.MaxNParticles = 1 # PDG code of a list of possible particles to be generated, default = {-211})
# Set up ParticleGun ParticleGun = ParticleGun("ParticleGun") # Event type is set as described in LHCb-2005-034 : G=5! (Def = 0) # gsdctnxu: # g=type of process (5=particle gun) # s=which particles are present and pass 400mrad w.r.t.beam cut; 2=mu # d=decay; particle or antipart; 2=several particles (??) # c=eta and p distribution : 2 (0=fix p, 1=flat eta, 2=flat xy, 3=mom range) # tnxu = track parameters; if c=2 or 3, tn=00; ParticleGun.EventType = 52220000 # Pick the type of particle gun generator from Configurables import Cosmics ParticleGun.addTool(Cosmics, name="Cosmics") ParticleGun.ParticleGunTool = "Cosmics" # Set min and max number of particles to produce in an event # defaults are = 1, i.e. always one particle from Configurables import FlatNParticles ParticleGun.addTool(FlatNParticles, name="FlatNParticles") ParticleGun.NumberOfParticlesTool = "FlatNParticles" #ParticleGun.FlatNParticles.MinNParticles = 1 #ParticleGun.FlatNParticles.MaxNParticles = 1 # PDG code of a list of possible particles to be generated, default = {13,-13) # GM: This should not be changed ParticleGun.Cosmics.PdgCodes = [-13, 13] # Generate position and angle