GithubHelp home page GithubHelp logo

numpy_fourvectors's Introduction

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.

numpy_fourvectors's People

Contributors

iwansmith avatar

Watchers

James Cloos avatar  avatar

numpy_fourvectors's Issues

Switch from numpy to pandas

Change the method of storing data in the arrays from 3/4 1D numpy arrays to a pandas structure with 3/4 columns.

This may only be necessary for the 3 vector
Can we "view " the data in the FourVector object so that it can directly access the members of the three vector?

Sort out constructors

Finalise how the constructors work, so they are identical to TLorentzVector/TVector3, but still have the ability to take arrays in place of values.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.