88// In applying this license CERN does not waive the privileges and immunities
99// granted to it by virtue of its status as an Intergovernmental Organization
1010// or submit itself to any jurisdiction.
11- // kstar meson spin alignment task
1211// sourav.kundu@cern.ch
1312
1413#include < TH1F.h>
@@ -80,11 +79,12 @@ struct kstarpbpb {
8079 Configurable<float > cfgCutEta{" cfgCutEta" , 0.8 , " Eta cut on daughter track" };
8180 Configurable<float > cfgCutDCAxy{" cfgCutDCAxy" , 2 .0f , " DCAxy range for tracks" };
8281 Configurable<float > cfgCutDCAz{" cfgCutDCAz" , 2 .0f , " DCAz range for tracks" };
82+ Configurable<bool > useGlobalTrack{" useGlobalTrack" , true , " use Global track" };
8383 Configurable<float > nsigmaCutTPC{" nsigmacutTPC" , 3.0 , " Value of the TPC Nsigma cut" };
8484 Configurable<float > nsigmaCutCombined{" nsigmaCutCombined" , 3.0 , " Value of the TOF Nsigma cut" };
8585 Configurable<int > cfgNoMixedEvents{" cfgNoMixedEvents" , 1 , " Number of mixed events per event" };
8686 Configurable<int > cfgITScluster{" cfgITScluster" , 0 , " Number of ITS cluster" };
87- Configurable<bool > ispTdepPID{ " ispTdepPID " , true , " pT dependent PID " };
87+ Configurable<int > cfgTPCcluster{ " cfgTPCcluster " , 70 , " Number of TPC cluster " };
8888 Configurable<double > confRapidity{" confRapidity" , 0.5 , " Rapidity cut" };
8989 ConfigurableAxis configThnAxisInvMass{" configThnAxisInvMass" , {120 , 0.66 , 1.2 }, " #it{M} (GeV/#it{c}^{2})" };
9090 ConfigurableAxis configThnAxisPt{" configThnAxisPt" , {100 , 0.0 , 10 .}, " #it{p}_{T} (GeV/#it{c})" };
@@ -93,6 +93,8 @@ struct kstarpbpb {
9393 ConfigurableAxis configThnAxisV2{" configThnAxisV2" , {200 , -1 , 1 }, " V2" };
9494 Configurable<bool > additionalEvsel{" additionalEvsel" , false , " Additional event selcection" };
9595 Configurable<bool > timFrameEvsel{" timFrameEvsel" , false , " TPC Time frame boundary cut" };
96+ Configurable<bool > ispTdepPID{" ispTdepPID" , true , " pT dependent PID" };
97+ Configurable<bool > additionalQAplots{" additionalQAplots" , true , " Additional QA plots" };
9698
9799 Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex;
98100 Filter acceptanceFilter = (nabs(aod::track::eta) < cfgCutEta && nabs(aod::track::pt) > cfgCutPT);
@@ -143,7 +145,35 @@ struct kstarpbpb {
143145 histos.add (" ResFT0CTPC" , " ResFT0CTPC" , kTH2F , {centAxis, resAxis});
144146 histos.add (" ResFT0CFT0A" , " ResFT0CFT0A" , kTH2F , {centAxis, resAxis});
145147 histos.add (" ResFT0ATPC" , " ResFT0ATPC" , kTH2F , {centAxis, resAxis});
146-
148+ if (additionalQAplots) {
149+ // DCA QA
150+ histos.add (" QAbefore/trkDCAxyka" , " DCAxy distribution of kaon track candidates" , HistType::kTH1F , {{150 , 0 .0f , 1 .0f }});
151+ histos.add (" QAbefore/trkDCAzka" , " DCAz distribution of kaon track candidates" , HistType::kTH1F , {{150 , 0 .0f , 1 .0f }});
152+ histos.add (" QAafter/trkDCAxyka" , " DCAxy distribution of kaon track candidates" , HistType::kTH1F , {{150 , 0 .0f , 1 .0f }});
153+ histos.add (" QAafter/trkDCAzka" , " DCAz distribution of kaon track candidates" , HistType::kTH1F , {{150 , 0 .0f , 1 .0f }});
154+ // PID QA before cuts
155+ histos.add (" QAbefore/TOF_TPC_Mapka_allka" , " TOF + TPC Combined PID for Kaon;#sigma_{TOF}^{Kaon};#sigma_{TPC}^{Kaon}" , {HistType::kTH2D , {{100 , -6 , 6 }, {100 , -6 , 6 }}});
156+ histos.add (" QAbefore/TOF_Nsigma_allka" , " TOF NSigma for Kaon;#it{p}_{T} (GeV/#it{c});#sigma_{TOF}^{Kaon};" , {HistType::kTH2D , {{200 , 0.0 , 20.0 }, {100 , -6 , 6 }}});
157+ histos.add (" QAbefore/TPC_Nsigma_allka" , " TPC NSigma for Kaon;#it{p}_{T} (GeV/#it{c});#sigma_{TPC}^{Kaon};" , {HistType::kTH2D , {{200 , 0.0 , 20.0 }, {100 , -6 , 6 }}});
158+ // PID QA after cuts
159+ histos.add (" QAafter/TOF_TPC_Mapka_allka" , " TOF + TPC Combined PID for Kaon;#sigma_{TOF}^{Kaon};#sigma_{TPC}^{Kaon}" , {HistType::kTH2D , {{100 , -6 , 6 }, {100 , -6 , 6 }}});
160+ histos.add (" QAafter/TOF_Nsigma_allka" , " TOF NSigma for Kaon;#it{p}_{T} (GeV/#it{c});#sigma_{TOF}^{Kaon};" , {HistType::kTH2D , {{200 , 0.0 , 20.0 }, {100 , -6 , 6 }}});
161+ histos.add (" QAafter/TPC_Nsigma_allka" , " TPC NSigma for Kaon;#it{p}_{T} (GeV/#it{c});#sigma_{TPC}^{Kaon};" , {HistType::kTH2D , {{200 , 0.0 , 20.0 }, {100 , -6 , 6 }}});
162+
163+ // DCA QA
164+ histos.add (" QAbefore/trkDCAxypi" , " DCAxy distribution of pion track candidates" , HistType::kTH1F , {{150 , 0 .0f , 1 .0f }});
165+ histos.add (" QAbefore/trkDCAzpi" , " DCAz distribution of pion track candidates" , HistType::kTH1F , {{150 , 0 .0f , 1 .0f }});
166+ histos.add (" QAafter/trkDCAxypi" , " DCAxy distribution of pion track candidates" , HistType::kTH1F , {{150 , 0 .0f , 1 .0f }});
167+ histos.add (" QAafter/trkDCAzpi" , " DCAz distribution of pion track candidates" , HistType::kTH1F , {{150 , 0 .0f , 1 .0f }});
168+ // PID QA before cuts
169+ histos.add (" QAbefore/TOF_TPC_Mapka_allpi" , " TOF + TPC Combined PID for pion;#sigma_{TOF}^{pion};#sigma_{TPC}^{pion}" , {HistType::kTH2D , {{100 , -6 , 6 }, {100 , -6 , 6 }}});
170+ histos.add (" QAbefore/TOF_Nsigma_allpi" , " TOF NSigma for pion;#it{p}_{T} (GeV/#it{c});#sigma_{TOF}^{pion};" , {HistType::kTH2D , {{200 , 0.0 , 20.0 }, {100 , -6 , 6 }}});
171+ histos.add (" QAbefore/TPC_Nsigma_allpi" , " TPC NSigma for pion;#it{p}_{T} (GeV/#it{c});#sigma_{TPC}^{pion};" , {HistType::kTH2D , {{200 , 0.0 , 20.0 }, {100 , -6 , 6 }}});
172+ // PID QA after cuts
173+ histos.add (" QAafter/TOF_TPC_Mapka_allpi" , " TOF + TPC Combined PID for pion;#sigma_{TOF}^{pion};#sigma_{TPC}^{pion}" , {HistType::kTH2D , {{100 , -6 , 6 }, {100 , -6 , 6 }}});
174+ histos.add (" QAafter/TOF_Nsigma_allpi" , " TOF NSigma for pion;#it{p}_{T} (GeV/#it{c});#sigma_{TOF}^{pion};" , {HistType::kTH2D , {{200 , 0.0 , 20.0 }, {100 , -6 , 6 }}});
175+ histos.add (" QAafter/TPC_Nsigma_allpi" , " TPC NSigma for pion;#it{p}_{T} (GeV/#it{c});#sigma_{TPC}^{pion};" , {HistType::kTH2D , {{200 , 0.0 , 20.0 }, {100 , -6 , 6 }}});
176+ }
147177 // Event selection cut additional - Alex
148178 if (additionalEvsel) {
149179 fMultPVCutLow = new TF1 (" fMultPVCutLow" , " [0]+[1]*x+[2]*x*x+[3]*x*x*x - 2.5*([4]+[5]*x+[6]*x*x+[7]*x*x*x+[8]*x*x*x*x)" , 0 , 100 );
@@ -187,7 +217,10 @@ struct kstarpbpb {
187217 template <typename T>
188218 bool selectionTrack (const T& candidate)
189219 {
190- if (!(candidate.isGlobalTrack () && candidate.isPVContributor () && candidate.itsNCls () > cfgITScluster)) {
220+ if (useGlobalTrack && !(candidate.isGlobalTrack () && candidate.isPVContributor () && candidate.itsNCls () > cfgITScluster && candidate.tpcNClsFound () > cfgTPCcluster)) {
221+ return false ;
222+ }
223+ if (!useGlobalTrack && !(candidate.isPVContributor () && candidate.itsNCls () > cfgITScluster)) {
191224 return false ;
192225 }
193226 return true ;
@@ -197,17 +230,17 @@ struct kstarpbpb {
197230 bool selectionPIDpTdependent (const T& candidate, int PID)
198231 {
199232 if (PID == 0 ) {
200- if (candidate.pt () < 0.5 && TMath::Abs (candidate.tpcNSigmaKa ()) < nsigmaCutTPC) {
233+ if (candidate.p () < 0.5 && TMath::Abs (candidate.tpcNSigmaKa ()) < nsigmaCutTPC) {
201234 return true ;
202235 }
203- if (candidate.pt () >= 0.5 && candidate.hasTOF () && ((candidate.tofNSigmaKa () * candidate.tofNSigmaKa ()) + (candidate.tpcNSigmaKa () * candidate.tpcNSigmaKa ())) < (nsigmaCutCombined * nsigmaCutCombined)) {
236+ if (candidate.p () >= 0.5 && candidate.hasTOF () && ((candidate.tofNSigmaKa () * candidate.tofNSigmaKa ()) + (candidate.tpcNSigmaKa () * candidate.tpcNSigmaKa ())) < (nsigmaCutCombined * nsigmaCutCombined)) {
204237 return true ;
205238 }
206239 } else if (PID == 1 ) {
207- if (candidate.pt () < 0.5 && TMath::Abs (candidate.tpcNSigmaPi ()) < nsigmaCutTPC) {
240+ if (candidate.p () < 0.5 && TMath::Abs (candidate.tpcNSigmaPi ()) < nsigmaCutTPC) {
208241 return true ;
209242 }
210- if (candidate.pt () >= 0.5 && candidate.hasTOF () && ((candidate.tofNSigmaPi () * candidate.tofNSigmaPi ()) + (candidate.tpcNSigmaPi () * candidate.tpcNSigmaPi ())) < (nsigmaCutCombined * nsigmaCutCombined)) {
243+ if (candidate.p () >= 0.5 && candidate.hasTOF () && ((candidate.tofNSigmaPi () * candidate.tofNSigmaPi ()) + (candidate.tpcNSigmaPi () * candidate.tpcNSigmaPi ())) < (nsigmaCutCombined * nsigmaCutCombined)) {
211244 return true ;
212245 }
213246 }
@@ -286,46 +319,115 @@ struct kstarpbpb {
286319 histos.fill (HIST (" ResFT0ATPC" ), centrality, TMath::Cos (2.0 * (psiTPC - psiFT0A)));
287320 histos.fill (HIST (" hCentrality" ), centrality);
288321 histos.fill (HIST (" hVtxZ" ), collision.posZ ());
322+
289323 for (auto track1 : posThisColl) {
290324 if (!selectionTrack (track1)) {
291325 continue ;
292326 }
327+ if (additionalQAplots) {
328+ histos.fill (HIST (" QAbefore/TPC_Nsigma_allka" ), track1.pt (), track1.tpcNSigmaKa ());
329+ histos.fill (HIST (" QAbefore/TOF_Nsigma_allka" ), track1.pt (), track1.tofNSigmaKa ());
330+ histos.fill (HIST (" QAbefore/trkDCAxyka" ), track1.dcaXY ());
331+ histos.fill (HIST (" QAbefore/trkDCAzka" ), track1.dcaZ ());
332+ histos.fill (HIST (" QAbefore/TOF_TPC_Mapka_allka" ), track1.tofNSigmaKa (), track1.tpcNSigmaKa ());
333+ }
334+
293335 bool track1pion = false ;
294336 bool track1kaon = false ;
295337 if (ispTdepPID && !(selectionPIDpTdependent (track1, 0 ) || selectionPIDpTdependent (track1, 1 ))) {
296338 continue ;
297339 }
340+ if (!ispTdepPID && !(selectionPID (track1, 0 ) || selectionPID (track1, 1 ))) {
341+ continue ;
342+ }
298343 for (auto track2 : negThisColl) {
299344 bool track2pion = false ;
300345 bool track2kaon = false ;
346+ if (!selectionTrack (track2)) {
347+ continue ;
348+ }
349+ if (additionalQAplots) {
350+ histos.fill (HIST (" QAbefore/TOF_TPC_Mapka_allpi" ), track2.tofNSigmaPi (), track2.tpcNSigmaPi ());
351+ histos.fill (HIST (" QAbefore/TPC_Nsigma_allpi" ), track2.pt (), track2.tpcNSigmaPi ());
352+ histos.fill (HIST (" QAbefore/TOF_Nsigma_allpi" ), track2.pt (), track2.tofNSigmaPi ());
353+ histos.fill (HIST (" QAbefore/trkDCAxypi" ), track2.dcaXY ());
354+ histos.fill (HIST (" QAbefore/trkDCAzpi" ), track2.dcaZ ());
355+ }
301356 if (ispTdepPID && !(selectionPIDpTdependent (track2, 0 ) || selectionPIDpTdependent (track2, 1 ))) {
302357 continue ;
303358 }
304- // track selection
305- if (!selectionTrack (track2)) {
359+ if (!ispTdepPID && !(selectionPID (track2, 0 ) || selectionPID (track2, 1 ))) {
306360 continue ;
307361 }
308362 if (track1.sign () * track2.sign () > 0 ) {
309363 continue ;
310364 }
311- if (selectionPIDpTdependent (track1, 1 )) {
312- track1pion = true ;
313- } else if (selectionPIDpTdependent (track1, 0 )) {
314- track1kaon = true ;
315- }
316- if (selectionPIDpTdependent (track2, 1 )) {
317- track2pion = true ;
318- } else if (selectionPIDpTdependent (track2, 0 )) {
319- track2kaon = true ;
365+
366+ if (ispTdepPID) {
367+ if (selectionPIDpTdependent (track1, 1 )) {
368+ track1pion = true ;
369+ } else if (selectionPIDpTdependent (track1, 0 )) {
370+ track1kaon = true ;
371+ }
372+ if (selectionPIDpTdependent (track2, 1 )) {
373+ track2pion = true ;
374+ } else if (selectionPIDpTdependent (track2, 0 )) {
375+ track2kaon = true ;
376+ }
377+ if (track1kaon && track2pion) {
378+ if (additionalQAplots) {
379+ histos.fill (HIST (" QAafter/TPC_Nsigma_allka" ), track1.pt (), track1.tpcNSigmaKa ());
380+ histos.fill (HIST (" QAafter/TOF_Nsigma_allka" ), track1.pt (), track1.tofNSigmaKa ());
381+ histos.fill (HIST (" QAafter/trkDCAxyka" ), track1.dcaXY ());
382+ histos.fill (HIST (" QAafter/trkDCAzka" ), track1.dcaZ ());
383+ histos.fill (HIST (" QAafter/TOF_TPC_Mapka_allka" ), track1.tofNSigmaKa (), track1.tpcNSigmaKa ());
384+ histos.fill (HIST (" QAafter/TOF_TPC_Mapka_allpi" ), track2.tofNSigmaPi (), track2.tpcNSigmaPi ());
385+ histos.fill (HIST (" QAafter/TPC_Nsigma_allpi" ), track2.pt (), track2.tpcNSigmaPi ());
386+ histos.fill (HIST (" QAafter/TOF_Nsigma_allpi" ), track2.pt (), track2.tofNSigmaPi ());
387+ histos.fill (HIST (" QAafter/trkDCAxypi" ), track2.dcaXY ());
388+ histos.fill (HIST (" QAafter/trkDCAzpi" ), track2.dcaZ ());
389+ }
390+ daughter1 = ROOT::Math::PxPyPzMVector (track1.px (), track1.py (), track1.pz (), massKa);
391+ daughter2 = ROOT::Math::PxPyPzMVector (track2.px (), track2.py (), track2.pz (), massPi);
392+ } else if (track1pion && track2kaon) {
393+ daughter1 = ROOT::Math::PxPyPzMVector (track1.px (), track1.py (), track1.pz (), massPi);
394+ daughter2 = ROOT::Math::PxPyPzMVector (track2.px (), track2.py (), track2.pz (), massKa);
395+ } else {
396+ continue ;
397+ }
320398 }
321- if (track1pion && track2kaon) {
322- daughter1 = ROOT::Math::PxPyPzMVector (track1.px (), track1.py (), track1.pz (), massPi);
323- daughter2 = ROOT::Math::PxPyPzMVector (track2.px (), track2.py (), track2.pz (), massKa);
324- } else if (track1kaon && track2pion) {
325- daughter1 = ROOT::Math::PxPyPzMVector (track1.px (), track1.py (), track1.pz (), massKa);
326- daughter2 = ROOT::Math::PxPyPzMVector (track2.px (), track2.py (), track2.pz (), massPi);
327- } else {
328- continue ;
399+ if (!ispTdepPID) {
400+ if (selectionPID (track1, 1 )) {
401+ track1pion = true ;
402+ } else if (selectionPID (track1, 0 )) {
403+ track1kaon = true ;
404+ }
405+ if (selectionPID (track2, 1 )) {
406+ track2pion = true ;
407+ } else if (selectionPID (track2, 0 )) {
408+ track2kaon = true ;
409+ }
410+ if (track1kaon && track2pion) {
411+ if (additionalQAplots) {
412+ histos.fill (HIST (" QAafter/TPC_Nsigma_allka" ), track1.pt (), track1.tpcNSigmaKa ());
413+ histos.fill (HIST (" QAafter/TOF_Nsigma_allka" ), track1.pt (), track1.tofNSigmaKa ());
414+ histos.fill (HIST (" QAafter/trkDCAxyka" ), track1.dcaXY ());
415+ histos.fill (HIST (" QAafter/trkDCAzka" ), track1.dcaZ ());
416+ histos.fill (HIST (" QAafter/TOF_TPC_Mapka_allka" ), track1.tofNSigmaKa (), track1.tpcNSigmaKa ());
417+ histos.fill (HIST (" QAafter/TOF_TPC_Mapka_allpi" ), track2.tofNSigmaPi (), track2.tpcNSigmaPi ());
418+ histos.fill (HIST (" QAafter/TPC_Nsigma_allpi" ), track2.pt (), track2.tpcNSigmaPi ());
419+ histos.fill (HIST (" QAafter/TOF_Nsigma_allpi" ), track2.pt (), track2.tofNSigmaPi ());
420+ histos.fill (HIST (" QAafter/trkDCAxypi" ), track2.dcaXY ());
421+ histos.fill (HIST (" QAafter/trkDCAzpi" ), track2.dcaZ ());
422+ }
423+ daughter1 = ROOT::Math::PxPyPzMVector (track1.px (), track1.py (), track1.pz (), massKa);
424+ daughter2 = ROOT::Math::PxPyPzMVector (track2.px (), track2.py (), track2.pz (), massPi);
425+ } else if (track1kaon && track2pion) {
426+ daughter1 = ROOT::Math::PxPyPzMVector (track1.px (), track1.py (), track1.pz (), massPi);
427+ daughter2 = ROOT::Math::PxPyPzMVector (track2.px (), track2.py (), track2.pz (), massKa);
428+ } else {
429+ continue ;
430+ }
329431 }
330432 KstarMother = daughter1 + daughter2;
331433 histos.fill (HIST (" hpTvsRapidity" ), KstarMother.Pt (), KstarMother.Rapidity ());
@@ -382,27 +484,55 @@ struct kstarpbpb {
382484 if (ispTdepPID && !(selectionPIDpTdependent (track2, 1 ) || selectionPIDpTdependent (track2, 0 ))) {
383485 continue ;
384486 }
385-
386- if (selectionPIDpTdependent (track1, 1 )) {
387- track1pion = true ;
388- } else if (selectionPIDpTdependent (track1, 0 )) {
389- track1kaon = true ;
390- }
391- if (selectionPIDpTdependent (track2, 1 )) {
392- track2pion = true ;
393- } else if (selectionPIDpTdependent (track2, 0 )) {
394- track2kaon = true ;
487+ if (!ispTdepPID && !(selectionPID (track1, 0 ) || selectionPID (track1, 1 ))) {
488+ continue ;
395489 }
396-
397- if (track1pion && track2kaon) {
398- daughter1 = ROOT::Math::PxPyPzMVector (track1.px (), track1.py (), track1.pz (), massPi);
399- daughter2 = ROOT::Math::PxPyPzMVector (track2.px (), track2.py (), track2.pz (), massKa);
400- } else if (track1kaon && track2pion) {
401- daughter1 = ROOT::Math::PxPyPzMVector (track1.px (), track1.py (), track1.pz (), massKa);
402- daughter2 = ROOT::Math::PxPyPzMVector (track2.px (), track2.py (), track2.pz (), massPi);
403- } else {
490+ if (!ispTdepPID && !(selectionPID (track2, 1 ) || selectionPID (track2, 0 ))) {
404491 continue ;
405492 }
493+ if (ispTdepPID) {
494+ if (selectionPIDpTdependent (track1, 1 )) {
495+ track1pion = true ;
496+ } else if (selectionPIDpTdependent (track1, 0 )) {
497+ track1kaon = true ;
498+ }
499+ if (selectionPIDpTdependent (track2, 1 )) {
500+ track2pion = true ;
501+ } else if (selectionPIDpTdependent (track2, 0 )) {
502+ track2kaon = true ;
503+ }
504+ if (track1pion && track2kaon) {
505+ daughter1 = ROOT::Math::PxPyPzMVector (track1.px (), track1.py (), track1.pz (), massPi);
506+ daughter2 = ROOT::Math::PxPyPzMVector (track2.px (), track2.py (), track2.pz (), massKa);
507+ } else if (track1kaon && track2pion) {
508+ daughter1 = ROOT::Math::PxPyPzMVector (track1.px (), track1.py (), track1.pz (), massKa);
509+ daughter2 = ROOT::Math::PxPyPzMVector (track2.px (), track2.py (), track2.pz (), massPi);
510+ } else {
511+ continue ;
512+ }
513+ }
514+ if (!ispTdepPID) {
515+ if (selectionPID (track1, 1 )) {
516+ track1pion = true ;
517+ } else if (selectionPID (track1, 0 )) {
518+ track1kaon = true ;
519+ }
520+ if (selectionPID (track2, 1 )) {
521+ track2pion = true ;
522+ } else if (selectionPID (track2, 0 )) {
523+ track2kaon = true ;
524+ }
525+ if (track1pion && track2kaon) {
526+ daughter1 = ROOT::Math::PxPyPzMVector (track1.px (), track1.py (), track1.pz (), massPi);
527+ daughter2 = ROOT::Math::PxPyPzMVector (track2.px (), track2.py (), track2.pz (), massKa);
528+ } else if (track1kaon && track2pion) {
529+ daughter1 = ROOT::Math::PxPyPzMVector (track1.px (), track1.py (), track1.pz (), massKa);
530+ daughter2 = ROOT::Math::PxPyPzMVector (track2.px (), track2.py (), track2.pz (), massPi);
531+ } else {
532+ continue ;
533+ }
534+ }
535+
406536 KstarMother = daughter1 + daughter2;
407537 if (TMath::Abs (KstarMother.Rapidity ()) > confRapidity) {
408538 continue ;
0 commit comments