ROOT logo
/* 
 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. 
 * See cxx source for full Copyright notice 
 * $Id$ 
 */

/*************************************************************** 
 * Only in this class nested loops are used for flow analysis. *
 * Nested loops are used to evaluate:                          *
 *                                                             *  
 *  a) Distribution of relative angle difference (phi1-phi2);  *
 *  b) Cross-check the results for mixed harmonics.            *
 *                                                             *
 *       Author: Ante Bilandzic (abilandzic@gmail.com)         *
 ***************************************************************/ 

#ifndef ALIFLOWANALYSISWITHNESTEDLOOPS_H
#define ALIFLOWANALYSISWITHNESTEDLOOPS_H

class TList;
class TDirectoryFile;
class TH1F;
class TH1D;
class TProfile;

class AliFlowEventSimple;
class AliFlowCommonConstants;
class AliFlowCommonHist;
class AliFlowCommonHistResults;

//================================================================================================================

class AliFlowAnalysisWithNestedLoops
{
 public:
  AliFlowAnalysisWithNestedLoops();
  virtual ~AliFlowAnalysisWithNestedLoops(); 
  // 0.) Methods called in the constructor:
    virtual void InitializeArraysForMH();
  // 1.) Method Init() and methods called within Init():
  virtual void Init();
    virtual void CrossCheckSettings();
    virtual void AccessConstants();
    virtual void BookAndNestAllLists();
    virtual void BookAndFillProfileHoldingSettings();
    virtual void BookCommonHistograms();
    virtual void BookEverythingForRAD(); // RAD = relative angle distribution phi1-phi2
    virtual void BookEverythingForMH(); // MH = Mixed Harmonics
    virtual void BookAndFillWeightsHistograms();
    virtual void StoreHarmonic();        
  // 2.) Method Make() and methods called within Make():
  virtual void Make(AliFlowEventSimple *anEvent);
    virtual void CheckPointersUsedInMake();
    virtual void EvaluateNestedLoopsForRAD(AliFlowEventSimple *anEvent);
    virtual void EvaluateNestedLoopsForMH(AliFlowEventSimple *anEvent);
  // 3.) Method Finish() and methods called within Finish():
  virtual void Finish();  
    virtual void CheckPointersUsedInFinish(); 
    virtual void AccessSettings();  
    virtual void PrintOnTheScreen();     
  // 4.) Method GetOutputHistograms and method called within it:
  virtual void GetOutputHistograms(TList *outputListHistos);
    virtual void GetPointersForBaseHistograms();
    virtual void GetPointersForCommonHistograms();
    virtual void GetPointersForRAD();
    virtual void GetPointersForMH();
  // 5.) Other methods:   
  virtual void WriteHistograms(TString outputFileName);
  virtual void WriteHistograms(TDirectoryFile *outputFileName);  
  virtual void CheckPointersForRAD(TString where);
  virtual void CheckPointersForMH(TString where);
  // 6.) Setters and getters:
  void SetHistList(TList* const hl) {this->fHistList = hl;}
  TList* GetHistList() const {return this->fHistList;}  
  void SetHistListName(const char *hln) {this->fHistListName->Append(*hln);}; 
  TString *GetHistListName() const {return this->fHistListName;};
  void SetHarmonic(Int_t const harmonic) {this->fHarmonic = harmonic;};
  Int_t GetHarmonic() const {return this->fHarmonic;};    
  void SetAnalysisLabel(const char *al) {this->fAnalysisLabel->Append(*al);}; 
  TString *GetAnalysisLabel() const {return this->fAnalysisLabel;};
  void SetAnalysisSettings(TProfile* const as) {this->fAnalysisSettings = as;};
  TProfile* GetAnalysisSettings() const {return this->fAnalysisSettings;};
  void SetOppositeChargesPOI(Bool_t const ocp) {this->fOppositeChargesPOI = ocp;};
  Bool_t GetOppositeChargesPOI() const {return this->fOppositeChargesPOI;};
  void SetEvaluateDifferential3pCorrelator(Bool_t const ed3pc) {this->fEvaluateDifferential3pCorrelator = ed3pc;};
  Bool_t GetEvaluateDifferential3pCorrelator() const {return this->fEvaluateDifferential3pCorrelator;};      
  void SetPrintOnTheScreen(Bool_t const pots) {this->fPrintOnTheScreen = pots;};
  Bool_t GetPrintOnTheScreen() const {return this->fPrintOnTheScreen;};   
  void SetCommonHists(AliFlowCommonHist* const ch) {this->fCommonHists = ch;};
  AliFlowCommonHist* GetCommonHists() const {return this->fCommonHists;};
  void SetWeightsList(TList* const wl) {this->fWeightsList = (TList*)wl->Clone();}
  TList* GetWeightsList() const {return this->fWeightsList;}  
  void SetUsePhiWeights(Bool_t const uPhiW) {this->fUsePhiWeights = uPhiW;};
  Bool_t GetUsePhiWeights() const {return this->fUsePhiWeights;};
  void SetUsePtWeights(Bool_t const uPtW) {this->fUsePtWeights = uPtW;};
  Bool_t GetUsePtWeights() const {return this->fUsePtWeights;};
  void SetUseEtaWeights(Bool_t const uEtaW) {this->fUseEtaWeights = uEtaW;};
  Bool_t GetUseEtaWeights() const {return this->fUseEtaWeights;};
  void SetUseParticleWeights(TProfile* const uPW) {this->fUseParticleWeights = uPW;};
  TProfile* GetUseParticleWeights() const {return this->fUseParticleWeights;};
  void SetPhiWeights(TH1F* const histPhiWeights) {this->fPhiWeights = histPhiWeights;};
  TH1F* GetPhiWeights() const {return this->fPhiWeights;};
  void SetPtWeights(TH1D* const histPtWeights) {this->fPtWeights = histPtWeights;};
  TH1D* GetPtWeights() const {return this->fPtWeights;};
  void SetEtaWeights(TH1D* const histEtaWeights) {this->fEtaWeights = histEtaWeights;};
  TH1D* GetEtaWeights() const {return this->fEtaWeights;};
  void SetListRAD(TList* const lRAD) {this->fListRAD = lRAD;}
  TList* GetListRAD() const {return this->fListRAD;}  
  void SetEvaluateNestedLoopsForRAD(Bool_t const enlfRAD) {this->fEvaluateNestedLoopsForRAD = enlfRAD;};
  Bool_t GetEvaluateNestedLoopsForRAD() const {return this->fEvaluateNestedLoopsForRAD;};
  void SetRelativeAngleDistribution(TH1D* const rad) {this->fRelativeAngleDistribution = rad;};
  TH1D* GetRelativeAngleDistribution() const {return this->fRelativeAngleDistribution;}; 
  void SetCharge(TH1D* const rad) {this->fCharge = rad;};
  TH1D* GetCharge() const {return this->fCharge;}; 
  // QC:
  void SetListQC(TList* const lQC) {this->fListQC = lQC;}
  TList* GetListQC() const {return this->fListQC;}  
  void SetEvaluateNestedLoopsForQC(Bool_t const enlfQC) {this->fEvaluateNestedLoopsForQC = enlfQC;};
  Bool_t GetEvaluateNestedLoopsForQC() const {return this->fEvaluateNestedLoopsForQC;};
  // MH:
  void SetListMH(TList* const lMH) {this->fListMH = lMH;}
  TList* GetListMH() const {return this->fListMH;}  
  void SetEvaluateNestedLoopsForMH(Bool_t const enlfMH) {this->fEvaluateNestedLoopsForMH = enlfMH;};
  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];};
  
 private:
  AliFlowAnalysisWithNestedLoops(const AliFlowAnalysisWithNestedLoops& afawQc);
  AliFlowAnalysisWithNestedLoops& operator=(const AliFlowAnalysisWithNestedLoops& afawQc); 
  // 0.) Base:
  TList *fHistList; // base list to hold all output objects
  TString *fHistListName; // name of base list
  Int_t fHarmonic; // harmonic     
  TString *fAnalysisLabel; // analysis label 
  TProfile *fAnalysisSettings; // profile to hold analysis settings
  Bool_t fOppositeChargesPOI; // two POIs, psi1 and psi2, in correlator <<cos[psi1+psi2-2phi3)]>> will be taken with opposite charges  
  Bool_t fEvaluateDifferential3pCorrelator; // evaluate <<cos[psi1+psi2-2phi3)]>>, where psi1 and psi2 are two POIs   
  Bool_t fPrintOnTheScreen; // print or not on the screen
  // 1.) Common:
  AliFlowCommonHist *fCommonHists; // common control histograms (filled only with events with 3 or more tracks for 3-p correlators) 
  Int_t fnBinsPhi; // number of phi bins
  Double_t fPhiMin; // minimum phi   
  Double_t fPhiMax; // maximum phi 
  Double_t fPhiBinWidth; // bin width for phi histograms  
  Int_t fnBinsPt; // number of pt bins
  Double_t fPtMin; // minimum pt   
  Double_t fPtMax; // maximum pt  
  Double_t fPtBinWidth; // bin width for pt histograms  
  Int_t fnBinsEta; // number of eta bins
  Double_t fEtaMin; // minimum eta   
  Double_t fEtaMax; // maximum eta
  Double_t fEtaBinWidth; // bin width for eta histograms 
  // 2a.) Particle weights:
  TList *fWeightsList; // list to hold all histograms with particle weights: fUseParticleWeights, fPhiWeights, fPtWeights and fEtaWeights
  Bool_t fUsePhiWeights; // use phi weights
  Bool_t fUsePtWeights; // use pt weights
  Bool_t fUseEtaWeights; // use eta weights
  TProfile *fUseParticleWeights; // profile with three bins to hold values of fUsePhiWeights, fUsePtWeights and fUseEtaWeights
  TH1F *fPhiWeights; // histogram holding phi weights
  TH1D *fPtWeights; // histogram holding phi weights
  TH1D *fEtaWeights; // histogram holding phi weights 
  // 3.) Relative angle distribution (RAD):
  TList *fListRAD; // list holding objects for calculation of relative angle distribution phi1-phi2 
  Bool_t fEvaluateNestedLoopsForRAD; // evaluate nested loops for relative angle distribution
  TH1D *fRelativeAngleDistribution; // distribution of phi1-phi2 for all distinct pairs of particles
  TH1D *fCharge; // distribution of phi1-phi2 for all distinct pairs of particles
  // 4.) Debugging and cross-checking QC:
  TList *fListQC; // list holding objects relevant for debugging and cross-checking of Q-cumulants class
  Bool_t fEvaluateNestedLoopsForQC; // evaluate nested loops for Q-cumulants
  // 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[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);
};

//================================================================================================================

#endif





 AliFlowAnalysisWithNestedLoops.h:1
 AliFlowAnalysisWithNestedLoops.h:2
 AliFlowAnalysisWithNestedLoops.h:3
 AliFlowAnalysisWithNestedLoops.h:4
 AliFlowAnalysisWithNestedLoops.h:5
 AliFlowAnalysisWithNestedLoops.h:6
 AliFlowAnalysisWithNestedLoops.h:7
 AliFlowAnalysisWithNestedLoops.h:8
 AliFlowAnalysisWithNestedLoops.h:9
 AliFlowAnalysisWithNestedLoops.h:10
 AliFlowAnalysisWithNestedLoops.h:11
 AliFlowAnalysisWithNestedLoops.h:12
 AliFlowAnalysisWithNestedLoops.h:13
 AliFlowAnalysisWithNestedLoops.h:14
 AliFlowAnalysisWithNestedLoops.h:15
 AliFlowAnalysisWithNestedLoops.h:16
 AliFlowAnalysisWithNestedLoops.h:17
 AliFlowAnalysisWithNestedLoops.h:18
 AliFlowAnalysisWithNestedLoops.h:19
 AliFlowAnalysisWithNestedLoops.h:20
 AliFlowAnalysisWithNestedLoops.h:21
 AliFlowAnalysisWithNestedLoops.h:22
 AliFlowAnalysisWithNestedLoops.h:23
 AliFlowAnalysisWithNestedLoops.h:24
 AliFlowAnalysisWithNestedLoops.h:25
 AliFlowAnalysisWithNestedLoops.h:26
 AliFlowAnalysisWithNestedLoops.h:27
 AliFlowAnalysisWithNestedLoops.h:28
 AliFlowAnalysisWithNestedLoops.h:29
 AliFlowAnalysisWithNestedLoops.h:30
 AliFlowAnalysisWithNestedLoops.h:31
 AliFlowAnalysisWithNestedLoops.h:32
 AliFlowAnalysisWithNestedLoops.h:33
 AliFlowAnalysisWithNestedLoops.h:34
 AliFlowAnalysisWithNestedLoops.h:35
 AliFlowAnalysisWithNestedLoops.h:36
 AliFlowAnalysisWithNestedLoops.h:37
 AliFlowAnalysisWithNestedLoops.h:38
 AliFlowAnalysisWithNestedLoops.h:39
 AliFlowAnalysisWithNestedLoops.h:40
 AliFlowAnalysisWithNestedLoops.h:41
 AliFlowAnalysisWithNestedLoops.h:42
 AliFlowAnalysisWithNestedLoops.h:43
 AliFlowAnalysisWithNestedLoops.h:44
 AliFlowAnalysisWithNestedLoops.h:45
 AliFlowAnalysisWithNestedLoops.h:46
 AliFlowAnalysisWithNestedLoops.h:47
 AliFlowAnalysisWithNestedLoops.h:48
 AliFlowAnalysisWithNestedLoops.h:49
 AliFlowAnalysisWithNestedLoops.h:50
 AliFlowAnalysisWithNestedLoops.h:51
 AliFlowAnalysisWithNestedLoops.h:52
 AliFlowAnalysisWithNestedLoops.h:53
 AliFlowAnalysisWithNestedLoops.h:54
 AliFlowAnalysisWithNestedLoops.h:55
 AliFlowAnalysisWithNestedLoops.h:56
 AliFlowAnalysisWithNestedLoops.h:57
 AliFlowAnalysisWithNestedLoops.h:58
 AliFlowAnalysisWithNestedLoops.h:59
 AliFlowAnalysisWithNestedLoops.h:60
 AliFlowAnalysisWithNestedLoops.h:61
 AliFlowAnalysisWithNestedLoops.h:62
 AliFlowAnalysisWithNestedLoops.h:63
 AliFlowAnalysisWithNestedLoops.h:64
 AliFlowAnalysisWithNestedLoops.h:65
 AliFlowAnalysisWithNestedLoops.h:66
 AliFlowAnalysisWithNestedLoops.h:67
 AliFlowAnalysisWithNestedLoops.h:68
 AliFlowAnalysisWithNestedLoops.h:69
 AliFlowAnalysisWithNestedLoops.h:70
 AliFlowAnalysisWithNestedLoops.h:71
 AliFlowAnalysisWithNestedLoops.h:72
 AliFlowAnalysisWithNestedLoops.h:73
 AliFlowAnalysisWithNestedLoops.h:74
 AliFlowAnalysisWithNestedLoops.h:75
 AliFlowAnalysisWithNestedLoops.h:76
 AliFlowAnalysisWithNestedLoops.h:77
 AliFlowAnalysisWithNestedLoops.h:78
 AliFlowAnalysisWithNestedLoops.h:79
 AliFlowAnalysisWithNestedLoops.h:80
 AliFlowAnalysisWithNestedLoops.h:81
 AliFlowAnalysisWithNestedLoops.h:82
 AliFlowAnalysisWithNestedLoops.h:83
 AliFlowAnalysisWithNestedLoops.h:84
 AliFlowAnalysisWithNestedLoops.h:85
 AliFlowAnalysisWithNestedLoops.h:86
 AliFlowAnalysisWithNestedLoops.h:87
 AliFlowAnalysisWithNestedLoops.h:88
 AliFlowAnalysisWithNestedLoops.h:89
 AliFlowAnalysisWithNestedLoops.h:90
 AliFlowAnalysisWithNestedLoops.h:91
 AliFlowAnalysisWithNestedLoops.h:92
 AliFlowAnalysisWithNestedLoops.h:93
 AliFlowAnalysisWithNestedLoops.h:94
 AliFlowAnalysisWithNestedLoops.h:95
 AliFlowAnalysisWithNestedLoops.h:96
 AliFlowAnalysisWithNestedLoops.h:97
 AliFlowAnalysisWithNestedLoops.h:98
 AliFlowAnalysisWithNestedLoops.h:99
 AliFlowAnalysisWithNestedLoops.h:100
 AliFlowAnalysisWithNestedLoops.h:101
 AliFlowAnalysisWithNestedLoops.h:102
 AliFlowAnalysisWithNestedLoops.h:103
 AliFlowAnalysisWithNestedLoops.h:104
 AliFlowAnalysisWithNestedLoops.h:105
 AliFlowAnalysisWithNestedLoops.h:106
 AliFlowAnalysisWithNestedLoops.h:107
 AliFlowAnalysisWithNestedLoops.h:108
 AliFlowAnalysisWithNestedLoops.h:109
 AliFlowAnalysisWithNestedLoops.h:110
 AliFlowAnalysisWithNestedLoops.h:111
 AliFlowAnalysisWithNestedLoops.h:112
 AliFlowAnalysisWithNestedLoops.h:113
 AliFlowAnalysisWithNestedLoops.h:114
 AliFlowAnalysisWithNestedLoops.h:115
 AliFlowAnalysisWithNestedLoops.h:116
 AliFlowAnalysisWithNestedLoops.h:117
 AliFlowAnalysisWithNestedLoops.h:118
 AliFlowAnalysisWithNestedLoops.h:119
 AliFlowAnalysisWithNestedLoops.h:120
 AliFlowAnalysisWithNestedLoops.h:121
 AliFlowAnalysisWithNestedLoops.h:122
 AliFlowAnalysisWithNestedLoops.h:123
 AliFlowAnalysisWithNestedLoops.h:124
 AliFlowAnalysisWithNestedLoops.h:125
 AliFlowAnalysisWithNestedLoops.h:126
 AliFlowAnalysisWithNestedLoops.h:127
 AliFlowAnalysisWithNestedLoops.h:128
 AliFlowAnalysisWithNestedLoops.h:129
 AliFlowAnalysisWithNestedLoops.h:130
 AliFlowAnalysisWithNestedLoops.h:131
 AliFlowAnalysisWithNestedLoops.h:132
 AliFlowAnalysisWithNestedLoops.h:133
 AliFlowAnalysisWithNestedLoops.h:134
 AliFlowAnalysisWithNestedLoops.h:135
 AliFlowAnalysisWithNestedLoops.h:136
 AliFlowAnalysisWithNestedLoops.h:137
 AliFlowAnalysisWithNestedLoops.h:138
 AliFlowAnalysisWithNestedLoops.h:139
 AliFlowAnalysisWithNestedLoops.h:140
 AliFlowAnalysisWithNestedLoops.h:141
 AliFlowAnalysisWithNestedLoops.h:142
 AliFlowAnalysisWithNestedLoops.h:143
 AliFlowAnalysisWithNestedLoops.h:144
 AliFlowAnalysisWithNestedLoops.h:145
 AliFlowAnalysisWithNestedLoops.h:146
 AliFlowAnalysisWithNestedLoops.h:147
 AliFlowAnalysisWithNestedLoops.h:148
 AliFlowAnalysisWithNestedLoops.h:149
 AliFlowAnalysisWithNestedLoops.h:150
 AliFlowAnalysisWithNestedLoops.h:151
 AliFlowAnalysisWithNestedLoops.h:152
 AliFlowAnalysisWithNestedLoops.h:153
 AliFlowAnalysisWithNestedLoops.h:154
 AliFlowAnalysisWithNestedLoops.h:155
 AliFlowAnalysisWithNestedLoops.h:156
 AliFlowAnalysisWithNestedLoops.h:157
 AliFlowAnalysisWithNestedLoops.h:158
 AliFlowAnalysisWithNestedLoops.h:159
 AliFlowAnalysisWithNestedLoops.h:160
 AliFlowAnalysisWithNestedLoops.h:161
 AliFlowAnalysisWithNestedLoops.h:162
 AliFlowAnalysisWithNestedLoops.h:163
 AliFlowAnalysisWithNestedLoops.h:164
 AliFlowAnalysisWithNestedLoops.h:165
 AliFlowAnalysisWithNestedLoops.h:166
 AliFlowAnalysisWithNestedLoops.h:167
 AliFlowAnalysisWithNestedLoops.h:168
 AliFlowAnalysisWithNestedLoops.h:169
 AliFlowAnalysisWithNestedLoops.h:170
 AliFlowAnalysisWithNestedLoops.h:171
 AliFlowAnalysisWithNestedLoops.h:172
 AliFlowAnalysisWithNestedLoops.h:173
 AliFlowAnalysisWithNestedLoops.h:174
 AliFlowAnalysisWithNestedLoops.h:175
 AliFlowAnalysisWithNestedLoops.h:176
 AliFlowAnalysisWithNestedLoops.h:177
 AliFlowAnalysisWithNestedLoops.h:178
 AliFlowAnalysisWithNestedLoops.h:179
 AliFlowAnalysisWithNestedLoops.h:180
 AliFlowAnalysisWithNestedLoops.h:181
 AliFlowAnalysisWithNestedLoops.h:182
 AliFlowAnalysisWithNestedLoops.h:183
 AliFlowAnalysisWithNestedLoops.h:184
 AliFlowAnalysisWithNestedLoops.h:185
 AliFlowAnalysisWithNestedLoops.h:186
 AliFlowAnalysisWithNestedLoops.h:187
 AliFlowAnalysisWithNestedLoops.h:188
 AliFlowAnalysisWithNestedLoops.h:189
 AliFlowAnalysisWithNestedLoops.h:190
 AliFlowAnalysisWithNestedLoops.h:191
 AliFlowAnalysisWithNestedLoops.h:192