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