+void AliFlowAnalysisWithQCumulants::GetPointersForControlHistograms()
+{
+ // Get pointers to all control histograms.
+
+ // a) Get pointer to base list for control histograms;
+ // b) Get pointer to TProfile fControlHistogramsFlags holding all flags for control histograms;
+ // c) Get pointers to TH2D *fCorrelation2468VsMult[4], TH2D *fCorrelationProduct2468VsMult[1] and TH2D *fQvectorTermsVsMult[4].
+
+ // a) Get pointer to base list for control histograms:
+ TList *controlHistogramsList = dynamic_cast<TList*>(fHistList->FindObject("Control Histograms"));
+ if(controlHistogramsList)
+ {
+ this->SetControlHistogramsList(controlHistogramsList);
+ } else
+ {
+ cout<<"WARNING: controlHistogramsList is NULL in AFAWQC::GPFMHH() !!!!"<<endl;
+ exit(0);
+ }
+
+ // b) Get pointer to TProfile fControlHistogramsFlags holding all flags for control histograms:
+ TString controlHistogramsFlagsName = "fControlHistogramsFlags";
+ controlHistogramsFlagsName += fAnalysisLabel->Data();
+ TProfile *controlHistogramsFlags = dynamic_cast<TProfile*>
+ (controlHistogramsList->FindObject(controlHistogramsFlagsName.Data()));
+ if(controlHistogramsFlags)
+ {
+ this->SetControlHistogramsFlags(controlHistogramsFlags);
+ fStoreControlHistograms = (Bool_t)controlHistogramsFlags->GetBinContent(1);
+ fUseQvectorTerms = (Bool_t)controlHistogramsFlags->GetBinContent(2);
+ } else
+ {
+ cout<<"WARNING: controlHistogramsFlags is NULL in AFAWQC::GPFMHH() !!!!"<<endl;
+ exit(0);
+ }
+
+ if(!fStoreControlHistograms){return;}
+
+ // c) Get pointers to TH2D *fCorrelation2468VsMult[4], TH2D *fCorrelationProduct2468VsMult[1] and TH2D *fQvectorTermsVsMult[4]:
+ TString sCorrelation[4] = {"#LT2#GT","#LT4#GT","#LT6#GT","#LT8#GT"};
+ TString sCorrelation2468VsMultName = "fCorrelation2468VsMult";
+ sCorrelation2468VsMultName += fAnalysisLabel->Data();
+ for(Int_t ci=0;ci<4;ci++)
+ {
+ TH2D *hCorrelation2468VsMult = dynamic_cast<TH2D*>(controlHistogramsList->FindObject(Form("%s vs M",sCorrelation[ci].Data())));
+ if(hCorrelation2468VsMult)
+ {
+ this->SetCorrelation2468VsMult(hCorrelation2468VsMult,ci);
+ } else
+ {
+ cout<<"WARNING: hCorrelation2468VsMult is NULL in AFAWQC::GPFCH() !!!!"<<endl;
+ cout<<"ci = "<<ci<<endl;
+ exit(0);
+ }
+ } // end of for(Int_t ci=0;ci<4;ci++)
+ TString sCorrelationProduct[1] = {"#LT2#GT#LT4#GT"}; // TBI: add the other ones when needed first time
+ TString sCorrelationProduct2468VsMultName = "fCorrelationProduct2468VsMult";
+ sCorrelationProduct2468VsMultName += fAnalysisLabel->Data();
+ for(Int_t cpi=0;cpi<1;cpi++) // TBI: hardwired 1
+ {
+ TH2D *hCorrelationProduct2468VsMult = dynamic_cast<TH2D*>(controlHistogramsList->FindObject(Form("%s vs M",sCorrelationProduct[cpi].Data())));
+ if(hCorrelationProduct2468VsMult)
+ {
+ this->SetCorrelationProduct2468VsMult(hCorrelationProduct2468VsMult,cpi);
+ } else
+ {
+ cout<<"WARNING: hCorrelationProduct2468VsMult is NULL in AFAWQC::GPFCH() !!!!"<<endl;
+ cout<<"cpi = "<<cpi<<endl;
+ exit(0);
+ }
+ } // end of for(Int_t cpi=0;cpi<1;cpi++) // TBI: hardwired 1
+
+ if(!fUseQvectorTerms){return;}
+ TString sQvectorTerms[4] = {"#frac{|Q_{n}|^{2}}{M}","#frac{|Q_{2n}|^{2}}{M}","#frac{|Q_{n}|^{4}}{M(2M-1)}","#frac{Re[Q_{2n}Q_{n}^{*}Q_{n}^{*}]}{M^{3/2}}"};
+ TString sQvectorTermsVsMultName = "fQvectorTermsVsMult";
+ sQvectorTermsVsMultName += fAnalysisLabel->Data();
+ for(Int_t qwti=0;qwti<4;qwti++) // TBI: hardwired 4
+ {
+ TH2D *hQvectorTermsVsMult = dynamic_cast<TH2D*>(controlHistogramsList->FindObject(Form("%s vs M",sQvectorTerms[qwti].Data())));
+ if(hQvectorTermsVsMult)
+ {
+ this->SetQvectorTermsVsMult(hQvectorTermsVsMult,qwti);
+ } else
+ {
+ cout<<"WARNING: hQvectorTermsVsMult is NULL in AFAWQC::GPFCH() !!!!"<<endl;
+ cout<<"qwti = "<<qwti<<endl;
+ exit(0);
+ }
+ } // end of for(Int_t qwti=0;qwti<1;qwti++) // TBI: hardwired 4
+
+} // end of void AliFlowAnalysisWithQCumulants::GetPointersForControlHistograms()
+
+//=======================================================================================================================
+