Skip to content

Commit 0bd8871

Browse files
committed
adding enum D0McCategory
1 parent 27b8c5f commit 0bd8871

1 file changed

Lines changed: 25 additions & 18 deletions

File tree

PWGJE/Tasks/jetCorrelationD0.cxx

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#include "PWGJE/DataModel/Jet.h"
1919
#include "PWGJE/DataModel/JetReducedData.h"
2020

21+
#include "PWGHF/Core/DecayChannels.h"
22+
2123
#include "Common/Core/RecoDecay.h"
2224

2325
#include <CommonConstants/MathConstants.h>
@@ -43,6 +45,7 @@ using namespace o2;
4345
using namespace o2::framework;
4446
using namespace o2::framework::expressions;
4547

48+
namespace hf2Prong = o2::hf_decay::hf_cand_2prong;
4649
namespace o2::aod
4750
{
4851

@@ -289,6 +292,15 @@ struct JetCorrelationD0 {
289292
registry.add("hPhiResolution", "#phi resolution;#p_{T,part};Resolution", {HistType::kTH2F, {{400, 0, 400}, {1000, -7.0, 7.0}}});
290293
registry.add("hEtaResolution", "#eta resolution;#p_{T,part};Resolution", {HistType::kTH2F, {{400, 0, 400}, {1000, -1.0, 1.0}}});
291294
}
295+
enum D0McCategory : int {
296+
Undefined = -1, // no truth match / unclassified
297+
Signal = 0, // correctly identified D0(bar), π+ K−
298+
Reflection = 1, // true D0(bar) reconstructed with swapped mass hypothesis
299+
CorrBkgPiKPi0 = 2, // correlated background: π+ K− π0
300+
CorrBkgPiPi = 3, // correlated background: π+ π−
301+
CorrBkgPiPiPi0 = 4, // correlated background: π+ π− π0
302+
CorrBkgKK = 5 // correlated background: K+ K−
303+
};
292304
void processData(soa::Filtered<aod::JetCollisions>::iterator const& collision,
293305
aod::CandidatesD0Data const& d0Candidates,
294306
soa::Join<aod::ChargedJets, aod::ChargedJetConstituents> const& jets)
@@ -353,12 +365,7 @@ struct JetCorrelationD0 {
353365

354366
int matchedFrom = 0;
355367
int selectedAs = 0;
356-
int category = -1; // -1 undefined, 0 signal, 1 reflection, 2-5 correlated backgrounds
357-
constexpr int kD0ToKPi = 1;
358-
constexpr int kD0ToKPiPi = 2;
359-
constexpr int kD0ToPiPi = 3;
360-
constexpr int kD0ToPiPiPi = 4;
361-
constexpr int kD0ToKK = 5;
368+
int category = D0McCategory::Undefined;
362369

363370
if (d0DecayChannel > 0) { // matched to a D0 on truth level (any channel)
364371
matchedFrom = 1;
@@ -370,18 +377,18 @@ struct JetCorrelationD0 {
370377
} else if ((d0Candidate.candidateSelFlag() & BIT(1)) != 0) { // CandidateSelFlag == BIT(1) -> selected as D0bar
371378
selectedAs = -1;
372379
}
373-
if ((std::abs(d0DecayChannel) == kD0ToKPi) && (matchedFrom != 0) && (selectedAs == matchedFrom)) {
374-
category = 0; // signal -> D0 or D0bar, π+ K−
375-
} else if ((d0DecayChannel == kD0ToKPi) && (selectedAs == -1 * matchedFrom)) {
376-
category = 1; // reflection
377-
} else if (d0DecayChannel == kD0ToKPiPi) {
378-
category = 2; // corr bkg: π+ K− π0
379-
} else if (d0DecayChannel == kD0ToPiPi) {
380-
category = 3; // corr bkg: π+ π−
381-
} else if (d0DecayChannel == kD0ToPiPiPi) {
382-
category = 4; // corr bkg: π+ π− π0
383-
} else if (d0DecayChannel == kD0ToKK) {
384-
category = 5; // corr bkg: K+ K−
380+
if ((std::abs(d0DecayChannel) == hf2Prong::DecayChannelMain::D0ToPiK) && (matchedFrom != 0) && (selectedAs == matchedFrom)) {
381+
category = D0McCategory::Signal; // D0 or D0bar, π+ K−
382+
} else if ((d0DecayChannel == hf2Prong::DecayChannelMain::D0ToPiK) && (selectedAs == -1 * matchedFrom)) {
383+
category = D0McCategory::Reflection;
384+
} else if (d0DecayChannel == hf2Prong::DecayChannelMain::D0ToPiKPi0) {
385+
category = D0McCategory::CorrBkgPiKPi0;
386+
} else if (d0DecayChannel == hf2Prong::DecayChannelMain::D0ToPiPi) {
387+
category = D0McCategory::CorrBkgPiPi;
388+
} else if (d0DecayChannel == hf2Prong::DecayChannelMain::D0ToPiPiPi0) {
389+
category = D0McCategory::CorrBkgPiPiPi0;
390+
} else if (d0DecayChannel == hf2Prong::DecayChannelMain::D0ToKK) {
391+
category = D0McCategory::CorrBkgKK;
385392
}
386393

387394
tableD0McDetector(tableCollision.lastIndex(), // might want to add some more detector level D0 quantities like prompt or non prompt info

0 commit comments

Comments
 (0)