TODO: consider using setPtEtaPhiM (?) for TLorentzVector in place of TLorentzVector(p3.Px(), p3.Py(), p3.Pz(), energy) and test whether this gives better mass for TLorentzVector.M() for a photon.
Details:
Example code: taken from pfreconstructor.py / reconstruct_cluster
if energy is None:
energy = cluster.energy
if energy < mass:
return None
if (mass==0): # addtional code added by alice to avoid sqrt when mass is zero
momentum= energy
else:
momentum = math.sqrt(energy2 - mass2)
p3 = cluster.position.Unit() * momentum
p4 = TLorentzVector(p3.Px(), p3.Py(), p3.Pz(), energy)
if (pdg_id==22):
print "22", momentum, energy, p4.M(), energy-momentum
pass
TODO: consider using setPtEtaPhiM (?) for TLorentzVector in place of TLorentzVector(p3.Px(), p3.Py(), p3.Pz(), energy) and test whether this gives better mass for TLorentzVector.M() for a photon.
Details: Example code: taken from pfreconstructor.py / reconstruct_cluster
if energy is None: energy = cluster.energy if energy < mass: return None if (mass==0): # addtional code added by alice to avoid sqrt when mass is zero momentum= energy else: momentum = math.sqrt(energy2 - mass2) p3 = cluster.position.Unit() * momentum p4 = TLorentzVector(p3.Px(), p3.Py(), p3.Pz(), energy) if (pdg_id==22): print "22", momentum, energy, p4.M(), energy-momentum pass
Example output: 22 0.852236756817 0.852236756817 1.05367121277e-08 0.0 22 0.443475662048 0.443475662048 7.45058059692e-09 0.0 22 3.05965131791 3.05965131791 0.0 0.0 22 2.15522270507 2.15522270507 2.98023223877e-08 0.0 22 0.509384400317 0.509384400317 0.0 0.0 22 0.484772885221 0.484772885221 0.0 0.0 22 0.97714326112 0.97714326112 1.05367121277e-08 0.0 22 10.8100802567 10.8100802567 1.19209289551e-07 0.0
Note that mass is often 1e-8 and sometimes 1e-7