Skip to content

Commit 6fde3b0

Browse files
committed
Added histograms for primary particles
1 parent 37874de commit 6fde3b0

File tree

1 file changed

+61
-35
lines changed

1 file changed

+61
-35
lines changed

PWGLF/Tasks/Resonances/chk892pp.cxx

Lines changed: 61 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ struct Chk892pp {
191191

192192
/// PID Selections, pion
193193
struct : ConfigurableGroup {
194-
Configurable<bool> cfgTPConly{"cfgTPConly", true, "Use only TPC for PID"}; // bool
194+
Configurable<bool> cfgTPConly{"cfgTPConly", true, "Use only TPC for PID"}; // bool
195195
Configurable<float> cfgMaxTPCnSigmaPion{"cfgMaxTPCnSigmaPion", 5.0, "TPC nSigma cut for Pion"}; // TPC
196196
Configurable<float> cfgMaxTOFnSigmaPion{"cfgMaxTOFnSigmaPion", 5.0, "TOF nSigma cut for Pion"}; // TOF
197197
Configurable<float> cfgNsigmaCutCombinedPion{"cfgNsigmaCutCombinedPion", -999, "Combined nSigma cut for Pion"}; // Combined
@@ -444,10 +444,13 @@ struct Chk892pp {
444444
histos.add("EffK0s/recoK0s", "Reco K0s (|y<0.8|)", HistType::kTH2F, {ptAxis, centAxis});
445445

446446
histos.add("EffKstar/genKstar", "Gen Kstar (|y|<0.5)", HistType::kTH2F, {ptAxis, centAxis});
447+
histos.add("EffKstar/genKstar_pri", "Gen primary Kstar (|y|<0.5)", HistType::kTH2F, {ptAxis, centAxis});
447448
histos.add("EffKstar/recoKstar", "Kstar Reco matched (final all)", HistType::kTH2F, {ptAxis, centAxis});
448449

449450
histos.add("Correction/sigLoss_den", "Gen Kstar (|y|<0.5) in truth class", HistType::kTH2F, {ptAxis, centAxis});
451+
histos.add("Correction/sigLoss_den_pri", "Gen primary Kstar (|y|<0.5) in truth class", HistType::kTH2F, {ptAxis, centAxis});
450452
histos.add("Correction/sigLoss_num", "Gen Kstar (|y|<0.5, selected events) in reco class", HistType::kTH2F, {ptAxis, centAxis});
453+
histos.add("Correction/sigLoss_num_pri", "Gen primary Kstar (|y|<0.5, selected events) in reco class", HistType::kTH2F, {ptAxis, centAxis});
451454
histos.add("Correction/EF_den", "Gen events (truth class)", HistType::kTH1F, {centAxis});
452455
histos.add("Correction/EF_num", "Reco events (selected events)", HistType::kTH1F, {centAxis});
453456
histos.add("Correction/MCTruthCent_all", "MC truth FT0M centrality (all mcCollisions)", HistType::kTH1F, {centAxis});
@@ -543,8 +546,8 @@ struct Chk892pp {
543546
if (std::abs(track.dcaXY()) > TrackCuts.cfgMaxbDCArToPVcut)
544547
return false;
545548
}
546-
if (TrackCuts.cfgpTdepDCAzCut) {
547-
// Tuned on the LHC22f anchored MC LHC23d1d on primary pions. 7 Sigmas of the resolution
549+
if (TrackCuts.cfgpTdepDCAzCut) {
550+
// Tuned on the LHC22f anchored MC LHC23d1d on primary pions. 7 Sigmas of the resolution
548551
if (std::abs(track.dcaZ()) > (0.004 + (0.013 / track.pt())))
549552
return false;
550553
} else {
@@ -911,6 +914,7 @@ struct Chk892pp {
911914
return true;
912915
} // matchRecoToTruthKstar
913916

917+
914918
void effKstarProcessGen(MCTrueTrackCandidates const& mcparts)
915919
{
916920
for (const auto& part : mcparts) {
@@ -921,37 +925,44 @@ struct Chk892pp {
921925
if (std::abs(part.y()) > KstarCuts.cfgKstarMaxRap)
922926
continue;
923927

924-
const int pionWanted = (part.pdgCode() > 0) ? +kPiPlus : -kPiPlus;
925-
bool hasRightPion = false;
926-
bool hasK0sToPipi = false;
927-
928-
for (const auto& d1 : part.template daughters_as<MCTrueTrackCandidates>()) {
929-
const int pdg1 = d1.pdgCode();
930-
if (pdg1 == pionWanted) {
931-
hasRightPion = true;
932-
} else if (std::abs(pdg1) == kPDGK0) {
933-
for (const auto& d2 : d1.template daughters_as<MCTrueTrackCandidates>()) {
934-
if (std::abs(d2.pdgCode()) == kPDGK0s) {
935-
bool seenPip = false, seenPim = false;
936-
for (const auto& d3 : d2.template daughters_as<MCTrueTrackCandidates>()) {
937-
if (d3.pdgCode() == +kPiPlus)
938-
seenPip = true;
939-
else if (d3.pdgCode() == -kPiPlus)
940-
seenPim = true;
941-
}
942-
if (seenPip && seenPim) {
943-
hasK0sToPipi = true;
944-
break;
945-
}
946-
}
947-
}
948-
}
949-
if (hasRightPion && hasK0sToPipi)
950-
break;
951-
}
952928

953-
if (!(hasRightPion && hasK0sToPipi))
954-
continue;
929+
const int pionWanted = (part.pdgCode() > 0) ? +kPiPlus : -kPiPlus;
930+
bool hasRightPion = false;
931+
bool hasK0sToPipi = false;
932+
933+
for (const auto& d1 : part.template daughters_as<MCTrueTrackCandidates>()) {
934+
const int pdg1 = d1.pdgCode();
935+
if (pdg1 == pionWanted)
936+
{
937+
hasRightPion = true;
938+
} else if (std::abs(pdg1) == kPDGK0)
939+
{
940+
for (const auto& d2 : d1.template daughters_as<MCTrueTrackCandidates>())
941+
{
942+
if (std::abs(d2.pdgCode()) == kPDGK0s)
943+
{
944+
bool seenPip = false, seenPim = false;
945+
for (const auto& d3 : d2.template daughters_as<MCTrueTrackCandidates>())
946+
{
947+
if (d3.pdgCode() == +kPiPlus)
948+
seenPip = true;
949+
else if (d3.pdgCode() == -kPiPlus)
950+
seenPim = true;
951+
}
952+
if (seenPip && seenPim)
953+
{
954+
hasK0sToPipi = true;
955+
break;
956+
}
957+
}
958+
}
959+
}
960+
if (hasRightPion && hasK0sToPipi) break;
961+
}
962+
963+
if (!(hasRightPion && hasK0sToPipi))
964+
continue;
965+
955966

956967
const auto mcid = part.mcCollisionId();
957968
if (allowedMcIds.count(mcid) == 0)
@@ -962,10 +973,15 @@ struct Chk892pp {
962973
continue;
963974

964975
const float lCentrality = iter->second;
965-
976+
966977
histos.fill(HIST("EffKstar/genKstar"), part.pt(), lCentrality);
978+
979+
if (part.vt() == 0)
980+
{
981+
histos.fill(HIST("EffKstar/genKstar_pri"), part.pt(), lCentrality);
982+
}
967983
}
968-
} // effKstarProcessGen
984+
} //effKstarProcessGen
969985

970986
template <typename V0RangeT, typename TrkRangeT>
971987
void effKstarProcessReco(V0RangeT const& v0s, TrkRangeT const& tracks)
@@ -1052,6 +1068,11 @@ struct Chk892pp {
10521068
const float lCentrality = iter->second;
10531069

10541070
histos.fill(HIST("Correction/sigLoss_num"), part.pt(), lCentrality);
1071+
if (part.vt() == 0)
1072+
{
1073+
histos.fill(HIST("Correction/sigLoss_num_pri"), part.pt(), lCentrality);
1074+
}
1075+
10551076
}
10561077
} // fillSigLossNum
10571078

@@ -1076,6 +1097,11 @@ struct Chk892pp {
10761097
const float lCentrality = iter->second;
10771098

10781099
histos.fill(HIST("Correction/sigLoss_den"), part.pt(), lCentrality);
1100+
if (part.vt() == 0)
1101+
{
1102+
histos.fill(HIST("Correction/sigLoss_den_pri"), part.pt(), lCentrality);
1103+
}
1104+
10791105
}
10801106
} // fillSigLossDen
10811107

0 commit comments

Comments
 (0)