Skip to content

Commit 24fc851

Browse files
committed
clang_format
1 parent a1413ca commit 24fc851

7 files changed

Lines changed: 1736 additions & 1429 deletions

File tree

analyzers/dataframe/FCCAnalyses/MCParticle.h

Lines changed: 314 additions & 246 deletions
Large diffs are not rendered by default.
Lines changed: 164 additions & 157 deletions
Original file line numberDiff line numberDiff line change
@@ -1,167 +1,174 @@
11

2-
#ifndef RECONSTRUCTEDPARTICLE2MC_ANALYZERS_H
3-
#define RECONSTRUCTEDPARTICLE2MC_ANALYZERS_H
2+
#ifndef RECONSTRUCTEDPARTICLE2MC_ANALYZERS_H
3+
#define RECONSTRUCTEDPARTICLE2MC_ANALYZERS_H
44

55
#include <cmath>
66
#include <vector>
77

88
#include "ROOT/RVec.hxx"
9-
#include "edm4hep/ReconstructedParticleData.h"
9+
#include "TLorentzVector.h"
1010
#include "edm4hep/MCParticleData.h"
11+
#include "edm4hep/ReconstructedParticleData.h"
1112
#include "podio/ObjectID.h"
12-
#include "TLorentzVector.h"
1313

14-
namespace FCCAnalyses{
15-
16-
namespace ReconstructedParticle2MC{
17-
18-
/// select ReconstructedParticles matched with a MC particle of a given PDG_id
19-
struct selRP_PDG {
20-
selRP_PDG(int arg_PDG, bool arg_chargedOnly);
21-
int m_PDG = 13 ;
22-
bool m_chargedOnly = true;
23-
std::vector<edm4hep::ReconstructedParticleData> operator() (ROOT::VecOps::RVec<int> recind,
24-
ROOT::VecOps::RVec<int> mcind,
25-
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco,
26-
ROOT::VecOps::RVec<edm4hep::MCParticleData> mc) ;
27-
};
28-
29-
/// select ReconstructedParticles matched with a MC particle of a given PDG_id
30-
struct selRP_PDG_index {
31-
selRP_PDG_index(int arg_PDG, bool arg_chargedOnly);
32-
int m_PDG = 13 ;
33-
bool m_chargedOnly = true;
34-
ROOT::VecOps::RVec<int> operator() (ROOT::VecOps::RVec<int> recind,
35-
ROOT::VecOps::RVec<int> mcind,
36-
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco,
37-
ROOT::VecOps::RVec<edm4hep::MCParticleData> mc) ;
38-
};
39-
40-
41-
/// select ReconstructedParticles with transverse momentum greater than a minimum value [GeV]
42-
struct getRP2MC_p_func {
43-
ROOT::VecOps::RVec<float> operator() (ROOT::VecOps::RVec<int> recin,
44-
ROOT::VecOps::RVec<int> mcin,
45-
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco,
46-
ROOT::VecOps::RVec<edm4hep::MCParticleData> mc);
47-
};
48-
49-
/// Return the D0 of a track to a reconstructed particle
50-
ROOT::VecOps::RVec<float> getRP2MC_p (ROOT::VecOps::RVec<int> recin,
51-
ROOT::VecOps::RVec<int> mcin,
52-
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco,
53-
ROOT::VecOps::RVec<edm4hep::MCParticleData> mc);
54-
55-
/// Return the D0 of a track to a reconstructed particle
56-
ROOT::VecOps::RVec<float> getRP2MC_px (ROOT::VecOps::RVec<int> recin,
57-
ROOT::VecOps::RVec<int> mcin,
58-
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco,
59-
ROOT::VecOps::RVec<edm4hep::MCParticleData> mc);
60-
61-
/// Return the D0 of a track to a reconstructed particle
62-
ROOT::VecOps::RVec<float> getRP2MC_py (ROOT::VecOps::RVec<int> recin,
63-
ROOT::VecOps::RVec<int> mcin,
64-
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco,
65-
ROOT::VecOps::RVec<edm4hep::MCParticleData> mc);
66-
67-
/// Return the D0 of a track to a reconstructed particle
68-
ROOT::VecOps::RVec<float> getRP2MC_pz (ROOT::VecOps::RVec<int> recin,
69-
ROOT::VecOps::RVec<int> mcin,
70-
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco,
71-
ROOT::VecOps::RVec<edm4hep::MCParticleData> mc);
72-
73-
/// Return the D0 of a track to a reconstructed particle
74-
ROOT::VecOps::RVec<float> getRP2MC_mass (ROOT::VecOps::RVec<int> recin,
75-
ROOT::VecOps::RVec<int> mcin,
76-
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco,
77-
ROOT::VecOps::RVec<edm4hep::MCParticleData> mc);
78-
79-
/// Return the D0 of a track to a reconstructed particle
80-
ROOT::VecOps::RVec<float> getRP2MC_charge (ROOT::VecOps::RVec<int> recin,
81-
ROOT::VecOps::RVec<int> mcin,
82-
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco,
83-
ROOT::VecOps::RVec<edm4hep::MCParticleData> mc);
84-
85-
/// Return the D0 of a track to a reconstructed particle
86-
ROOT::VecOps::RVec<float> getRP2MC_pdg (ROOT::VecOps::RVec<int> recin,
87-
ROOT::VecOps::RVec<int> mcin,
88-
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco,
89-
ROOT::VecOps::RVec<edm4hep::MCParticleData> mc);
90-
91-
/// Return the D0 of a track to a reconstructed particle
92-
ROOT::VecOps::RVec<TLorentzVector> getRP2MC_tlv (ROOT::VecOps::RVec<int> recin,
93-
ROOT::VecOps::RVec<int> mcin,
94-
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco,
95-
ROOT::VecOps::RVec<edm4hep::MCParticleData> mc);
96-
97-
/// Return the D0 of a track to a reconstructed particle
98-
ROOT::VecOps::RVec<int> getRP2MC_index (ROOT::VecOps::RVec<int> recin,
99-
ROOT::VecOps::RVec<int> mcin,
100-
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco);
101-
102-
/// Return the D0 of a track to a reconstructed particle
103-
ROOT::VecOps::RVec<ROOT::VecOps::RVec<int>> getRP2MC_indexVec (ROOT::VecOps::RVec<int> recin,
104-
ROOT::VecOps::RVec<int> mcin,
105-
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco);
106-
107-
/// Return the D0 of a track to a reconstructed particle
108-
ROOT::VecOps::RVec<int> getRP2MC_index_test (ROOT::VecOps::RVec<int> recin,
109-
ROOT::VecOps::RVec<int> mcin,
110-
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco,
111-
ROOT::VecOps::RVec<edm4hep::MCParticleData> mc,
112-
ROOT::VecOps::RVec<int> parents);
113-
114-
115-
/// Return the D0 of a track to a reconstructed particle
116-
ROOT::VecOps::RVec<int> getRP2MC_parentid (ROOT::VecOps::RVec<int> recin,
117-
ROOT::VecOps::RVec<int> mcin,
118-
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco,
119-
ROOT::VecOps::RVec<edm4hep::MCParticleData> mc,
120-
ROOT::VecOps::RVec<int> parents);
121-
122-
/// select ReconstructedParticles matched with a MC charged hadrons
123-
std::vector<edm4hep::ReconstructedParticleData> selRP_ChargedHadrons ( ROOT::VecOps::RVec<int> recind,
124-
ROOT::VecOps::RVec<int> mcind,
125-
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco,
126-
ROOT::VecOps::RVec<edm4hep::MCParticleData> mc) ;
127-
128-
/// select ReconstructedParticles matched to the MC particles whose indices are passed in a list
129-
/// @param mcParticles_indices indices of the MC particles to look up
130-
/// @param recind: reco index component of the MCRecoAssociations
131-
/// @param mcind: mc index component of the MCRecoAssociations
132-
/// @param reco: full reco particle list (ReconstructedParticles)
133-
/// @param mc: full mc particle list (Particles)
134-
/// @param require_stable: if set to true, will only match stable particles.
135-
/// @return List of ReconstructedParticle candidates with length corresponding to the number of *stable* MC particles in the mcParticles_indices vector. In presence of unstable particles, no 1:1 correspondence. For non-reconstructed stable MC particles, a dummy particle will be inserted. If 1:1 length correspondence is required, set require_stable to false.
136-
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> selRP_matched_to_list(
137-
const ROOT::VecOps::RVec<int> & mcParticles_indices,
138-
const ROOT::VecOps::RVec<int> & recind,
139-
const ROOT::VecOps::RVec<int> & mcind,
140-
const ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> & reco,
141-
const ROOT::VecOps::RVec<edm4hep::MCParticleData> & mc,
142-
bool require_stable = true) ;
143-
/// select indices of ReconstructedParticles matched to the MC particles whose indices are passed in a list
144-
/// @param mcParticles_indices indices of the MC particles to look up
145-
/// @param recind: reco index component of the MCRecoAssociations
146-
/// @param mcind: mc index component of the MCRecoAssociations
147-
/// @param mc: full mc particle list (Particles)
148-
/// @param require_stable: if set to true, will only match stable particles.
149-
/// @return List of ReconstructedParticle candidates with length corresponding to the number of *stable* MC particles in the mcParticles_indices vector. In presence of unstable particles, no 1:1 correspondence. For non-reconstructed stable MC particles, a "-1" entry will be inserted. If 1:1 length correspondence is required, set require_stable to false.
150-
ROOT::VecOps::RVec<int> selRP_indices_matched_to_list(
151-
const ROOT::VecOps::RVec<int> & mcParticles_indices,
152-
const ROOT::VecOps::RVec<int> & recind,
153-
const ROOT::VecOps::RVec<int> & mcind,
154-
const ROOT::VecOps::RVec<edm4hep::MCParticleData> & mc,
155-
bool require_stable = true
156-
) ;
157-
158-
/// return the index of the MC particle that is associated to a given track (via the track-reco association)
159-
int getTrack2MC_index ( int track_index,
160-
ROOT::VecOps::RVec<int> recind,
161-
ROOT::VecOps::RVec<int> mcind,
162-
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco);
163-
164-
}//end NS ReconstructedParticle2MC
165-
166-
}//end NS FCCAnalyses
14+
namespace FCCAnalyses {
15+
16+
namespace ReconstructedParticle2MC {
17+
18+
/// select ReconstructedParticles matched with a MC particle of a given PDG_id
19+
struct selRP_PDG {
20+
selRP_PDG(int arg_PDG, bool arg_chargedOnly);
21+
int m_PDG = 13;
22+
bool m_chargedOnly = true;
23+
std::vector<edm4hep::ReconstructedParticleData>
24+
operator()(ROOT::VecOps::RVec<int> recind, ROOT::VecOps::RVec<int> mcind,
25+
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco,
26+
ROOT::VecOps::RVec<edm4hep::MCParticleData> mc);
27+
};
28+
29+
/// select ReconstructedParticles matched with a MC particle of a given PDG_id
30+
struct selRP_PDG_index {
31+
selRP_PDG_index(int arg_PDG, bool arg_chargedOnly);
32+
int m_PDG = 13;
33+
bool m_chargedOnly = true;
34+
ROOT::VecOps::RVec<int>
35+
operator()(ROOT::VecOps::RVec<int> recind, ROOT::VecOps::RVec<int> mcind,
36+
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco,
37+
ROOT::VecOps::RVec<edm4hep::MCParticleData> mc);
38+
};
39+
40+
/// select ReconstructedParticles with transverse momentum greater than a
41+
/// minimum value [GeV]
42+
struct getRP2MC_p_func {
43+
ROOT::VecOps::RVec<float>
44+
operator()(ROOT::VecOps::RVec<int> recin, ROOT::VecOps::RVec<int> mcin,
45+
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco,
46+
ROOT::VecOps::RVec<edm4hep::MCParticleData> mc);
47+
};
48+
49+
/// Return the D0 of a track to a reconstructed particle
50+
ROOT::VecOps::RVec<float>
51+
getRP2MC_p(ROOT::VecOps::RVec<int> recin, ROOT::VecOps::RVec<int> mcin,
52+
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco,
53+
ROOT::VecOps::RVec<edm4hep::MCParticleData> mc);
54+
55+
/// Return the D0 of a track to a reconstructed particle
56+
ROOT::VecOps::RVec<float>
57+
getRP2MC_px(ROOT::VecOps::RVec<int> recin, ROOT::VecOps::RVec<int> mcin,
58+
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco,
59+
ROOT::VecOps::RVec<edm4hep::MCParticleData> mc);
60+
61+
/// Return the D0 of a track to a reconstructed particle
62+
ROOT::VecOps::RVec<float>
63+
getRP2MC_py(ROOT::VecOps::RVec<int> recin, ROOT::VecOps::RVec<int> mcin,
64+
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco,
65+
ROOT::VecOps::RVec<edm4hep::MCParticleData> mc);
66+
67+
/// Return the D0 of a track to a reconstructed particle
68+
ROOT::VecOps::RVec<float>
69+
getRP2MC_pz(ROOT::VecOps::RVec<int> recin, ROOT::VecOps::RVec<int> mcin,
70+
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco,
71+
ROOT::VecOps::RVec<edm4hep::MCParticleData> mc);
72+
73+
/// Return the D0 of a track to a reconstructed particle
74+
ROOT::VecOps::RVec<float>
75+
getRP2MC_mass(ROOT::VecOps::RVec<int> recin, ROOT::VecOps::RVec<int> mcin,
76+
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco,
77+
ROOT::VecOps::RVec<edm4hep::MCParticleData> mc);
78+
79+
/// Return the D0 of a track to a reconstructed particle
80+
ROOT::VecOps::RVec<float>
81+
getRP2MC_charge(ROOT::VecOps::RVec<int> recin, ROOT::VecOps::RVec<int> mcin,
82+
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco,
83+
ROOT::VecOps::RVec<edm4hep::MCParticleData> mc);
84+
85+
/// Return the D0 of a track to a reconstructed particle
86+
ROOT::VecOps::RVec<float>
87+
getRP2MC_pdg(ROOT::VecOps::RVec<int> recin, ROOT::VecOps::RVec<int> mcin,
88+
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco,
89+
ROOT::VecOps::RVec<edm4hep::MCParticleData> mc);
90+
91+
/// Return the D0 of a track to a reconstructed particle
92+
ROOT::VecOps::RVec<TLorentzVector>
93+
getRP2MC_tlv(ROOT::VecOps::RVec<int> recin, ROOT::VecOps::RVec<int> mcin,
94+
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco,
95+
ROOT::VecOps::RVec<edm4hep::MCParticleData> mc);
96+
97+
/// Return the D0 of a track to a reconstructed particle
98+
ROOT::VecOps::RVec<int>
99+
getRP2MC_index(ROOT::VecOps::RVec<int> recin, ROOT::VecOps::RVec<int> mcin,
100+
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco);
101+
102+
/// Return the D0 of a track to a reconstructed particle
103+
ROOT::VecOps::RVec<ROOT::VecOps::RVec<int>>
104+
getRP2MC_indexVec(ROOT::VecOps::RVec<int> recin, ROOT::VecOps::RVec<int> mcin,
105+
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco);
106+
107+
/// Return the D0 of a track to a reconstructed particle
108+
ROOT::VecOps::RVec<int>
109+
getRP2MC_index_test(ROOT::VecOps::RVec<int> recin, ROOT::VecOps::RVec<int> mcin,
110+
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco,
111+
ROOT::VecOps::RVec<edm4hep::MCParticleData> mc,
112+
ROOT::VecOps::RVec<int> parents);
113+
114+
/// Return the D0 of a track to a reconstructed particle
115+
ROOT::VecOps::RVec<int>
116+
getRP2MC_parentid(ROOT::VecOps::RVec<int> recin, ROOT::VecOps::RVec<int> mcin,
117+
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco,
118+
ROOT::VecOps::RVec<edm4hep::MCParticleData> mc,
119+
ROOT::VecOps::RVec<int> parents);
120+
121+
/// select ReconstructedParticles matched with a MC charged hadrons
122+
std::vector<edm4hep::ReconstructedParticleData> selRP_ChargedHadrons(
123+
ROOT::VecOps::RVec<int> recind, ROOT::VecOps::RVec<int> mcind,
124+
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco,
125+
ROOT::VecOps::RVec<edm4hep::MCParticleData> mc);
126+
127+
/// select ReconstructedParticles matched to the MC particles whose indices are
128+
/// passed in a list
129+
/// @param mcParticles_indices indices of the MC particles to look up
130+
/// @param recind: reco index component of the MCRecoAssociations
131+
/// @param mcind: mc index component of the MCRecoAssociations
132+
/// @param reco: full reco particle list (ReconstructedParticles)
133+
/// @param mc: full mc particle list (Particles)
134+
/// @param require_stable: if set to true, will only match stable particles.
135+
/// @return List of ReconstructedParticle candidates with length corresponding
136+
/// to the number of *stable* MC particles in the mcParticles_indices vector. In
137+
/// presence of unstable particles, no 1:1 correspondence. For non-reconstructed
138+
/// stable MC particles, a dummy particle will be inserted. If 1:1 length
139+
/// correspondence is required, set require_stable to false.
140+
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> selRP_matched_to_list(
141+
const ROOT::VecOps::RVec<int> &mcParticles_indices,
142+
const ROOT::VecOps::RVec<int> &recind, const ROOT::VecOps::RVec<int> &mcind,
143+
const ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> &reco,
144+
const ROOT::VecOps::RVec<edm4hep::MCParticleData> &mc,
145+
bool require_stable = true);
146+
/// select indices of ReconstructedParticles matched to the MC particles whose
147+
/// indices are passed in a list
148+
/// @param mcParticles_indices indices of the MC particles to look up
149+
/// @param recind: reco index component of the MCRecoAssociations
150+
/// @param mcind: mc index component of the MCRecoAssociations
151+
/// @param mc: full mc particle list (Particles)
152+
/// @param require_stable: if set to true, will only match stable particles.
153+
/// @return List of ReconstructedParticle candidates with length corresponding
154+
/// to the number of *stable* MC particles in the mcParticles_indices vector. In
155+
/// presence of unstable particles, no 1:1 correspondence. For non-reconstructed
156+
/// stable MC particles, a "-1" entry will be inserted. If 1:1 length
157+
/// correspondence is required, set require_stable to false.
158+
ROOT::VecOps::RVec<int> selRP_indices_matched_to_list(
159+
const ROOT::VecOps::RVec<int> &mcParticles_indices,
160+
const ROOT::VecOps::RVec<int> &recind, const ROOT::VecOps::RVec<int> &mcind,
161+
const ROOT::VecOps::RVec<edm4hep::MCParticleData> &mc,
162+
bool require_stable = true);
163+
164+
/// return the index of the MC particle that is associated to a given track (via
165+
/// the track-reco association)
166+
int getTrack2MC_index(
167+
int track_index, ROOT::VecOps::RVec<int> recind,
168+
ROOT::VecOps::RVec<int> mcind,
169+
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> reco);
170+
171+
} // namespace ReconstructedParticle2MC
172+
173+
} // namespace FCCAnalyses
167174
#endif

0 commit comments

Comments
 (0)