Skip to content

numpy implementation of ROOT's TLorentzVector and TVector3

Notifications You must be signed in to change notification settings

iwansmith/numpy_FourVectors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Three Vector and Four Vector implementation using numpy

This attempts to replicate TLorentzVector and TVector3 from ROOT using numpy.

Please note that this is a work in progress, so not all functions have been transfered over.

The most basic usage is very similar to TLorentzVector:

In [1]: from FourVector import FourVector

In [2]: # Generate Two Kaons

In [3]: #Use the standard TLorentzVector Constructor

In [4]: Kplus  = FourVector(3567.06, -2206.11, 54175.99, 54340.33904788)

In [5]: # Use SetXYZM()

In [6]: Kminus = FourVector()

In [7]: Kminus.SetXYZM(3398.82, -633.59, 49368.01, 493.677)

In [8]: # Build a Phi Candidate:

In [9]: Phi = Kplus + Kminus

In [10]: print Phi.M()
1755.09049972

This constrcutors can take lists and numpy arrays in addition to floats.

About

numpy implementation of ROOT's TLorentzVector and TVector3

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages