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,21 @@ 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+ double nSumInWinBpi = 0.0 ;
536+ double nSumInWinBka = 0.0 ;
537+ double nSumInWinBprot = 0.0 ;
538+
539+ double nSumInWinA = 0.0 ; // for X (in window A) to calculate v2^2
540+ double nSumInWinC = 0.0 ; // for Y (in window C) to calculate v2^2
541+ TComplex vecQInWinA = TComplex (0 ., 0 .);
542+ TComplex vecQInWinC = TComplex (0 ., 0 .);
543+
501544 for (const auto & track : inputTracks) { // Loop over tracks
502545
503546 if (!track.has_collision ()) {
@@ -521,6 +564,7 @@ struct V0ptHadPiKaProt {
521564
522565 double trkPt = track.pt ();
523566 double trkEta = track.eta ();
567+ double trkPhi = track.phi ();
524568
525569 // inclusive charged particles
526570 if (track.sign () != 0 ) {
@@ -535,6 +579,29 @@ struct V0ptHadPiKaProt {
535579 }
536580 }
537581
582+ // fill subevent B for f(pT) in v02(pT)
583+ if (track.sign () != 0 && trkPt < cfgCutPtMaxForV02) {
584+ if (std::abs (trkEta) < cfgCutEtaWindowB) {
585+ fPtProfileHadInWinB ->Fill (trkPt);
586+ nSumInWinB += 1.0 ;
587+ }
588+ }
589+ double phiweight = 1.0 ;
590+ // fill subevent C for v2^2 in v02(pT)
591+ if (track.sign () != 0 && trkPt < cfgCutPtMaxForV02) {
592+ if (cfgCutEtaWindowB < trkEta && trkEta < 0.8 ) {
593+ vecQInWinC += phiweight * TComplex (TMath::Cos (2 . * trkPhi), TMath::Sin (2 . * trkPhi));
594+ nSumInWinC += phiweight;
595+ }
596+ }
597+ // fill subevent A for v2^2 in v02(pT)
598+ if (track.sign () != 0 && trkPt < cfgCutPtMaxForV02) {
599+ if (-0.8 < trkEta && trkEta < -1.0 * cfgCutEtaWindowB) {
600+ vecQInWinA += phiweight * TComplex (TMath::Cos (2 . * trkPhi), TMath::Sin (2 . * trkPhi));
601+ nSumInWinA += phiweight;
602+ }
603+ }
604+
538605 // PID QAs before selection
539606 double nSigmaTpcPi = track.tpcNSigmaPi ();
540607 double nSigmaTpcKa = track.tpcNSigmaKa ();
@@ -607,6 +674,24 @@ struct V0ptHadPiKaProt {
607674 }
608675 }
609676
677+ // fill subevent B for ***identified particles'*** f(pT) in v02(pT)
678+ if (track.sign () != 0 && trkPt < cfgCutPtMaxForV02) {
679+ if (std::abs (trkEta) < cfgCutEtaWindowB) {
680+ if (isPion) {
681+ fPtProfilePiInWinB ->Fill (trkPt);
682+ nSumInWinBpi += 1.0 ;
683+ }
684+ if (isKaon) {
685+ fPtProfileKaInWinB ->Fill (trkPt);
686+ nSumInWinBka += 1.0 ;
687+ }
688+ if (isProton && trkPt > cfgCutPtLowerProt) {
689+ fPtProfileProtInWinB ->Fill (trkPt);
690+ nSumInWinBprot += 1.0 ;
691+ }
692+ }
693+ }
694+
610695 } // End track loop
611696
612697 // selecting subsample and filling profiles
@@ -676,11 +761,68 @@ struct V0ptHadPiKaProt {
676761 }
677762 }
678763
764+ if (nSumInWinA > 4 && nSumInWinB > 4 && nSumInWinC > 4 ) {
765+ double twoParCorr = (vecQInWinA * TComplex::Conjugate (vecQInWinC)).Re ();
766+ twoParCorr *= 1.0 / (nSumInWinA * nSumInWinC);
767+ histos.get <TProfile2D>(HIST (" Prof_XY" ))->Fill (cent, 0.5 , twoParCorr);
768+
769+ subSampleV02[sampleIndex][0 ]->Fill (cent, 0.5 , twoParCorr);
770+
771+ // hadrons
772+ for (int i = 0 ; i < cfgNbinsV02pt; i++) {
773+ double threeParCorrHad = (vecQInWinA * TComplex::Conjugate (vecQInWinC) * fPtProfileHadInWinB ->GetBinContent (i + 1 )).Re ();
774+ threeParCorrHad *= 1.0 / (nSumInWinA * nSumInWinC * nSumInWinB);
775+ histos.get <TProfile2D>(HIST (" Prof_XYZ_had" ))->Fill (cent, fPtProfileHadInWinB ->GetBinCenter (i + 1 ), threeParCorrHad);
776+ histos.get <TProfile2D>(HIST (" Prof_Z_had" ))->Fill (cent, fPtProfileHadInWinB ->GetBinCenter (i + 1 ), (fPtProfileHadInWinB ->GetBinContent (i + 1 ) / nSumInWinB));
777+
778+ subSampleV02[sampleIndex][1 ]->Fill (cent, fPtProfileHadInWinB ->GetBinCenter (i + 1 ), threeParCorrHad);
779+ subSampleV02[sampleIndex][2 ]->Fill (cent, fPtProfileHadInWinB ->GetBinCenter (i + 1 ), (fPtProfileHadInWinB ->GetBinContent (i + 1 ) / nSumInWinB));
780+ }
781+
782+ // pions
783+ for (int i = 0 ; i < cfgNbinsV02pt; i++) {
784+ double threeParCorrPi = (vecQInWinA * TComplex::Conjugate (vecQInWinC) * fPtProfilePiInWinB ->GetBinContent (i + 1 )).Re ();
785+ threeParCorrPi *= 1.0 / (nSumInWinA * nSumInWinC * nSumInWinB);
786+ histos.get <TProfile2D>(HIST (" Prof_XYZ_pi" ))->Fill (cent, fPtProfilePiInWinB ->GetBinCenter (i + 1 ), threeParCorrPi);
787+ histos.get <TProfile2D>(HIST (" Prof_Z_pi" ))->Fill (cent, fPtProfilePiInWinB ->GetBinCenter (i + 1 ), (fPtProfilePiInWinB ->GetBinContent (i + 1 ) / nSumInWinB));
788+
789+ subSampleV02[sampleIndex][1 ]->Fill (cent, fPtProfilePiInWinB ->GetBinCenter (i + 1 ), threeParCorrPi);
790+ subSampleV02[sampleIndex][2 ]->Fill (cent, fPtProfilePiInWinB ->GetBinCenter (i + 1 ), (fPtProfilePiInWinB ->GetBinContent (i + 1 ) / nSumInWinB));
791+ }
792+
793+ // kaons
794+ for (int i = 0 ; i < cfgNbinsV02pt; i++) {
795+ double threeParCorrKa = (vecQInWinA * TComplex::Conjugate (vecQInWinC) * fPtProfileKaInWinB ->GetBinContent (i + 1 )).Re ();
796+ threeParCorrKa *= 1.0 / (nSumInWinA * nSumInWinC * nSumInWinB);
797+ histos.get <TProfile2D>(HIST (" Prof_XYZ_ka" ))->Fill (cent, fPtProfileKaInWinB ->GetBinCenter (i + 1 ), threeParCorrKa);
798+ histos.get <TProfile2D>(HIST (" Prof_Z_ka" ))->Fill (cent, fPtProfileKaInWinB ->GetBinCenter (i + 1 ), (fPtProfileKaInWinB ->GetBinContent (i + 1 ) / nSumInWinB));
799+
800+ subSampleV02[sampleIndex][1 ]->Fill (cent, fPtProfileKaInWinB ->GetBinCenter (i + 1 ), threeParCorrKa);
801+ subSampleV02[sampleIndex][2 ]->Fill (cent, fPtProfileKaInWinB ->GetBinCenter (i + 1 ), (fPtProfileKaInWinB ->GetBinContent (i + 1 ) / nSumInWinB));
802+ }
803+
804+ // protons
805+ for (int i = 1 ; i < cfgNbinsV02pt; i++) {
806+ double threeParCorrProt = (vecQInWinA * TComplex::Conjugate (vecQInWinC) * fPtProfileProtInWinB ->GetBinContent (i + 1 )).Re ();
807+ threeParCorrProt *= 1.0 / (nSumInWinA * nSumInWinC * nSumInWinB);
808+ histos.get <TProfile2D>(HIST (" Prof_XYZ_prot" ))->Fill (cent, fPtProfileProtInWinB ->GetBinCenter (i + 1 ), threeParCorrProt);
809+ histos.get <TProfile2D>(HIST (" Prof_Z_prot" ))->Fill (cent, fPtProfileProtInWinB ->GetBinCenter (i + 1 ), (fPtProfileProtInWinB ->GetBinContent (i + 1 ) / nSumInWinB));
810+
811+ subSampleV02[sampleIndex][1 ]->Fill (cent, fPtProfileProtInWinB ->GetBinCenter (i + 1 ), threeParCorrProt);
812+ subSampleV02[sampleIndex][2 ]->Fill (cent, fPtProfileProtInWinB ->GetBinCenter (i + 1 ), (fPtProfileProtInWinB ->GetBinContent (i + 1 ) / nSumInWinB));
813+ }
814+ }
815+
679816 fPtProfileHad ->Delete ();
680817 fPtProfilePi ->Delete ();
681818 fPtProfileKa ->Delete ();
682819 fPtProfileProt ->Delete ();
683820
821+ fPtProfileHadInWinB ->Delete ();
822+ fPtProfilePiInWinB ->Delete ();
823+ fPtProfileKaInWinB ->Delete ();
824+ fPtProfileProtInWinB ->Delete ();
825+
684826 } // End process loop
685827};
686828
0 commit comments