2#ifndef MCPARTICLE_ANALYZERS_H
3#define MCPARTICLE_ANALYZERS_H
8#include "TLorentzVector.h"
9#include "ROOT/RVec.hxx"
10#include "edm4hep/MCParticleData.h"
11#include "edm4hep/ParticleIDData.h"
12#include "edm4hep/Vector3f.h"
13#include "edm4hep/Vector3d.h"
14#include "edm4hep/Vector2i.h"
32 bool operator() (ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
39 ROOT::VecOps::RVec<edm4hep::MCParticleData>
operator() (ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
46 ROOT::VecOps::RVec<edm4hep::MCParticleData>
operator() (ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
51 sel_pdgID(
int arg_pdg,
bool arg_chargeconjugate);
54 ROOT::VecOps::RVec<edm4hep::MCParticleData>
operator() (ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
61 ROOT::VecOps::RVec<int>
operator() (ROOT::VecOps::RVec<edm4hep::MCParticleData> in, ROOT::VecOps::RVec<int> ind);
66 get_decay(
int arg_mother,
int arg_daughters,
bool arg_inf);
70 bool operator() (ROOT::VecOps::RVec<edm4hep::MCParticleData> in, ROOT::VecOps::RVec<int> ind);
77 TVector3
operator() (ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
84 TLorentzVector
operator() (ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
90 get_indices(
int pdg_mother, std::vector<int> pdg_daughters,
bool stableDaughters,
bool chargeConjugateMother,
bool chargeConjugateDaughters,
bool inclusiveDecay ) ;
97 ROOT::VecOps::RVec<int>
operator() ( ROOT::VecOps::RVec<edm4hep::MCParticleData> in , ROOT::VecOps::RVec<int> ind);
107 std::vector<int> m_pdg_daughters,
108 bool m_stableDaughters,
109 bool m_chargeConjugateDaughters,
110 bool m_inclusiveDecay,
111 ROOT::VecOps::RVec<edm4hep::MCParticleData> in ,
112 ROOT::VecOps::RVec<int> ind);
116 std::vector<int> m_pdg_daughters,
117 bool m_stableDaughters,
118 ROOT::VecOps::RVec<edm4hep::MCParticleData> in ,
119 ROOT::VecOps::RVec<int> ind);
123 ROOT::VecOps::RVec<int>
get_parentid(ROOT::VecOps::RVec<int> mcind, ROOT::VecOps::RVec<edm4hep::MCParticleData> mc, ROOT::VecOps::RVec<int> parents);
126 ROOT::VecOps::RVec<float>
get_time(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
129 ROOT::VecOps::RVec<float>
get_pdg(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
132 ROOT::VecOps::RVec<float>
get_genStatus(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
135 ROOT::VecOps::RVec<float>
get_simStatus(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
138 ROOT::VecOps::RVec<edm4hep::Vector3d>
get_vertex(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
141 ROOT::VecOps::RVec<float>
get_vertex_x(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
144 ROOT::VecOps::RVec<float>
get_vertex_y(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
147 ROOT::VecOps::RVec<float>
get_vertex_z(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
150 ROOT::VecOps::RVec<edm4hep::Vector3d>
get_endPoint(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
153 ROOT::VecOps::RVec<edm4hep::Vector3d>
get_endPoint(ROOT::VecOps::RVec<edm4hep::MCParticleData> in, ROOT::VecOps::RVec<int> ind );
156 ROOT::VecOps::RVec<float>
get_endPoint_x(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
159 ROOT::VecOps::RVec<float>
get_endPoint_y(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
162 ROOT::VecOps::RVec<float>
get_endPoint_z(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
165 ROOT::VecOps::RVec<float>
get_pt(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
168 ROOT::VecOps::RVec<float>
get_p(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
171 ROOT::VecOps::RVec<float>
get_px(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
174 ROOT::VecOps::RVec<float>
get_py(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
177 ROOT::VecOps::RVec<float>
get_pz(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
180 ROOT::VecOps::RVec<float>
get_eta(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
183 ROOT::VecOps::RVec<float>
get_y(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
186 ROOT::VecOps::RVec<float>
get_theta(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
189 ROOT::VecOps::RVec<float>
get_phi(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
192 ROOT::VecOps::RVec<float>
get_e(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
195 ROOT::VecOps::RVec<float>
get_mass(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
198 ROOT::VecOps::RVec<float>
get_charge(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
201 ROOT::VecOps::RVec<TLorentzVector>
get_tlv(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
204 ROOT::VecOps::RVec<edm4hep::MCParticleData>
mergeParticles(ROOT::VecOps::RVec<edm4hep::MCParticleData> x, ROOT::VecOps::RVec<edm4hep::MCParticleData> y);
207 int get_n(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
210 ROOT::VecOps::RVec<float>
AngleBetweenTwoMCParticles( ROOT::VecOps::RVec<edm4hep::MCParticleData> p1, ROOT::VecOps::RVec<edm4hep::MCParticleData> p2 );
217 ROOT::VecOps::RVec<edm4hep::MCParticleData> in,
218 ROOT::VecOps::RVec<int> ind);
221 edm4hep::MCParticleData
sel_byIndex(
int idx, ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
227 ROOT::VecOps::RVec<edm4hep::MCParticleData> in,
228 ROOT::VecOps::RVec<int> ind);
233 const ROOT::VecOps::RVec<edm4hep::MCParticleData> &in,
234 const ROOT::VecOps::RVec<int> &ind);
237 const ROOT::VecOps::RVec<edm4hep::MCParticleData> &in,
238 const ROOT::VecOps::RVec<int> &ind);
240 ROOT::VecOps::RVec<int>
get_leptons_origin(
const ROOT::VecOps::RVec<edm4hep::MCParticleData> &particles,
241 const ROOT::VecOps::RVec<edm4hep::MCParticleData> &in,
242 const ROOT::VecOps::RVec<int> &ind);
ROOT::VecOps::RVec< int > get_leptons_origin(const ROOT::VecOps::RVec< edm4hep::MCParticleData > &particles, const ROOT::VecOps::RVec< edm4hep::MCParticleData > &in, const ROOT::VecOps::RVec< int > &ind)
Definition MCParticle.cc:764
edm4hep::MCParticleData sel_byIndex(int idx, ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
returns one MCParticle selected by its index in the particle block
Definition MCParticle.cc:470
ROOT::VecOps::RVec< float > get_px(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
return the momenta of the input MCParticles
Definition MCParticle.cc:360
ROOT::VecOps::RVec< float > get_simStatus(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
return the simulation status of the input MCParticles
Definition MCParticle.cc:218
ROOT::VecOps::RVec< float > get_py(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
return the momenta of the input MCParticles
Definition MCParticle.cc:368
ROOT::VecOps::RVec< edm4hep::Vector3d > get_vertex(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
return the production vertex of the input MCParticles
Definition MCParticle.cc:226
ROOT::VecOps::RVec< float > get_phi(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
return the phi of the input MCParticles
Definition MCParticle.cc:330
int get_lepton_origin(int idx, const ROOT::VecOps::RVec< edm4hep::MCParticleData > &in, const ROOT::VecOps::RVec< int > &ind)
return the pdg ID of the parent of a lepton (pre-FSR)
Definition MCParticle.cc:755
ROOT::VecOps::RVec< float > get_eta(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
return the pseudo-rapidity of the input MCParticles
Definition MCParticle.cc:320
ROOT::VecOps::RVec< int > get_indices_MotherByIndex(int imother, std::vector< int > m_pdg_daughters, bool m_stableDaughters, bool m_chargeConjugateDaughters, bool m_inclusiveDecay, ROOT::VecOps::RVec< edm4hep::MCParticleData > in, ROOT::VecOps::RVec< int > ind)
return a list of indices that correspond to a given MC decay
Definition MCParticle.cc:565
ROOT::VecOps::RVec< float > get_theta(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
return the theta of the input MCParticles
Definition MCParticle.cc:402
ROOT::VecOps::RVec< float > get_pz(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
return the momenta of the input MCParticles
Definition MCParticle.cc:376
ROOT::VecOps::RVec< float > get_genStatus(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
return the generator status of the input MCParticles
Definition MCParticle.cc:210
std::vector< int > list_of_particles_from_decay(int i, ROOT::VecOps::RVec< edm4hep::MCParticleData > in, ROOT::VecOps::RVec< int > ind)
obsolete: should use get_list_of_particles_from_decay instead
Definition MCParticle.cc:553
ROOT::VecOps::RVec< TLorentzVector > get_tlv(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
return the TlorentzVector of the input MCParticles
Definition MCParticle.cc:412
ROOT::VecOps::RVec< float > get_endPoint_y(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
return the end point y of the input MCParticles
Definition MCParticle.cc:296
ROOT::VecOps::RVec< float > get_endPoint_z(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
return the z of the input MCParticles
Definition MCParticle.cc:304
ROOT::VecOps::RVec< int > get_indices_ExclusiveDecay_MotherByIndex(int imother, std::vector< int > m_pdg_daughters, bool m_stableDaughters, ROOT::VecOps::RVec< edm4hep::MCParticleData > in, ROOT::VecOps::RVec< int > ind)
a shorthand for get_indices_MotherByIndex with m_chargeConjugateDaughters=false, m_inclusiveDecay =fa...
Definition MCParticle.cc:615
ROOT::VecOps::RVec< float > get_vertex_y(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
return the production vertex y of the input MCParticles
Definition MCParticle.cc:242
ROOT::VecOps::RVec< float > get_pt(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
return the transverse momenta of the input MCParticles
Definition MCParticle.cc:176
std::vector< int > get_list_of_particles_from_decay(int i, ROOT::VecOps::RVec< edm4hep::MCParticleData > in, ROOT::VecOps::RVec< int > ind)
return the list of particles from the decay of a mother particle. i is the mother index in the Partic...
Definition MCParticle.cc:518
ROOT::VecOps::RVec< int > get_parentid(ROOT::VecOps::RVec< int > mcind, ROOT::VecOps::RVec< edm4hep::MCParticleData > mc, ROOT::VecOps::RVec< int > parents)
return the parent index of a given list of MC particles
Definition MCParticle.cc:431
ROOT::VecOps::RVec< float > get_e(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
return the energy of the input MCParticles
Definition MCParticle.cc:340
ROOT::VecOps::RVec< edm4hep::MCParticleData > mergeParticles(ROOT::VecOps::RVec< edm4hep::MCParticleData > x, ROOT::VecOps::RVec< edm4hep::MCParticleData > y)
concatenate both input vectors and return the resulting vector
Definition MCParticle.cc:184
ROOT::VecOps::RVec< float > get_time(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
return the time of the input MCParticles
Definition MCParticle.cc:194
ROOT::VecOps::RVec< float > AngleBetweenTwoMCParticles(ROOT::VecOps::RVec< edm4hep::MCParticleData > p1, ROOT::VecOps::RVec< edm4hep::MCParticleData > p2)
return the angle (3D) between two MCParticles :
Definition MCParticle.cc:674
ROOT::VecOps::RVec< float > get_vertex_x(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
return the production vertex x of the input MCParticles
Definition MCParticle.cc:234
ROOT::VecOps::RVec< float > get_endPoint_x(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
return the end point x of the input MCParticles
Definition MCParticle.cc:288
ROOT::VecOps::RVec< float > get_y(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
return the rapidity of the input MCParticles
Definition MCParticle.cc:392
ROOT::VecOps::RVec< float > get_p(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
return the momenta of the input MCParticles
Definition MCParticle.cc:350
std::vector< int > get_list_of_stable_particles_from_decay(int i, ROOT::VecOps::RVec< edm4hep::MCParticleData > in, ROOT::VecOps::RVec< int > ind)
return the list of stable particles from the decay of a mother particle, looking at the full decay ch...
Definition MCParticle.cc:484
std::vector< int > list_of_stable_particles_from_decay(int i, ROOT::VecOps::RVec< edm4hep::MCParticleData > in, ROOT::VecOps::RVec< int > ind)
obsolete: should use get_list_of_stable_particles_from_decay instead
Definition MCParticle.cc:548
ROOT::VecOps::RVec< float > get_pdg(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
return the PDG of the input MCParticles
Definition MCParticle.cc:202
int get_n(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
return the size of the input collection
Definition MCParticle.cc:422
ROOT::VecOps::RVec< edm4hep::Vector3d > get_endPoint(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
return the end point of the input MCParticles
Definition MCParticle.cc:258
ROOT::VecOps::RVec< float > get_mass(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
return the masses of the input MCParticles
Definition MCParticle.cc:312
ROOT::VecOps::RVec< float > get_charge(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
return the charges of the input MCParticles
Definition MCParticle.cc:384
ROOT::VecOps::RVec< float > get_vertex_z(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
return the production vertex z of the input MCParticles
Definition MCParticle.cc:250
FCC analyzers collection.
Definition Algorithms.h:15
Filter events based on a MCParticles PDGID.
Definition MCParticle.h:28
float m_pdgid
Definition MCParticle.h:30
bool m_abs
Definition MCParticle.h:31
filter_pdgID(int arg_pdgid, bool arg_abs)
Definition MCParticle.cc:76
bool operator()(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
Definition MCParticle.cc:77
return the event primary vertex position and time (mm)
Definition MCParticle.h:81
TLorentzVector operator()(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
Definition MCParticle.cc:103
int m_genstatus
Definition MCParticle.h:83
get_EventPrimaryVertexP4()
Definition MCParticle.cc:102
return the event primary vertex (mm)
Definition MCParticle.h:74
get_EventPrimaryVertex(int arg_genstatus)
Definition MCParticle.cc:86
TVector3 operator()(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
Definition MCParticle.cc:87
int m_genstatus
Definition MCParticle.h:76
get the decay of a given particle
Definition MCParticle.h:65
get_decay(int arg_mother, int arg_daughters, bool arg_inf)
Definition MCParticle.cc:42
bool operator()(ROOT::VecOps::RVec< edm4hep::MCParticleData > in, ROOT::VecOps::RVec< int > ind)
Definition MCParticle.cc:43
int m_mother
Definition MCParticle.h:67
int m_daughters
Definition MCParticle.h:68
bool m_inf
Definition MCParticle.h:69
A shorthand for get_indices, with m_chargeConjugateDaughters=false, inclusiveDecay=false.
Definition MCParticle.h:101
get_indices_ExclusiveDecay(int pdg_mother, std::vector< int > pdg_daughters, bool stableDaughters, bool chargeConjugate)
Definition MCParticle.cc:668
return a list of indices that correspond to a given MC decay. The list contains the index of the moth...
Definition MCParticle.h:89
get_indices(int pdg_mother, std::vector< int > pdg_daughters, bool stableDaughters, bool chargeConjugateMother, bool chargeConjugateDaughters, bool inclusiveDecay)
Definition MCParticle.cc:631
bool m_chargeConjugateMother
Definition MCParticle.h:94
bool m_chargeConjugateDaughters
Definition MCParticle.h:95
bool m_stableDaughters
Definition MCParticle.h:93
std::vector< int > m_pdg_daughters
Definition MCParticle.h:92
bool m_inclusiveDecay
Definition MCParticle.h:96
int m_pdg_mother
Definition MCParticle.h:91
ROOT::VecOps::RVec< int > operator()(ROOT::VecOps::RVec< edm4hep::MCParticleData > in, ROOT::VecOps::RVec< int > ind)
Definition MCParticle.cc:640
get MC history tree for a given MCParticle index
Definition MCParticle.h:58
get_tree(int arg_index)
Definition MCParticle.cc:133
float m_index
Definition MCParticle.h:60
ROOT::VecOps::RVec< int > operator()(ROOT::VecOps::RVec< edm4hep::MCParticleData > in, ROOT::VecOps::RVec< int > ind)
Definition MCParticle.cc:134
select MCParticles with their status
Definition MCParticle.h:43
ROOT::VecOps::RVec< edm4hep::MCParticleData > operator()(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
Definition MCParticle.cc:12
float m_status
Definition MCParticle.h:45
sel_genStatus(int arg_status)
Definition MCParticle.cc:11
select MCParticles with their PDG id
Definition MCParticle.h:50
int m_pdg
Definition MCParticle.h:52
ROOT::VecOps::RVec< edm4hep::MCParticleData > operator()(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
Definition MCParticle.cc:25
bool m_chargeconjugate
Definition MCParticle.h:53
sel_pdgID(int arg_pdg, bool arg_chargeconjugate)
Definition MCParticle.cc:24
select MCParticles with transverse momentum greater than a minimum value [GeV]
Definition MCParticle.h:36
ROOT::VecOps::RVec< edm4hep::MCParticleData > operator()(ROOT::VecOps::RVec< edm4hep::MCParticleData > in)
Definition MCParticle.cc:63
sel_pt(float arg_min_pt)
Definition MCParticle.cc:62
float m_min_pt
Definition MCParticle.h:38