Skip to content

Commit e25da72

Browse files
committed
adding zdc info for upc and adding proper hf matching
1 parent baa4dcf commit e25da72

6 files changed

Lines changed: 270 additions & 258 deletions

File tree

PWGJE/Core/JetCandidateUtilities.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,13 @@ template <typename T, typename U, typename V>
188188
auto matchedParticle(const T& candidate, const U& tracks, const V& particles)
189189
{
190190
if constexpr (jethfutilities::isHFCandidate<T>()) {
191-
bool isMatched = false;
192-
return jethfutilities::matchedHFParticle(candidate, tracks, particles, isMatched);
191+
return jethfutilities::matchedHFParticle(candidate, tracks, particles);
193192
} else if constexpr (jetv0utilities::isV0Candidate<T>()) {
194193
return jetv0utilities::matchedV0Particle(candidate, tracks, particles);
195194
} else if constexpr (jetdqutilities::isDielectronCandidate<T>()) {
196195
return jetdqutilities::matchedDielectronParticle(candidate, tracks, particles);
197196
} else {
198-
bool isMatched = false;
199-
return jethfutilities::matchedHFParticle(candidate, tracks, particles, isMatched); // this is a dummy output which should never be triggered
197+
return jethfutilities::matchedHFParticle(candidate, tracks, particles); // this is a dummy output which should never be triggered
200198
}
201199
}
202200

PWGJE/Core/JetDQUtilities.h

Lines changed: 72 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,74 @@ constexpr bool isDielectronMcTable()
7272
return isDielectronMcCandidate<typename T::iterator>() || isDielectronMcCandidate<typename T::filtered_iterator>();
7373
}
7474

75+
/**
76+
* returns the PDG of the candidate based on Dielectron Table
77+
*
78+
* @param candidate dielectron candidate that is being checked
79+
*/
80+
template <typename T>
81+
int getDielectronCandidatePDG(T const& /*candidate*/)
82+
{
83+
if constexpr (isDielectronCandidate<T>() || isDielectronMcCandidate<T>()) {
84+
return static_cast<int>(o2::constants::physics::Pdg::kJPsi);
85+
} else {
86+
return 0;
87+
}
88+
}
89+
90+
/**
91+
* returns the PDG of the candidates in the table type
92+
*/
93+
template <typename T>
94+
int getDielectronTablePDG()
95+
{
96+
if constexpr (isDielectronTable<T>() || isDielectronMcTable<T>()) {
97+
return static_cast<int>(o2::constants::physics::Pdg::kJPsi);
98+
} else {
99+
return 0;
100+
}
101+
}
102+
103+
/**
104+
* returns the mass of the candidate based on Dielectron Table
105+
*
106+
* @param candidate dielectron candidate that is being checked
107+
*/
108+
template <typename T>
109+
float getDielectronCandidatePDGMass(T const& /*candidate*/)
110+
{
111+
if constexpr (isDielectronCandidate<T>() || isDielectronMcCandidate<T>()) {
112+
return static_cast<float>(o2::constants::physics::MassJPsi);
113+
} else {
114+
return -1.0;
115+
}
116+
}
117+
118+
/**
119+
* returns the mass of the candidates in the table type
120+
*
121+
*/
122+
template <typename T>
123+
float getDielectronTablePDGMass()
124+
{
125+
if constexpr (isDielectronTable<T>() || isDielectronMcTable<T>()) {
126+
return static_cast<float>(o2::constants::physics::MassJPsi);
127+
} else {
128+
return -1.0;
129+
}
130+
}
131+
132+
/**
133+
* returns the mass of the candidate based on Dielectron Table
134+
*
135+
* @param candidate dielectron candidate that is being checked
136+
*/
137+
template <typename T>
138+
float getDielectronCandidateInvariantMass(T const& candidate)
139+
{
140+
return candidate.mass();
141+
}
142+
75143
/**
76144
* returns true if the candidate is matched to a reconstructed level candidate with the correct decay
77145
* * @param candidate candidate that is being checked
@@ -117,10 +185,9 @@ bool isDielectronDaughterTrack(T& track, U& candidate)
117185
* @param particles particle table
118186
*/
119187
template <typename T, typename U, typename V>
120-
auto matchedDielectronParticleId(const T& candidate, const U& /*tracks*/, const V& /*particles*/)
188+
auto matchedDielectronParticleId(const T& candidate, const U& /*tracks*/, const V& particles)
121189
{
122-
const auto candidateDaughterParticle = candidate.template prong1_as<U>().template mcParticle_as<V>();
123-
return candidateDaughterParticle.template mothers_first_as<V>().globalIndex(); // can we get the Id directly?
190+
return RecoDecay::getMother(particles, candidate.template prong0_as<U>().template mcParticle_as<V>(), getDielectronCandidatePDG(candidate), true);
124191
}
125192

126193
/**
@@ -131,10 +198,9 @@ auto matchedDielectronParticleId(const T& candidate, const U& /*tracks*/, const
131198
* @param particles particle table
132199
*/
133200
template <typename T, typename U, typename V>
134-
auto matchedDielectronParticle(const T& candidate, const U& /*tracks*/, const V& /*particles*/)
201+
auto matchedDielectronParticle(const T& candidate, const U& /*tracks*/, const V& particles)
135202
{
136-
const auto candidateDaughterParticle = candidate.template prong1_as<U>().template mcParticle_as<V>();
137-
return candidateDaughterParticle.template mothers_first_as<V>();
203+
return particles.iteratorAt(RecoDecay::getMother(particles, candidate.template prong0_as<U>().template mcParticle_as<V>(), getDielectronCandidatePDG(candidate), true));
138204
}
139205

140206
/**
@@ -195,74 +261,6 @@ int getDielectronMcCandidateCollisionId(T const& candidate)
195261
}
196262
}
197263

198-
/**
199-
* returns the PDG of the candidate based on Dielectron Table
200-
*
201-
* @param candidate dielectron candidate that is being checked
202-
*/
203-
template <typename T>
204-
int getDielectronCandidatePDG(T const& /*candidate*/)
205-
{
206-
if constexpr (isDielectronCandidate<T>() || isDielectronMcCandidate<T>()) {
207-
return static_cast<int>(o2::constants::physics::Pdg::kJPsi);
208-
} else {
209-
return 0;
210-
}
211-
}
212-
213-
/**
214-
* returns the PDG of the candidates in the table type
215-
*/
216-
template <typename T>
217-
int getDielectronTablePDG()
218-
{
219-
if constexpr (isDielectronTable<T>() || isDielectronMcTable<T>()) {
220-
return static_cast<int>(o2::constants::physics::Pdg::kJPsi);
221-
} else {
222-
return 0;
223-
}
224-
}
225-
226-
/**
227-
* returns the mass of the candidate based on Dielectron Table
228-
*
229-
* @param candidate dielectron candidate that is being checked
230-
*/
231-
template <typename T>
232-
float getDielectronCandidatePDGMass(T const& /*candidate*/)
233-
{
234-
if constexpr (isDielectronCandidate<T>() || isDielectronMcCandidate<T>()) {
235-
return static_cast<float>(o2::constants::physics::MassJPsi);
236-
} else {
237-
return -1.0;
238-
}
239-
}
240-
241-
/**
242-
* returns the mass of the candidates in the table type
243-
*
244-
*/
245-
template <typename T>
246-
float getDielectronTablePDGMass()
247-
{
248-
if constexpr (isDielectronTable<T>() || isDielectronMcTable<T>()) {
249-
return static_cast<float>(o2::constants::physics::MassJPsi);
250-
} else {
251-
return -1.0;
252-
}
253-
}
254-
255-
/**
256-
* returns the mass of the candidate based on Dielectron Table
257-
*
258-
* @param candidate dielectron candidate that is being checked
259-
*/
260-
template <typename T>
261-
float getDielectronCandidateInvariantMass(T const& candidate)
262-
{
263-
return candidate.mass();
264-
}
265-
266264
template <typename T, typename U>
267265
bool isDielectronParticle(T const& particles, U const& particle)
268266
{

0 commit comments

Comments
 (0)