3939#include " ReconstructionDataFormats/Track.h"
4040#include < CCDB/BasicCCDBManager.h>
4141
42+ #include < TComplex.h>
4243#include < TDirectory.h>
4344#include < TF1.h>
4445#include < TFile.h>
@@ -133,9 +134,13 @@ struct V0ptHadPiKaProt {
133134 Configurable<float > cfgPtCutTOF{" cfgPtCutTOF" , 0 .3f , " Minimum pt to use TOF N-sigma" };
134135 Configurable<LabeledArray<float >> nSigmas{" nSigmas" , {LongArrayFloat[0 ], 3 , 6 , {" TPC" , " TOF" , " ITS" }, {" pos_pi" , " pos_ka" , " pos_pr" , " neg_pi" , " neg_ka" , " neg_pr" }}, " Labeled array for n-sigma values for TPC, TOF, ITS for pions, kaons, protons (positive and negative)" };
135136 Configurable<bool > cfgUseRun3V2PID{" cfgUseRun3V2PID" , true , " True if PID cuts to be used are similar to Run3 v2 PID analysis" };
137+ Configurable<int > cfgNbinsV02pt{" cfgNbinsV02pt" , 14 , " No. of pT bins for v02(pT) analysis" };
138+ Configurable<float > cfgCutPtMaxForV02{" cfgCutPtMaxForV02" , 3 .0f , " Max. pT for v02(pT)" };
139+ Configurable<float > cfgCutEtaWindowB{" cfgCutEtaWindowB" , 0 .4f , " value of x in |eta|<x for window B" };
136140
137141 HistogramRegistry histos{" Histos" , {}, OutputObjHandlingPolicy::AnalysisObject};
138142 std::vector<std::vector<std::shared_ptr<TProfile2D>>> subSample;
143+ std::vector<std::vector<std::shared_ptr<TProfile2D>>> subSampleV02;
139144 TRandom3* funRndm = new TRandom3(0 );
140145
141146 // Filter command***********
@@ -244,10 +249,23 @@ struct V0ptHadPiKaProt {
244249 histos.add (" Prof_Bone_prot" , " " , {HistType::kTProfile2D , {centAxis, noAxis}});
245250 histos.add (" Prof_Btwo_prot" , " " , {HistType::kTProfile2D , {centAxis, noAxis}});
246251
252+ // Analysis profile for v02(pT)
253+ histos.add (" Prof_XY" , " " , {HistType::kTProfile2D , {centAxis, noAxis}});
254+ histos.add (" Prof_XYZ_had" , " " , {HistType::kTProfile2D , {centAxis, ptAxis}});
255+ histos.add (" Prof_Z_had" , " " , {HistType::kTProfile2D , {centAxis, ptAxis}});
256+ histos.add (" Prof_XYZ_pi" , " " , {HistType::kTProfile2D , {centAxis, ptAxis}});
257+ histos.add (" Prof_Z_pi" , " " , {HistType::kTProfile2D , {centAxis, ptAxis}});
258+ histos.add (" Prof_XYZ_ka" , " " , {HistType::kTProfile2D , {centAxis, ptAxis}});
259+ histos.add (" Prof_Z_ka" , " " , {HistType::kTProfile2D , {centAxis, ptAxis}});
260+ histos.add (" Prof_XYZ_prot" , " " , {HistType::kTProfile2D , {centAxis, ptAxis}});
261+ histos.add (" Prof_Z_prot" , " " , {HistType::kTProfile2D , {centAxis, ptAxis}});
262+
247263 // initial array
248264 subSample.resize (cfgNSubsample);
265+ subSampleV02.resize (cfgNSubsample);
249266 for (int i = 0 ; i < cfgNSubsample; i++) {
250267 subSample[i].resize (20 );
268+ subSampleV02[i].resize (20 );
251269 }
252270 for (int i = 0 ; i < cfgNSubsample; i++) {
253271 subSample[i][0 ] = std::get<std::shared_ptr<TProfile2D>>(histos.add (Form (" subSample_%d/Prof_A_had" , i), " " , {HistType::kTProfile2D , {centAxis, ptAxis}}));
@@ -273,6 +291,16 @@ struct V0ptHadPiKaProt {
273291 subSample[i][17 ] = std::get<std::shared_ptr<TProfile2D>>(histos.add (Form (" subSample_%d/Prof_D_prot" , i), " " , {HistType::kTProfile2D , {centAxis, noAxis}}));
274292 subSample[i][18 ] = std::get<std::shared_ptr<TProfile2D>>(histos.add (Form (" subSample_%d/Prof_Bone_prot" , i), " " , {HistType::kTProfile2D , {centAxis, noAxis}}));
275293 subSample[i][19 ] = std::get<std::shared_ptr<TProfile2D>>(histos.add (Form (" subSample_%d/Prof_Btwo_prot" , i), " " , {HistType::kTProfile2D , {centAxis, noAxis}}));
294+
295+ subSampleV02[i][0 ] = std::get<std::shared_ptr<TProfile2D>>(histos.add (Form (" subSampleV02_%d/Prof_XY" , i), " " , {HistType::kTProfile2D , {centAxis, noAxis}}));
296+ subSampleV02[i][1 ] = std::get<std::shared_ptr<TProfile2D>>(histos.add (Form (" subSampleV02_%d/Prof_XYZ_had" , i), " " , {HistType::kTProfile2D , {centAxis, ptAxis}}));
297+ subSampleV02[i][2 ] = std::get<std::shared_ptr<TProfile2D>>(histos.add (Form (" subSampleV02_%d/Prof_Z_had" , i), " " , {HistType::kTProfile2D , {centAxis, ptAxis}}));
298+ subSampleV02[i][3 ] = std::get<std::shared_ptr<TProfile2D>>(histos.add (Form (" subSampleV02_%d/Prof_XYZ_pi" , i), " " , {HistType::kTProfile2D , {centAxis, ptAxis}}));
299+ subSampleV02[i][4 ] = std::get<std::shared_ptr<TProfile2D>>(histos.add (Form (" subSampleV02_%d/Prof_Z_pi" , i), " " , {HistType::kTProfile2D , {centAxis, ptAxis}}));
300+ subSampleV02[i][5 ] = std::get<std::shared_ptr<TProfile2D>>(histos.add (Form (" subSampleV02_%d/Prof_XYZ_ka" , i), " " , {HistType::kTProfile2D , {centAxis, ptAxis}}));
301+ subSampleV02[i][6 ] = std::get<std::shared_ptr<TProfile2D>>(histos.add (Form (" subSampleV02_%d/Prof_Z_ka" , i), " " , {HistType::kTProfile2D , {centAxis, ptAxis}}));
302+ subSampleV02[i][1 ] = std::get<std::shared_ptr<TProfile2D>>(histos.add (Form (" subSampleV02_%d/Prof_XYZ_prot" , i), " " , {HistType::kTProfile2D , {centAxis, ptAxis}}));
303+ subSampleV02[i][2 ] = std::get<std::shared_ptr<TProfile2D>>(histos.add (Form (" subSampleV02_%d/Prof_Z_prot" , i), " " , {HistType::kTProfile2D , {centAxis, ptAxis}}));
276304 }
277305 } // end init
278306
@@ -482,7 +510,7 @@ struct V0ptHadPiKaProt {
482510 histos.fill (HIST (" Hist2D_globalTracks_PVTracks" ), coll.multNTracksPV (), inputTracks.size ());
483511 histos.fill (HIST (" Hist2D_cent_nch" ), inputTracks.size (), cent);
484512
485- // Analysis variables
513+ // Analysis variables for v0(pT)
486514 int nbinsHad = 20 ;
487515 int nbinsPid = 18 ;
488516 double binsarray[21 ] = {0.2 , 0.4 , 0.6 , 0.8 , 1.0 , 1.2 , 1.4 , 1.6 , 1.8 , 2.0 , 2.2 , 2.4 , 2.6 , 2.8 , 3.0 , 3.5 , 4.0 , 5.0 , 6.0 , 8.0 , 10.0 };
@@ -498,6 +526,18 @@ struct V0ptHadPiKaProt {
498526 double nSumEtaLeftKa = 0.0 ;
499527 double nSumEtaLeftProt = 0.0 ;
500528
529+ // Analysis variables for v02(pT)
530+ TH1D* fPtProfileHadInWinB = new TH1D (" fPtProfileHadInWinB" , " fPtProfileHadInWinB" , 20 , binsarray);
531+ TH1D* fPtProfilePiInWinB = new TH1D (" fPtProfilePiInWinB" , " fPtProfilePiInWinB" , 20 , binsarray);
532+ TH1D* fPtProfileKaInWinB = new TH1D (" fPtProfileKaInWinB" , " fPtProfileKaInWinB" , 20 , binsarray);
533+ TH1D* fPtProfileProtInWinB = new TH1D (" fPtProfileProtInWinB" , " fPtProfileProtInWinB" , 20 , binsarray);
534+ double nSumInWinB = 0.0 ; // for Z = f(pT) = n(pT)/N_B in window B
535+
536+ double nSumInWinA = 0.0 ; // for X (in window A) to calculate v2^2
537+ double nSumInWinC = 0.0 ; // for Y (in window C) to calculate v2^2
538+ TComplex vecQInWinA = TComplex (0 ., 0 .);
539+ TComplex vecQInWinC = TComplex (0 ., 0 .);
540+
501541 for (const auto & track : inputTracks) { // Loop over tracks
502542
503543 if (!track.has_collision ()) {
@@ -521,6 +561,7 @@ struct V0ptHadPiKaProt {
521561
522562 double trkPt = track.pt ();
523563 double trkEta = track.eta ();
564+ double trkPhi = track.phi ();
524565
525566 // inclusive charged particles
526567 if (track.sign () != 0 ) {
@@ -535,6 +576,29 @@ struct V0ptHadPiKaProt {
535576 }
536577 }
537578
579+ // fill subevent B for f(pT) in v02(pT)
580+ if (track.sign () != 0 && trkPt < cfgCutPtMaxForV02) {
581+ if (std::abs (trkEta) < cfgCutEtaWindowB) {
582+ fPtProfileHadInWinB ->Fill (trkPt);
583+ nSumInWinB += 1.0 ;
584+ }
585+ }
586+ double phiweight = 1.0 ;
587+ // fill subevent C for v2^2 in v02(pT)
588+ if (track.sign () != 0 && trkPt < cfgCutPtMaxForV02) {
589+ if (cfgCutEtaWindowB < trkEta && trkEta < 0.8 ) {
590+ vecQInWinC += phiweight * TComplex (TMath::Cos (2 . * trkPhi), TMath::Sin (2 . * trkPhi));
591+ nSumInWinC += phiweight;
592+ }
593+ }
594+ // fill subevent A for v2^2 in v02(pT)
595+ if (track.sign () != 0 && trkPt < cfgCutPtMaxForV02) {
596+ if (-0.8 < trkEta && trkEta < -1.0 * cfgCutEtaWindowB) {
597+ vecQInWinA += phiweight * TComplex (TMath::Cos (2 . * trkPhi), TMath::Sin (2 . * trkPhi));
598+ nSumInWinA += phiweight;
599+ }
600+ }
601+
538602 // PID QAs before selection
539603 double nSigmaTpcPi = track.tpcNSigmaPi ();
540604 double nSigmaTpcKa = track.tpcNSigmaKa ();
@@ -607,6 +671,21 @@ struct V0ptHadPiKaProt {
607671 }
608672 }
609673
674+ // fill subevent B for ***identified particles'*** f(pT) in v02(pT)
675+ if (track.sign () != 0 && trkPt < cfgCutPtMaxForV02) {
676+ if (std::abs (trkEta) < cfgCutEtaWindowB) {
677+ if (isPion) {
678+ fPtProfilePiInWinB ->Fill (trkPt);
679+ }
680+ if (isKaon) {
681+ fPtProfileKaInWinB ->Fill (trkPt);
682+ }
683+ if (isProton && trkPt > cfgCutPtLowerProt) {
684+ fPtProfileProtInWinB ->Fill (trkPt);
685+ }
686+ }
687+ }
688+
610689 } // End track loop
611690
612691 // selecting subsample and filling profiles
@@ -676,11 +755,68 @@ struct V0ptHadPiKaProt {
676755 }
677756 }
678757
758+ if (nSumInWinA > 4 && nSumInWinB > 4 && nSumInWinC > 4 ) {
759+ double twoParCorr = (vecQInWinA * TComplex::Conjugate (vecQInWinC)).Re ();
760+ twoParCorr *= 1.0 / (nSumInWinA * nSumInWinC);
761+ histos.get <TProfile2D>(HIST (" Prof_XY" ))->Fill (cent, 0.5 , twoParCorr);
762+
763+ subSampleV02[sampleIndex][0 ]->Fill (cent, 0.5 , twoParCorr);
764+
765+ // hadrons
766+ for (int i = 0 ; i < cfgNbinsV02pt; i++) {
767+ double threeParCorrHad = (vecQInWinA * TComplex::Conjugate (vecQInWinC) * fPtProfileHadInWinB ->GetBinContent (i + 1 )).Re ();
768+ threeParCorrHad *= 1.0 / (nSumInWinA * nSumInWinC * nSumInWinB);
769+ histos.get <TProfile2D>(HIST (" Prof_XYZ_had" ))->Fill (cent, fPtProfileHadInWinB ->GetBinCenter (i + 1 ), threeParCorrHad);
770+ histos.get <TProfile2D>(HIST (" Prof_Z_had" ))->Fill (cent, fPtProfileHadInWinB ->GetBinCenter (i + 1 ), (fPtProfileHadInWinB ->GetBinContent (i + 1 ) / nSumInWinB));
771+
772+ subSampleV02[sampleIndex][1 ]->Fill (cent, fPtProfileHadInWinB ->GetBinCenter (i + 1 ), threeParCorrHad);
773+ subSampleV02[sampleIndex][2 ]->Fill (cent, fPtProfileHadInWinB ->GetBinCenter (i + 1 ), (fPtProfileHadInWinB ->GetBinContent (i + 1 ) / nSumInWinB));
774+ }
775+
776+ // pions
777+ for (int i = 0 ; i < cfgNbinsV02pt; i++) {
778+ double threeParCorrPi = (vecQInWinA * TComplex::Conjugate (vecQInWinC) * fPtProfilePiInWinB ->GetBinContent (i + 1 )).Re ();
779+ threeParCorrPi *= 1.0 / (nSumInWinA * nSumInWinC * nSumInWinB);
780+ histos.get <TProfile2D>(HIST (" Prof_XYZ_pi" ))->Fill (cent, fPtProfilePiInWinB ->GetBinCenter (i + 1 ), threeParCorrPi);
781+ histos.get <TProfile2D>(HIST (" Prof_Z_pi" ))->Fill (cent, fPtProfilePiInWinB ->GetBinCenter (i + 1 ), (fPtProfilePiInWinB ->GetBinContent (i + 1 ) / nSumInWinB));
782+
783+ subSampleV02[sampleIndex][1 ]->Fill (cent, fPtProfilePiInWinB ->GetBinCenter (i + 1 ), threeParCorrPi);
784+ subSampleV02[sampleIndex][2 ]->Fill (cent, fPtProfilePiInWinB ->GetBinCenter (i + 1 ), (fPtProfilePiInWinB ->GetBinContent (i + 1 ) / nSumInWinB));
785+ }
786+
787+ // kaons
788+ for (int i = 0 ; i < cfgNbinsV02pt; i++) {
789+ double threeParCorrKa = (vecQInWinA * TComplex::Conjugate (vecQInWinC) * fPtProfileKaInWinB ->GetBinContent (i + 1 )).Re ();
790+ threeParCorrKa *= 1.0 / (nSumInWinA * nSumInWinC * nSumInWinB);
791+ histos.get <TProfile2D>(HIST (" Prof_XYZ_ka" ))->Fill (cent, fPtProfileKaInWinB ->GetBinCenter (i + 1 ), threeParCorrKa);
792+ histos.get <TProfile2D>(HIST (" Prof_Z_ka" ))->Fill (cent, fPtProfileKaInWinB ->GetBinCenter (i + 1 ), (fPtProfileKaInWinB ->GetBinContent (i + 1 ) / nSumInWinB));
793+
794+ subSampleV02[sampleIndex][1 ]->Fill (cent, fPtProfileKaInWinB ->GetBinCenter (i + 1 ), threeParCorrKa);
795+ subSampleV02[sampleIndex][2 ]->Fill (cent, fPtProfileKaInWinB ->GetBinCenter (i + 1 ), (fPtProfileKaInWinB ->GetBinContent (i + 1 ) / nSumInWinB));
796+ }
797+
798+ // protons
799+ for (int i = 1 ; i < cfgNbinsV02pt; i++) {
800+ double threeParCorrProt = (vecQInWinA * TComplex::Conjugate (vecQInWinC) * fPtProfileProtInWinB ->GetBinContent (i + 1 )).Re ();
801+ threeParCorrProt *= 1.0 / (nSumInWinA * nSumInWinC * nSumInWinB);
802+ histos.get <TProfile2D>(HIST (" Prof_XYZ_prot" ))->Fill (cent, fPtProfileProtInWinB ->GetBinCenter (i + 1 ), threeParCorrProt);
803+ histos.get <TProfile2D>(HIST (" Prof_Z_prot" ))->Fill (cent, fPtProfileProtInWinB ->GetBinCenter (i + 1 ), (fPtProfileProtInWinB ->GetBinContent (i + 1 ) / nSumInWinB));
804+
805+ subSampleV02[sampleIndex][1 ]->Fill (cent, fPtProfileProtInWinB ->GetBinCenter (i + 1 ), threeParCorrProt);
806+ subSampleV02[sampleIndex][2 ]->Fill (cent, fPtProfileProtInWinB ->GetBinCenter (i + 1 ), (fPtProfileProtInWinB ->GetBinContent (i + 1 ) / nSumInWinB));
807+ }
808+ }
809+
679810 fPtProfileHad ->Delete ();
680811 fPtProfilePi ->Delete ();
681812 fPtProfileKa ->Delete ();
682813 fPtProfileProt ->Delete ();
683814
815+ fPtProfileHadInWinB ->Delete ();
816+ fPtProfilePiInWinB ->Delete ();
817+ fPtProfileKaInWinB ->Delete ();
818+ fPtProfileProtInWinB ->Delete ();
819+
684820 } // End process loop
685821};
686822
0 commit comments