Skip to content

Commit a1f7a10

Browse files
authored
[PWGLF] Added hasTOF condition and optimised code (#14305)
1 parent c696d9c commit a1f7a10

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

PWGLF/Tasks/Resonances/kstarqa.cxx

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ struct Kstarqa {
113113
Configurable<float> cfgITSChi2NCl{"cfgITSChi2NCl", 36.0, "ITS Chi2/NCl"};
114114
Configurable<float> cfgTPCChi2NClMax{"cfgTPCChi2NClMax", 4.0, "TPC Chi2/NCl"};
115115
Configurable<float> cfgTPCChi2NClMin{"cfgTPCChi2NClMin", 0.0, "TPC Chi2/NCl"};
116+
Configurable<bool> hasITS{"hasITS", true, "Required ITS"};
116117
Configurable<bool> isITSTPCRefit{"isITSTPCRefit", false, "Require ITS Refit"};
117118
Configurable<bool> isVertexITSTPC{"isVertexITSTPC", false, "Vertex ITS TPC"};
118119
Configurable<bool> isVertexTOFMatched{"isVertexTOFMatched", false, "Vertex TOF Matched"};
@@ -551,6 +552,8 @@ struct Kstarqa {
551552
return false;
552553
if (selectionConfig.cfgPVContributor && !candidate.isPVContributor())
553554
return false;
555+
if (selectionConfig.hasITS && !candidate.hasITS())
556+
return false;
554557
if (selectionConfig.isITSTPCRefit && (!(o2::aod::track::ITSrefit) || !(o2::aod::track::TPCrefit)))
555558
return false;
556559
} else if (!selectionConfig.isGlobalTracks) {
@@ -2135,7 +2138,9 @@ struct Kstarqa {
21352138
hInvMass.fill(HIST("h1RecMult"), multiplicity);
21362139
hInvMass.fill(HIST("h1RecMult2"), multiplicityRec);
21372140

2138-
hInvMass.fill(HIST("h1RecMult"), multiplicity);
2141+
if (cQAevents) {
2142+
rEventSelection.fill(HIST("hVertexZRec"), collision.posZ());
2143+
}
21392144

21402145
auto oldindex = -999;
21412146
for (const auto& track1 : tracks) {
@@ -2147,6 +2152,11 @@ struct Kstarqa {
21472152
continue;
21482153
}
21492154

2155+
if (cQAevents) {
2156+
rEventSelection.fill(HIST("hDcaxy_cent_pt"), track1.dcaXY(), multiplicity, track1.pt());
2157+
rEventSelection.fill(HIST("hDcaz_cent_pt"), track1.dcaZ(), multiplicity, track1.pt());
2158+
}
2159+
21502160
auto track1ID = track1.index();
21512161
for (const auto& track2 : tracks) {
21522162
rEventSelection.fill(HIST("recMCparticles"), 0.5);
@@ -2188,13 +2198,13 @@ struct Kstarqa {
21882198
hPID.fill(HIST("Before/hNsigmaTPC_Ka_before"), track2.pt(), track2.tpcNSigmaKa());
21892199
hPID.fill(HIST("Before/hNsigmaTOF_Ka_before"), track2.pt(), track2.tofNSigmaKa());
21902200
}
2191-
if (cQAplots && (mctrack2.pdgCode() == -PDG_t::kPiMinus)) { // negative track pion
2201+
if (cQAplots && (mctrack2.pdgCode() == PDG_t::kPiMinus)) { // negative track pion
21922202
hPID.fill(HIST("Before/h1PID_TPC_neg_pion"), track2.tpcNSigmaPi());
21932203
hPID.fill(HIST("Before/h1PID_TOF_neg_pion"), track2.tofNSigmaPi());
21942204
hPID.fill(HIST("Before/hNsigmaTPC_Pi_before"), track2.pt(), track2.tpcNSigmaPi());
21952205
hPID.fill(HIST("Before/hNsigmaTOF_Pi_before"), track2.pt(), track2.tofNSigmaPi());
21962206
}
2197-
if (cQAplots && (mctrack2.pdgCode() == -PDG_t::kKMinus)) { // negative track kaon
2207+
if (cQAplots && (mctrack2.pdgCode() == PDG_t::kKMinus)) { // negative track kaon
21982208
hPID.fill(HIST("Before/h1PID_TPC_neg_kaon"), track2.tpcNSigmaKa());
21992209
hPID.fill(HIST("Before/h1PID_TOF_neg_kaon"), track2.tofNSigmaKa());
22002210
hPID.fill(HIST("Before/hNsigmaTPC_Ka_before"), track2.pt(), track2.tpcNSigmaKa());
@@ -2203,6 +2213,10 @@ struct Kstarqa {
22032213
if (cQAplots && (std::abs(mctrack1.pdgCode()) == PDG_t::kKPlus && std::abs(mctrack2.pdgCode()) == PDG_t::kPiPlus)) {
22042214
hPID.fill(HIST("Before/hNsigma_TPC_TOF_Ka_before"), track1.tpcNSigmaKa(), track1.tofNSigmaKa());
22052215
hPID.fill(HIST("Before/hNsigma_TPC_TOF_Pi_before"), track2.tpcNSigmaPi(), track2.tofNSigmaPi());
2216+
hPID.fill(HIST("Before/hTPCnsigKa_mult_pt"), track1.tpcNSigmaKa(), multiplicity, track1.pt());
2217+
hPID.fill(HIST("Before/hTPCnsigPi_mult_pt"), track2.tpcNSigmaPi(), multiplicity, track2.pt());
2218+
hPID.fill(HIST("Before/hTOFnsigKa_mult_pt"), track1.tofNSigmaKa(), multiplicity, track1.pt());
2219+
hPID.fill(HIST("Before/hTOFnsigPi_mult_pt"), track2.tofNSigmaPi(), multiplicity, track2.pt());
22062220
}
22072221

22082222
if (!mctrack1.isPhysicalPrimary()) {

0 commit comments

Comments
 (0)