Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Photon mass is not zero for TLorentzVector(p3.Px(), p3.Py(), p3.Pz(), energy) #8

Open
alicerobson opened this issue Mar 30, 2016 · 0 comments

Comments

@alicerobson
Copy link
Contributor

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

cbernet added a commit that referenced this issue Apr 5, 2016
bug fix: hadron shower prob in ecal now correct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant