Skip to content

Commit 5d2f00d

Browse files
authored
PWGLF strangeness_in_jets: added function to diagnose efficiency loss of K0s (AliceO2Group#7930)
* PWGLF strangeness_in_jets: added function to diagnose efficiency loss of K0s * PWGLF strangeness_in_jets: fixed typo * PWGLF strangeness_in_jets: fixed typo
1 parent 31653cc commit 5d2f00d

File tree

1 file changed

+125
-37
lines changed

1 file changed

+125
-37
lines changed

PWGLF/Tasks/Strangeness/strangeness_in_jets.cxx

Lines changed: 125 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ using std::array;
4444

4545
using SelCollisions = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms>;
4646
using SimCollisions = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms, aod::McCollisionLabels>;
47-
using FullTracks = soa::Join<aod::Tracks, aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::TracksDCA, aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr, aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr>;
48-
using MCTracks = soa::Join<FullTracks, aod::McTrackLabels>;
47+
using StrHadronDaughterTracks = soa::Join<aod::Tracks, aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::TracksDCA, aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr, aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr>;
48+
using MCTracks = soa::Join<StrHadronDaughterTracks, aod::McTrackLabels>;
4949

5050
struct strangeness_in_jets {
5151

@@ -111,7 +111,7 @@ struct strangeness_in_jets {
111111
void init(InitContext const&)
112112
{
113113
// Event Counters
114-
registryData.add("number_of_events_data", "number of events in data", HistType::kTH1F, {{10, 0, 10, "Event Cuts"}});
114+
registryData.add("number_of_events_data", "number of events in data", HistType::kTH1F, {{20, 0, 20, "Event Cuts"}});
115115
registryMC.add("number_of_events_mc", "number of events in mc", HistType::kTH1F, {{10, 0, 10, "Event Cuts"}});
116116

117117
// QC Histograms
@@ -128,6 +128,7 @@ struct strangeness_in_jets {
128128
registryQC.add("dcaxy_vs_pt", "dcaxy_vs_pt", HistType::kTH2F, {{100, 0.0, 5.0, "#it{p}_{T} (GeV/#it{c})"}, {2000, -0.05, 0.05, "DCA_{xy} (cm)"}});
129129
registryQC.add("dcaz_vs_pt", "dcaz_vs_pt", HistType::kTH2F, {{100, 0.0, 5.0, "#it{p}_{T} (GeV/#it{c})"}, {2000, -0.05, 0.05, "DCA_{z} (cm)"}});
130130
registryQC.add("jet_ue_overlaps", "jet_ue_overlaps", HistType::kTH2F, {{20, 0.0, 20.0, "#it{n}_{jet}"}, {200, 0.0, 200.0, "#it{n}_{overlaps}"}});
131+
registryQC.add("survivedK0", "survivedK0", HistType::kTH1F, {{20, 0, 20, "step"}});
131132

132133
// Multiplicity Binning
133134
std::vector<double> multBinning = {0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100};
@@ -312,9 +313,9 @@ struct strangeness_in_jets {
312313
return false;
313314
if (v0.dcaV0daughters() > dcaV0DaughtersMax)
314315
return false;
315-
if (v0.dcapostopv() < dcapostoPVmin)
316+
if (TMath::Abs(v0.dcapostopv()) < dcapostoPVmin)
316317
return false;
317-
if (v0.dcanegtopv() < dcanegtoPVmin)
318+
if (TMath::Abs(v0.dcanegtopv()) < dcanegtoPVmin)
318319
return false;
319320

320321
// PID Selections (TPC)
@@ -363,9 +364,9 @@ struct strangeness_in_jets {
363364
return false;
364365
if (v0.dcaV0daughters() > dcaV0DaughtersMax)
365366
return false;
366-
if (v0.dcapostopv() < dcapostoPVmin)
367+
if (TMath::Abs(v0.dcapostopv()) < dcapostoPVmin)
367368
return false;
368-
if (v0.dcanegtopv() < dcanegtoPVmin)
369+
if (TMath::Abs(v0.dcanegtopv()) < dcanegtoPVmin)
369370
return false;
370371

371372
// PID Selections (TPC)
@@ -414,9 +415,9 @@ struct strangeness_in_jets {
414415
return false;
415416
if (v0.dcaV0daughters() > dcaV0DaughtersMax)
416417
return false;
417-
if (v0.dcapostopv() < dcapostoPVmin)
418+
if (TMath::Abs(v0.dcapostopv()) < dcapostoPVmin)
418419
return false;
419-
if (v0.dcanegtopv() < dcanegtoPVmin)
420+
if (TMath::Abs(v0.dcanegtopv()) < dcanegtoPVmin)
420421
return false;
421422

422423
// PID Selections (TPC)
@@ -660,10 +661,9 @@ struct strangeness_in_jets {
660661
template <typename pionTrack>
661662
bool isHighPurityPion(const pionTrack& track)
662663
{
663-
if (track.p() < 0.6 && std::abs(track.tpcNSigmaPi()) < 3.0)
664+
if (track.p() < 0.6 && TMath::Abs(track.tpcNSigmaPi()) < 3.0)
664665
return true;
665-
if (track.p() > 0.6 && std::abs(track.tpcNSigmaPi()) < 3.0 &&
666-
std::abs(track.tofNSigmaPi()) < 3.0)
666+
if (track.p() > 0.6 && TMath::Abs(track.tpcNSigmaPi()) < 3.0 && TMath::Abs(track.tofNSigmaPi()) < 3.0)
667667
return true;
668668
return false;
669669
}
@@ -765,7 +765,7 @@ struct strangeness_in_jets {
765765
return false;
766766
}
767767

768-
void processData(SelCollisions::iterator const& collision, aod::V0Datas const& fullV0s, aod::CascDataExt const& Cascades, FullTracks const& tracks)
768+
void processData(SelCollisions::iterator const& collision, aod::V0Datas const& fullV0s, aod::CascDataExt const& Cascades, StrHadronDaughterTracks const& tracks)
769769
{
770770

771771
// Event Counter: before event selection
@@ -779,7 +779,7 @@ struct strangeness_in_jets {
779779
registryData.fill(HIST("number_of_events_data"), 1.5);
780780

781781
// Cut on z-vertex
782-
if (std::abs(collision.posZ()) > zVtx)
782+
if (TMath::Abs(collision.posZ()) > zVtx)
783783
return;
784784

785785
// Event Counter: after z-vertex cut
@@ -847,7 +847,7 @@ struct strangeness_in_jets {
847847
int n_jets_selected(0);
848848
for (int i = 0; i < static_cast<int>(jet.size()); i++) {
849849

850-
if ((std::abs(jet[i].Eta()) + Rjet) > etaMax)
850+
if ((TMath::Abs(jet[i].Eta()) + Rjet) > etaMax)
851851
continue;
852852

853853
// Perpendicular cones
@@ -954,8 +954,8 @@ struct strangeness_in_jets {
954954
if (particle_of_interest == option::vzeros) {
955955
for (auto& v0 : fullV0s) {
956956

957-
const auto& pos = v0.posTrack_as<FullTracks>();
958-
const auto& neg = v0.negTrack_as<FullTracks>();
957+
const auto& pos = v0.posTrack_as<StrHadronDaughterTracks>();
958+
const auto& neg = v0.negTrack_as<StrHadronDaughterTracks>();
959959
TVector3 v0dir(v0.px(), v0.py(), v0.pz());
960960

961961
float deltaEta_jet = v0dir.Eta() - jet[i].Eta();
@@ -1002,9 +1002,9 @@ struct strangeness_in_jets {
10021002
if (particle_of_interest == option::cascades) {
10031003
for (auto& casc : Cascades) {
10041004

1005-
auto bach = casc.bachelor_as<FullTracks>();
1006-
auto pos = casc.posTrack_as<FullTracks>();
1007-
auto neg = casc.negTrack_as<FullTracks>();
1005+
auto bach = casc.bachelor_as<StrHadronDaughterTracks>();
1006+
auto pos = casc.posTrack_as<StrHadronDaughterTracks>();
1007+
auto neg = casc.negTrack_as<StrHadronDaughterTracks>();
10081008

10091009
TVector3 cascade_dir(casc.px(), casc.py(), casc.pz());
10101010
float deltaEta_jet = cascade_dir.Eta() - jet[i].Eta();
@@ -1139,6 +1139,95 @@ struct strangeness_in_jets {
11391139
}
11401140
PROCESS_SWITCH(strangeness_in_jets, processData, "Process data", true);
11411141

1142+
void processK0s(SelCollisions::iterator const& collision, aod::V0Datas const& fullV0s, StrHadronDaughterTracks const&)
1143+
{
1144+
registryData.fill(HIST("number_of_events_data"), 10.5);
1145+
if (!collision.sel8())
1146+
return;
1147+
registryData.fill(HIST("number_of_events_data"), 11.5);
1148+
if (TMath::Abs(collision.posZ()) > zVtx)
1149+
return;
1150+
registryData.fill(HIST("number_of_events_data"), 12.5);
1151+
1152+
for (auto& v0 : fullV0s) {
1153+
const auto& ptrack = v0.posTrack_as<StrHadronDaughterTracks>();
1154+
const auto& ntrack = v0.negTrack_as<StrHadronDaughterTracks>();
1155+
1156+
registryQC.fill(HIST("survivedK0"), 0.5);
1157+
1158+
// Single-Track Selections
1159+
if (!passedSingleTrackSelection(ptrack))
1160+
continue;
1161+
registryQC.fill(HIST("survivedK0"), 1.5);
1162+
1163+
if (!passedSingleTrackSelection(ntrack))
1164+
continue;
1165+
registryQC.fill(HIST("survivedK0"), 2.5);
1166+
1167+
// Momentum K0s Daughters
1168+
TVector3 pion_pos(v0.pxpos(), v0.pypos(), v0.pzpos());
1169+
TVector3 pion_neg(v0.pxneg(), v0.pyneg(), v0.pzneg());
1170+
1171+
if (pion_pos.Pt() < ptMin_K0_pion)
1172+
continue;
1173+
registryQC.fill(HIST("survivedK0"), 3.5);
1174+
1175+
if (pion_pos.Pt() > ptMax_K0_pion)
1176+
continue;
1177+
registryQC.fill(HIST("survivedK0"), 4.5);
1178+
1179+
if (pion_neg.Pt() < ptMin_K0_pion)
1180+
continue;
1181+
registryQC.fill(HIST("survivedK0"), 5.5);
1182+
1183+
if (pion_neg.Pt() > ptMax_K0_pion)
1184+
continue;
1185+
registryQC.fill(HIST("survivedK0"), 6.5);
1186+
1187+
// V0 Selections
1188+
if (v0.v0cosPA() < v0cospaMin)
1189+
continue;
1190+
registryQC.fill(HIST("survivedK0"), 7.5);
1191+
1192+
if (v0.v0radius() < minimumV0Radius || v0.v0radius() > maximumV0Radius)
1193+
continue;
1194+
registryQC.fill(HIST("survivedK0"), 8.5);
1195+
1196+
if (v0.dcaV0daughters() > dcaV0DaughtersMax)
1197+
continue;
1198+
registryQC.fill(HIST("survivedK0"), 9.5);
1199+
1200+
if (TMath::Abs(v0.dcapostopv()) < dcapostoPVmin)
1201+
continue;
1202+
registryQC.fill(HIST("survivedK0"), 10.5);
1203+
1204+
if (TMath::Abs(v0.dcanegtopv()) < dcanegtoPVmin)
1205+
continue;
1206+
registryQC.fill(HIST("survivedK0"), 11.5);
1207+
1208+
// PID Selections (TPC)
1209+
if (ptrack.tpcNSigmaPi() < nsigmaTPCmin || ptrack.tpcNSigmaPi() > nsigmaTPCmax)
1210+
continue;
1211+
registryQC.fill(HIST("survivedK0"), 12.5);
1212+
1213+
if (ntrack.tpcNSigmaPi() < nsigmaTPCmin || ntrack.tpcNSigmaPi() > nsigmaTPCmax)
1214+
continue;
1215+
registryQC.fill(HIST("survivedK0"), 13.5);
1216+
1217+
// PID Selections (TOF)
1218+
if (requireTOF) {
1219+
if (ptrack.tofNSigmaPi() < nsigmaTOFmin || ptrack.tofNSigmaPi() > nsigmaTOFmax)
1220+
continue;
1221+
registryQC.fill(HIST("survivedK0"), 14.5);
1222+
1223+
if (ntrack.tofNSigmaPi() < nsigmaTOFmin || ntrack.tofNSigmaPi() > nsigmaTOFmax)
1224+
continue;
1225+
registryQC.fill(HIST("survivedK0"), 15.5);
1226+
}
1227+
}
1228+
}
1229+
PROCESS_SWITCH(strangeness_in_jets, processK0s, "Process K0s", false);
1230+
11421231
Preslice<aod::V0Datas> perCollisionV0 = o2::aod::v0data::collisionId;
11431232
Preslice<aod::CascDataExt> perCollisionCasc = o2::aod::cascade::collisionId;
11441233
Preslice<aod::McParticles> perMCCollision = o2::aod::mcparticle::mcCollisionId;
@@ -1152,7 +1241,7 @@ struct strangeness_in_jets {
11521241
continue;
11531242

11541243
registryMC.fill(HIST("number_of_events_mc"), 1.5);
1155-
if (std::abs(collision.posZ()) > 10.0)
1244+
if (TMath::Abs(collision.posZ()) > 10.0)
11561245
continue;
11571246

11581247
registryMC.fill(HIST("number_of_events_mc"), 2.5);
@@ -1244,7 +1333,7 @@ struct strangeness_in_jets {
12441333
for (auto& particleMotherOfBach : bachParticle.mothers_as<aod::McParticles>()) {
12451334
if (particleMotherOfNeg != particleMotherOfPos)
12461335
continue;
1247-
if (abs(particleMotherOfNeg.pdgCode()) != 3122)
1336+
if (TMath::Abs(particleMotherOfNeg.pdgCode()) != 3122)
12481337
continue;
12491338
if (!particleMotherOfBach.isPhysicalPrimary())
12501339
continue;
@@ -1284,7 +1373,7 @@ struct strangeness_in_jets {
12841373
continue;
12851374

12861375
const auto particle = track.mcParticle();
1287-
if (abs(particle.pdgCode()) != 211)
1376+
if (TMath::Abs(particle.pdgCode()) != 211)
12881377
continue;
12891378

12901379
if (particle.isPhysicalPrimary()) {
@@ -1387,7 +1476,7 @@ struct strangeness_in_jets {
13871476
registryMC.fill(HIST("number_of_events_mc"), 3.5);
13881477

13891478
// Selection on z_{vertex}
1390-
if (std::abs(mccollision.posZ()) > 10)
1479+
if (TMath::Abs(mccollision.posZ()) > 10)
13911480
continue;
13921481
registryMC.fill(HIST("number_of_events_mc"), 4.5);
13931482

@@ -1399,7 +1488,7 @@ struct strangeness_in_jets {
13991488

14001489
for (auto& particle : mcParticles_per_coll) {
14011490

1402-
int pdg = abs(particle.pdgCode());
1491+
int pdg = TMath::Abs(particle.pdgCode());
14031492

14041493
if (particle.isPhysicalPrimary() && pdg == 211) {
14051494
registryMC.fill(HIST("Pion_eta_pt_pythia"), particle.pt(), particle.eta());
@@ -1422,14 +1511,14 @@ struct strangeness_in_jets {
14221511
double dy = particle.vy() - mccollision.posY();
14231512
double dz = particle.vz() - mccollision.posZ();
14241513
double dcaxy = sqrt(dx * dx + dy * dy);
1425-
double dcaz = std::abs(dz);
1514+
double dcaz = TMath::Abs(dz);
1515+
if (particle.pt() < 0.15)
1516+
continue;
14261517
if (dcaxy > (par0 + par1 / particle.pt()))
14271518
continue;
14281519
if (dcaz > (par0 + par1 / particle.pt()))
14291520
continue;
1430-
if (std::abs(particle.eta()) > 0.8)
1431-
continue;
1432-
if (particle.pt() < 0.15)
1521+
if (TMath::Abs(particle.eta()) > 0.8)
14331522
continue;
14341523

14351524
// PDG Selection
@@ -1489,7 +1578,7 @@ struct strangeness_in_jets {
14891578
int n_jets_selected(0);
14901579
for (int i = 0; i < static_cast<int>(jet.size()); i++) {
14911580

1492-
if ((std::abs(jet[i].Eta()) + Rjet) > etaMax)
1581+
if ((TMath::Abs(jet[i].Eta()) + Rjet) > etaMax)
14931582
continue;
14941583

14951584
// Perpendicular cones
@@ -1512,19 +1601,18 @@ struct strangeness_in_jets {
15121601
double dy = particle.vy() - mccollision.posY();
15131602
double dz = particle.vz() - mccollision.posZ();
15141603
double dcaxy = sqrt(dx * dx + dy * dy);
1515-
double dcaz = std::abs(dz);
1516-
1604+
double dcaz = TMath::Abs(dz);
1605+
if (particle.pt() < 0.15)
1606+
continue;
15171607
if (dcaxy > (par0 + par1 / particle.pt()))
15181608
continue;
15191609
if (dcaz > (par0 + par1 / particle.pt()))
15201610
continue;
1521-
if (std::abs(particle.eta()) > 0.8)
1522-
continue;
1523-
if (particle.pt() < 0.15)
1611+
if (TMath::Abs(particle.eta()) > 0.8)
15241612
continue;
15251613

15261614
// PDG Selection
1527-
int pdg = abs(particle.pdgCode());
1615+
int pdg = TMath::Abs(particle.pdgCode());
15281616
if ((pdg != 11) && (pdg != 211) && (pdg != 321) && (pdg != 2212))
15291617
continue;
15301618

@@ -1585,7 +1673,7 @@ struct strangeness_in_jets {
15851673
double deltaPhi_ue2 = GetDeltaPhi(particle_dir.Phi(), ue2[i].Phi());
15861674
double deltaR_ue2 = sqrt(deltaEta_ue2 * deltaEta_ue2 + deltaPhi_ue2 * deltaPhi_ue2);
15871675

1588-
int pdg = abs(particle.pdgCode());
1676+
int pdg = TMath::Abs(particle.pdgCode());
15891677

15901678
if (pdg == 211) {
15911679
if (deltaR_jet < Rjet) {

0 commit comments

Comments
 (0)