5 particle cumulants
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 10 Feb 2011 21:16:02 +0000 (21:16 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 10 Feb 2011 21:16:02 +0000 (21:16 +0000)
PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithMixedHarmonics.cxx
PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithMixedHarmonics.h
PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithNestedLoops.cxx
PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithNestedLoops.h

index f33864e..a417a57 100644 (file)
@@ -91,6 +91,7 @@ fImQnk(NULL),
 fSpk(NULL),
 fProfileList(NULL),
 f3pCorrelatorPro(NULL),
+f5pCorrelatorPro(NULL),
 fNonIsotropicTermsPro(NULL),
 f3pCorrelatorVsMPro(NULL),
 f3pPOICorrelatorVsM(NULL),
@@ -235,8 +236,8 @@ void AliFlowAnalysisWithMixedHarmonics::Make(AliFlowEventSimple* anEvent)
     {
      wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth))); 
     } 
-    // Calculate Re[Q_{m,k}] and Im[Q_{m,k}], (m <= n and k = 0,1,2,3) for this event:
-    for(Int_t m=0;m<2;m++) // needs only Q-vectors in harmonincs n and 2n
+    // Calculate Re[Q_{m,k}] and Im[Q_{m,k}], (m = 1,2,3,4,5,6 and k = 0,1,2,3) for this event:
+    for(Int_t m=0;m<6;m++) 
     {
      for(Int_t k=0;k<4;k++) // to be improved (what is the maximum k that I need?)
      {
@@ -336,7 +337,11 @@ void AliFlowAnalysisWithMixedHarmonics::Make(AliFlowEventSimple* anEvent)
  {
   this->Calculate3pCorrelator();
   this->CalculateNonIsotropicTerms();                          
- }             
+  if(anEvent->GetEventNSelTracksRP() >= 5) 
+  {
+   this->Calculate5pCorrelator();
+  } // end of if(anEvent->GetEventNSelTracksRP() >= 5) 
+ } // end of if(anEvent->GetEventNSelTracksRP() >= 3)             
                  
  // f) Calculate differential 3-p azimuthal correlator cos[n(psi1+psi2-2*phi3)] in terms of Q_{2n} and p_{n}:
  if(fEvaluateDifferential3pCorrelator && anEvent->GetEventNSelTracksRP() >= 1)
@@ -514,6 +519,13 @@ void AliFlowAnalysisWithMixedHarmonics::GetPointersForAllEventProfiles()
  TProfile *g2pCorrelatorSinPsiSum = dynamic_cast<TProfile *>(profileList->FindObject("f2pCorrelatorSinPsiSum"));
  if(g2pCorrelatorSinPsiSum)
    this->Set2pCorrelatorSinPsiSum(g2pCorrelatorSinPsiSum);
+   
+ TString s5pCorrelatorProName = "f5pCorrelatorPro";
+ TProfile *p5pCorrelatorPro = dynamic_cast<TProfile*>(profileList->FindObject(s5pCorrelatorProName.Data()));
+ if(p5pCorrelatorPro)
+ {
+  this->Set5pCorrelatorPro(p5pCorrelatorPro);  
+ }
   
 } // end of void AliFlowAnalysisWithMixedHarmonics::GetPointersForAllEventProfiles()
 
@@ -689,12 +701,10 @@ void AliFlowAnalysisWithMixedHarmonics::BookAllEventByEventQuantities()
 {
  // Book all event-by-event quantitites.
  
- Int_t n = fHarmonic;
- // Q_{n,k} and S{p,k}:
- fReQnk = new TMatrixD(2*n,9); // to be improved(bound on k)
- fImQnk = new TMatrixD(2*n,9); // to be improved(bound on k)
- fSpk = new TMatrixD(4,4); // to be improved(bound on p and k)
+  // Q_{n,k} and S{p,k}:
+ fReQnk = new TMatrixD(6,9); // to be improved (check bound on k!)
+ fImQnk = new TMatrixD(6,9); // to be improved (check bound on k!)
+ fSpk = new TMatrixD(4,4); // to be improved (check bound on p and k!)
  
  // p_n vs [(p1+p2)/2,|p1-p2|]
  if(!fEvaluateDifferential3pCorrelator){return;} 
@@ -744,7 +754,8 @@ void AliFlowAnalysisWithMixedHarmonics::BookDefault()
  // a) 3-p correlator <<cos[n*(phi1+phi2-2phi3)]>> for all events (not corrected for detector effects);
  // b) Non-isotropic terms in the decomposition of <<cos[n(phi1+phi2-2phi3)]>>;
  // c) 3-p correlator <<cos[n(phi1+phi2-2phi3)]>> corrected for detector effects;
- // d) Histogram which quantifies bias coming from detector inefficiencies to 3-p correlator <<cos[n(phi1+phi2-2phi3)]>>.
+ // d) Histogram which quantifies bias coming from detector inefficiencies to 3-p correlator <<cos[n(phi1+phi2-2phi3)]>>;
+ // e) 5-p correlator <<cos[n*(2phi1+2phi2+2phi3-3phi4-3phi5)]>> for all events (not corrected for detector effects - not supported yet).
 
  // a) 3-p correlator <<cos[n*(phi1+phi2-2phi3)]>> for all events (not corrected for detector effects);
  TString s3pCorrelatorProName = "f3pCorrelatorPro";
@@ -822,6 +833,21 @@ void AliFlowAnalysisWithMixedHarmonics::BookDefault()
    }  
  fResultsList->Add(fDetectorBiasHist);
  
+ // e) 5-p correlator <<cos[n*(2phi1+2phi2+2phi3-3phi4-3phi5)]>> for all events (not corrected for detector effects - not supported yet):
+ TString s5pCorrelatorProName = "f5pCorrelatorPro";
+ f5pCorrelatorPro = new TProfile(s5pCorrelatorProName.Data(),"",1,0,1);
+ f5pCorrelatorPro->SetStats(kFALSE);
+ f5pCorrelatorPro->GetXaxis()->SetLabelOffset(0.01);
+ f5pCorrelatorPro->GetXaxis()->SetLabelSize(0.05);
+ if(fHarmonic == 1)
+ {
+  f5pCorrelatorPro->GetXaxis()->SetBinLabel(1,"#LT#LTcos(2#phi_{1}+2#phi_{2}+2#phi_{3}-3#phi_{4}-3#phi_{5})#GT#GT");
+ } else
+   {
+    f5pCorrelatorPro->GetXaxis()->SetBinLabel(1,Form("#LT#LTcos[%i(2#phi_{1}+2#phi_{2}+2#phi_{3}-3#phi_{4}-3#phi_{5})]#GT#GT",fHarmonic));
+   }
+ fProfileList->Add(f5pCorrelatorPro);
 } // end of void AliFlowAnalysisWithMixedHarmonics::BookDefault()     
       
 //================================================================================================================
@@ -1184,6 +1210,13 @@ void AliFlowAnalysisWithMixedHarmonics::CheckPointersUsedInMake()
   cout<<endl;
   exit(0); 
  }
+ if(!f5pCorrelatorPro)
+ {
+  cout<<endl;
+  cout<<" WARNING (MH): f5pCorrelatorPro is NULL in CheckPointersUsedInMake() !!!!"<<endl;
+  cout<<endl;
+  exit(0); 
+ }
  if(!fNonIsotropicTermsPro)
  {                        
   cout<<endl;
@@ -1212,32 +1245,8 @@ void AliFlowAnalysisWithMixedHarmonics::CheckPointersUsedInMake()
   cout<<endl;
   exit(0);
  }
-
- if(!f2pCorrelatorCosPsiDiff) {
-  cout<<endl;
-  cout<<" WARNING (MH): f2pCorrelatorCosPsiDiff is NULL in CheckPointersUsedInMake() !!!!"<<endl;
-  cout<<endl;
-  exit(0);
- }
- if(!f2pCorrelatorCosPsiSum) {
-  cout<<endl;
-  cout<<" WARNING (MH): f2pCorrelatorCosPsiSum is NULL in CheckPointersUsedInMake() !!!!"<<endl;
-  cout<<endl;
-  exit(0);
- }
- if(!f2pCorrelatorSinPsiDiff) {
-  cout<<endl;
-  cout<<" WARNING (MH): f2pCorrelatorSinPsiDiff is NULL in CheckPointersUsedInMake() !!!!"<<endl;
-  cout<<endl;
-  exit(0);
- }
- if(!f2pCorrelatorSinPsiSum) {
-  cout<<endl;
-  cout<<" WARNING (MH): f2pCorrelatorSinPsiSum is NULL in CheckPointersUsedInMake() !!!!"<<endl;
-  cout<<endl;
-  exit(0);
- }
-
+ // Differential correlators:
  if(!fEvaluateDifferential3pCorrelator){return;}
  for(Int_t sd=0;sd<2;sd++)
  {
@@ -1290,6 +1299,31 @@ for(Int_t fs=0;fs<2;fs++)
    }
   } // end of for(Int_t fs=0;fs<2;fs++)
  } // end of for(Int_t sd=0;sd<2;sd++)
+ if(!f2pCorrelatorCosPsiDiff) {
+  cout<<endl;
+  cout<<" WARNING (MH): f2pCorrelatorCosPsiDiff is NULL in CheckPointersUsedInMake() !!!!"<<endl;
+  cout<<endl;
+  exit(0);
+ }
+ if(!f2pCorrelatorCosPsiSum) {
+  cout<<endl;
+  cout<<" WARNING (MH): f2pCorrelatorCosPsiSum is NULL in CheckPointersUsedInMake() !!!!"<<endl;
+  cout<<endl;
+  exit(0);
+ }
+ if(!f2pCorrelatorSinPsiDiff) {
+  cout<<endl;
+  cout<<" WARNING (MH): f2pCorrelatorSinPsiDiff is NULL in CheckPointersUsedInMake() !!!!"<<endl;
+  cout<<endl;
+  exit(0);
+ }
+ if(!f2pCorrelatorSinPsiSum) {
+  cout<<endl;
+  cout<<" WARNING (MH): f2pCorrelatorSinPsiSum is NULL in CheckPointersUsedInMake() !!!!"<<endl;
+  cout<<endl;
+  exit(0);
+ }
                                                                                                                                                                                                                                                                                                                                    
 } // end of AliFlowAnalysisWithMixedHarmonics::CheckPointersUsedInMake()
 
@@ -1349,31 +1383,6 @@ void AliFlowAnalysisWithMixedHarmonics::CheckPointersUsedInFinish()
   exit(0);
  }
 
- if(!f2pCorrelatorCosPsiDiff) {
-  cout<<endl;
-  cout<<" WARNING (MH): f2pCorrelatorCosPsiDiff is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
-  cout<<endl;
-  exit(0);
- }
- if(!f2pCorrelatorCosPsiSum) {
-  cout<<endl;
-  cout<<" WARNING (MH): f2pCorrelatorCosPsiSum is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
-  cout<<endl;
-  exit(0);
- }
- if(!f2pCorrelatorSinPsiDiff) {
-  cout<<endl;
-  cout<<" WARNING (MH): f2pCorrelatorSinPsiDiff is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
-  cout<<endl;
-  exit(0);
- }
- if(!f2pCorrelatorSinPsiSum) {
-  cout<<endl;
-  cout<<" WARNING (MH): f2pCorrelatorSinPsiSum is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
-  cout<<endl;
-  exit(0);
- }
-
  if(!f3pCorrelatorHist)
  {                        
   cout<<endl;
@@ -1397,6 +1406,8 @@ void AliFlowAnalysisWithMixedHarmonics::CheckPointersUsedInFinish()
   exit(0);
  } 
  */  
+ // Differential correlators:
  if(!fEvaluateDifferential3pCorrelator){return;} 
  for(Int_t sd=0;sd<2;sd++)
  {
@@ -1416,6 +1427,31 @@ void AliFlowAnalysisWithMixedHarmonics::CheckPointersUsedInFinish()
   } 
  }
 
+ if(!f2pCorrelatorCosPsiDiff) {
+  cout<<endl;
+  cout<<" WARNING (MH): f2pCorrelatorCosPsiDiff is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
+  cout<<endl;
+  exit(0);
+ }
+ if(!f2pCorrelatorCosPsiSum) {
+  cout<<endl;
+  cout<<" WARNING (MH): f2pCorrelatorCosPsiSum is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
+  cout<<endl;
+  exit(0);
+ }
+ if(!f2pCorrelatorSinPsiDiff) {
+  cout<<endl;
+  cout<<" WARNING (MH): f2pCorrelatorSinPsiDiff is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
+  cout<<endl;
+  exit(0);
+ }
+ if(!f2pCorrelatorSinPsiSum) {
+  cout<<endl;
+  cout<<" WARNING (MH): f2pCorrelatorSinPsiSum is NULL in CheckPointersUsedInFinish() !!!!"<<endl;
+  cout<<endl;
+  exit(0);
+ }
+
 } // end of AliFlowAnalysisWithMixedHarmonics::CheckPointersUsedInFinish()
 
 //================================================================================================================
@@ -1440,9 +1476,12 @@ void AliFlowAnalysisWithMixedHarmonics::PrintOnTheScreen()
  // <<cos[n*(psi1+psi2-2phi3)]>>:
  Double_t d3pCorrelatorPoi = 0.;
  Double_t d3pCorrelatorPoiError = 0.;
- GetCorrelatorAndError(f3pCorrelatorVsPtSumDiffPro[0],
+ if(fEvaluateDifferential3pCorrelator)
+ {
+  GetCorrelatorAndError(f3pCorrelatorVsPtSumDiffPro[0],
                       d3pCorrelatorPoi,
                       d3pCorrelatorPoiError);
+ }                    
  cout<<endl;
  cout<<"*******************************************************"<<endl;
  cout<<"*******************************************************"<<endl;
@@ -1657,6 +1696,79 @@ void AliFlowAnalysisWithMixedHarmonics::Calculate3pCorrelator()
 
 //================================================================================================================
 
+void AliFlowAnalysisWithMixedHarmonics::Calculate5pCorrelator()
+{
+ // Calculate 5-p azimuthal correlator cos[n(2phi1+2phi2+2phi3-3phi4-3phi5)] in terms of Q_{n,k} and S_{p,k}.
+ // a) Calculate 5-p correlator without using particle weights;
+ // b) Calculate 5-p correlator with using particle weights.
+
+ // a) Calculate 5-p correlator without using particle weights: 
+ if(!(fUsePhiWeights || fUsePtWeights || fUseEtaWeights))
+ {
+  // Multiplicity (number of RPs):
+  Double_t dMult = (*fSpk)(0,0);
+  // Real and imaginary parts of non-weighted Q-vectors (Q_{n,0}) evaluated in harmonics n,2n,...,6n: 
+  Double_t dReQ1n = (*fReQnk)(0,0);
+  Double_t dReQ2n = (*fReQnk)(1,0);
+  Double_t dReQ3n = (*fReQnk)(2,0);
+  Double_t dReQ4n = (*fReQnk)(3,0);
+  //Double_t dReQ5n = (*fReQnk)(4,0); // not needed
+  Double_t dReQ6n = (*fReQnk)(5,0);
+  Double_t dImQ1n = (*fImQnk)(0,0);
+  Double_t dImQ2n = (*fImQnk)(1,0);
+  Double_t dImQ3n = (*fImQnk)(2,0);
+  Double_t dImQ4n = (*fImQnk)(3,0);
+  //Double_t dImQ5n = (*fImQnk)(4,0); // not needed
+  Double_t dImQ6n = (*fImQnk)(5,0);
+  
+  // 5-particle azimuthal correlator:
+  Double_t five2n2n2n3n3n = 0.; // <cos[n(2phi1+2phi2+2phi3-3phi4-3phi5)]>
+  Double_t reQ2nQ2nQ2nQ3nstarQ3nstar = pow(dReQ2n,3.)*pow(dReQ3n,2.) 
+                                     - 3.*dReQ2n*pow(dReQ3n,2.)*pow(dImQ2n,2.)
+                                     + 6.*pow(dReQ2n,2.)*dReQ3n*dImQ2n*dImQ3n 
+                                     - 2.*dReQ3n*pow(dImQ2n,3.)*dImQ3n-pow(dReQ2n,3.)*pow(dImQ3n,2.) 
+                                     + 3.*dReQ2n*pow(dImQ2n,2.)*pow(dImQ3n,2.);
+  Double_t reQ2nQ2nQ2nQ6nstar = dReQ6n*pow(dReQ2n,3)-3.*dReQ2n*dReQ6n*pow(dImQ2n,2)
+                               + 3.*dImQ2n*dImQ6n*pow(dReQ2n,2)-dImQ6n*pow(dImQ2n,3); 
+  Double_t reQ4nQ2nQ3nstarQ3nstar = (dReQ4n*dReQ2n-dImQ4n*dImQ2n)*(dReQ3n*dReQ3n-dImQ3n*dImQ3n)
+                                  + 2.*(dReQ4n*dImQ2n+dImQ4n*dReQ2n)*dReQ3n*dImQ3n;
+  Double_t reQ2nQ2nQ1nstarQ3nstar = (pow(dReQ2n,2.)-pow(dImQ2n,2.))*(dReQ3n*dReQ1n-dImQ3n*dImQ1n) 
+                                  + 2.*dReQ2n*dImQ2n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n);                            
+  Double_t reQ6nQ3nstarQ3nstar = pow(dReQ3n,2.)*dReQ6n + 2.*dReQ3n*dImQ3n*dImQ6n 
+                               - pow(dImQ3n,2.)*dReQ6n; 
+  Double_t reQ4nQ2nQ6nstar = dReQ6n*dReQ4n*dReQ2n-dReQ6n*dImQ4n*dImQ2n+dImQ6n*dReQ4n*dImQ2n
+                           + dImQ6n*dImQ4n*dReQ2n;
+  Double_t reQ4nQ1nstarQ3nstar = dReQ4n*(dReQ3n*dReQ1n-dImQ3n*dImQ1n)+dImQ4n*(dReQ3n*dImQ1n+dImQ3n*dReQ1n); 
+  Double_t reQ2nQ2nQ4nstar = pow(dReQ2n,2.)*dReQ4n+2.*dReQ2n*dImQ2n*dImQ4n-pow(dImQ2n,2.)*dReQ4n;                       
+  Double_t reQ2nQ1nQ3nstar = dReQ3n*dReQ2n*dReQ1n-dReQ3n*dImQ2n*dImQ1n+dImQ3n*dReQ2n*dImQ1n
+                           + dImQ3n*dImQ2n*dReQ1n;
+  Double_t reQ2nQ1nstarQ1nstar = pow(dReQ1n,2.)*dReQ2n + 2.*dReQ1n*dImQ1n*dImQ2n - pow(dImQ1n,2.)*dReQ2n; 
+  // Analytic expression for 5-particle azimuthal correlator:                                   
+  five2n2n2n3n3n = (reQ2nQ2nQ2nQ3nstarQ3nstar-reQ2nQ2nQ2nQ6nstar-3.*reQ4nQ2nQ3nstarQ3nstar 
+                 - 6.*reQ2nQ2nQ1nstarQ3nstar+2.*reQ6nQ3nstarQ3nstar+3.*reQ4nQ2nQ6nstar
+                 + 6.*reQ4nQ1nstarQ3nstar+6.*reQ2nQ2nQ4nstar
+                 + 12.*reQ2nQ1nQ3nstar+6.*reQ2nQ1nstarQ1nstar
+                 - 2.*((pow(dReQ6n,2.)+pow(dImQ6n,2.)) 
+                 + 3.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
+                 + 6.*(pow(dReQ3n,2.)+pow(dImQ3n,2.)) 
+                 + 9.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))
+                 + 6.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))-12.*dMult))
+                 /(dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
+  // Fill all-events profile:                       
+  f5pCorrelatorPro->Fill(0.5,five2n2n2n3n3n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
+ } // end of if(!(fUsePhiWeights || fUsePtWeights || fUseEtaWeights)) 
+
+ // b) Calculate 5-p correlator with using particle weights: 
+ if(fUsePhiWeights || fUsePtWeights || fUseEtaWeights)
+ {
+  // ...
+ } // end of if(fUsePhiWeights || fUsePtWeights || fUseEtaWeights)
+} // end of void AliFlowAnalysisWithMixedHarmonics::Calculate5pCorrelator() 
+
+//================================================================================================================
+
 void AliFlowAnalysisWithMixedHarmonics::CalculateNonIsotropicTerms()
 {
  // Calculate non-isotropic terms which appear in the decomposition of 3-p correlator <cos[n(phi1+phi2-2phi3)]>.
index 02b434b..38600b0 100644 (file)
@@ -65,6 +65,7 @@ class AliFlowAnalysisWithMixedHarmonics
   virtual void Make(AliFlowEventSimple *anEvent);
   virtual void CheckPointersUsedInMake();
   virtual void Calculate3pCorrelator();
+  virtual void Calculate5pCorrelator();
   virtual void CalculateNonIsotropicTerms();
   virtual void CalculateDifferential3pCorrelator(Double_t &gIntegratedValue);
                                                 
@@ -143,6 +144,8 @@ class AliFlowAnalysisWithMixedHarmonics
   TList* GetProfileList() const {return this->fProfileList;}  
   void Set3pCorrelatorPro(TProfile* const s3pPro) {this->f3pCorrelatorPro = s3pPro;};
   TProfile* Get3pCorrelatorPro() const {return this->f3pCorrelatorPro;};
+  void Set5pCorrelatorPro(TProfile* const s5pPro) {this->f5pCorrelatorPro = s5pPro;};
+  TProfile* Get5pCorrelatorPro() const {return this->f5pCorrelatorPro;};
   void SetNonIsotropicTermsPro(TProfile* const nitPro) {this->fNonIsotropicTermsPro = nitPro;};
   TProfile* GetNonIsotropicTermsPro() const {return this->fNonIsotropicTermsPro;};
   void Set3pCorrelatorVsMPro(TProfile* const s3pVsMPro) {this->f3pCorrelatorVsMPro = s3pVsMPro;};
@@ -238,6 +241,7 @@ class AliFlowAnalysisWithMixedHarmonics
   // 4.) Profiles:
   TList *fProfileList; // list holding all all-event profiles 
   TProfile *f3pCorrelatorPro; // 3-p correlator <<cos[n(phi1+phi2-2phi3)]>> (not corrected for detector effects)
+  TProfile *f5pCorrelatorPro; // 5-p correlator <<cos[n*(2.*phi1+2.*phi2+2.*phi3-3.*phi4-3.*phi5)]>> (not corrected for detector effects)
   TProfile *fNonIsotropicTermsPro; // non-isotropic terms in the decomposition of 3-p correlator <<cos[n(phi1+phi2-2phi3)]>>
   TProfile *f3pCorrelatorVsMPro; // 3-p correlator <<cos[n(phi1+phi2-2phi3)]>> vs multiplicity
   TProfile *f3pPOICorrelatorVsM; // 3-p correlator <<cos[n(psi1+psi2-2phi3)]>> vs multiplicity
index 7e41939..0e81761 100644 (file)
@@ -85,7 +85,8 @@ fListQC(NULL),
 fEvaluateNestedLoopsForQC(kFALSE),
 fListMH(NULL),
 fEvaluateNestedLoopsForMH(kFALSE),
-f3pCorrelatorPro(NULL) 
+f3pCorrelatorPro(NULL),
+f5pCorrelatorPro(NULL) 
 {
  // Constructor. 
  
@@ -318,6 +319,12 @@ void AliFlowAnalysisWithNestedLoops::GetPointersForMH()
  {
   this->Set3pCorrelatorPro(p3pCorrelatorPro);  
  } 
+ TString s5pCorrelatorProName = "f5pCorrelatorPro";
+ TProfile *p5pCorrelatorPro = dynamic_cast<TProfile*>(listMH->FindObject(s5pCorrelatorProName.Data()));
+ if(p5pCorrelatorPro)
+ {
+  this->Set5pCorrelatorPro(p5pCorrelatorPro);  
+ } 
  if(!fEvaluateDifferential3pCorrelator){return;} 
  TString psdFlag[2] = {"PtSum","PtDiff"};
  for(Int_t sd=0;sd<2;sd++)
@@ -626,6 +633,13 @@ void AliFlowAnalysisWithNestedLoops::CheckPointersForMH(TString where)
    cout<<endl;
    exit(0); 
   }
+  if(!f5pCorrelatorPro)
+  {
+   cout<<endl;
+   cout<<" WARNING (NL): f5pCorrelatorPro is NULL in Make() !!!!"<<endl;
+   cout<<endl;
+   exit(0); 
+  }  
   if(!fEvaluateDifferential3pCorrelator){return;}
   for(Int_t sd=0;sd<2;sd++)
   {
@@ -648,6 +662,13 @@ void AliFlowAnalysisWithNestedLoops::CheckPointersForMH(TString where)
    cout<<endl;
    exit(0); 
   }
+  if(!f5pCorrelatorPro)
+  {
+   cout<<endl;
+   cout<<" WARNING (NL): f5pCorrelatorPro is NULL in Finish() !!!!"<<endl;
+   cout<<endl;
+   exit(0); 
+  }
  } // else if(strcmp(where.Data(),"Finish") == 0)
 
 } // end of void AliFlowAnalysisWithNestedLoops::CheckPointersForMH(TString where)
@@ -689,6 +710,7 @@ void AliFlowAnalysisWithNestedLoops::BookEverythingForMH()
  
  if(fEvaluateNestedLoopsForMH)
  {  
+  // 3-p:
   TString s3pCorrelatorProName = "f3pCorrelatorPro";
   f3pCorrelatorPro = new TProfile(s3pCorrelatorProName.Data(),"",1,0,1);
   f3pCorrelatorPro->SetStats(kFALSE);
@@ -702,7 +724,20 @@ void AliFlowAnalysisWithNestedLoops::BookEverythingForMH()
      f3pCorrelatorPro->GetXaxis()->SetBinLabel(1,Form("#LT#LTcos[%i(#phi_{1}+#phi_{2}-2#phi_{3})]#GT#GT",fHarmonic));
     }
   fListMH->Add(f3pCorrelatorPro);  
-  
+  // 5-p:
+  TString s5pCorrelatorProName = "f5pCorrelatorPro";
+  f5pCorrelatorPro = new TProfile(s5pCorrelatorProName.Data(),"",1,0,1);
+  f5pCorrelatorPro->SetStats(kFALSE);
+  f5pCorrelatorPro->GetXaxis()->SetLabelOffset(0.01);
+  f5pCorrelatorPro->GetXaxis()->SetLabelSize(0.05);
+  if(fHarmonic == 1)
+  {
+   f5pCorrelatorPro->GetXaxis()->SetBinLabel(1,"#LT#LTcos(2#phi_{1}+2#phi_{2}+2#phi_{3}-3#phi_{4}-3#phi_{5})#GT#GT");
+  } else
+    {
+     f5pCorrelatorPro->GetXaxis()->SetBinLabel(1,Form("#LT#LTcos[%i(2#phi_{1}+2#phi_{2}+2#phi_{3}-3#phi_{4}-3#phi_{5})]#GT#GT",fHarmonic));
+    }  
+  fListMH->Add(f5pCorrelatorPro);     
   if(fEvaluateDifferential3pCorrelator)
   {
    TString psdFlag[2] = {"PtSum","PtDiff"};
@@ -776,7 +811,7 @@ void AliFlowAnalysisWithNestedLoops::EvaluateNestedLoopsForMH(AliFlowEventSimple
  Int_t nPrim = anEvent->NumberOfTracks(); 
  Int_t nRP = anEvent->GetEventNSelTracksRP(); 
  AliFlowTrackSimple *aftsTrack = NULL;
- Double_t phi1=0.,phi2=0.,phi3=0.; // azimuthal angles of RPs
+ Double_t phi1=0.,phi2=0.,phi3=0.,phi4=0.,phi5=0.; // azimuthal angles of RPs
  Double_t psi1=0.,psi2=0.; // azimuthal angles of POIs
  Int_t charge1=0,charge2=0; // charge of POIs
  Double_t pt1=0.,pt2=0.; // transverse momenta of POIs
@@ -807,6 +842,46 @@ void AliFlowAnalysisWithNestedLoops::EvaluateNestedLoopsForMH(AliFlowEventSimple
    } // end of for(Int_t i2=0;i2<nPrim;i2++)  
   } // end of for(Int_t i1=0;i1<nPrim;i1++)
  }
+ // Evaluting correlator cos[n(2*phi1+2*phi2+2*phi3-3*phi4-3*phi5)] with five nested loops: 
+ if(nRP>=5)
+ {
+  for(Int_t i1=0;i1<nPrim;i1++)
+  {
+   aftsTrack=anEvent->GetTrack(i1);
+   if(!(aftsTrack->InRPSelection())) continue;  
+   phi1=aftsTrack->Phi();
+   for(Int_t i2=0;i2<nPrim;i2++)
+   {
+    if(i2==i1)continue;
+    aftsTrack=anEvent->GetTrack(i2);
+    if(!(aftsTrack->InRPSelection())) continue;
+    phi2=aftsTrack->Phi();
+    for(Int_t i3=0;i3<nPrim;i3++)
+    {
+     if(i3==i1||i3==i2)continue;
+     aftsTrack=anEvent->GetTrack(i3);
+     if(!(aftsTrack->InRPSelection())) continue;
+     phi3=aftsTrack->Phi();
+     for(Int_t i4=0;i4<nPrim;i4++)
+     {
+      if(i4==i1||i4==i2||i4==i3)continue;
+      aftsTrack=anEvent->GetTrack(i4);
+      if(!(aftsTrack->InRPSelection())) continue;
+      phi4=aftsTrack->Phi();
+      for(Int_t i5=0;i5<nPrim;i5++)
+      {
+       if(i5==i1||i5==i2||i5==i3||i5==i4)continue;
+       aftsTrack=anEvent->GetTrack(i5);
+       if(!(aftsTrack->InRPSelection())) continue;
+       phi5=aftsTrack->Phi();
+       f5pCorrelatorPro->Fill(0.5,cos(2.*n*phi1+2.*n*phi2+2.*n*phi3-3.*n*phi4-3.*n*phi5),1.);
+      } // end of for(Int_t i5=0;i5<nPrim;i5++)
+     } // end of for(Int_t i4=0;i4<nPrim;i4++)  
+    } // end of for(Int_t i3=0;i3<nPrim;i3++)
+   } // end of for(Int_t i2=0;i2<nPrim;i2++)
+  } // end of for(Int_t i1=0;i1<nPrim;i1++)
+ } // end of if(nPrim>=5) 
 
  // Evaluting correlator cos[n(psi1+psi2-2*phi3)] with three nested loops:
  if(!fEvaluateDifferential3pCorrelator){return;}
@@ -851,8 +926,8 @@ void AliFlowAnalysisWithNestedLoops::PrintOnTheScreen()
  // Print on the screen.
  
  cout<<endl;
- cout<<"****************************************************"<<endl;
- cout<<"****************************************************"<<endl;
+ cout<<"********************************************************************"<<endl;
+ cout<<"********************************************************************"<<endl;
  cout<<"                  Nested Loops                 "<<endl; 
  cout<<endl;
  
@@ -867,9 +942,11 @@ void AliFlowAnalysisWithNestedLoops::PrintOnTheScreen()
   if(fHarmonic != 1)
   {
    cout<<"   cos["<<fHarmonic<<"(phi1+phi2-2phi3)] = "<<f3pCorrelatorPro->GetBinContent(1)<<" +/- " <<f3pCorrelatorPro->GetBinError(1)<<endl;
+   cout<<"   cos["<<fHarmonic<<"(2phi1+2phi2+2phi3-3phi4-3phi5)] = "<<f5pCorrelatorPro->GetBinContent(1)<<" +/- " <<f5pCorrelatorPro->GetBinError(1)<<endl;
   } else
     {
      cout<<"   cos(phi1+phi2-2phi3) = "<<f3pCorrelatorPro->GetBinContent(1)<<" +/- " <<f3pCorrelatorPro->GetBinError(1)<<endl;
+     cout<<"   cos[(2phi1+2phi2+2phi3-3phi4-3phi5)] = "<<f5pCorrelatorPro->GetBinContent(1)<<" +/- " <<f5pCorrelatorPro->GetBinError(1)<<endl; 
     }  
   if(fEvaluateDifferential3pCorrelator)
   {
@@ -889,8 +966,8 @@ void AliFlowAnalysisWithNestedLoops::PrintOnTheScreen()
   cout<<"  Not evaluated."<<endl;
  }
  cout<<endl;
- cout<<"****************************************************"<<endl;
- cout<<"****************************************************"<<endl;
+ cout<<"********************************************************************"<<endl;
+ cout<<"********************************************************************"<<endl;
  cout<<endl;
  
 } // end of void AliFlowAnalysisWithNestedLoops::PrintOnTheScreen()
index f74540e..3dc0593 100644 (file)
@@ -125,6 +125,8 @@ class AliFlowAnalysisWithNestedLoops
   Bool_t GetEvaluateNestedLoopsForMH() const {return this->fEvaluateNestedLoopsForMH;};
   void Set3pCorrelatorPro(TProfile* const s3pPro) {this->f3pCorrelatorPro = s3pPro;};
   TProfile* Get3pCorrelatorPro() const {return this->f3pCorrelatorPro;};  
+  void Set5pCorrelatorPro(TProfile* const s3pPro) {this->f5pCorrelatorPro = s3pPro;};
+  TProfile* Get5pCorrelatorPro() const {return this->f5pCorrelatorPro;};   
   void Set3pCorrelatorVsPtSumDiffDirectPro(TProfile* const s3pcvpsdd, Int_t const sd) {this->f3pCorrelatorVsPtSumDiffDirectPro[sd] = s3pcvpsdd;};
   TProfile* Get3pCorrelatorVsPtSumDiffDirectPro(Int_t sd) const {return this->f3pCorrelatorVsPtSumDiffDirectPro[sd];};
   
@@ -174,7 +176,8 @@ class AliFlowAnalysisWithNestedLoops
   // 5.) Debugging and cross-checking MH:
   TList *fListMH; // list holding objects relevant for debugging and cross-checking of MH class
   Bool_t fEvaluateNestedLoopsForMH; // evaluate nested loops for mixed harmonics
-  TProfile *f3pCorrelatorPro; // 3-p correlator <<cos[phi1+phi2-2phi3]>>  
+  TProfile *f3pCorrelatorPro; // 3-p correlator <<cos[n(phi1+phi2-2phi3)]>>  
+  TProfile *f5pCorrelatorPro; // 5-p correlator <<cos[n(2phi1+2phi2+2phi3-3phi4-3phi5)]>>  
   TProfile *f3pCorrelatorVsPtSumDiffDirectPro[2]; // differential 3-p correlator cos[n(2phi1-psi2-psi3)] vs [(p1+p2)/2,|p1-p2|]
   
   ClassDef(AliFlowAnalysisWithNestedLoops, 0);