![]() |
JHUGen MELA
JHUGen v7.5.6, MELA v2.4.2
Matrix element calculations as used in JHUGen.
|
The type SimpleParticleCollection_t is a typedef described in TVar.hh. It is a vector of SimpleParticle_t objects. These correspond to the particle lists that are submitted to Mela::setInputEvent. There are a few constructors for this object, each of which depend on what suits your needs.
There are 4 different ways to construct the SimpleParticleCollection_t object. This is due to both the aforementioned pyROOT and C++ ROOT compatibility issues alongside the usage of syntactic sugar to allow for easier columnar data entry.
This initializes a SimpleParticleCollection_t from a list of PDG ids, and either a set of \(P_x\), \(P_y\), \(P_z\), \(E\) OR \(P_t\), \(\eta\), \(\phi\), mass depending on the boolean flag set (just like in particle_initializer), and is documented here.
Example:
This initializes a SimpleParticleCollection_t from a list of SimpleParticle_t objects, and is documented here. One benefit of operating this way is that you can mix and match particles initialized via { \(P_x\), \(P_y\), \(P_z\), \(E\)}and those via { \(P_t\), \(\eta\), \(\phi\), \(m\)}.
Example:
This is an empty initializer that simply creates a "list-like" object you can add particles to. You can use the Mela.SimpleParticleCollection_t.add_particle method to do this. Just like [collection_intializer](collection_initializer_doc), one can mix and match bases of vectors between { \(P_x\), \(P_y\), \(P_z\), \(E\)}and { \(P_t\), \(\eta\), \(\phi\), \(m\)}.
Example:
The SimpleParticleCollection_t object has a few methods that you can use alongside iteration capabilities.
Simply call Mela.SimpleParticleCollection_t.add_particle(Mela.SimpleParticle_t P) to add a particle to the collection.
Example in the Default Constructor section.
Simple call Mela.SimpleParticleCollection_t.toList() to return a normal Python list of SimpleParticle objects.
Example:
Even without converting a SimpleParticleCollection_t into a list, one can still iterate over it! Iteration over the Mela.SimpleParticle_t objects stored within can be accessed in a for loop. See the example below:
One can also index the underlying vector for the simpleParticleCollection_t class. Indexing works as normal.
This method returns the 4-vector that is the sum of all the 4-vectors stored inside the class. It returns them as a tuple of 4 values: \(P_x\), \(P_y\), \(P_z\), \(E\).
This function is just like SimpleParticleCollection_t.Sum, however it returns the total mass of the resultant 4-vector.
Should you desire to pickle a SimpleParticleCollection_t object, this is supported through the Python MELA bindings. This support for pickling also means that SimpleParticleCollection_t supports the python multiprocessing package.