Adding comments (Laurent)
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowWeighter.h
1 //////////////////////////////////////////////////////////////////////
2 //
3 // $Id$
4 //
5 // Author: Emanuele Simili
6 //
7 //////////////////////////////////////////////////////////////////////
8 //
9 // Description: generates phi-weights and counts particle abundances .
10 //  So, in fact, you should run this thing before the analysis,
11 //  if you want to use phi-weight.
12 //
13 //////////////////////////////////////////////////////////////////////
14
15 #ifndef ALIFLOWWEIGHTER_H
16 #define ALIFLOWWEIGHTER_H
17
18 #include <TFile.h>
19 #include "AliFlowConstants.h"
20
21 class TH1F;
22 class TH1D;
23 class TOrdCollection;
24 class TVector2;
25
26 class AliFlowTrack;
27 class AliFlowV0;
28 class AliFlowEvent;
29 class AliFlowSelection;
30
31 class AliFlowWeighter {
32
33
34  public:
35
36   AliFlowWeighter(const AliFlowSelection* flowSelect = 0);      // Constructor with selection object (default selection if no one given)
37   virtual  ~AliFlowWeighter();                                  // Default destructor (no actions)
38
39  // Steps of the flow analysis
40   Bool_t   Init() ;                                             // Books wgt histograms, opens output file
41   Bool_t   Finish() ;                                           // Saves histograms, closes stuff
42
43  // Analysis of 1 event (can be called from outside)
44   Bool_t   WeightEvent(AliFlowEvent* fFlowEvent = 0) ;          // Runs on the event
45
46  // Output 
47   void     SetWgtFileName(TString name)                         { fWgtFileName = name ; }                                  // Sets output file name
48   void     SetWgtFile(TFile* file)                              { fWgtFile = file ; fWgtFileName = fWgtFile->GetName() ; }  // Sets output file
49   TString  GetWgtFileName() const                               { return fWgtFileName ; }
50
51   void     PrintBayesian(Int_t selN = 0) const ;                // Prints normalized particle abundance (selN)
52
53
54  protected:
55  
56  // Internal methods to fill the histogram
57   void     TracksLoop(TObjArray* fFlowTracks) ;                 // Fills Phi and PId histograms
58   Bool_t   Weightening() ;                                      // Calculates weights and fills PhiWgt histograms
59
60
61  private:
62
63  // to make the code checker happy
64   AliFlowWeighter(const AliFlowWeighter &flowWgt) ;             // Copy Constructor (dummy)
65   AliFlowWeighter &operator=(const AliFlowWeighter &flowAnal) ; // Assignment Operator
66
67  // enumerators etc.                        
68   Int_t            fEventNumber ;                               //! progressive enumeration of AliFlowEvents
69   Int_t            fTrackNumber ;                               //! progressive enumeration of AliFlowTracks
70   Int_t            fNumberOfV0s ;                               //! total number of V0s in the current event
71   Int_t            fNumberOfTracks ;                            //! total number of tracks in the current event
72
73   Int_t            fPhiBins ;                                   //! phi bins   
74   Float_t          fPhiMin ;                                    //! i.e. 0
75   Float_t          fPhiMax ;                                    //! i.e. 2 Pi
76
77  // Internal pointers
78   AliFlowEvent*     fFlowEvent ;                                //! pointer to AliFlowEvent
79   AliFlowTrack*     fFlowTrack ;                                //! pointer to AliFlowTrack
80   AliFlowSelection* fFlowSelect ;                               //  selection object
81   TObjArray*        fFlowTracks ;                               //! pointer to the TrackCollection
82   //Float_t           fVertex[3] ;                              //! Event's Vertex position 
83
84  // PhiWgt File
85   TFile*            fWgtFile ;                                  //! phi weight file 
86   TString           fWgtFileName ;                              //! Wgt File Name (histograms for weight)
87
88  // Histograms
89   TOrdCollection*   fPhiWgtHistList ;                           //! Weights:  histogram list
90   struct AliHistFullHars 
91   {
92     TH1D*       fHistPhiPlus;                                   //! histogram ...
93     TH1D*       fHistPhiMinus;                                  //! histogram ...
94     TH1D*       fHistPhiAll;                                    //! histogram ...
95     TH1D*       fHistPhi;                                       //! histogram ...
96     TH1D*       fHistPhiWgtPlus;                                //! histogram ...
97     TH1D*       fHistPhiWgtMinus;                               //! histogram ...
98     TH1D*       fHistPhiWgtAll;                                 //! histogram ...
99     TH1D*       fHistPhiWgt;                                    //! histogram ...
100     TH1D*       fHistPhiFlatPlus;                               //! histogram ...
101     TH1D*       fHistPhiFlatMinus;                              //! histogram ...
102     TH1D*       fHistPhiFlatAll;                                //! histogram ...
103     TH1D*       fHistPhiFlat;                                   //! histogram ...
104   };
105   
106   struct AliHistFulls 
107   {
108    TH1F*        fHistBayPidMult ;                               //! histogram ...
109    struct AliHistFullHars fHistFullHar[AliFlowConstants::kHars];                //! structure wgt, evts, trks, v0s (as defined above)
110   };
111   struct AliHistFulls fHistFull[AliFlowConstants::kSels];                   //! structure array ...
112
113   ClassDef(AliFlowWeighter,0)                                   // macro for rootcint
114 };
115
116 #endif
117
118
119