Skip to content

Commit 35b03e6

Browse files
authored
[PWGJE,PWGLF] New task to prepare training data to tag s-jets (#12599)
1 parent 686c3db commit 35b03e6

File tree

3 files changed

+561
-1
lines changed

3 files changed

+561
-1
lines changed

PWGJE/Core/JetTaggingUtilities.h

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ enum JetTaggingSpecies {
5050
beauty = 2,
5151
lightflavour = 3,
5252
lightquark = 4,
53-
gluon = 5
53+
gluon = 5,
54+
udg = 6,
55+
strange = 7,
5456
};
5557

5658
enum BJetTaggingMethod {
@@ -413,6 +415,45 @@ int16_t getJetFlavor(AnyJet const& jet, AllMCParticles const& mcparticles)
413415
return JetTaggingSpecies::lightflavour; // Light flavor jet
414416
}
415417

418+
/**
419+
* return also the s-jet flavor: 1 for c-jet, 2 for b-jet, 7 for s-jet
420+
* 6 for u,d or g jets.
421+
*
422+
* @param AnyJet the jet that we need to study its flavor
423+
* @param AllMCParticles a vector of all the mc particles stack
424+
*/
425+
template <typename AnyJet, typename AllMCParticles>
426+
int16_t getSJetFlavor(AnyJet const& jet, AllMCParticles const& mcparticles)
427+
{
428+
bool charmQuark = false;
429+
bool strangeQuark = false;
430+
431+
for (auto const& mcpart : mcparticles) {
432+
int pdgcode = mcpart.pdgCode();
433+
if (std::abs(pdgcode) == 21 || (std::abs(pdgcode) >= 1 && std::abs(pdgcode) <= 5)) {
434+
double dR = jetutilities::deltaR(jet, mcpart);
435+
436+
if (dR < jet.r() / 100.f) {
437+
if (std::abs(pdgcode) == 5) {
438+
return JetTaggingSpecies::beauty; // Beauty jet
439+
} else if (std::abs(pdgcode) == 4) {
440+
charmQuark = true;
441+
} else if (std::abs(pdgcode) == 3) {
442+
strangeQuark = true;
443+
}
444+
}
445+
}
446+
}
447+
448+
if (charmQuark) {
449+
return JetTaggingSpecies::charm; // Charm jet
450+
} else if (strangeQuark) {
451+
return JetTaggingSpecies::strange; // Strange jet
452+
}
453+
454+
return JetTaggingSpecies::udg; // Up, Down or Gluon jet
455+
}
456+
416457
/**
417458
* return the jet flavor if it finds a HF hadron inside the jet: 0 for lf-jet, 1 for c-jet, 2 for b-jet
418459
*

PWGLF/Tasks/Strangeness/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ o2physics_add_dpl_workflow(strangeness-in-jets
109109
SOURCES strangenessInJets.cxx
110110
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::PWGJECore FastJet::FastJet FastJet::Contrib O2Physics::EventFilteringUtils
111111
COMPONENT_NAME Analysis)
112+
113+
o2physics_add_dpl_workflow(sjet-tree-creator
114+
SOURCES sjetTreeCreator.cxx
115+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::PWGJECore FastJet::FastJet FastJet::Contrib
116+
COMPONENT_NAME Analysis)
112117
endif()
113118

114119
o2physics_add_dpl_workflow(v0topologicalcuts

0 commit comments

Comments
 (0)