Esempio n. 1
0
 def reconstruct_cluster(self, cluster, layer, energy=None, vertex=None):
     if vertex is None:
         vertex = TVector3()
     pdg_id = None
     if layer=='ecal_in':
         pdg_id = 22
     elif layer=='hcal_in':
         pdg_id = 130
     else:
         raise ValueError('layer must be equal to ecal_in or hcal_in')
     assert(pdg_id)
     mass, charge = particle_data[pdg_id]
     if energy is None:
         energy = cluster.energy
     if energy < mass: 
         return None 
     momentum = math.sqrt(energy**2 - mass**2)
     p3 = cluster.position.Unit() * momentum
     p4 = TLorentzVector(p3.Px(), p3.Py(), p3.Pz(), energy)
     particle = Particle(p4, vertex, charge, pdg_id)
     path = StraightLine(p4, vertex)
     path.points[layer] = cluster.position
     particle.set_path(path)
     particle.clusters_smeared[layer] = cluster
     cluster.locked = True
     return particle
Esempio n. 2
0
 def reconstruct_track(self, track, clusters=None):
     vertex = track.path.points['vertex']
     pdg_id = 211 * track.charge
     mass, charge = particle_data[pdg_id]
     p4 = TLorentzVector()
     p4.SetVectM(track.p3, mass)
     particle = Particle(p4, vertex, charge, pdg_id)
     particle.set_path(track.path)
     particle.clusters = clusters
     track.locked = True
     return particle
Esempio n. 3
0
 def reconstruct_track(self, track):
     vertex = track.path.points['vertex']
     pdg_id = 211 * track.charge
     try: 
         mass, charge = particle_data[pdg_id]
     except KeyError:
         import pdb; pdb.set_trace()
     p4 = TLorentzVector()
     p4.SetVectM(track.p3, mass)
     particle = Particle(p4, vertex, charge, pdg_id)
     particle.set_path(track.path)
     track.locked = True
     return particle