new correlators and reduced numbers of hist filled
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 4 Apr 2012 18:15:07 +0000 (18:15 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 4 Apr 2012 18:15:07 +0000 (18:15 +0000)
PWG/FLOW/Base/AliFlowAnalysisWithFittingQDistribution.cxx
PWG/FLOW/Base/AliFlowAnalysisWithFittingQDistribution.h
PWG/FLOW/Base/AliFlowAnalysisWithQCumulants.cxx
PWG/FLOW/Tasks/AliAnalysisTaskFittingQDistribution.cxx
PWG/FLOW/Tasks/AliAnalysisTaskFittingQDistribution.h
PWG/FLOW/Tasks/AliAnalysisTaskQCumulants.cxx

index b37defb..d70c253 100644 (file)
@@ -34,6 +34,7 @@
 #include "TFile.h"
 #include "TList.h" 
 #include "TF1.h"
+#include "TH2D.h"
 #include "TParticle.h"
 #include "TProfile.h"
 #include "AliFlowEventSimple.h"
@@ -58,6 +59,7 @@ ClassImp(AliFlowAnalysisWithFittingQDistribution)
 
 AliFlowAnalysisWithFittingQDistribution::AliFlowAnalysisWithFittingQDistribution():  
  fHistList(NULL),
+ fBookOnlyBasicCCH(kTRUE),
  fCommonHists(NULL),
  fCommonHistsResults(NULL),
  fnBinsPhi(0),
@@ -85,8 +87,13 @@ AliFlowAnalysisWithFittingQDistribution::AliFlowAnalysisWithFittingQDistribution
  fSumOfParticleWeights(NULL),
  fqDistribution(NULL),
  fqMin(0.),
- fqMax(1000.),
+ fqMax(100.),
  fqNbins(10000),
+ fStoreqDistributionVsMult(kFALSE),
+ fqDistributionVsMult(NULL),
+ fMinMult(0.),
+ fMaxMult(10000.),
+ fnBinsMult(1000),
  fFittingParameters(NULL), 
  fTreshold(5.),
  fvStart(0.05),
@@ -113,7 +120,7 @@ AliFlowAnalysisWithFittingQDistribution::AliFlowAnalysisWithFittingQDistribution
 
   // initialize all arrays:  
   this->InitializeArrays();
-
  } // end of constructor
  
 //================================================================================================================
@@ -195,13 +202,14 @@ void AliFlowAnalysisWithFittingQDistribution::Make(AliFlowEventSimple* anEvent)
                                           // nRP   = # of particles used to determine the reaction plane;
                                           // nPOI  = # of particles of interest for a detailed flow analysis;
                                           // rest  = # of particles which are not niether RPs nor POIs.   
+                                                                                    
  // Start loop over particles:
  for(Int_t i=0;i<nPrim;i++) 
  { 
   aftsTrack=anEvent->GetTrack(i);
   if(aftsTrack)
   {
-   if(!(aftsTrack->InRPSelection())) continue; // consider only tracks which are RPs    
+   if(!(aftsTrack->InRPSelection())){continue;} // consider only tracks which are RPs    
    dPhi = aftsTrack->Phi();
    dPt  = aftsTrack->Pt();
    dEta = aftsTrack->Eta();
@@ -228,11 +236,12 @@ void AliFlowAnalysisWithFittingQDistribution::Make(AliFlowEventSimple* anEvent)
                                            
  // d) Fill the histogram for q-distribution and sum of particle weights:
  Double_t q = 0.; // q = Q\sqrt{sum of particle weights}                                         
- if(dSumOfParticleWeights)
+ if(dSumOfParticleWeights > 0.)
  {
   q = pow(dReQ*dReQ+dImQ*dImQ,0.5)/pow(dSumOfParticleWeights,0.5);
   fqDistribution->Fill(q,1.);
   fSumOfParticleWeights->Fill(dSumOfParticleWeights,1.);
+  if(fStoreqDistributionVsMult){fqDistributionVsMult->Fill(q,dSumOfParticleWeights);}
  } else
    {
     cout<<endl;
@@ -618,7 +627,7 @@ void AliFlowAnalysisWithFittingQDistribution::BookCommonHistograms()
  // common control histogram: 
  TString commonHistName = "AliFlowCommonHistFQD";
  commonHistName += fAnalysisLabel->Data();
- fCommonHists = new AliFlowCommonHist(commonHistName.Data());
+ fCommonHists = new AliFlowCommonHist(commonHistName.Data(),commonHistName.Data(),fBookOnlyBasicCCH);
  fHistList->Add(fCommonHists);  
 
  // common histograms for final results:
@@ -750,7 +759,18 @@ void AliFlowAnalysisWithFittingQDistribution::BookEverythingForDistributions()
  fqDistribution = new TH1D(Form("%s",fqDistributionName.Data()),"q-distribution",fqNbins,fqMin,fqMax);  
  fqDistribution->SetXTitle("q_{n}=|Q_{n}|/#sqrt{M}");
  fqDistribution->SetYTitle("Counts");
- fHistList->Add(fqDistribution);
+ fHistList->Add(fqDistribution); 
+ // q-distribution vs multiplicity:
+ if(fStoreqDistributionVsMult)
+ {
+  TString fqDistributionVsMultName = "fqDistributionVsMult";
+  fqDistributionVsMultName += fAnalysisLabel->Data();
+  fqDistributionVsMult = new TH2D(Form("%s",fqDistributionVsMultName.Data()),"q-distribution vs M",fqNbins,fqMin,fqMax,fnBinsMult,fMinMult,fMaxMult);  
+  fqDistributionVsMult->GetXaxis()->SetTitle("q_{n}=|Q_{n}|/#sqrt{M}");
+  fqDistributionVsMult->GetYaxis()->SetTitle("multiplicity");
+  fqDistributionVsMult->GetZaxis()->SetTitle("Counts");
+  fHistList->Add(fqDistributionVsMult);
+ } // end of if(fStoreqDistributionVsMult)
  // Sum of particle weights: 
  TString fSumOfParticleWeightsName = "fSumOfParticleWeights";
  fSumOfParticleWeightsName += fAnalysisLabel->Data();
@@ -817,9 +837,9 @@ void AliFlowAnalysisWithFittingQDistribution::BookEverythingForDistributions()
 void AliFlowAnalysisWithFittingQDistribution::DoFit(Bool_t sigma2Fitted)
 {
  // Do the final fit of q-distribution.
+  
  Int_t s2F = (Int_t)(sigma2Fitted); // shortcut
- Double_t dAvM = fSumOfParticleWeights->GetMean(1); // average multiplicity
+ Double_t AvM = fSumOfParticleWeights->GetMean(1); // average multiplicity
  //Int_t nEvts = (Int_t)fSumOfParticleWeights->GetEntries(); // number of events:
  
  // Start fitting from the bin with at least fTreshold entries, 
@@ -841,12 +861,13 @@ void AliFlowAnalysisWithFittingQDistribution::DoFit(Bool_t sigma2Fitted)
  {
   ent += fqDistribution->GetBinContent(b);
  }
  Double_t norm = binWidth*ent; // norm (assuming that all bins have the same width)
  // Fitting function:
  fFittingFunction[s2F]->SetRange(qmin,qmax); 
  fFittingFunction[s2F]->SetParNames("v*sqrt{sum of particle weights}","sigma^2","norm");
- fFittingFunction[s2F]->SetParameters(fvStart*pow(dAvM,0.5),fSigma2Start,norm);         
- fFittingFunction[s2F]->SetParLimits(0,fvMin*pow(dAvM,0.5),fvMax*pow(dAvM,0.5)); 
+ fFittingFunction[s2F]->SetParameters(fvStart*pow(AvM,0.5),fSigma2Start,norm);         
+ fFittingFunction[s2F]->SetParLimits(0,fvMin*pow(AvM,0.5),fvMax*pow(AvM,0.5)); 
  if(s2F == 0)
  {
   fFittingFunction[s2F]->FixParameter(1,0.5);
@@ -861,6 +882,7 @@ void AliFlowAnalysisWithFittingQDistribution::DoFit(Bool_t sigma2Fitted)
  {
   fqDistribution->Fit(fFittingFunction[s2F]->GetName(),"NQ","",qmin,qmax);
  }
+
  // Final results:
  Double_t v = 0.; // reference flow
  Double_t vError = 0.; // error of reference flow 
@@ -868,16 +890,16 @@ void AliFlowAnalysisWithFittingQDistribution::DoFit(Bool_t sigma2Fitted)
  Double_t sigma2Error = 0.; // error of sigma^2
  Double_t chi2 = 0; // chi^2 from Minuit
  // Reference flow:
- if(dAvM > 0.)
+ if(AvM)
  { 
-  v = fFittingFunction[s2F]->GetParameter(0)/pow(dAvM,0.5);
-  vError = fFittingFunction[s2F]->GetParError(0)/pow(dAvM,0.5);
+  v = fFittingFunction[s2F]->GetParameter(0)/pow(AvM,0.5);
+  vError = fFittingFunction[s2F]->GetParError(0)/pow(AvM,0.5);
   fIntFlow[s2F]->SetBinContent(1,v); // s2F is shortcut for "sigma^2 fitted"
   fIntFlow[s2F]->SetBinError(1,vError); // s2F is shortcut for "sigma^2 fitted"
  } else
    {
     cout<<endl;
-    cout<<"WARNING (FQD): dAvM == 0 in AFAWFQD::DoFit()"<<endl;
+    cout<<"WARNING (FQD): AvM == 0 in AFAWFQD::DoFit()"<<endl;
     cout<<endl;
    }    
  // sigma^2:: 
@@ -915,8 +937,8 @@ void AliFlowAnalysisWithFittingQDistribution::FillCommonHistResults(Bool_t sigma
  Double_t vError = fIntFlow[s2F]->GetBinError(1);
  fCommonHistsResults->FillIntegratedFlow(v,vError);   
  // Resolution:
- Double_t dAvM = fSumOfParticleWeights->GetMean(1);
- Double_t chi2 = dAvM*pow(v,2.); // chi^2
+ Double_t AvM = fSumOfParticleWeights->GetMean(1);
+ Double_t chi2 = AvM*pow(v,2.); // chi^2
  if(chi2>=0.)
  {
   fCommonHistsResults->FillChi(pow(chi2,0.5));   
index fa43439..fc4a740 100644 (file)
@@ -18,6 +18,8 @@
 #ifndef ALIFLOWANALYSISWITHFITTINGQDISTRIBUTION_H
 #define ALIFLOWANALYSISWITHFITTINGQDISTRIBUTION_H
 
+#include "AliFlowCommonConstants.h"
+
 class TObjArray;
 class TList;
 class TFile;
@@ -25,12 +27,12 @@ class TDirectoryFile;
 
 class TH1F;
 class TH1D;
+class TH2D;
 class TProfile;
 class TF1;
 
 class AliFlowEventSimple;
 class AliFlowTrackSimple;
-class AliFlowCommonConstants;
 class AliFlowCommonHist;
 class AliFlowCommonHistResults;
 class AliFlowVector;
@@ -71,6 +73,8 @@ class AliFlowAnalysisWithFittingQDistribution{
   // 0.) base:                                                                                              
   TList* GetHistList() const {return this->fHistList;} 
   // 1.) common:
+  void SetBookOnlyBasicCCH(Bool_t const bobcch) {this->fBookOnlyBasicCCH = bobcch;};
+  Bool_t GetBookOnlyBasicCCH() const {return this->fBookOnlyBasicCCH;};  
   void SetCommonHists(AliFlowCommonHist* const ch) {this->fCommonHists = ch;};
   AliFlowCommonHist* GetCommonHists() const {return this->fCommonHists;};
   void SetCommonHistsResults(AliFlowCommonHistResults* const chr) {this->fCommonHistsResults = chr;};
@@ -106,7 +110,17 @@ class AliFlowAnalysisWithFittingQDistribution{
   void SetqMax(Double_t const qmax) {this->fqMax = qmax;};
   Double_t GetqMax() const {return this->fqMax;};
   void SetqNbins(Int_t const qNbins) {this->fqNbins = qNbins;};
-  Int_t GetqNbins() const {return this->fqNbins;};  
+  Int_t GetqNbins() const {return this->fqNbins;};
+  void SetStoreqDistributionVsMult(Bool_t const sqdvm) {this->fStoreqDistributionVsMult = sqdvm;};
+  Bool_t GetStoreqDistributionVsMult() const {return this->fStoreqDistributionVsMult;};  
+  void SetqDistributionVsMult(TH2D* const qdvm) {this->fqDistributionVsMult = qdvm;};
+  TH2D* GetqDistributionVsMult() const {return this->fqDistributionVsMult;};
+  void SetMinMult(Double_t const minm) {this->fMinMult = minm;};
+  Double_t GetMinMult() const {return this->fMinMult;};
+  void SetMaxMult(Double_t const maxm) {this->fMaxMult = maxm;};
+  Double_t GetMaxMult() const {return this->fMaxMult;};
+  void SetnBinsMult(Int_t const nbm) {this->fnBinsMult = nbm;};
+  Int_t GetnBinsMult() const {return this->fnBinsMult;};  
   // 4.) final results of fitting:
   void SetIntFlow(TH1D* const intFlow, Int_t sigmaFitted) {this->fIntFlow[sigmaFitted] = intFlow;};
   TH1D* GetIntFlow(Int_t sigmaFitted) const {return this->fIntFlow[sigmaFitted];};
@@ -144,6 +158,7 @@ class AliFlowAnalysisWithFittingQDistribution{
   // 0.) base:
   TList *fHistList; // base list to hold all output object
   // 1.) common:
+  Bool_t fBookOnlyBasicCCH; // book only basis common control histrograms (TRUE by default)  
   AliFlowCommonHist *fCommonHists; // common control histograms 
   AliFlowCommonHistResults *fCommonHistsResults; // final results in common histograms
   Int_t fnBinsPhi; // number of phi bins
@@ -171,10 +186,15 @@ class AliFlowAnalysisWithFittingQDistribution{
   TH1D *fEtaWeights; // histogram holding eta weights 
   // 3.) distributions:
   TH1D *fSumOfParticleWeights; // distribution of sum of particle weights (for unit weights this equals to multiplicity)
-  TH1D *fqDistribution; // distribution of Q/sqrt{sum of phi weights}
+  TH1D *fqDistribution; // distribution of Q/sqrt{M}
   Double_t fqMin; // lower boundary of TH1D *fqDistribution
   Double_t fqMax; // upper boundary of TH1D *fqDistribution
   Int_t fqNbins; // number of bins of TH1D *fqDistribution
+  Bool_t fStoreqDistributionVsMult; // store q-distributions vs M 
+  TH2D *fqDistributionVsMult; // distribution of Q/sqrt{M} vs multiplicity
+  Double_t fMinMult; // minimum multiplicity
+  Double_t fMaxMult; // maximum multiplicity
+  Int_t fnBinsMult; // number of multiplicity bins
   // 4.) final results of fitting:
   TH1D *fIntFlow[2]; // final result for integrated flow [0=sigma^2 not fitted, 1=sigma^2 fitted]  
   TH1D *fSigma2[2]; // final results for sigma^2 [0=sigma^2 not fitted, 1=sigma^2 fitted]
index 463cc29..5031b73 100644 (file)
@@ -70,7 +70,7 @@ AliFlowAnalysisWithQCumulants::AliFlowAnalysisWithQCumulants():
  // 0.) base:
  fHistList(NULL),
  // 1.) common:
- fBookOnlyBasicCCH(kFALSE),
+ fBookOnlyBasicCCH(kTRUE),
  fCommonHists(NULL),
  fCommonHists2nd(NULL), 
  fCommonHists4th(NULL),
@@ -2866,6 +2866,8 @@ void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()
  Double_t dQ3nQ2nQ3nstarQ2nstar = (pow(dReQ2n,2.)+pow(dImQ2n,2.))*(pow(dReQ3n,2.)+pow(dImQ3n,2.));
  // |Q_{5n}|^2 |Q_{n}|^2
  Double_t dQ5nQ1nQ5nstarQ1nstar = (pow(dReQ5n,2.)+pow(dImQ5n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.));
+ // |Q_{3n}|^2 |Q_{n}|^2
+ Double_t dQ3nQ1nQ3nstarQ1nstar = (pow(dReQ3n,2.)+pow(dImQ3n,2.))*(pow(dReQ1n,2.)+pow(dImQ1n,2.));
  // Re[Q_{2n}Q_{n}Q_{n}^*Q_{n}^*Q_{n}^*]
  Double_t reQ2nQ1nQ1nstarQ1nstarQ1nstar = (dReQ2n*dReQ1n-dImQ2n*dImQ1n)*(pow(dReQ1n,3)-3.*dReQ1n*pow(dImQ1n,2))
                                         + (dReQ2n*dImQ1n+dReQ1n*dImQ2n)*(3.*dImQ1n*pow(dReQ1n,2)-pow(dImQ1n,3)); 
@@ -2927,7 +2929,30 @@ void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()
  // Re[Q_{2n}Q_{n}Q_{n}Q_{n}^*Q_{n}^*Q_{n}^*Q_{n}^*]
  Double_t reQ2nQ1nQ1nQ1nstarQ1nstarQ1nstarQ1nstar = pow((pow(dReQ1n,2.)+pow(dImQ1n,2.)),2.)
                                                   * (pow(dReQ1n,2.)*dReQ2n-dReQ2n*pow(dImQ1n,2.)
-                                                  + 2.*dReQ1n*dImQ1n*dImQ2n);
+                                                  + 2.*dReQ1n*dImQ1n*dImQ2n);                                                  
+ // Re[Q_{6n}Q_{2n}^*Q_{2n}^*Q_{n}^*Q_{n}^*]
+ Double_t reQ6nQ2nstarQ2nstarQ1nstarQ1nstar = pow(dReQ1n*dReQ2n,2.)*dReQ6n-pow(dReQ2n*dImQ1n,2.)*dReQ6n
+                                            - 4.*dReQ1n*dReQ2n*dReQ6n*dImQ1n*dImQ2n 
+                                            - pow(dReQ1n*dImQ2n,2.)*dReQ6n+pow(dImQ1n*dImQ2n,2.)*dReQ6n
+                                            + 2.*dReQ1n*pow(dReQ2n,2.)*dImQ1n*dImQ6n
+                                            + 2.*pow(dReQ1n,2.)*dReQ2n*dImQ2n*dImQ6n 
+                                            - 2.*dReQ2n*pow(dImQ1n,2.)*dImQ2n*dImQ6n 
+                                            - 2.*dReQ1n*dImQ1n*pow(dImQ2n,2.)*dImQ6n;       
+ // Re[Q_{4n}Q_{1n}Q_{1n}Q_{3n}^*Q_{3n}^*]
+ Double_t reQ4nQ1nQ1nQ3nstarQ3nstar = pow(dReQ1n*dReQ3n,2.)*dReQ4n-pow(dReQ3n*dImQ1n,2.)*dReQ4n  
+                                    + 4.*dReQ1n*dReQ3n*dReQ4n*dImQ1n*dImQ3n 
+                                    - pow(dReQ1n*dImQ3n,2.)*dReQ4n+pow(dImQ1n*dImQ3n,2.)*dReQ4n  
+                                    - 2.*dReQ1n*pow(dReQ3n,2.)*dImQ1n*dImQ4n 
+                                    + 2.*pow(dReQ1n,2.)*dReQ3n*dImQ3n*dImQ4n 
+                                    - 2.*dReQ3n*pow(dImQ1n,2.)*dImQ3n*dImQ4n 
+                                    + 2.*dReQ1n*dImQ1n*pow(dImQ3n,2.)*dImQ4n;
+ // Re[Q_{3n}Q_{3n}Q_{2n}^*Q_{2n}^*Q_{1n}^*Q_{1n}^*]
+ Double_t reQ3nQ3nQ2nstarQ2nstarQ1nstarQ1nstar = (dReQ1n*dReQ2n*dReQ3n-dReQ2n*dReQ3n*dImQ1n-dReQ1n*dReQ3n*dImQ2n 
+                                               - dReQ3n*dImQ1n*dImQ2n+dReQ1n*dReQ2n*dImQ3n+dReQ2n*dImQ1n*dImQ3n 
+                                               + dReQ1n*dImQ2n*dImQ3n-dImQ1n*dImQ2n*dImQ3n)*(dReQ1n*dReQ2n*dReQ3n 
+                                               + dReQ2n*dReQ3n*dImQ1n+dReQ1n*dReQ3n*dImQ2n-dReQ3n*dImQ1n*dImQ2n 
+                                               - dReQ1n*dReQ2n*dImQ3n+dReQ2n*dImQ1n*dImQ3n+dReQ1n*dImQ2n*dImQ3n 
+                                               + dImQ1n*dImQ2n*dImQ3n);
     
  // Results for multiparticle azimuthal correlations:
  // 2-particle:
@@ -3528,14 +3553,15 @@ void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()
   four5n1n5n1n = (dQ5nQ1nQ5nstarQ1nstar-2.*reQ6nQ5nstarQ1nstar-2.*reQ5nQ4nstarQ1nstar
                + pow(dReQ6n,2.)+pow(dImQ6n,2.)-(dMult-4.)*(pow(dReQ5n,2.)+pow(dImQ5n,2.))
                + pow(dReQ4n,2.)+pow(dImQ4n,2.)-(dMult-4.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))+dMult*(dMult-6.))  
-               / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));                  
-  
+               / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));    
+                              
+  // TBI: Recursive formula needed:
   four6n4n1n1n = (reQ6nQ4nstarQ1nstarQ1nstar
                - dMult*(dMult-1.)*(dMult-2.)*(three2n1n1n+2.*three5n4n1n+2.*three6n5n1n+three6n4n2n)
                - dMult*(dMult-1.)*(2.*two1n1n+1.*two4n4n+1.*two6n6n+1.*two2n2n+2.*two5n5n)
                - 1.*dMult)
                / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.));
+  
   four6n2n2n2n = (reQ6nQ2nstarQ2nstarQ2nstar-3.*reQ6nQ4nstarQ2nstar-3.*reQ4nQ2nstarQ2nstar
                + 2.*(pow(dReQ6n,2.)+pow(dImQ6n,2.))+3.*(pow(dReQ4n,2.)+pow(dImQ4n,2.))
                + 6.*(pow(dReQ2n,2.)+pow(dImQ2n,2.))-6.*dMult)
@@ -3633,9 +3659,42 @@ void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()
                  + (dMult-10.)*(pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*(dMult-7.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
                  - 2.*dMult*(dMult-12.))
                  / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));      
+  // Peter Jochumzsen:
+  five6n2n2n1n1n = (reQ6nQ2nstarQ2nstarQ1nstarQ1nstar
+                 - 12.*pow(dReQ1n,2.)-12.*pow(dImQ1n,2.)
+                 - 14.*pow(dReQ2n,2.)-14.*pow(dImQ2n,2.)
+                 - 8.*pow(dReQ3n,2.)-8.*pow(dImQ3n,2.)
+                 - 6.*pow(dReQ4n,2.)-6.*pow(dImQ4n,2.)
+                 - 4.*pow(dReQ5n,2.)-4.*pow(dImQ5n,2.)
+                 - 6.*pow(dReQ6n,2.)-6.*pow(dImQ6n,2.)
+                 + 2.*reQ2nQ1nstarQ1nstar + 8.*reQ3nQ2nstarQ1nstar
+                 + 5.*reQ6nQ4nstarQ2nstar - reQ6nQ4nstarQ1nstarQ1nstar
+                 + 2.*reQ6nQ3nstarQ3nstar - reQ6nQ2nstarQ2nstarQ2nstar 
+                 + 4.*reQ4nQ2nstarQ2nstar - 2.*reQ4nQ2nstarQ1nstarQ1nstar 
+                 + 2.*reQ5nQ4nstarQ1nstar - 2.*reQ5nQ2nstarQ2nstarQ1nstar 
+                 + 4.*reQ4nQ3nstarQ1nstar + 4.*reQ5nQ3nstarQ2nstar
+                 + 4.*reQ6nQ5nstarQ1nstar - 4.*reQ6nQ3nstarQ2nstarQ1nstar + 24.*dMult)
+                 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
   
-  // five6n2n2n1n1n = ;
-  // five4n1n1n3n3n = ; 
+  // Peter Jochumzsen:
+  /*
+  five4n1n1n3n3n = (reQ6nQ2nstarQ2nstarQ1nstarQ1nstar
+                 - 12.*pow(dReQ1n,2.)-12.*pow(dImQ1n,2.)
+                 - 14.*pow(dReQ2n,2.)-14.*pow(dImQ2n,2.)
+                 - 8.*pow(dReQ3n,2.)-8.*pow(dImQ3n,2.)
+                 - 6.*pow(dReQ4n,2.)-6.*pow(dImQ4n,2.)
+                 - 4.*pow(dReQ5n,2.)-4.*pow(dImQ5n,2.)
+                 - 6.*pow(dReQ6n,2.)-6.*pow(dImQ6n,2.)
+                 + 2.*reQ2nQ1nstarQ1nstar + 8.*reQ3nQ2nstarQ1nstar
+                 + 5.*reQ6nQ4nstarQ2nstar - reQ6nQ4nstarQ1nstarQ1nstar
+                 + 2.*reQ6nQ3nstarQ3nstar - reQ6nQ2nstarQ2nstarQ2nstar
+                 + 4.*reQ4nQ2nstarQ2nstar - 2.*reQ4nQ2nstarQ1nstarQ1nstar
+                 + 2.*reQ5nQ4nstarQ1nstar - 2.*reQ5nQ2nstarQ2nstarQ1nstar
+                 + 4.*reQ4nQ3nstarQ1nstar + 4.*reQ5nQ3nstarQ2nstar
+                 + 4.*reQ6nQ5nstarQ1nstar - 4.*reQ6nQ3nstarQ2nstarQ1nstar + 24.*dMult)
+                 / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
+  */
   
   // Average 5-particle correlations for all events:      
   fIntFlowCorrelationsAllPro->Fill(52.5,five3n3n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.));
@@ -3688,8 +3747,36 @@ void AliFlowAnalysisWithQCumulants::CalculateIntFlowCorrelations()
                   + (dMult*dMult-20.*dMult+80.)*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
                   - dMult*(dMult-12.)*(dMult-10.))
                   / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));   
-
-  // six3n3n2n2n1n1n = ;
+  
+  // Peter Jochumzsen:
+  six3n3n2n2n1n1n = (reQ3nQ3nQ2nstarQ2nstarQ1nstarQ1nstar
+                  + (80.-16.*dMult)*pow(dReQ1n,2.)+(80.-16.*dMult)*pow(dImQ1n,2.)
+                  + (78.-16.*dMult)*pow(dReQ2n,2.)+(78.-16.*dMult)*pow(dImQ2n,2.)
+                  + (72.-16.*dMult)*pow(dReQ3n,2.)+(72.-16.*dMult)*pow(dImQ3n,2.)
+                  + 14.*pow(dReQ4n,2.)+14.*pow(dImQ4n,2.)
+                  + 8.*pow(dReQ5n,2.)+8.*pow(dImQ5n,2.)
+                  + 6.*pow(dReQ6n,2.)+6.*pow(dImQ6n,2.)
+                  + 1.*reQ6nQ2nstarQ2nstarQ2nstar - 1.*reQ6nQ2nstarQ2nstarQ1nstarQ1nstar
+                  - 76.*reQ3nQ2nstarQ1nstar + 4.*reQ3nQ1nstarQ1nstarQ1nstar
+                  - 8.*reQ3nQ2nstarQ1nstar + 8.*dQ2nQ1nQ2nstarQ1nstar
+                  + 4.*reQ5nQ2nstarQ2nstarQ1nstar - 2.*reQ6nQ3nstarQ3nstar
+                  + 4.*reQ6nQ3nstarQ2nstarQ1nstar - 4.*reQ5nQ4nstarQ1nstar
+                  + 16.*dMult*reQ3nQ2nstarQ1nstar - 2.*reQ4nQ2nstarQ2nstar
+                  - 4.*reQ3nQ3nQ3nstarQ2nstarQ1nstar -8.*reQ4nQ3nstarQ1nstar
+                  - 10.*reQ4nQ2nstarQ2nstar + 4.*reQ4nQ2nstarQ1nstarQ1nstar
+                  - 12.*reQ4nQ3nstarQ1nstar + 8.*dQ3nQ1nQ3nstarQ1nstar
+                  + 8.*reQ3nQ1nQ2nstarQ2nstar - 4.*reQ3nQ1nQ2nstarQ1nstarQ1nstar
+                  + 5.*reQ4nQ2nQ3nstarQ3nstar+2.*pow(pow(dReQ2n,2.)+pow(dImQ2n,2.),2.)
+                  + 4.*reQ5nQ1nQ3nstarQ3nstar+2.*pow(pow(dReQ3n,2.)+pow(dImQ3n,2.),2.)
+                  - 6.*reQ6nQ3nstarQ3nstar - 14.*reQ2nQ1nstarQ1nstar
+                  - 1.*reQ3nQ3nQ2nstarQ2nstarQ2nstar-4.*reQ3nQ2nQ2nstarQ2nstarQ1nstar
+                  - 1.*reQ4nQ1nQ1nQ3nstarQ3nstar-8.*reQ5nQ3nstarQ2nstar
+                  + 2.*pow(pow(dReQ1n,2.)+pow(dImQ1n,2.),2.) - 10.*reQ2nQ1nstarQ1nstar
+                  - 4.*reQ6nQ5nstarQ1nstar-5.*reQ6nQ4nstarQ2nstar
+                  + 1.*reQ6nQ4nstarQ1nstarQ1nstar-8.*reQ5nQ3nstarQ2nstar
+                  + 4.*reQ4nQ1nQ3nstarQ2nstar+8.*dQ3nQ2nQ3nstarQ2nstar
+                  - 120.*dMult + 16.*dMult*dMult)
+                  / (dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
 
   // Average 6-particle correlations for all events:      
   fIntFlowCorrelationsAllPro->Fill(57.5,six3n2n1n3n2n1n,dMult*(dMult-1.)*(dMult-2.)*(dMult-3.)*(dMult-4.)*(dMult-5.));
@@ -9915,14 +10002,14 @@ void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
  // Calculate generalized Q-cumulants (cumulants corrected for non-unifom acceptance).
  
  // Isotropic cumulants:
- Double_t qc2 = fIntFlowQcumulants->GetBinContent(1);
- Double_t qc2Error = fIntFlowQcumulants->GetBinError(1);
- Double_t qc4 = fIntFlowQcumulants->GetBinContent(2);
- Double_t qc4Error = fIntFlowQcumulants->GetBinError(2);
- //Double_t qc6 = fIntFlowQcumulants->GetBinContent(3);
- //Double_t qc6Error = fIntFlowQcumulants->GetBinError(3);
- //Double_t qc8 = fIntFlowQcumulants->GetBinContent(4);
- //Double_t qc8Error = fIntFlowQcumulants->GetBinError(4);
+ Double_t QC2 = fIntFlowQcumulants->GetBinContent(1);
+ Double_t QC2Error = fIntFlowQcumulants->GetBinError(1);
+ Double_t QC4 = fIntFlowQcumulants->GetBinContent(2);
+ Double_t QC4Error = fIntFlowQcumulants->GetBinError(2);
+ //Double_t QC6 = fIntFlowQcumulants->GetBinContent(3);
+ //Double_t QC6Error = fIntFlowQcumulants->GetBinError(3);
+ //Double_t QC8 = fIntFlowQcumulants->GetBinContent(4);
+ //Double_t QC8Error = fIntFlowQcumulants->GetBinError(4);
  
  // Measured 2-, 4-, 6- and 8-particle correlations:
  Double_t two = fIntFlowCorrelationsHist->GetBinContent(1); // <<2>>
@@ -10047,18 +10134,18 @@ void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
     }   
  } // end of if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
  // Quantify detector bias to QC{2}:
- if(TMath::Abs(qc2)>0.)
+ if(TMath::Abs(QC2)>0.)
  {
-  fIntFlowDetectorBias->SetBinContent(1,gQC2/qc2); 
-  if(qc2Error>0.)
+  fIntFlowDetectorBias->SetBinContent(1,gQC2/QC2); 
+  if(QC2Error>0.)
   {
-   Double_t errorSquared = gQC2ErrorSquared/pow(qc2,2.)+pow(gQC2,2.)*pow(qc2Error,2.)/pow(qc2,4.);
+   Double_t errorSquared = gQC2ErrorSquared/pow(QC2,2.)+pow(gQC2,2.)*pow(QC2Error,2.)/pow(QC2,4.);
    if(errorSquared>0.)
    {
     fIntFlowDetectorBias->SetBinError(1,pow(errorSquared,0.5));  
    }
   }
- } // end of if(TMath::Abs(qc2)>0.)
+ } // end of if(TMath::Abs(QC2)>0.)
 
  // Calculating generalized QC{4}:
  //  Generalized QC{4}:
@@ -10099,18 +10186,18 @@ void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
     }   
  } // end of if(fApplyCorrectionForNUA && fPropagateErrorAlsoFromNIT)
  // Quantify detector bias to QC{4}:
- if(TMath::Abs(qc4)>0.)
+ if(TMath::Abs(QC4)>0.)
  {
-  fIntFlowDetectorBias->SetBinContent(2,gQC4/qc4); 
-  if(qc4Error>0.)
+  fIntFlowDetectorBias->SetBinContent(2,gQC4/QC4); 
+  if(QC4Error>0.)
   {
-   Double_t errorSquared = gQC4ErrorSquared/pow(qc4,2.)+pow(gQC4,2.)*pow(qc4Error,2.)/pow(qc4,4.);
+   Double_t errorSquared = gQC4ErrorSquared/pow(QC4,2.)+pow(gQC4,2.)*pow(QC4Error,2.)/pow(QC4,4.);
    if(errorSquared>0.)
    {
     fIntFlowDetectorBias->SetBinError(2,pow(errorSquared,0.5));  
    }
   }
- } // end of if(TMath::Abs(qc4)>0.)
+ } // end of if(TMath::Abs(QC4)>0.)
 
 
  // .... to be improved (continued for 6th and 8th order) ....            
@@ -10130,8 +10217,8 @@ void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
    two = fIntFlowCorrelationsVsMHist[0]->GetBinContent(b); // <<2>> vs M
    four = fIntFlowCorrelationsVsMHist[1]->GetBinContent(b); // <<4>> vs M
    // Isotropic cumulants:
-   qc2 = two;
-   qc4 = four-2.*pow(two,2.);
+   QC2 = two;
+   QC4 = four-2.*pow(two,2.);
    // Non-isotropic terms:
    c1 = fIntFlowCorrectionTermsForNUAVsMPro[1][0]->GetBinContent(b); // <<cos(n*phi1)>>
    c2 = fIntFlowCorrectionTermsForNUAVsMPro[1][1]->GetBinContent(b); // <<cos(n*(phi1+phi2))>>
@@ -10149,14 +10236,14 @@ void AliFlowAnalysisWithQCumulants::CalculateQcumulantsCorrectedForNUAIntFlow()
                  + 8.*two*(pow(c1,2.)+pow(s1,2.))-6.*pow((pow(c1,2.)+pow(s1,2.)),2.);
    if(fApplyCorrectionForNUAVsM){fIntFlowQcumulantsVsM[1]->SetBinContent(b,gQC4);}   
    // Detector bias vs M:
-   if(TMath::Abs(qc2)>0.)
+   if(TMath::Abs(QC2)>0.)
    {
-    fIntFlowDetectorBiasVsM[0]->SetBinContent(b,gQC2/qc2); 
-   } // end of if(TMath::Abs(qc2)>0.)
-   if(TMath::Abs(qc4)>0.)
+    fIntFlowDetectorBiasVsM[0]->SetBinContent(b,gQC2/QC2); 
+   } // end of if(TMath::Abs(QC2)>0.)
+   if(TMath::Abs(QC4)>0.)
    {
-    fIntFlowDetectorBiasVsM[1]->SetBinContent(b,gQC4/qc4); 
-   } // end of if(TMath::Abs(qc4)>0.)  
+    fIntFlowDetectorBiasVsM[1]->SetBinContent(b,gQC4/QC4); 
+   } // end of if(TMath::Abs(QC4)>0.)  
    // Rebin in M:
    for(Int_t co=0;co<4;co++)
    {
index c27bf0e..ddb7167 100644 (file)
@@ -34,6 +34,7 @@ class AliAnalysisTaskSE;
 #include "AliFlowEventSimple.h"
 #include "AliAnalysisTaskFittingQDistribution.h"
 #include "AliFlowAnalysisWithFittingQDistribution.h"
+#include "TH2D.h"
 
 ClassImp(AliAnalysisTaskFittingQDistribution)
 
@@ -44,13 +45,19 @@ AliAnalysisTaskFittingQDistribution::AliAnalysisTaskFittingQDistribution(const c
  fEvent(NULL),
  fFQD(NULL),
  fListHistos(NULL),
+ fBookOnlyBasicCCH(kTRUE), 
  fUseWeights(useWeights),
  fUsePhiWeights(kFALSE),
  fListWeights(NULL),
  fHarmonic(2), 
  fqMin(0.),
- fqMax(1000.),
- fqNbins(10000)
+ fqMax(100.),
+ fqNbins(10000),
+ fStoreqDistributionVsMult(kFALSE),
+ fqDistributionVsMult(NULL),
+ fMinMult(0.),
+ fMaxMult(10000.),
+ fnBinsMult(1000) 
  {
   //constructor
   cout<<"AliAnalysisTaskFittingQDistribution::AliAnalysisTaskFittingQDistribution(const char *name, Bool_t useWeights)"<<endl;
@@ -73,14 +80,20 @@ AliAnalysisTaskFittingQDistribution::AliAnalysisTaskFittingQDistribution():
  AliAnalysisTaskSE(),
  fEvent(NULL),
  fFQD(NULL),
- fListHistos(NULL),  
+ fListHistos(NULL), 
+ fBookOnlyBasicCCH(kFALSE),   
  fUseWeights(kFALSE),
  fUsePhiWeights(kFALSE),
  fListWeights(NULL),
  fHarmonic(0), 
  fqMin(0.),
  fqMax(0.),
- fqNbins(0)
+ fqNbins(0),
+ fStoreqDistributionVsMult(kFALSE),
+ fqDistributionVsMult(NULL),
+ fMinMult(0.),
+ fMaxMult(0.),
+ fnBinsMult(0) 
  {
   // Dummy constructor
   cout<<"AliAnalysisTaskFittingQDistribution::AliAnalysisTaskFittingQDistribution()"<<endl;
@@ -96,6 +109,7 @@ void AliAnalysisTaskFittingQDistribution::UserCreateOutputObjects()
   // Analyser:
   fFQD = new AliFlowAnalysisWithFittingQDistribution();
   
+  fFQD->SetBookOnlyBasicCCH(fBookOnlyBasicCCH);
   // Particle weights:
   if(fUseWeights) 
   {
@@ -114,6 +128,11 @@ void AliAnalysisTaskFittingQDistribution::UserCreateOutputObjects()
   fFQD->SetqMin(fqMin);
   fFQD->SetqMax(fqMax);
   fFQD->SetqNbins(fqNbins); 
+  fFQD->SetStoreqDistributionVsMult(fStoreqDistributionVsMult);
+  fFQD->SetqDistributionVsMult(fqDistributionVsMult);
+  fFQD->SetMinMult(fMinMult);
+  fFQD->SetMaxMult(fMaxMult);
+  fFQD->SetnBinsMult(fnBinsMult);
 
   fFQD->Init();
   
index 824f176..2804e3c 100644 (file)
@@ -25,6 +25,7 @@ class TString;
 class TList;
 class AliFlowEventSimple;
 class AliFlowAnalysisWithFittingQDistribution;
+class TH2D;
 
 //================================================================================================================
 
@@ -37,7 +38,9 @@ class AliAnalysisTaskFittingQDistribution : public AliAnalysisTaskSE{
   virtual void   UserCreateOutputObjects();
   virtual void   UserExec(Option_t *option);
   virtual void   Terminate(Option_t *);
-  
+
+  void SetBookOnlyBasicCCH(Bool_t const bobcch) {this->fBookOnlyBasicCCH = bobcch;};
+  Bool_t GetBookOnlyBasicCCH() const {return this->fBookOnlyBasicCCH;};   
   void SetUsePhiWeights(Bool_t const uPhiW) {this->fUsePhiWeights = uPhiW;};
   Bool_t GetUsePhiWeights() const {return this->fUsePhiWeights;};
   void SetHarmonic(Int_t const harmonic) {this->fHarmonic = harmonic;};
@@ -49,6 +52,16 @@ class AliAnalysisTaskFittingQDistribution : public AliAnalysisTaskSE{
   Double_t GetqMax() const {return this->fqMax;};
   void SetqNbins(Int_t const qNbins) {this->fqNbins = qNbins;};
   Int_t GetqNbins() const {return this->fqNbins;};  
+  void SetStoreqDistributionVsMult(Bool_t const sqdvm) {this->fStoreqDistributionVsMult = sqdvm;};
+  Bool_t GetStoreqDistributionVsMult() const {return this->fStoreqDistributionVsMult;};  
+  void SetqDistributionVsMult(TH2D* const qdvm) {this->fqDistributionVsMult = qdvm;};
+  TH2D* GetqDistributionVsMult() const {return this->fqDistributionVsMult;};
+  void SetMinMult(Double_t const minm) {this->fMinMult = minm;};
+  Double_t GetMinMult() const {return this->fMinMult;};
+  void SetMaxMult(Double_t const maxm) {this->fMaxMult = maxm;};
+  Double_t GetMaxMult() const {return this->fMaxMult;};
+  void SetnBinsMult(Int_t const nbm) {this->fnBinsMult = nbm;};
+  Int_t GetnBinsMult() const {return this->fnBinsMult;};  
  
  private:
   AliAnalysisTaskFittingQDistribution(const AliAnalysisTaskFittingQDistribution& aatfqd);
@@ -58,13 +71,19 @@ class AliAnalysisTaskFittingQDistribution : public AliAnalysisTaskSE{
   AliFlowAnalysisWithFittingQDistribution* fFQD; // Fitting q-distribution (FQD) object
   TList *fListHistos;                            // collection of output 
      
-  Bool_t fUseWeights;    // use any weights
-  Bool_t fUsePhiWeights; // phi weights
-  TList* fListWeights;   // list with weights  
-  Int_t fHarmonic;       // harmonic   
-  Double_t fqMin;        // lower boundary of TH1D *fqDistribution
-  Double_t fqMax;        // upper boundary of TH1D *fqDistribution
-  Int_t fqNbins;         // number of bins of TH1D *fqDistribution                                             
+  Bool_t fBookOnlyBasicCCH;          // book only basis common control histrograms (by default book them all) 
+  Bool_t fUseWeights;               // use any weights
+  Bool_t fUsePhiWeights;            // phi weights
+  TList* fListWeights;              // list with weights  
+  Int_t fHarmonic;                  // harmonic   
+  Double_t fqMin;                   // lower boundary of TH1D *fqDistribution
+  Double_t fqMax;                   // upper boundary of TH1D *fqDistribution
+  Int_t fqNbins;                    // number of bins of TH1D *fqDistribution                                             
+  Bool_t fStoreqDistributionVsMult; // store q-distributions vs M 
+  TH2D *fqDistributionVsMult;       // distribution of Q/sqrt{M} vs multiplicity
+  Double_t fMinMult;                // minimum multiplicity
+  Double_t fMaxMult;                // maximum multiplicity
+  Int_t fnBinsMult;                 // number of multiplicity bins
                                                            
   ClassDef(AliAnalysisTaskFittingQDistribution, 1); 
 };
index 7d59f5f..a8f0d77 100644 (file)
@@ -45,7 +45,7 @@ AliAnalysisTaskQCumulants::AliAnalysisTaskQCumulants(const char *name, Bool_t us
  fEvent(NULL),
  fQC(NULL), 
  fListHistos(NULL),
- fBookOnlyBasicCCH(kFALSE),
+ fBookOnlyBasicCCH(kTRUE),
  fFillMultipleControlHistograms(kFALSE),
  fHarmonic(2),  
  fApplyCorrectionForNUA(kFALSE),