4040
4141#include < cstring>
4242#include < string>
43+ #include < unordered_map>
4344#include < vector>
4445
4546using namespace o2 ;
@@ -95,17 +96,17 @@ struct MultiharmonicCorrelations { // this name is used in lower-case format to
9596
9697 // *) Define configurables:
9798 Configurable<bool > cfDryRun{" cfDryRun" , false , " book all histos and run without filling and calculating anything" }; // example for built-in type (float, string, etc.)
98- Configurable<std::vector<float >> cfPtBins{" cfPtBins" , {1000 , 0 ., 100 .}, " nPtBins, ptMin, ptMax" }; // example for an array
99- Configurable<std::vector<float >> cfPhiBins{" cfPhiBins" , {100 , 0 ., o2::constants::math::TwoPI}, " nPhiBins, phiMin, phiMax" };
100- Configurable<std::vector<float >> cfCentrBins{" cfCentrBins" , {100 , 0 ., 100 .}, " nCentrBins, centrMin, centrMax" };
101- Configurable<std::vector<float >> cfXBins{" cfXBins" , {1000 , -100 ., 100 . }, " nXBins, xMin, xMax" };
102- Configurable<std::vector<float >> cfYBins{" cfYBins" , {1000 , -100 ., 100 . }, " nYBins, yMin, yMax" };
103- Configurable<std::vector<float >> cfZBins{" cfZBins" , {1000 , -100 ., 100 .}, " nZBins, zMin, zMax" };
104- Configurable<std::vector<float >> cfMultBins{" cfMultBins" , {50 , 0 , 3e3 }, " nMultBins, multMin, multMax" };
105- Configurable<std::vector<float >> cfTPCnclsBins{" cfTPCnclsBins" , {100 , 0 ., 1000 .}, " ntpcnclsBins, tpnclsMin, tpcnclsMax" };
106- Configurable<std::vector<float >> cfDCAxyBins{" cfDCAxyBins" , {1000 , -20 ., 20 . }, " ndcaxyBins, dcaxyMin, dcaxyMax" };
107- Configurable<std::vector<float >> cfDCAzBins{" cfDCAzBins" , {1000 , -10 ., 10 .}, " ndcazBins, dcazMin, dcazMax" };
108- Configurable<std::vector<float >> cfNcontrBins{" cfNcontrBins" , {100 , 0 ., 1000 }, " nNContrBins, NContrMin, NContrMax" };
99+ Configurable<std::vector<float >> cfPtBins{" cfPtBins" , {1000 , 0 ., 8 .}, " nPtBins, ptMin, ptMax" }; // example for an array
100+ Configurable<std::vector<float >> cfPhiBins{" cfPhiBins" , {360 , 0 ., o2::constants::math::TwoPI}, " nPhiBins, phiMin, phiMax" };
101+ Configurable<std::vector<float >> cfCentrBins{" cfCentrBins" , {100 , 0 ., 80 .}, " nCentrBins, centrMin, centrMax" };
102+ Configurable<std::vector<float >> cfXBins{" cfXBins" , {1000 , -0.04 , - 0.01 }, " nXBins, xMin, xMax" };
103+ Configurable<std::vector<float >> cfYBins{" cfYBins" , {1000 , -0.01 , 0.006 }, " nYBins, yMin, yMax" };
104+ Configurable<std::vector<float >> cfZBins{" cfZBins" , {1000 , -20 ., 20 .}, " nZBins, zMin, zMax" };
105+ Configurable<std::vector<float >> cfMultBins{" cfMultBins" , {50 , 0 , 2e4 }, " nMultBins, multMin, multMax" };
106+ Configurable<std::vector<float >> cfTPCnclsBins{" cfTPCnclsBins" , {100 , 0 ., 200 .}, " ntpcnclsBins, tpnclsMin, tpcnclsMax" };
107+ Configurable<std::vector<float >> cfDCAxyBins{" cfDCAxyBins" , {1000 , -0.5 , 0.5 }, " ndcaxyBins, dcaxyMin, dcaxyMax" };
108+ Configurable<std::vector<float >> cfDCAzBins{" cfDCAzBins" , {1000 , -3 ., 3 .}, " ndcazBins, dcazMin, dcazMax" };
109+ Configurable<std::vector<float >> cfNcontrBins{" cfNcontrBins" , {100 , 0 ., 10000 . }, " nNContrBins, NContrMin, NContrMax" };
109110
110111 Configurable<std::string> cfCent{" cfCent" , " FT0C" , " centrality estimator" };
111112 Configurable<std::string> cfMult{" cfMult" , " TPC" , " multiplicity" };
@@ -115,7 +116,8 @@ struct MultiharmonicCorrelations { // this name is used in lower-case format to
115116 Configurable<std::vector<float >> cfPt{" cfPt" , {0.2 , 5.0 }, " transverse momentum range" };
116117 Configurable<std::vector<float >> cfEta{" cfEta" , {-0.8 , 0.8 }, " eta range" };
117118
118- Configurable<std::string> cfFileWithWeights{" cfFileWithWeights" , " /alice-ccdb.cern.ch/Users/p/pengchon/test04" , " path to external ROOT file which holds all particle weights" };
119+ Configurable<std::vector<int >> cfRuns{" cfRuns" , {544091 , 544095 , 544098 , 544116 , 544121 , 544122 , 544123 , 544124 }, " List of run numbers to analyze" };
120+ Configurable<std::string> cfFileWithWeights{" cfFileWithWeights" , " /alice-ccdb.cern.ch/Users/p/pengchon/weightsfile01" , " path to external ROOT file which holds all particle weights" };
119121
120122 // *) Define and initialize all data members to be called in the main process* functions:
121123 // **) Task configuration:
@@ -150,6 +152,7 @@ struct MultiharmonicCorrelations { // this name is used in lower-case format to
150152 struct QA {
151153 TList* fQAList = NULL ;
152154 TH2F * fQA = NULL ;
155+ TH2F * fQAM_NC = NULL ;
153156 } qa;
154157
155158 static constexpr int maxHarmonic = 7 ;
@@ -163,6 +166,11 @@ struct MultiharmonicCorrelations { // this name is used in lower-case format to
163166 TComplex Qvector[maxHarmonic];
164167 } cor;
165168
169+ struct PhiHist {
170+ TList* fPhiHistList = NULL ;
171+ std::unordered_map<int , TH1F *> histMap;
172+ } phih;
173+
166174 TObject* GetObjectFromList (TList* list, const char * objectName)
167175 {
168176 // Get TObject pointer from TList, even if it's in some nested TList. Foreseen
@@ -384,7 +392,8 @@ struct MultiharmonicCorrelations { // this name is used in lower-case format to
384392 }
385393 // Print current run number:
386394 // LOGF(info, "Run number: %d", collision.bc().runNumber());
387-
395+ int currentRun = collision.bc ().runNumber ();
396+ auto it = phih.histMap .find (currentRun);
388397 float zrec = 0 ., zsim = 0 ., centr = 0 , M = 0 .;
389398
390399 if constexpr (rs == eRec || rs == eRecAndSim) {
@@ -414,6 +423,7 @@ struct MultiharmonicCorrelations { // this name is used in lower-case format to
414423 else if (cfMult.value == " NTracksPV" )
415424 M = collision.multNTracksPV ();
416425 event.fHistMult [eRec]->Fill (M);
426+ qa.fQAM_NC ->Fill (M, collision.numContrib ());
417427
418428 if constexpr (rs == eRecAndSim) {
419429 auto mccollision = collision.mcCollision ();
@@ -440,7 +450,7 @@ struct MultiharmonicCorrelations { // this name is used in lower-case format to
440450 }
441451
442452 // before loop over particles
443- float phi = 0 ;
453+ float phi = 0 , weight = 0 ;
444454 for (int ih = 0 ; ih < maxHarmonic; ih++) {
445455 cor.Qvector [ih] = TComplex (0 ., 0 .);
446456 }
@@ -456,12 +466,17 @@ struct MultiharmonicCorrelations { // this name is used in lower-case format to
456466 event.fEventHistograms [ePt][eRec][0 ]->Fill (track.pt ());
457467 ptrec = track.pt ();
458468 phi = track.phi ();
469+ if (it != phih.histMap .end ()) {
470+ it->second ->Fill (phi);
471+ }
459472 pc.fHistPhi [eRec]->Fill (track.phi ());
460473 pc.fHistCharge [eRec]->Fill (track.sign ());
461474 pc.fHistTPCncls [eRec]->Fill (track.tpcNClsFindable ());
462475 pc.fHistTracksdcaXY [eRec]->Fill (track.dcaXY ());
463476 pc.fHistTracksdcaZ [eRec]->Fill (track.dcaZ ());
464477
478+ weight = 1 .; // pc.histWeights->GetBinContent(phi);
479+
465480 // ... and corresponding MC truth simulated:
466481 // See https://github.com/AliceO2Group/O2Physics/blob/master/Tutorials/src/mcHistograms.cxx
467482 // See https://aliceo2group.github.io/analysis-framework/docs/datamodel/ao2dTables.html#montecarlo
@@ -494,7 +509,7 @@ struct MultiharmonicCorrelations { // this name is used in lower-case format to
494509
495510 // analysis in the loop over particle
496511 for (int ih = 0 ; ih < maxHarmonic; ih++) {
497- cor.Qvector [ih] += TComplex (TMath::Cos (ih * phi), TMath::Sin (ih * phi));
512+ cor.Qvector [ih] += TComplex (weight * TMath::Cos (ih * phi), weight * TMath::Sin (ih * phi));
498513 }
499514 } // end of for (auto track: tracks)
500515 // calculate correlations
@@ -551,6 +566,11 @@ struct MultiharmonicCorrelations { // this name is used in lower-case format to
551566 cor.fCorrelationVariablesList ->SetOwner (true );
552567 fBaseList ->Add (cor.fCorrelationVariablesList );
553568
569+ phih.fPhiHistList = new TList ();
570+ phih.fPhiHistList ->SetName (" PhiHistograms" );
571+ phih.fPhiHistList ->SetOwner (true );
572+ fBaseList ->Add (phih.fPhiHistList );
573+
554574 // *) Book pt distribution with binning defined through configurables in the json file:
555575 vector<float > l_pt_bins = cfPtBins.value ; // define local array and initialize it from an array set in the configurables
556576 vector<float > l_phi_bins = cfPhiBins.value ;
@@ -563,6 +583,7 @@ struct MultiharmonicCorrelations { // this name is used in lower-case format to
563583 vector<float > l_dcaxy_bins = cfDCAxyBins.value ;
564584 vector<float > l_dcaz_bins = cfDCAzBins.value ;
565585 vector<float > l_ncontr_bins = cfNcontrBins.value ;
586+ vector<int > targetRuns = cfRuns.value ;
566587 int nBins = static_cast <int >(l_pt_bins[0 ]);
567588 int nBinsphi = static_cast <int >(l_phi_bins[0 ]);
568589 int nBinscentr = static_cast <int >(l_centr_bins[0 ]);
@@ -695,9 +716,11 @@ struct MultiharmonicCorrelations { // this name is used in lower-case format to
695716 }
696717 }
697718
698- qa.fQA = new TH2F (" QA" , " quality assurance" , nBinscentr, mincentr, maxcentr, nBinscentr, mincentr, maxcentr);
719+ qa.fQA = new TH2F (" QA_centr" , " quality assurance of centrality" , nBinscentr, mincentr, maxcentr, nBinscentr, mincentr, maxcentr);
720+ qa.fQAM_NC = new TH2F (" QAM_NC" , " quality assurance of mult vs. NContributors" , nBinsmult, minmult, maxmult, nBinsncontr, minncontr, maxncontr);
699721 if (cfQA) {
700722 qa.fQAList ->Add (qa.fQA );
723+ qa.fQAList ->Add (qa.fQAM_NC );
701724 }
702725
703726 // float quantiles[10] = {0, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8};
@@ -723,6 +746,16 @@ struct MultiharmonicCorrelations { // this name is used in lower-case format to
723746 cor.fCorrelationVariablesList ->Add (cor.pfour32_centr );
724747 cor.fCorrelationVariablesList ->Add (cor.pfour42_centr );
725748
749+ // init of phi hist for different runs
750+ for (const int & run : targetRuns) {
751+ std::string histName = " hphi_run_" + std::to_string (run);
752+ std::string histTitle = " Phi dis for Run " + std::to_string (run);
753+
754+ TH1F * h = new TH1F (histName.c_str (), histTitle.c_str (), nBinsphi, minphi, maxphi);
755+ phih.fPhiHistList ->Add (h);
756+ phih.histMap [run] = h;
757+ }
758+
726759 } // end of void init(InitContext&) {
727760
728761 // A) Process only reconstructed data:
0 commit comments