Exemple #1
0
def my_configure_pgun(self, seq):
    from GaudiKernel.SystemOfUnits import GeV, rad
    from Configurables import ParticleGun
    pgun = ParticleGun("ParticleGun")
    pgun.EventType = 53210205
    from Configurables import MomentumRange
    pgun.addTool(MomentumRange, name="MomentumRange")
    pgun.ParticleGunTool = "MomentumRange"
    from Configurables import FlatNParticles
    pgun.addTool(FlatNParticles, name="FlatNParticles")
    pgun.NumberOfParticlesTool = "FlatNParticles"
    pgun.FlatNParticles.MinNParticles = 1
    pgun.FlatNParticles.MaxNParticles = 1
    pgun.MomentumRange.PdgCodes = [-11]
    pgun.MomentumRange.MomentumMin = 2.0 * GeV
    pgun.MomentumRange.MomentumMax = 100.0 * GeV
    pgun.MomentumRange.ThetaMin = 0.015 * rad
    pgun.MomentumRange.ThetaMax = 0.300 * rad
    seq += [pgun]
Exemple #2
0
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.
#ParticleGun.MaterialEval.Xorig = 0*mm
#ParticleGun.MaterialEval.Yorig = 0*mm
ParticleGun.MaterialEval.Zorig = 500 * mm

# The abs(P) of the particle if fixed at the given value (default = 500 GeV)
ParticleGun.MaterialEval.ModP = 1 * GeV
Exemple #3
0
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