FCCAnalyses
Loading...
Searching...
No Matches
MCParticle.h
Go to the documentation of this file.
1
2#ifndef MCPARTICLE_ANALYZERS_H
3#define MCPARTICLE_ANALYZERS_H
4
5#include <cmath>
6#include <vector>
7
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"
15
16
17namespace FCCAnalyses{
18
25namespace MCParticle{
26
28 struct filter_pdgID {
29 filter_pdgID(int arg_pdgid, bool arg_abs);
30 float m_pdgid; //> Generator pdgid
31 bool m_abs;//> Use absolute value for pdgig
32 bool operator() (ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
33 };
34
36 struct sel_pt {
37 sel_pt(float arg_min_pt);
38 float m_min_pt = 20; //> transverse momentum threshold [GeV]
39 ROOT::VecOps::RVec<edm4hep::MCParticleData> operator() (ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
40 };
41
44 sel_genStatus(int arg_status);
45 float m_status = 1; //> Generator status
46 ROOT::VecOps::RVec<edm4hep::MCParticleData> operator() (ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
47 };
48
50 struct sel_pdgID {
51 sel_pdgID(int arg_pdg, bool arg_chargeconjugate);
52 int m_pdg = 13;
53 bool m_chargeconjugate = true;
54 ROOT::VecOps::RVec<edm4hep::MCParticleData> operator() (ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
55 };
56
58 struct get_tree{
59 get_tree(int arg_index);
60 float m_index; //> MC Particle index to build the tree from
61 ROOT::VecOps::RVec<int> operator() (ROOT::VecOps::RVec<edm4hep::MCParticleData> in, ROOT::VecOps::RVec<int> ind);
62 };
63
65 struct get_decay {
66 get_decay(int arg_mother, int arg_daughters, bool arg_inf);
67 int m_mother = 0; //> mother pdg id
68 int m_daughters = 0;//> daughters pdg id
69 bool m_inf = false;//> boolean to check if the pdgid is below a value rather than equal
70 bool operator() (ROOT::VecOps::RVec<edm4hep::MCParticleData> in, ROOT::VecOps::RVec<int> ind);
71 };
72
75 get_EventPrimaryVertex( int arg_genstatus );
76 int m_genstatus = 21; // Pythia8 code of the incoming particles of the hardest subprocess
77 TVector3 operator() (ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
78 };
79
83 int m_genstatus = 21; // Pythia8 code of the incoming particles of the hardest subprocess
84 TLorentzVector operator() (ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
85 };
86
87
90 get_indices( int pdg_mother, std::vector<int> pdg_daughters, bool stableDaughters, bool chargeConjugateMother, bool chargeConjugateDaughters, bool inclusiveDecay ) ;
92 std::vector<int> m_pdg_daughters;
97 ROOT::VecOps::RVec<int> operator() ( ROOT::VecOps::RVec<edm4hep::MCParticleData> in , ROOT::VecOps::RVec<int> ind);
98 };
99
102 get_indices_ExclusiveDecay( int pdg_mother, std::vector<int> pdg_daughters, bool stableDaughters, bool chargeConjugate ) ;
103 };
104
106 ROOT::VecOps::RVec<int> get_indices_MotherByIndex( int imother,
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);
113
115 ROOT::VecOps::RVec<int> get_indices_ExclusiveDecay_MotherByIndex( int imother,
116 std::vector<int> m_pdg_daughters,
117 bool m_stableDaughters,
118 ROOT::VecOps::RVec<edm4hep::MCParticleData> in ,
119 ROOT::VecOps::RVec<int> ind);
120
121
123 ROOT::VecOps::RVec<int> get_parentid(ROOT::VecOps::RVec<int> mcind, ROOT::VecOps::RVec<edm4hep::MCParticleData> mc, ROOT::VecOps::RVec<int> parents);
124
126 ROOT::VecOps::RVec<float> get_time(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
127
129 ROOT::VecOps::RVec<float> get_pdg(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
130
132 ROOT::VecOps::RVec<float> get_genStatus(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
133
135 ROOT::VecOps::RVec<float> get_simStatus(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
136
138 ROOT::VecOps::RVec<edm4hep::Vector3d> get_vertex(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
139
141 ROOT::VecOps::RVec<float> get_vertex_x(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
142
144 ROOT::VecOps::RVec<float> get_vertex_y(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
145
147 ROOT::VecOps::RVec<float> get_vertex_z(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
148
150 ROOT::VecOps::RVec<edm4hep::Vector3d> get_endPoint(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
151
153 ROOT::VecOps::RVec<edm4hep::Vector3d> get_endPoint(ROOT::VecOps::RVec<edm4hep::MCParticleData> in, ROOT::VecOps::RVec<int> ind );
154
156 ROOT::VecOps::RVec<float> get_endPoint_x(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
157
159 ROOT::VecOps::RVec<float> get_endPoint_y(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
160
162 ROOT::VecOps::RVec<float> get_endPoint_z(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
163
165 ROOT::VecOps::RVec<float> get_pt(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
166
168 ROOT::VecOps::RVec<float> get_p(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
169
171 ROOT::VecOps::RVec<float> get_px(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
172
174 ROOT::VecOps::RVec<float> get_py(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
175
177 ROOT::VecOps::RVec<float> get_pz(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
178
180 ROOT::VecOps::RVec<float> get_eta(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
181
183 ROOT::VecOps::RVec<float> get_y(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
184
186 ROOT::VecOps::RVec<float> get_theta(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
187
189 ROOT::VecOps::RVec<float> get_phi(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
190
192 ROOT::VecOps::RVec<float> get_e(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
193
195 ROOT::VecOps::RVec<float> get_mass(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
196
198 ROOT::VecOps::RVec<float> get_charge(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
199
201 ROOT::VecOps::RVec<TLorentzVector> get_tlv(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
202
204 ROOT::VecOps::RVec<edm4hep::MCParticleData> mergeParticles(ROOT::VecOps::RVec<edm4hep::MCParticleData> x, ROOT::VecOps::RVec<edm4hep::MCParticleData> y);
205
207 int get_n(ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
208
210 ROOT::VecOps::RVec<float> AngleBetweenTwoMCParticles( ROOT::VecOps::RVec<edm4hep::MCParticleData> p1, ROOT::VecOps::RVec<edm4hep::MCParticleData> p2 );
211
213 std::vector<int> get_list_of_stable_particles_from_decay( int i, ROOT::VecOps::RVec<edm4hep::MCParticleData> in, ROOT::VecOps::RVec<int> ind) ;
214
216 std::vector<int> get_list_of_particles_from_decay( int i,
217 ROOT::VecOps::RVec<edm4hep::MCParticleData> in,
218 ROOT::VecOps::RVec<int> ind);
219
221 edm4hep::MCParticleData sel_byIndex( int idx, ROOT::VecOps::RVec<edm4hep::MCParticleData> in);
222
224 std::vector<int> list_of_stable_particles_from_decay( int i, ROOT::VecOps::RVec<edm4hep::MCParticleData> in, ROOT::VecOps::RVec<int> ind) ;
226 std::vector<int> list_of_particles_from_decay( int i,
227 ROOT::VecOps::RVec<edm4hep::MCParticleData> in,
228 ROOT::VecOps::RVec<int> ind);
229
230
232 int get_lepton_origin(int idx,
233 const ROOT::VecOps::RVec<edm4hep::MCParticleData> &in,
234 const ROOT::VecOps::RVec<int> &ind);
235
236 int get_lepton_origin(const edm4hep::MCParticleData &p,
237 const ROOT::VecOps::RVec<edm4hep::MCParticleData> &in,
238 const ROOT::VecOps::RVec<int> &ind);
239
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);
243
244
245}//end NS MCParticle
246
247}//end NS FCCAnalyses
248#endif
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
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