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

/* $Id$ */


#ifndef ALIFLOWANALYSISWITHSCALARPRODUCT_H
#define ALIFLOWANALYSISWITHSCALARPRODUCT_H

class AliFlowTrackSimple;
class AliFlowEventSimple;
class AliFlowCommonHist;
class AliFlowCommonHistResults;

#include  "TList.h"
#include "AliFlowAnalysis.h"

class TH1D;
class TH1F;
class TH2D;
class TProfile;
class TDirectoryFile;

/////////////////////////////////////////////////////////////////////////////
// Description: Maker to analyze Flow from the Event Plane method.
//              Adaptation based on Scalar Product
// authors: Naomi van del Kolk (kolk@nikhef.nl)
//          Ante Bilandzic (anteb@nikhef.nl)
// mods:    Carlos Perez (cperez@nikhef.nl)
/////////////////////////////////////////////////////////////////////////////
 
class AliFlowAnalysisWithScalarProduct : public AliFlowAnalysis {
 public:
 
   AliFlowAnalysisWithScalarProduct();            //default constructor
   virtual  ~AliFlowAnalysisWithScalarProduct();  //destructor
 
   void Init();                                       //Define output objects
   void Make(AliFlowEventSimple* anEvent);            //Main routine
   void GetOutputHistograms(TList *outputListHistos); //Copy output objects from TList
   void Finish();                                     //Fill results
   void WriteHistograms(TDirectoryFile *outputFileName) const; //writes histograms locally (for OnTheFly)


   void SetHarmonic(Int_t iHarmonic)          { fHarmonic = iHarmonic; }
   void SetApplyCorrectionForNUA(Bool_t iVal) { fApplyCorrectionForNUA = iVal?1:0; }
   void SetNormalizationType(Int_t iVal)      { fNormalizationType = iVal; }
   void SetDebug(Bool_t bVal)                 { fDebug = bVal; }
   void SetBookOnlyBasicCCH(Bool_t bVal)           { fMinimalBook = bVal; }
   void SetTotalQvector(Int_t iVal)           { fTotalQvector = iVal; }

   void SetUsePhiWeights(Bool_t bVal)        { fUsePhiWeights = bVal; }
   void SetWeightsList(TList* const aWeightsList)  { fWeightsList = (TList*)aWeightsList->Clone(); }
  
   TList*    GetHistList()      const { return fHistList; }
   TProfile* GetHistProConfig() const { return fHistProConfig; }
   TProfile* GetHistProUQ(Int_t iRFPorPOI, Int_t iPTorETA) const { return fHistProUQ[iRFPorPOI][iPTorETA]; }
   TProfile* GetHistProQaQbNorm() const  { return fHistProQaQbNorm; }
   TProfile* GetHistProNUAq()     const  { return fHistProNUAq; }
   TProfile* GetHistProNUAu(Int_t iRFPorPOI, Int_t iPTorETA, Int_t iIMorRE) const { return fHistProNUAu[iRFPorPOI][iPTorETA][iIMorRE]; }
   TH1D*     GetHistSumOfWeights() const { return fHistSumOfWeights; }
   TProfile* GetHistProUQQaQb( Int_t iRFPorPOI, Int_t iPTorETA ) const { return fHistProUQQaQb[iRFPorPOI][iPTorETA]; }
   TH1D*     GetHistSumOfWeightsu(Int_t iRFPorPOI, Int_t iPTorETA, Int_t iWeight) const { return fHistSumOfWeightsu[iRFPorPOI][iPTorETA][iWeight]; }
   AliFlowCommonHist*        GetCommonHists()    const { return fCommonHists; }
   AliFlowCommonHistResults* GetCommonHistsRes() const { return fCommonHistsRes; }
   
 private:
   AliFlowAnalysisWithScalarProduct(const AliFlowAnalysisWithScalarProduct& anAnalysis);            //copy constructor
   AliFlowAnalysisWithScalarProduct& operator=(const AliFlowAnalysisWithScalarProduct& anAnalysis); //assignment operator
   Double_t CalculateStatisticalError( Int_t RFPorPOI, Int_t PTorETA, Int_t bin, Double_t errV ) const;
   Double_t ComputeResolution( Double_t x ) const;
   Double_t FindXi( Double_t res, Double_t prec ) const;

      
   Int_t fDebug ;                // flag for analysis: more print statements
   Bool_t fMinimalBook;          // flag to turn off QA and minimize FlowCommonHist
   Int_t fUsePhiWeights;         // use phi weights
   Int_t fApplyCorrectionForNUA; // apply correction for non-uniform acceptance
   Int_t fHarmonic;              // harmonic 
   Int_t fNormalizationType;     // 0: EP mode || 1: SP mode
   Int_t fTotalQvector;          // 1:Qa 2:Qb 3:QaQb

   TList*     fWeightsList;      // list holding input histograms with phi weights
   TList*     fHistList;         // list to hold all output histograms  
   TProfile*  fHistProConfig;    // configuration values
   TProfile*  fHistProQaQbNorm;  // average of QaQb
   TH1D*      fHistSumOfWeights; // holds sum of Na*Nb and (Na*Nb)^2
   TProfile*  fHistProNUAq;      // NUA related qq

   //QAHists
   TProfile* fHistProQNorm; // QNorm
   TProfile* fHistProQaQb; // QaQb
   TProfile* fHistProQaQbM; // QaQb/MaMb
   TH2D* fHistMaMb;         // MaMb
   TH2D* fHistQNormQaQbNorm; // QNorm vs QaQbNorm
   TH2D* fHistQaNormMa; // QaNorm Ma
   TH2D* fHistQbNormMb; // QbNorm Mb
   TH1D* fResolution; // Resolution
   TH1D* fHistQaQb; // QaQb
   TH1D* fHistQaQbCos; // QaQbCos
   TH1I* fHistNumberOfSubtractedDaughters; //how many daughters were subtracted during Q calculation?

   AliFlowCommonHist*        fCommonHists;    // control histograms
   AliFlowCommonHist*        fCommonHistsuQ;  // control histograms
   AliFlowCommonHistResults* fCommonHistsRes; // results histograms

   TH1F*      fPhiWeightsSub[2];           // histogram holding phi weights for subevents
   TProfile*  fHistProUQ[2][2];            // uQ for RP|POI PT|ETA
   TProfile*  fHistProUQQaQb[2][2];        // holds weighted average of <QuQaQb> for RP|POI PT|ETA
   TH1D*      fHistSumOfWeightsu[2][2][3]; // holds sums of 0: Nq', 1: Nq'^2, 2: Nq'*Na*Nb
   TProfile*  fHistProNUAu[2][2][2];          // NUA related qq for RP|POI PT|ETA

   ClassDef(AliFlowAnalysisWithScalarProduct,1)  // class version
};
 

#endif
 AliFlowAnalysisWithScalarProduct.h:1
 AliFlowAnalysisWithScalarProduct.h:2
 AliFlowAnalysisWithScalarProduct.h:3
 AliFlowAnalysisWithScalarProduct.h:4
 AliFlowAnalysisWithScalarProduct.h:5
 AliFlowAnalysisWithScalarProduct.h:6
 AliFlowAnalysisWithScalarProduct.h:7
 AliFlowAnalysisWithScalarProduct.h:8
 AliFlowAnalysisWithScalarProduct.h:9
 AliFlowAnalysisWithScalarProduct.h:10
 AliFlowAnalysisWithScalarProduct.h:11
 AliFlowAnalysisWithScalarProduct.h:12
 AliFlowAnalysisWithScalarProduct.h:13
 AliFlowAnalysisWithScalarProduct.h:14
 AliFlowAnalysisWithScalarProduct.h:15
 AliFlowAnalysisWithScalarProduct.h:16
 AliFlowAnalysisWithScalarProduct.h:17
 AliFlowAnalysisWithScalarProduct.h:18
 AliFlowAnalysisWithScalarProduct.h:19
 AliFlowAnalysisWithScalarProduct.h:20
 AliFlowAnalysisWithScalarProduct.h:21
 AliFlowAnalysisWithScalarProduct.h:22
 AliFlowAnalysisWithScalarProduct.h:23
 AliFlowAnalysisWithScalarProduct.h:24
 AliFlowAnalysisWithScalarProduct.h:25
 AliFlowAnalysisWithScalarProduct.h:26
 AliFlowAnalysisWithScalarProduct.h:27
 AliFlowAnalysisWithScalarProduct.h:28
 AliFlowAnalysisWithScalarProduct.h:29
 AliFlowAnalysisWithScalarProduct.h:30
 AliFlowAnalysisWithScalarProduct.h:31
 AliFlowAnalysisWithScalarProduct.h:32
 AliFlowAnalysisWithScalarProduct.h:33
 AliFlowAnalysisWithScalarProduct.h:34
 AliFlowAnalysisWithScalarProduct.h:35
 AliFlowAnalysisWithScalarProduct.h:36
 AliFlowAnalysisWithScalarProduct.h:37
 AliFlowAnalysisWithScalarProduct.h:38
 AliFlowAnalysisWithScalarProduct.h:39
 AliFlowAnalysisWithScalarProduct.h:40
 AliFlowAnalysisWithScalarProduct.h:41
 AliFlowAnalysisWithScalarProduct.h:42
 AliFlowAnalysisWithScalarProduct.h:43
 AliFlowAnalysisWithScalarProduct.h:44
 AliFlowAnalysisWithScalarProduct.h:45
 AliFlowAnalysisWithScalarProduct.h:46
 AliFlowAnalysisWithScalarProduct.h:47
 AliFlowAnalysisWithScalarProduct.h:48
 AliFlowAnalysisWithScalarProduct.h:49
 AliFlowAnalysisWithScalarProduct.h:50
 AliFlowAnalysisWithScalarProduct.h:51
 AliFlowAnalysisWithScalarProduct.h:52
 AliFlowAnalysisWithScalarProduct.h:53
 AliFlowAnalysisWithScalarProduct.h:54
 AliFlowAnalysisWithScalarProduct.h:55
 AliFlowAnalysisWithScalarProduct.h:56
 AliFlowAnalysisWithScalarProduct.h:57
 AliFlowAnalysisWithScalarProduct.h:58
 AliFlowAnalysisWithScalarProduct.h:59
 AliFlowAnalysisWithScalarProduct.h:60
 AliFlowAnalysisWithScalarProduct.h:61
 AliFlowAnalysisWithScalarProduct.h:62
 AliFlowAnalysisWithScalarProduct.h:63
 AliFlowAnalysisWithScalarProduct.h:64
 AliFlowAnalysisWithScalarProduct.h:65
 AliFlowAnalysisWithScalarProduct.h:66
 AliFlowAnalysisWithScalarProduct.h:67
 AliFlowAnalysisWithScalarProduct.h:68
 AliFlowAnalysisWithScalarProduct.h:69
 AliFlowAnalysisWithScalarProduct.h:70
 AliFlowAnalysisWithScalarProduct.h:71
 AliFlowAnalysisWithScalarProduct.h:72
 AliFlowAnalysisWithScalarProduct.h:73
 AliFlowAnalysisWithScalarProduct.h:74
 AliFlowAnalysisWithScalarProduct.h:75
 AliFlowAnalysisWithScalarProduct.h:76
 AliFlowAnalysisWithScalarProduct.h:77
 AliFlowAnalysisWithScalarProduct.h:78
 AliFlowAnalysisWithScalarProduct.h:79
 AliFlowAnalysisWithScalarProduct.h:80
 AliFlowAnalysisWithScalarProduct.h:81
 AliFlowAnalysisWithScalarProduct.h:82
 AliFlowAnalysisWithScalarProduct.h:83
 AliFlowAnalysisWithScalarProduct.h:84
 AliFlowAnalysisWithScalarProduct.h:85
 AliFlowAnalysisWithScalarProduct.h:86
 AliFlowAnalysisWithScalarProduct.h:87
 AliFlowAnalysisWithScalarProduct.h:88
 AliFlowAnalysisWithScalarProduct.h:89
 AliFlowAnalysisWithScalarProduct.h:90
 AliFlowAnalysisWithScalarProduct.h:91
 AliFlowAnalysisWithScalarProduct.h:92
 AliFlowAnalysisWithScalarProduct.h:93
 AliFlowAnalysisWithScalarProduct.h:94
 AliFlowAnalysisWithScalarProduct.h:95
 AliFlowAnalysisWithScalarProduct.h:96
 AliFlowAnalysisWithScalarProduct.h:97
 AliFlowAnalysisWithScalarProduct.h:98
 AliFlowAnalysisWithScalarProduct.h:99
 AliFlowAnalysisWithScalarProduct.h:100
 AliFlowAnalysisWithScalarProduct.h:101
 AliFlowAnalysisWithScalarProduct.h:102
 AliFlowAnalysisWithScalarProduct.h:103
 AliFlowAnalysisWithScalarProduct.h:104
 AliFlowAnalysisWithScalarProduct.h:105
 AliFlowAnalysisWithScalarProduct.h:106
 AliFlowAnalysisWithScalarProduct.h:107
 AliFlowAnalysisWithScalarProduct.h:108
 AliFlowAnalysisWithScalarProduct.h:109
 AliFlowAnalysisWithScalarProduct.h:110
 AliFlowAnalysisWithScalarProduct.h:111
 AliFlowAnalysisWithScalarProduct.h:112
 AliFlowAnalysisWithScalarProduct.h:113
 AliFlowAnalysisWithScalarProduct.h:114
 AliFlowAnalysisWithScalarProduct.h:115
 AliFlowAnalysisWithScalarProduct.h:116
 AliFlowAnalysisWithScalarProduct.h:117