Skip to content

Commit c382d50

Browse files
committed
Process function for Phi-K0S(Pion) 2D without weight in data
1 parent 0e79550 commit c382d50

File tree

1 file changed

+116
-0
lines changed

1 file changed

+116
-0
lines changed

PWGLF/Tasks/Strangeness/phik0shortanalysis.cxx

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2188,6 +2188,122 @@ struct Phik0shortanalysis {
21882188
}
21892189

21902190
PROCESS_SWITCH(Phik0shortanalysis, processPhiPionMCGen, "Process function for Phi-Pion Correlations Efficiency correction in MCGen", false);
2191+
2192+
void processPhiK0SPionData2D(SelCollisions::iterator const& collision, FullTracks const& fullTracks, FullV0s const& V0s, V0DauTracks const&)
2193+
{
2194+
// Check if the event selection is passed
2195+
if (!acceptEventQA<false>(collision, true))
2196+
return;
2197+
2198+
float multiplicity = collision.centFT0M();
2199+
dataEventHist.fill(HIST("hMultiplicityPercent"), multiplicity);
2200+
2201+
// Defining positive and negative tracks for phi reconstruction
2202+
auto posThisColl = posTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache);
2203+
auto negThisColl = negTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache);
2204+
2205+
bool isCountedPhi = false;
2206+
bool isFilledhV0 = false;
2207+
2208+
double weight{1.0};
2209+
2210+
// Loop over all positive tracks
2211+
for (const auto& track1 : posThisColl) {
2212+
if (!selectionTrackResonance<false>(track1, true) || !selectionPIDKaonpTdependent(track1))
2213+
continue; // topological and PID selection
2214+
2215+
dataPhiHist.fill(HIST("hEta"), track1.eta());
2216+
dataPhiHist.fill(HIST("hNsigmaKaonTPC"), track1.tpcInnerParam(), track1.tpcNSigmaKa());
2217+
dataPhiHist.fill(HIST("hNsigmaKaonTOF"), track1.tpcInnerParam(), track1.tofNSigmaKa());
2218+
2219+
auto track1ID = track1.globalIndex();
2220+
2221+
// Loop over all negative tracks
2222+
for (const auto& track2 : negThisColl) {
2223+
if (!selectionTrackResonance<false>(track2, true) || !selectionPIDKaonpTdependent(track2))
2224+
continue; // topological and PID selection
2225+
2226+
auto track2ID = track2.globalIndex();
2227+
if (track2ID == track1ID)
2228+
continue; // condition to avoid double counting of pair
2229+
2230+
ROOT::Math::PxPyPzMVector recPhi = recMother(track1, track2, massKa, massKa);
2231+
if (recPhi.Pt() < minPhiPt || recPhi.Pt() > maxPhiPt)
2232+
continue;
2233+
if (std::abs(recPhi.Rapidity()) > cfgYAcceptance)
2234+
continue;
2235+
2236+
if (!isCountedPhi) {
2237+
dataEventHist.fill(HIST("hEventSelection"), 4); // at least a Phi candidate in the event
2238+
dataEventHist.fill(HIST("hMultiplicityPercentWithPhi"), multiplicity);
2239+
isCountedPhi = true;
2240+
}
2241+
2242+
if (fillMethodSingleWeight)
2243+
weight *= (1 - getPhiPurity(multiplicity, recPhi));
2244+
2245+
dataPhiHist.fill(HIST("h3PhipurData"), multiplicity, recPhi.Pt(), recPhi.M());
2246+
2247+
// V0 already reconstructed by the builder
2248+
for (const auto& v0 : V0s) {
2249+
const auto& posDaughterTrack = v0.posTrack_as<V0DauTracks>();
2250+
const auto& negDaughterTrack = v0.negTrack_as<V0DauTracks>();
2251+
2252+
// Cut on V0 dynamic columns
2253+
if (!selectionV0(v0, posDaughterTrack, negDaughterTrack))
2254+
continue;
2255+
if (v0Configs.cfgFurtherV0Selection && !furtherSelectionV0(v0, collision))
2256+
continue;
2257+
2258+
if (!isFilledhV0) {
2259+
dataK0SHist.fill(HIST("hDCAV0Daughters"), v0.dcaV0daughters());
2260+
dataK0SHist.fill(HIST("hV0CosPA"), v0.v0cosPA());
2261+
2262+
// Filling the PID of the V0 daughters in the region of the K0 peak
2263+
if (lowMK0S < v0.mK0Short() && v0.mK0Short() < upMK0S) {
2264+
dataK0SHist.fill(HIST("hNSigmaPosPionFromK0S"), posDaughterTrack.tpcInnerParam(), posDaughterTrack.tpcNSigmaPi());
2265+
dataK0SHist.fill(HIST("hNSigmaNegPionFromK0S"), negDaughterTrack.tpcInnerParam(), negDaughterTrack.tpcNSigmaPi());
2266+
}
2267+
}
2268+
2269+
if (std::abs(v0.yK0Short()) > cfgYAcceptance)
2270+
continue;
2271+
2272+
dataPhiK0SHist.fill(HIST("h5PhiK0SData"), 0, multiplicity, v0.pt(), v0.mK0Short(), recPhi.M(), 1.0);
2273+
for (size_t i = 0; i < cfgDeltaYAcceptanceBins->size(); i++) {
2274+
if (std::abs(v0.yK0Short() - recPhi.Rapidity()) > cfgDeltaYAcceptanceBins->at(i))
2275+
continue;
2276+
dataPhiK0SHist.fill(HIST("h5PhiK0SData"), i + 1, multiplicity, v0.pt(), v0.mK0Short(), recPhi.M(), 1.0);
2277+
}
2278+
}
2279+
2280+
isFilledhV0 = true;
2281+
2282+
// Loop over all primary pion candidates
2283+
for (const auto& track : fullTracks) {
2284+
if (!selectionPion<true, false>(track, false))
2285+
continue;
2286+
2287+
if (std::abs(track.rapidity(massPi)) > cfgYAcceptance)
2288+
continue;
2289+
2290+
float nSigmaTOFPi = (track.hasTOF() ? track.tofNSigmaPi() : -999);
2291+
2292+
dataPhiPionHist.fill(HIST("h6PhiPiData"), 0, multiplicity, track.pt(), track.tpcNSigmaPi(), nSigmaTOFPi, recPhi.M(), 1.0);
2293+
for (size_t i = 0; i < cfgDeltaYAcceptanceBins->size(); i++) {
2294+
if (std::abs(track.rapidity(massPi) - recPhi.Rapidity()) > cfgDeltaYAcceptanceBins->at(i))
2295+
continue;
2296+
dataPhiPionHist.fill(HIST("h6PhiPiData"), i + 1, multiplicity, track.pt(), track.tpcNSigmaPi(), nSigmaTOFPi, recPhi.M(), 1.0);
2297+
}
2298+
}
2299+
}
2300+
}
2301+
2302+
weight = 1 - weight;
2303+
dataEventHist.fill(HIST("hEventSelection"), 5, weight); // at least a Phi in the event
2304+
}
2305+
2306+
PROCESS_SWITCH(Phik0shortanalysis, processPhiK0SPionData2D, "Process function for Phi-K0S and Phi-Pion Correlations in Data2D", false);
21912307
};
21922308

21932309
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

0 commit comments

Comments
 (0)