Skip to content

Commit ec92790

Browse files
committed
Added histograms to fill when conducting primary selection
1 parent 37874de commit ec92790

File tree

1 file changed

+109
-41
lines changed

1 file changed

+109
-41
lines changed

PWGLF/Tasks/Resonances/chk892pp.cxx

Lines changed: 109 additions & 41 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
@@ -275,6 +275,7 @@ struct Chk892pp {
275275
int kPDGK0 = kK0;
276276
int kKstarPlus = o2::constants::physics::Pdg::kKPlusStar892;
277277
// int kPiPlus = 211;
278+
double fMaxPosPV = 1e-2;
278279

279280
void init(o2::framework::InitContext&)
280281
{
@@ -444,10 +445,16 @@ struct Chk892pp {
444445
histos.add("EffK0s/recoK0s", "Reco K0s (|y<0.8|)", HistType::kTH2F, {ptAxis, centAxis});
445446

446447
histos.add("EffKstar/genKstar", "Gen Kstar (|y|<0.5)", HistType::kTH2F, {ptAxis, centAxis});
448+
histos.add("EffKstar/genKstar_pri", "Gen primary Kstar (|y|<0.5)", HistType::kTH2F, {ptAxis, centAxis});
449+
histos.add("EffKstar/genKstar_pri_pos", "Gen primary Kstar selected by vertex position (|y|<0.5)", HistType::kTH2F, {ptAxis, centAxis});
447450
histos.add("EffKstar/recoKstar", "Kstar Reco matched (final all)", HistType::kTH2F, {ptAxis, centAxis});
448451

449452
histos.add("Correction/sigLoss_den", "Gen Kstar (|y|<0.5) in truth class", HistType::kTH2F, {ptAxis, centAxis});
453+
histos.add("Correction/sigLoss_den_pri", "Gen primary Kstar (|y|<0.5) in truth class", HistType::kTH2F, {ptAxis, centAxis});
454+
histos.add("Correction/sigLoss_den_pri_pos", "Gen primary Kstar selected by vertex position (|y|<0.5) in truth class", HistType::kTH2F, {ptAxis, centAxis});
450455
histos.add("Correction/sigLoss_num", "Gen Kstar (|y|<0.5, selected events) in reco class", HistType::kTH2F, {ptAxis, centAxis});
456+
histos.add("Correction/sigLoss_num_pri", "Gen primary Kstar (|y|<0.5, selected events) in reco class", HistType::kTH2F, {ptAxis, centAxis});
457+
histos.add("Correction/sigLoss_num_pri_pos", "Gen primary Kstar selected by vertex position (|y|<0.5, selected events) in reco class", HistType::kTH2F, {ptAxis, centAxis});
451458
histos.add("Correction/EF_den", "Gen events (truth class)", HistType::kTH1F, {centAxis});
452459
histos.add("Correction/EF_num", "Reco events (selected events)", HistType::kTH1F, {centAxis});
453460
histos.add("Correction/MCTruthCent_all", "MC truth FT0M centrality (all mcCollisions)", HistType::kTH1F, {centAxis});
@@ -543,8 +550,8 @@ struct Chk892pp {
543550
if (std::abs(track.dcaXY()) > TrackCuts.cfgMaxbDCArToPVcut)
544551
return false;
545552
}
546-
if (TrackCuts.cfgpTdepDCAzCut) {
547-
// Tuned on the LHC22f anchored MC LHC23d1d on primary pions. 7 Sigmas of the resolution
553+
if (TrackCuts.cfgpTdepDCAzCut) {
554+
// Tuned on the LHC22f anchored MC LHC23d1d on primary pions. 7 Sigmas of the resolution
548555
if (std::abs(track.dcaZ()) > (0.004 + (0.013 / track.pt())))
549556
return false;
550557
} else {
@@ -911,7 +918,8 @@ struct Chk892pp {
911918
return true;
912919
} // matchRecoToTruthKstar
913920

914-
void effKstarProcessGen(MCTrueTrackCandidates const& mcparts)
921+
922+
void effKstarProcessGen(soa::Join<MCTrueEventCandidates, aod::McCentFT0Ms> const&, MCTrueTrackCandidates const& mcparts)
915923
{
916924
for (const auto& part : mcparts) {
917925
if (!part.has_mcCollision())
@@ -921,37 +929,44 @@ struct Chk892pp {
921929
if (std::abs(part.y()) > KstarCuts.cfgKstarMaxRap)
922930
continue;
923931

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-
}
952932

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

956971
const auto mcid = part.mcCollisionId();
957972
if (allowedMcIds.count(mcid) == 0)
@@ -962,10 +977,28 @@ struct Chk892pp {
962977
continue;
963978

964979
const float lCentrality = iter->second;
965-
980+
966981
histos.fill(HIST("EffKstar/genKstar"), part.pt(), lCentrality);
982+
983+
if (part.vt() == 0)
984+
{
985+
histos.fill(HIST("EffKstar/genKstar_pri"), part.pt(), lCentrality);
986+
}
987+
988+
const auto mcc = part.mcCollision_as<soa::Join<MCTrueEventCandidates, aod::McCentFT0Ms>>();
989+
990+
const float dx = part.vx() - mcc.posX();
991+
const float dy = part.vy() - mcc.posY();
992+
const float dz = part.vz() - mcc.posZ();
993+
994+
const float distanceFromPV = std::sqrt(dx*dx + dy*dy + dz*dz);
995+
996+
if (distanceFromPV < fMaxPosPV)
997+
{
998+
histos.fill(HIST("EffKstar/genKstar_pri_pos"), part.pt(), lCentrality);
999+
}
9671000
}
968-
} // effKstarProcessGen
1001+
} //effKstarProcessGen
9691002

9701003
template <typename V0RangeT, typename TrkRangeT>
9711004
void effKstarProcessReco(V0RangeT const& v0s, TrkRangeT const& tracks)
@@ -1031,7 +1064,7 @@ struct Chk892pp {
10311064
}
10321065
} // effKstarProcessReco
10331066

1034-
void fillSigLossNum(MCTrueTrackCandidates const& mcparts)
1067+
void fillSigLossNum(soa::Join<MCTrueEventCandidates, aod::McCentFT0Ms> const&, MCTrueTrackCandidates const& mcparts)
10351068
{
10361069
for (auto const& part : mcparts) {
10371070
if (!part.has_mcCollision())
@@ -1052,10 +1085,27 @@ struct Chk892pp {
10521085
const float lCentrality = iter->second;
10531086

10541087
histos.fill(HIST("Correction/sigLoss_num"), part.pt(), lCentrality);
1088+
if (part.vt() == 0)
1089+
{
1090+
histos.fill(HIST("Correction/sigLoss_num_pri"), part.pt(), lCentrality);
1091+
}
1092+
1093+
const auto mcc = part.mcCollision_as<soa::Join<MCTrueEventCandidates, aod::McCentFT0Ms>>();
1094+
1095+
const float dx = part.vx() - mcc.posX();
1096+
const float dy = part.vy() - mcc.posY();
1097+
const float dz = part.vz() - mcc.posZ();
1098+
1099+
const float distanceFromPV = std::sqrt(dx*dx + dy*dy + dz*dz);
1100+
1101+
if (distanceFromPV < fMaxPosPV)
1102+
{
1103+
histos.fill(HIST("Correction/sigLoss_num_pri_pos"), part.pt(), lCentrality);
1104+
}
10551105
}
10561106
} // fillSigLossNum
10571107

1058-
void fillSigLossDen(MCTrueTrackCandidates const& mcparts)
1108+
void fillSigLossDen(soa::Join<MCTrueEventCandidates, aod::McCentFT0Ms> const&, MCTrueTrackCandidates const& mcparts)
10591109
{
10601110
for (auto const& part : mcparts) {
10611111
if (!part.has_mcCollision())
@@ -1076,6 +1126,24 @@ struct Chk892pp {
10761126
const float lCentrality = iter->second;
10771127

10781128
histos.fill(HIST("Correction/sigLoss_den"), part.pt(), lCentrality);
1129+
if (part.vt() == 0)
1130+
{
1131+
histos.fill(HIST("Correction/sigLoss_den_pri"), part.pt(), lCentrality);
1132+
}
1133+
1134+
const auto mcc = part.mcCollision_as<soa::Join<MCTrueEventCandidates, aod::McCentFT0Ms>>();
1135+
1136+
const float dx = part.vx() - mcc.posX();
1137+
const float dy = part.vy() - mcc.posY();
1138+
const float dz = part.vz() - mcc.posZ();
1139+
1140+
const float distanceFromPV = std::sqrt(dx*dx + dy*dy + dz*dz);
1141+
1142+
if (distanceFromPV < fMaxPosPV)
1143+
{
1144+
histos.fill(HIST("Correction/sigLoss_den_pri_pos"), part.pt(), lCentrality);
1145+
}
1146+
10791147
}
10801148
} // fillSigLossDen
10811149

@@ -1338,10 +1406,10 @@ struct Chk892pp {
13381406
buildReferenceMcIds(mccolls, mcpart);
13391407
effK0sProcessGen(mcpart);
13401408
effK0sProcessReco(v0s);
1341-
effKstarProcessGen(mcpart);
1409+
effKstarProcessGen(mccolls, mcpart);
13421410
effKstarProcessReco(v0s, tracks);
1343-
fillSigLossNum(mcpart);
1344-
fillSigLossDen(mcpart);
1411+
fillSigLossNum(mccolls, mcpart);
1412+
fillSigLossDen(mccolls, mcpart);
13451413

13461414
for (const auto& mcid : refClassIds) {
13471415
histos.fill(HIST("Correction/EF_den"), refCentByMcId[mcid]);

0 commit comments

Comments
 (0)