]>
Commit | Line | Data |
---|---|---|
dc8ba4dd | 1 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
2 | * See cxx source for full Copyright notice */ | |
3 | /* $Id$ */ | |
4 | ||
5 | #ifndef ALIFLOWANALYSISWITHMSP_H | |
6 | #define ALIFLOWANALYSISWITHMSP_H | |
7 | ||
8 | // The original implementation of the scalar produc method was done by Naomi van der Kolk and Ante Bilandzic | |
9 | // This file contains a completely rewritten implementation that extends the SP method to allow for subevents | |
10 | // with different v2. | |
11 | // | |
12 | // Author: Paul Kuijer <mailto:Paul.Kuijer@nikhef.nl> | |
13 | // | |
14 | ||
15 | #include <TNamed.h> | |
16 | ||
17 | class TH1D; | |
18 | class TProfile; | |
19 | class TDirectoryFile; | |
20 | ||
21 | class AliFlowEventSimple; | |
22 | class AliFlowCommonHist; | |
23 | class AliFlowMSPHistograms; | |
24 | ||
25 | class AliFlowAnalysisWithMSP : public TNamed | |
26 | { | |
27 | /////////////////////////////////////////////////////////////////////////////// | |
28 | // // | |
29 | // AliFlowAnalysisWithMSP // | |
30 | // // | |
31 | // Use the modified scalar produc method to analyze flow // | |
32 | // // | |
33 | /////////////////////////////////////////////////////////////////////////////// | |
34 | public: | |
35 | AliFlowAnalysisWithMSP(); // Default constructor for root I/O | |
36 | AliFlowAnalysisWithMSP(const unsigned int harmonic, const bool commonConst=true, const bool commonHist=false); // Construct and define params | |
7b5556ef | 37 | AliFlowAnalysisWithMSP(TDirectory *file); // Construct and read from file |
38 | AliFlowAnalysisWithMSP(TList *list); // Construct and load histograms from a TList. This object becomes owner. | |
39 | AliFlowAnalysisWithMSP(const AliFlowAnalysisWithMSP &x); // Copy constructor | |
dc8ba4dd | 40 | ~AliFlowAnalysisWithMSP(); // Destructor assumes everything is owned |
41 | ||
42 | void Init(); // (re)define all output objects, clears results | |
43 | void Make(AliFlowEventSimple *event); // Analyze one event | |
44 | void Finish(); // Calculate final results without redefining NUA usage | |
7b5556ef | 45 | void Finish(bool nua){fNUA=nua;Finish();}; // Calculate after redefining if NUA is applied |
dc8ba4dd | 46 | void WriteHistograms(TDirectoryFile *file) const; // Write all histograms to a file |
47 | void WriteCommonResults(TDirectoryFile *file) const; // Write an AliFlowCommonHistResults() to file | |
7b5556ef | 48 | TList *ListHistograms(); // Create a TList from all histograms, ownership is kept in this class |
dc8ba4dd | 49 | |
50 | void Print(const Option_t *opt=0)const; // Summarize results on std::cout | |
51 | ||
52 | void SetHarmonic(const unsigned int h){fHarmonic=h;}; // Define harmonic for the flow analysis, should be followed by Init() | |
53 | void UseCommonConstants(bool b=true){fUseCommonConstants=b;}; // Get parameters from AliFlowCommonConstants. MUST be called before Init() | |
54 | void EnableCommonHistograms(bool c=true){fBookCommonHistograms=c;}; // Create and fill AliFlowCommonHistograms() MUST be called before Init() | |
55 | void EnableNUA(bool c=true){fNUA=c;}; // Switch on/off NUA corrections. MUST be called before Finish() | |
7b5556ef | 56 | // TODO: Allow NUA off, NUAu integrated, NUAu per bin instead of On(per bin)/OFF. Default should be backward compatible |
57 | // TODO: Allow setting of pt and eta binning in a simpler way, i.e. independent of AliFlowCommonConstants. | |
dc8ba4dd | 58 | |
59 | const TH1D* GetIntegratedFlow(){return fIntegratedFlow;}; // Access result | |
60 | const TH1D* GetDiffFlowPt(){return fDiffFlowPt;}; // Access to result | |
61 | const TH1D* GetDiffFlowEta(){return fDiffFlowEta;}; // Access to result | |
62 | ||
7b5556ef | 63 | AliFlowAnalysisWithMSP &operator=(const AliFlowAnalysisWithMSP &x); // Assignment |
64 | ||
dc8ba4dd | 65 | private: |
66 | UInt_t fHarmonic; // Harmonic (n) in v_n analysis, used in Init() and Make() | |
67 | Bool_t fNUA; // Correct for Non Uniform Acceptance during Finish() | |
68 | Bool_t fUseCommonConstants; //! Get parameters from AliFlowCommonConstants during Init() | |
69 | Bool_t fBookCommonHistograms; //! Book standard histograms in Init() | |
70 | ||
71 | AliFlowCommonHist *fCommonHist; // Standard control histograms, if enabled | |
72 | ||
7b5556ef | 73 | // Correlations |
dc8ba4dd | 74 | AliFlowMSPHistograms *fQaComponents; // Averages of Qa components per event for NUA |
75 | AliFlowMSPHistograms *fQbComponents; // Averages of Qb components per event for NUA | |
76 | AliFlowMSPHistograms *fQaQb; // Average of QaQb per event | |
77 | AliFlowMSPHistograms *fPtUComponents; // ux and uy per pt bin for NUA | |
78 | AliFlowMSPHistograms *fEtaUComponents; // ux and uy per eta bin for NUA | |
79 | AliFlowMSPHistograms *fAllStatistics; // Correlations for uQa uQb and QaQb (integrated) | |
80 | AliFlowMSPHistograms *fPtStatistics; // Correlations for uQa uQb and QaQb per pt bin | |
81 | AliFlowMSPHistograms *fEtaStatistics; // Correlations for uQa uQb and QaQb per eta bin | |
82 | ||
7b5556ef | 83 | // Result histograms (if calculated) |
84 | TH1D *fIntegratedFlow; // vn for POI and subevents | |
85 | TH1D *fDiffFlowPt; // vn as function of pt | |
86 | TH1D *fDiffFlowEta; // vn as function of eta | |
87 | TProfile *fFlags; // Stores fHarmonic and fNUA | |
88 | ||
89 | TList *fHistList; // List of all histograms if requested by ListHistograms() | |
dc8ba4dd | 90 | |
7b5556ef | 91 | // Helper functions |
dc8ba4dd | 92 | bool Calculate(double &vn, double &vnerror, const AliFlowMSPHistograms *hist, const AliFlowMSPHistograms *comp, const int bin=1, const int poi=0)const; // Calculates flow from histograms with NUA corrections |
93 | bool Calculate(double &vn, double &vnerror, const AliFlowMSPHistograms *hist, const int bin=1, const int poi=0)const{return Calculate(vn,vnerror,hist,0,bin,poi);}; // No NUA version | |
7b5556ef | 94 | void ReadHistograms(TDirectory *file); // Restore histograms from a file |
95 | void ReadHistograms(TList *list); // Restore histograms from a TList | |
dc8ba4dd | 96 | |
7b5556ef | 97 | ClassDef(AliFlowAnalysisWithMSP,0); // Class version |
dc8ba4dd | 98 | }; |
99 | ||
100 | #endif //ALIFLOWANALYSISWITHMSP_H |