JHUGen MELA  JHUGen v7.5.6, MELA v2.4.2
Matrix element calculations as used in JHUGen.
Functions that construct objects differently than the C++

These functions are factories for datatypes that either need to be created differently in Python bindings or make it much easier to do so. More...

Collaboration diagram for Functions that construct objects differently than the C++:

Functions

SimpleParticle_t particle_initializer (int id, float x, float y, float z, float e, bool ptEtaPhi=false)
 This function intializes a single SimpleParticle_t in the Python. More...
 
SimpleParticleCollection_t collection_initializer_from_column (std::vector< int > ids, std::vector< double > x, std::vector< double > y, std::vector< double > z, std::vector< double > e, bool ptEtaPhi=false)
 This function initializes a single SimpleParticleCollection_t (or a list of SimpleParticle_t) in the Python from a series of lists. More...
 
SimpleParticleCollection_t collection_initializer (py::list listOfParticles)
 This function initializes a single SimpleParticleCollection_t (or a list of SimpleParticle_t) in the Python from a single list. More...
 

Detailed Description

These functions are factories for datatypes that either need to be created differently in Python bindings or make it much easier to do so.

Function Documentation

◆ collection_initializer()

SimpleParticleCollection_t collection_initializer ( py::list  listOfParticles)

This function initializes a single SimpleParticleCollection_t (or a list of SimpleParticle_t) in the Python from a single list.

Parameters
listOfParticlesA list of SimpleParticle_t objects
Returns
A TVar::SimpleParticleCollection_t object

Definition at line 367 of file mela_binding.cpp.

367  {
368 
370  for(py::handle P : listOfParticles){
371  SimpleParticle_t particle = P.cast<SimpleParticle_t>();
372  collection.push_back(particle);
373  }
374  return collection;
375 }

◆ collection_initializer_from_column()

SimpleParticleCollection_t collection_initializer_from_column ( std::vector< int >  ids,
std::vector< double >  x,
std::vector< double >  y,
std::vector< double >  z,
std::vector< double >  e,
bool  ptEtaPhi = false 
)

This function initializes a single SimpleParticleCollection_t (or a list of SimpleParticle_t) in the Python from a series of lists.

Note
This function is useful for data in columnar form! One can imagine dumping columns of vector quantities into this function.
Parameters
idsa list of PDG ids
xA list of either the pX or the pT of the vectors
yA list of either the pY or the Eta of the vectors
zA list of either the pZ or the Phi of the Vectors
eA list of either the Energy or the Mass of the vectors
ptEtaPhiif true, interpret the vector using <pT, Eta, Phi, m>. Otherwise, use <pX, pY, pZ, E>
Returns
A TVar::SimpleParticleCollection_t object

Definition at line 349 of file mela_binding.cpp.

349  {
351 
352  unsigned int i;
353  for(i = 0; i < ids.size(); i++){
354  collection.push_back(
355  particle_initializer(ids[i], x[i], y[i], z[i], e[i], ptEtaPhi)
356  );
357  }
358 
359  return collection;
360 }

◆ particle_initializer()

SimpleParticle_t particle_initializer ( int  id,
float  x,
float  y,
float  z,
float  e,
bool  ptEtaPhi = false 
)

This function intializes a single SimpleParticle_t in the Python.

Parameters
idThe particle PDG ID
xEither the pX or the pT of the vector
yEither the pY or the Eta of the vector
zEither the pZ or the Phi of the Vector
eEither the Energy or the Mass of the vector
ptEtaPhiif true, interpret the vector using <pT, Eta, Phi, m>. Otherwise, use <pX, pY, pZ, E>
Returns
A TVar::Simpleparticle_t with the provided id and Lorentz 4-vector.

Definition at line 328 of file mela_binding.cpp.

328  {
329  TLorentzVector vec = TLorentzVector();
330  if(ptEtaPhi){
331  vec.SetPtEtaPhiM(x, y, z, e);
332  } else{
333  vec.SetPxPyPzE(x, y, z, e);
334  }
335  return SimpleParticle_t(id, vec);
336 }
SimpleParticle_t
std::pair< int, TLorentzVector > SimpleParticle_t
Definition: TVar.hh:24
particle_initializer
SimpleParticle_t particle_initializer(int id, float x, float y, float z, float e, bool ptEtaPhi=false)
This function intializes a single SimpleParticle_t in the Python.
Definition: mela_binding.cpp:328
globalc::z
double complex, dimension(2, 2) z
Definition: reductionC.F90:50
SimpleParticleCollection_t
std::vector< SimpleParticle_t > SimpleParticleCollection_t
Definition: TVar.hh:25