@@ -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 */
119187template <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 */
133200template <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-
266264template <typename T, typename U>
267265bool isDielectronParticle (T const & particles, U const & particle)
268266{
0 commit comments