4646#include < cmath>
4747#include < cstddef>
4848#include < cstdlib>
49- #include < iostream>
5049#include < string>
5150#include < utility>
5251#include < vector>
@@ -76,7 +75,6 @@ struct kstarInOO {
7675
7776 // Track Selection
7877 // General
79- Configurable<std::string> cfg_Track_Selections{" cfg_Track_Selections" , " globalTracks" , " set track selections" };
8078 Configurable<double > cfg_Track_MinPt{" cfg_Track_MinPt" , 0.15 , " set track min pT" };
8179 Configurable<double > cfg_Track_MaxEta{" cfg_Track_MaxEta" , 0.9 , " set track max Eta" };
8280 Configurable<double > cfg_Track_MaxDCArToPVcut{" cfg_Track_MaxDCArToPVcut" , 0.5 , " Track DCAr cut to PV Maximum" };
@@ -126,23 +124,27 @@ struct kstarInOO {
126124 const AxisSpec MinvAxis = {cfg_MinvNBins, cfg_MinvMin, cfg_MinvMax};
127125
128126 if (cfg_Event_CutQA) {
129- OOhistos.add (" hPosZ_BC" , " PosZ_Bc " , kTH1F , {{100 , 0.0 , 15.0 }});
130- OOhistos.add (" hPosZ_AC" , " PosZ_AC " , kTH1F , {{100 , 0.0 , 15.0 }});
127+ OOhistos.add (" hPosZ_BC" , " hPosZ_Bc " , kTH1F , {{100 , 0.0 , 15.0 }});
128+ OOhistos.add (" hPosZ_AC" , " hPosZ_AC " , kTH1F , {{100 , 0.0 , 15.0 }});
131129 }
132130
133131 if (cfg_Track_CutQA) {
134- OOhistos.add (" h_rawpT" , " h_rawpT" , kTH1F , {{1000 , 0.0 , 10.0 }});
135- OOhistos.add (" h_rawpT_Kaon" , " h_rawpT_Kaon" , kTH1F , {{1000 , 0.0 , 10.0 }});
136- OOhistos.add (" h_rawpT_Pion" , " h_rawpT_Pion" , kTH1F , {{1000 , 0.0 , 10.0 }});
137- OOhistos.add (" h_eta" , " h_eta" , kTH1F , {axisEta});
138- OOhistos.add (" h_phi" , " h_phi" , kTH1F , {axisPhi});
132+ // OOhistos.add("h_rawpT", "h_rawpT", kTH1F, {{1000, 0.0, 10.0}});
133+ // OOhistos.add("h_rawpT_Kaon", "h_rawpT_Kaon", kTH1F, {{1000, 0.0, 10.0}});
134+ // OOhistos.add("h_rawpT_Pion", "h_rawpT_Pion", kTH1F, {{1000, 0.0, 10.0}});
135+ // OOhistos.add("h_eta", "h_eta", kTH1F, {axisEta});
136+ // OOhistos.add("h_phi", "h_phi", kTH1F, {axisPhi});
139137
140138 OOhistos.add (" QA_nSigma_pion_TPC" , " QA_nSigma_pion_TPC" , {HistType::kTH2F , {PtAxis, PIDAxis}});
141139 OOhistos.add (" QA_nSigma_pion_TOF" , " QA_nSigma_pion_TOF" , {HistType::kTH2F , {PtAxis, PIDAxis}});
142140 OOhistos.add (" QA_pion_TPC_TOF" , " QA_pion_TPC_TOF" , {HistType::kTH2F , {PIDAxis, PIDAxis}});
143- OOhistos.add (" QA_nSigma_kaon_TPC" , " QA_nSigma_kaon_TPC" , {HistType::kTH2F , {PtAxis, PIDAxis}});
144- OOhistos.add (" QA_nSigma_kaon_TOF" , " QA_nSigma_kaon_TOF" , {HistType::kTH2F , {PtAxis, PIDAxis}});
145- OOhistos.add (" QA_kaon_TPC_TOF" , " QA_kaon_TPC_TOF" , {HistType::kTH2F , {PIDAxis, PIDAxis}});
141+ OOhistos.add (" QA_nSigma_kaon_TPC_BC" , " QA_nSigma_kaon_TPC_BC" , {HistType::kTH2F , {PtAxis, PIDAxis}});
142+ OOhistos.add (" QA_nSigma_kaon_TOF_BC" , " QA_nSigma_kaon_TOF_BC" , {HistType::kTH2F , {PtAxis, PIDAxis}});
143+ OOhistos.add (" QA_kaon_TPC_TOF_BC" , " QA_kaon_TPC_TOF_BC" , {HistType::kTH2F , {PIDAxis, PIDAxis}});
144+
145+ OOhistos.add (" QA_nSigma_kaon_TPC_AC" , " QA_nSigma_kaon_TPC_AC" , {HistType::kTH2F , {PtAxis, PIDAxis}});
146+ OOhistos.add (" QA_nSigma_kaon_TOF_AC" , " QA_nSigma_kaon_TOF_AC" , {HistType::kTH2F , {PtAxis, PIDAxis}});
147+ OOhistos.add (" QA_kaon_TPC_TOF_AC" , " QA_kaon_TPC_TOF_AC" , {HistType::kTH2F , {PIDAxis, PIDAxis}});
146148 }
147149
148150 // MC histos
@@ -170,8 +172,8 @@ struct kstarInOO {
170172 // For Mixed Event
171173 using BinningType = ColumnBinningPolicy<aod::collision::PosZ, aod::cent::CentFT0C>;
172174
173- Partition<TrackCandidates_MC> Kaon_MC = nabs(aod::pidtpc::tpcNSigmaKa) <= cfg_Track_TPCPID_nSig;
174- Partition<TrackCandidates_MC> Pion_MC = nabs(aod::pidtpc::tpcNSigmaPi) <= cfg_Track_TPCPID_nSig;
175+ Partition<TrackCandidates_MC> Kaon_MC = !cfg_Track_TPCPID || ( nabs(aod::pidtpc::tpcNSigmaKa) <= cfg_Track_TPCPID_nSig) ;
176+ Partition<TrackCandidates_MC> Pion_MC = !cfg_Track_TPCPID || ( nabs(aod::pidtpc::tpcNSigmaPi) <= cfg_Track_TPCPID_nSig) ;
175177
176178 double massKa = o2::constants::physics::MassKPlus;
177179 double massPi = o2::constants::physics::MassPiMinus;
@@ -184,6 +186,9 @@ struct kstarInOO {
184186 template <typename EventType>
185187 bool eventSelection (const EventType event)
186188 {
189+ if (cfg_Event_CutQA)
190+ OOhistos.fill (HIST (" hPosZ_BC" ), event.posZ ());
191+
187192 if (!event.sel8 ())
188193 return false ;
189194 if (std::abs (event.posZ ()) > cfg_Event_VtxCut)
@@ -199,6 +204,9 @@ struct kstarInOO {
199204 if (!event.selection_bit (aod::evsel::kNoCollInTimeRangeStandard ))
200205 return false ;
201206
207+ if (cfg_Event_CutQA)
208+ OOhistos.fill (HIST (" hPosZ_AC" ), event.posZ ());
209+
202210 return true ;
203211 };
204212
@@ -250,25 +258,31 @@ struct kstarInOO {
250258 bool tpcPIDPassed{false }, tofPIDPassed{false };
251259 // TPC
252260 if (cfg_Track_CutQA) {
253- OOhistos.fill (HIST (" QA_nSigma_kaon_TPC " ), candidate.pt (), candidate.tpcNSigmaKa ());
254- OOhistos.fill (HIST (" QA_nSigma_kaon_TOF " ), candidate.pt (), candidate.tofNSigmaKa ());
255- OOhistos.fill (HIST (" QA_kaon_TPC_TOF " ), candidate.tpcNSigmaKa (), candidate.tofNSigmaKa ());
261+ OOhistos.fill (HIST (" QA_nSigma_kaon_TPC_BC " ), candidate.pt (), candidate.tpcNSigmaKa ());
262+ OOhistos.fill (HIST (" QA_nSigma_kaon_TOF_BC " ), candidate.pt (), candidate.tofNSigmaKa ());
263+ OOhistos.fill (HIST (" QA_kaon_TPC_TOF_BC " ), candidate.tpcNSigmaKa (), candidate.tofNSigmaKa ());
256264 }
257265 if (std::abs (candidate.tpcNSigmaKa ()) < cfg_Track_TPCPID_nSig)
258266 tpcPIDPassed = true ;
259267
260268 // TOF
261269 if (candidate.hasTOF ()) {
262- if (std::abs (candidate.tofNSigmaKa ()) < cfg_Track_TOFPID_nSig)
263- tofPIDPassed = true ;
264- else
270+ if (std::abs (candidate.tofNSigmaKa ()) < cfg_Track_TOFPID_nSig) {
265271 tofPIDPassed = true ;
272+ }
273+ } else {
274+ tofPIDPassed = true ;
266275 }
267276
268277 // TPC & TOF
269- if (tpcPIDPassed && tofPIDPassed)
278+ if (tpcPIDPassed && tofPIDPassed) {
279+ if (cfg_Track_CutQA) {
280+ OOhistos.fill (HIST (" QA_nSigma_kaon_TPC_AC" ), candidate.pt (), candidate.tpcNSigmaKa ());
281+ OOhistos.fill (HIST (" QA_nSigma_kaon_TOF_AC" ), candidate.pt (), candidate.tofNSigmaKa ());
282+ OOhistos.fill (HIST (" QA_kaon_TPC_TOF_AC" ), candidate.tpcNSigmaKa (), candidate.tofNSigmaKa ());
283+ }
270284 return true ;
271-
285+ }
272286 return false ;
273287 }
274288
@@ -308,6 +322,12 @@ struct kstarInOO {
308322 auto centrality = collision1.centFT0C ();
309323
310324 for (auto & [trk1, trk2] : combinations (o2::soa::CombinationsFullIndexPolicy (tracks1, tracks2))) {
325+
326+ if (!trackSelection (trk1) || !trackSelection (trk2))
327+ continue ;
328+ if (!trackPIDKaon (trk1) || !trackPIDPion (trk2))
329+ continue ;
330+
311331 auto [KstarPt, Minv] = minvReconstruction (trk1, trk2);
312332 if (Minv < 0 )
313333 continue ;
@@ -336,14 +356,14 @@ struct kstarInOO {
336356
337357 if (!trackSelection (trk1) || !trackSelection (trk2))
338358 return {-1.0 , -1.0 };
359+
339360 if (!trackPIDKaon (trk1) || !trackPIDPion (trk2))
340361 return {-1.0 , -1.0 };
341362
342363 if (trk1.globalIndex () == trk2.globalIndex ()) {
343- // std::cout<<"This happens"<<std::endl;
344-
345- return {-1.0 , -1.0 }; // For Kstar, we need to run (0,1), (1,0) pairs as well. but same id pairs are not neede.
364+ return {-1.0 , -1.0 }; // For Kstar, we need to run (0,1), (1,0) pairs as well. but same id pairs are not need.
346365 }
366+
347367 lDecayDaughter1.SetXYZM (trk1.px (), trk1.py (), trk1.pz (), massKa);
348368 lDecayDaughter2.SetXYZM (trk2.px (), trk2.py (), trk2.pz (), massPi);
349369 lResonance = lDecayDaughter1 + lDecayDaughter2;
0 commit comments