ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
ParticleGun_FastCalo_NoChargeFlip_Config.MyParticleSampler Class Reference
Inheritance diagram for ParticleGun_FastCalo_NoChargeFlip_Config.MyParticleSampler:
Collaboration diagram for ParticleGun_FastCalo_NoChargeFlip_Config.MyParticleSampler:

Public Member Functions

def __init__ (self, energy, eta, pid, shift_z=0)
 
def shoot (self)
 

Public Attributes

 pid
 
 shift_z
 
 mom1
 

Detailed Description

Definition at line 10 of file ParticleGun_FastCalo_NoChargeFlip_Config.py.

Constructor & Destructor Documentation

◆ __init__()

def ParticleGun_FastCalo_NoChargeFlip_Config.MyParticleSampler.__init__ (   self,
  energy,
  eta,
  pid,
  shift_z = 0 
)

Definition at line 11 of file ParticleGun_FastCalo_NoChargeFlip_Config.py.

11  def __init__(self,energy,eta,pid,shift_z=0):
12  self.pid = pid
13  self.shift_z = shift_z
14  pdg_table = ROOT.TDatabasePDG.Instance() #Gives values in GeV
15  mass = pdg_table.GetParticle(self.pid()).Mass()*1000.
16  self.mom1 = PG.EEtaMPhiSampler(energy=energy,eta=eta,mass=mass)
17 

Member Function Documentation

◆ shoot()

def ParticleGun_FastCalo_NoChargeFlip_Config.MyParticleSampler.shoot (   self)

Definition at line 18 of file ParticleGun_FastCalo_NoChargeFlip_Config.py.

18  def shoot(self):
19  pid = self.pid()
20 
21  shift_z = self.shift_z
22 
23  mom = self.mom1.shoot()
24  pos_temp = mom.Vect().Unit()
25 
26  # Would it hit the barrel, or the endcap?
27  if abs(pos_temp.Z())/3550.<pos_temp.Perp()/1148.: # Hit the barrel!
28  pos_temp *= 1148./pos_temp.Perp()
29  else: # Hit the endcap!
30  pos_temp *= 3550./abs(pos_temp.Z())
31 
32  # Shift position of vector in the Z direction
33  pos_temp_2 = ROOT.TVector3()
34  pos_temp_2.SetXYZ(pos_temp.X(), pos_temp.Y(), pos_temp.Z()+shift_z)
35  pos_temp_2 *= 1. / pos_temp_2.Mag(); # reduce magnitude of vector
36 
37  # recalculate; Would it hit the barrel, or the endcap?
38  if abs(pos_temp_2.Z())/3550.<pos_temp_2.Perp()/1148.:
39  pos_temp_2 *= 1148./pos_temp_2.Perp()
40  else:
41  pos_temp_2 *= 3550./abs(pos_temp_2.Z())
42 
43  pos = ROOT.TLorentzVector(pos_temp_2.X(),pos_temp_2.Y(),pos_temp_2.Z(), pos_temp_2.Mag())
44 
45  #print "pid ",pid
46 
47  return [ PG.SampledParticle( pid , mom , pos ) ]
48 

Member Data Documentation

◆ mom1

ParticleGun_FastCalo_NoChargeFlip_Config.MyParticleSampler.mom1

Definition at line 16 of file ParticleGun_FastCalo_NoChargeFlip_Config.py.

◆ pid

ParticleGun_FastCalo_NoChargeFlip_Config.MyParticleSampler.pid

Definition at line 12 of file ParticleGun_FastCalo_NoChargeFlip_Config.py.

◆ shift_z

ParticleGun_FastCalo_NoChargeFlip_Config.MyParticleSampler.shift_z

Definition at line 13 of file ParticleGun_FastCalo_NoChargeFlip_Config.py.


The documentation for this class was generated from the following file:
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18