Improved version, kinetree included
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowAnalyser.h
1 //////////////////////////////////////////////////////////////////////
2 //
3 // $Id$
4 //
5 // Author: Emanuele Simili
6 //
7 //////////////////////////////////////////////////////////////////////
8 //
9 // Description: ALICE flow analysis for AliFlowEvent(s), 
10 // adapted from the STAR flow analysis .
11 // Original Authors:                 Raimond Snellings & Art Poskanzer
12 //
13 //////////////////////////////////////////////////////////////////////
14
15 #ifndef ALIFLOWANALYSER_H
16 #define ALIFLOWANALYSER_H
17
18 #include <TVector2.h>
19 #include <TFile.h>
20 #include "AliFlowConstants.h"
21
22 class TH1F;
23 class TH1D;
24 class TH2F;
25 class TH2D;
26 class TH3F;
27 class TProfile;
28 class TProfile2D;
29 class TOrdCollection;
30
31 class TClonesArray;
32
33 class AliFlowTrack;
34 class AliFlowV0;
35 class AliFlowEvent;
36 class AliFlowSelection;
37 class AliFlowConstants;
38
39 class AliFlowAnalyser {
40
41
42 public:
43   
44   AliFlowAnalyser(const AliFlowSelection* flowSelect = 0);      // Constructor with selection object (default selection if no one given)
45   virtual  ~AliFlowAnalyser();                                  // Default destructor (no actions)
46
47  // Steps of the flow analysis
48   Bool_t   Init() ;                                             // Books histograms for flow analysis
49   Bool_t   Finish() ;                                           // Saves histograms, Closes stuff
50
51  // Analysis of 1 event (can be called from outside)
52   Bool_t   Analyze(AliFlowEvent* flowEvent = 0) ;               // Fills the defaults histograms (init them first!) and performs the calculation for the given event         
53
54  // Resolution corrections to v_n (call it at the end of the evts loop)
55   Bool_t   Resolution() ;                                       // Calculates resolution and mean flow values
56  
57  // Weights calculation and saving (call it at the end of the evts loop)
58   void     Weightening() ;                                      // Calculates weights and fills PhiWgt histograms
59
60  // Options
61   void     SetEtaSub(Bool_t es = kTRUE)                         { fEtaSub = es ; }              // Set eta subevents
62   void     SetV1Ep1Ep2(Bool_t v1Ep1Ep2 = kTRUE)                 { fV1Ep1Ep2 = v1Ep1Ep2 ; }      // Switches the v_1{EP1,EP2} calculation on/off
63   void     SetShuffle(Bool_t sh = kTRUE)                        { fShuffle = sh ; }             // Set to re-shuffle evt tracks
64   void     SetUsePhiWgt(Bool_t pw = kTRUE)                      { fReadPhiWgt = pw ; }          // Set to use phi weights (true by default...if there)
65   void     SetUseBayWgt(Bool_t bw = kTRUE)                      { fBayWgt = bw ; }              // Set to use bayesian weights for p.id. (false by default)
66   void     SetUsePtWgt(Bool_t ptw = kTRUE)                      { fPtWgt = ptw ; }              // uses pT as a weight for RP determination
67   void     SetUseEtaWgt(Bool_t etw = kTRUE)                     { fEtaWgt = etw ; }             // uses eta as a weight for RP determination
68   void     SetUseOnePhiWgt(Bool_t opw = kTRUE)                  { fOnePhiWgt = opw ; }          // just one wgt histogram
69   void     SetUseFirstLastPhiWgt(Bool_t flw = kTRUE)            { fOnePhiWgt = !flw ; }         // uses 3 wgt histograms
70   void     SetFlowForV0(Bool_t v0 = kTRUE)                      { fV0loop = v0 ; }              // Enables Flow study for v0
71   void     SetTrackLoop(Bool_t trkl = kTRUE)                    { fTrackLoop = trkl ; }         // Enables Tracks loop (keep it kTRUE)
72   void     SetCustomRespFunc(Bool_t crf = kTRUE)                { fCustomRespFunc = crf ; }     // Enables to use a custom detector response function
73   //void     SetDebugg(Int_t db = 1) ;                          // set the cout's for debug (default is 1)
74
75  // Histograms
76   void     SetPtRangevEta(Float_t lo, Float_t hi)               { fPtRangevEta[0] = lo ; fPtRangevEta[1] = hi ; }  // Sets the pt range for the v(eta) histograms.
77   void     SetEtaRangevPt(Float_t lo, Float_t hi)               { fEtaRangevPt[0] = lo ; fEtaRangevPt[1] = hi ; }  // Sets the |eta| range for the v(pt) histograms.
78   //void     SetMaxLabel(Int_t lab = 100)                       { fMaxLabel = lab ; }
79   
80  // Output 
81   void     SetHistFileName(TString name)                        { fHistFileName = name ; }      // Sets output file name
82   TString  GetHistFileName() const                              { return fHistFileName ; }
83
84  // Phi Weights 
85   TString  GetWgtFileName() const                               { return (TString)fPhiWgtFile->GetName() ; }
86   void     FillWgtArrays(TFile* wgtFile) ;                      // Loads phi & bayesian weights from file (flowPhiWgt.hist.root) and fills the arrays
87
88  // Results
89   Float_t  GetRunBayesian(Int_t nPid=2, Int_t selN=0) const ;   // Normalized Particle abundance (all events up to here)
90   void     PrintRunBayesian(Int_t selN=0) const ;               // Prints the normalized Particle abundance (up to here)
91   void     PrintEventQuantities() const ;                       // Prints event by event calculated quantities
92   Float_t  Res(Int_t eventN, Int_t harN) const                  { return fRes[eventN][harN]; }    // Returns the calculated resolution for the RP
93   Float_t  ResErr(Int_t eventN, Int_t harN) const               { return fResErr[eventN][harN]; } // Returns the estimated error on the resolution 
94
95
96  protected:
97  
98  // Internal methods to fill the histogram
99   Bool_t   FillFromFlowEvent(AliFlowEvent* fFlowEvent) ;        // Fills internal variables and array from Flow Events
100   void     FillEventHistograms(AliFlowEvent* fFlowEvent) ;      // Fills Events' histograms (from AliFlowEvent)
101   void     FillParticleHistograms(TClonesArray* fFlowTracks) ;          // Fills Tracks' histograms (from AliFlowTrack)
102   void     FillV0Histograms(TClonesArray* fFlowV0s) ;           // Fills V0s' histograms
103   Int_t    HarmonicsLoop(AliFlowTrack* fFlowTrack) ;            // Harmonics & Selections histograms (from AliFlowTracks)
104   //void     FillLabels() ;                                     // fills an histogram of Labels (the ones from ESD) 
105
106  // Weights plugged to the event
107   void     FillBayesianWgt(AliFlowEvent* fFlowEvent) ;          // Plugs the bayesian weights (fBayesianWgt[0]*) into the AliFlowEvent
108   void     FillEvtPhiWgt(AliFlowEvent* fFlowEvent) ;            // Plugs the PhiWeights (fPhiWgt*, etc.) into the AliFlowEvent
109  
110  // Resolution Calculation
111   Double_t Chi(Double_t res) ;                                  // Calculates chi from the event plane resolution
112   Double_t ResEventPlane(Double_t chi) ;                        // Calculates the event plane resolution as a function of chi
113   Double_t ResEventPlaneK2(Double_t chi) ;                      // Calculates the event plane resolution as a function of chi for the case k=2.
114   Double_t ResEventPlaneK3(Double_t chi) ;                      // Calculates the event plane resolution as a function of chi for the case k=3.
115   Double_t ResEventPlaneK4(Double_t chi) ;                      // Calculates the event plane resolution as a function of chi for the case k=4.
116
117
118  private:
119
120  // to make the code checker happy
121   AliFlowAnalyser(const AliFlowAnalyser &flowAnal) ;            // Copy Constructor (dummy)
122   AliFlowAnalyser &operator=(const AliFlowAnalyser &flowAnal) ; // Assignment Operator
123
124  // Flags
125   Bool_t           fTrackLoop ;                                 //! tracks main loop
126   Bool_t           fV0loop ;                                    //! correlation analysis is done also for neutral secundary vertex
127   Bool_t           fShuffle ;                                   //! to randomly reshuffle tracks
128   Bool_t           fV1Ep1Ep2;                                   //! Flag for v_1{EP1,EP2} calculation on/off
129   Bool_t           fEtaSub;                                     //! eta subevents
130   Bool_t           fReadPhiWgt ;                                //! Phi Weights are applied to Phi distrib. (default is false)
131   Bool_t           fBayWgt ;                                    //! Bayesian Weights are applied to P.Id. (default is false) 
132   Bool_t           fRePid ;                                     //! Re-Calculates the P.Id. basing on the bayesian wgts (if plugged in)
133   Bool_t           fCustomRespFunc ;                            //! A custom "detector response function" is used for P.Id (default is false -> the combined response function from the ESD will be used)
134
135   Bool_t           fPtWgt ;                                     //! flag to use pT as a weight for RP determination
136   Bool_t           fEtaWgt ;                                    //! flag to use eta as a weight for RP determination
137   Bool_t           fOnePhiWgt ;                                 //! if kTRUE: just one phi-wgt histogram, if kFALSE: three phi-wgt histogram (TPC+,TPC-,cross)
138
139  // Files
140   TFile*           fHistFile ;                                  //! histograms file (output)
141   TFile*           fPhiWgtFile ;                                //! phi weight file 
142   TString          fHistFileName ;                              //! Output File Name (histograms from flow analysis)
143   //TString        fFlowEvtFileName ;                           //! Input file name (Flow Events)
144
145  // enumerators                             
146   Int_t            fEventNumber ;                               //! progressive enumeration of AliFlowEvents
147   Int_t            fTrackNumber ;                               //! progressive enumeration of AliFlowTracks
148   Int_t            fV0Number ;                                  //! progressive enumeration of AliFlowV0s
149   //Int_t          fNumberOfEvents ;                            //! total number of AliFlowEvents in file
150   Int_t            fNumberOfTracks ;                            //! total number of tracks in the current event
151   Int_t            fNumberOfV0s ;                               //! total number of v0s in the current event
152   Int_t            fPidId ;                                     //! Particle Id hypothesys of the track (0..4 for e,mu,pi,k,p)
153   Int_t            fSelParts ;                                  //! n. of tracks selected for correlation analysis
154   Int_t            fSelV0s ;                                    //! n. of v0s selected for correlation analysis
155
156  // Internal pointers
157   AliFlowEvent*     fFlowEvent ;                                //! pointer to AliFlowEvent
158   AliFlowTrack*     fFlowTrack ;                                //! pointer to AliFlowTrack
159   AliFlowV0*        fFlowV0 ;                                   //! pointer to AliFlowV0
160   AliFlowSelection* fFlowSelect ;                               //! selection object
161   TClonesArray*     fFlowTracks ;                               //! pointer to the TrackCollection
162   TClonesArray*     fFlowV0s ;                                  //! pointer to the V0Collection
163
164   Float_t           fVertex[3] ;                                //! Event's Vertex position 
165
166  // For weights
167   Int_t             fPhiBins ;                                  //! n. of phi bins     
168   Float_t           fPhiMin ;                                   //! wgt histo range (phi)
169   Float_t           fPhiMax ;                                   //! wgt histo range (phi) 
170
171   AliFlowConstants::PhiWgt_t    fPhiWgt ;                       //! PhiWgt Array (all TPC)
172   AliFlowConstants::PhiWgt_t    fPhiWgtPlus ;                   //! PhiWgt Array (TPC+)
173   AliFlowConstants::PhiWgt_t    fPhiWgtMinus ;                  //! PhiWgt Array (TPC-)
174   AliFlowConstants::PhiWgt_t    fPhiWgtCross ;                  //! PhiWgt Array (TPC/)     
175
176  // For bayesian weights
177   Double_t fBayesianWgt[AliFlowConstants::kSels][AliFlowConstants::kPid] ;      //! Bayesian weights (expected particle abundance)
178   TVector2 fQ[AliFlowConstants::kSels][AliFlowConstants::kHars];                        //! flow vector
179   Float_t  fPsi[AliFlowConstants::kSels][AliFlowConstants::kHars];                      //! event plane angle
180   UInt_t   fMult[AliFlowConstants::kSels][AliFlowConstants::kHars];                     //! multiplicity
181   Float_t  fQnorm[AliFlowConstants::kSels][AliFlowConstants::kHars];                    //! Q/Sqrt(Mult)
182   TVector2 fQSub[AliFlowConstants::kSubs][AliFlowConstants::kSels][AliFlowConstants::kHars];            //! flow vector subs
183   Float_t  fPsiSub[AliFlowConstants::kSubs][AliFlowConstants::kSels][AliFlowConstants::kHars];          //! plane angle of subevents
184   UInt_t   fMultSub[AliFlowConstants::kSubs][AliFlowConstants::kSels][AliFlowConstants::kHars];         //! multiplicity subs
185   Float_t  fRes[AliFlowConstants::kSels][AliFlowConstants::kHars];                      //! event plane resolution
186   Float_t  fResErr[AliFlowConstants::kSels][AliFlowConstants::kHars];                   //! event plane resolution error
187
188  // for Histograms
189   TString           fLabel ;                                    //! label axis : rapidity or pseudorapidity
190   Float_t           fEtaMin ;                                   //! histo range (eta)
191   Float_t           fEtaMax ;                                   //! histo range (eta) 
192   Float_t           fPtMin ;                                    //! histo range (pt)       
193   Float_t           fPtMax ;                                    //! histo range (pt)       
194   Float_t           fPtMaxPart ;                                //! max pt for _part histo
195   Int_t             fEtaBins ;                                  //! n. of eta bins
196   Int_t             fPtBins ;                                   //! n. of pt bins     
197   Int_t             fPtBinsPart ;                               //! n. of pt bins for _part histo
198   Float_t           fPtRangevEta[2] ;                           //! pt range for the v(eta) histograms.
199   Float_t           fEtaRangevPt[2] ;                           //! |eta| range for the v(pt) histograms.
200   Int_t             fMaxLabel ;                                 //! for the MC labels histogram (max bin)
201
202   TOrdCollection*   fPhiWgtHistList ;                           //! Weights:  histogram list
203   TOrdCollection*   fVnResHistList ;                            //! Resolution and Vn:  histogram list
204  
205 // for Single histograms
206
207  // *****************
208  // EVENTs HISTOGRAMS
209  // *****************
210   TH1F*     fHistTrigger;                                  //! histogram ...
211   TH1F*     fHistMult;                                     //! histogram ...
212   TH1F*     fHistV0Mult;                                   //! histogram ...
213   TH1F*     fHistOrigMult;                                 //! histogram ...
214   TH1F*     fHistMultOverOrig;                             //! histogram ...
215   TH1F*     fHistMultEta;                                  //! histogram ...
216   TH1F*     fHistCent;                                     //! histogram ...
217   TH1F*     fHistVertexZ;                                  //! histogram ...
218   TH2F*     fHistVertexXY2D;                               //! histogram ...
219   TH2F*     fHistEnergyZDC;                                //! histogram ...
220   TH1F*     fHistPartZDC;                                  //! histogram ...
221   TProfile* fHistPidMult;                                  //! histogram ...
222   TH1F*     fHistBayPidMult;                               //! histogram ...
223   TH1F*     fHistEtaSym;                                   //! histogram ...
224   TH1F*     fHistEtaSymPart;                               //! histogram ...
225   TH2F*     fHistEtaSymVerZ2D;                             //! histogram ...
226   TH2F*     fHistEtaSymVerZ2DPart;                         //! histogram ...
227  // selected (TR & V0)
228   TH1F*     fHistMultPart;                                 //! histogram ...
229   TH1F*     fHistV0MultPart;                               //! histogram ...
230   TH1F*     fHistBayPidMultPart;                           //! histogram ...
231   TH1F*     fHistMultPartUnit;                             //! histogram ...
232   
233  // *****************
234  // TRACKs HISTOGRAMS (all tracks)
235  // *****************
236   TH1F*     fHistPtot ;                                    //! histogram ...
237   TH1F*     fHistPt ;                                      //! histogram ...
238   TH1F*     fHistCharge;                                   //! histogram ...
239   TH1F*     fHistDcaGlobal;                                //! histogram ...
240   TH1F*     fHistDca;                                      //! histogram ...
241   TH1F*     fHistTransDca;                                 //! histogram ...
242   TH1F*     fHistChi2;                                     //! histogram ...
243   TH1F*     fHistLenght;                                   //! histogram ...
244   TH1F*     fHistInvMass ;                                 //! histogram ...
245   TH1F*     fHistFitOverMax;                               //! histogram ...
246   TH2D*     fHistPhiPtCon ;                                //! histogram ...
247   TH2D*     fHistPhiPtUnc ;                                //! histogram ...
248   TH2D*     fHistPtPhiPos ;                                //! histogram ...
249   TH2D*     fHistPtPhiNeg ;                                //! histogram ...
250   TH3F*     fHistAllEtaPtPhi3D;                            //! histogram ...
251   TProfile* fHistCosPhi;                                   //! histogram ...
252   TH2F*     fHistPidPt;                                    //! histogram ...
253   TH1F*     fHistPhi ;                                     //! histogram ...
254   TH1F*     fHistPhiCons ;                                 //! histogram ...
255   TH2D*     fHistYieldAll2D;                               //! histogram ...
256   TH2D*     fHistYieldCon2D;                               //! histogram ...
257   TH2D*     fHistYieldUnc2D;                               //! histogram ...
258   TH3F*     fHistConsEtaPtPhi3D;                           //! histogram ...
259   TH3F*     fHistGlobEtaPtPhi3D;                           //! histogram ...
260   TH3F*     fHistUncEtaPtPhi3D ;                           //! histogram ...
261   // fit & dE/dX for each detector (all tracks)
262   TH1F*     fHistChi2ITS;                                  //! histogram ...
263   TH1F*     fHistChi2normITS;                              //! histogram ...
264   TH1F*     fHistFitPtsITS;                                //! histogram ...
265   TH1F*     fHistMaxPtsITS;                                //! histogram ...
266   TH2F*     fHistMeanDedxPos2DITS;                         //! histogram ...
267   TH2F*     fHistMeanDedxNeg2DITS;                         //! histogram ...
268   // -
269   TH1F*     fHistChi2TPC;                                  //! histogram ...
270   TH1F*     fHistChi2normTPC;                              //! histogram ...
271   TH1F*     fHistFitPtsTPC;                                //! histogram ...
272   TH1F*     fHistMaxPtsTPC;                                //! histogram ...
273   TH1F*     fHistFitOverMaxTPC;                            //! histogram ...
274   TH2F*     fHistMeanDedxPos2D;                            //! histogram ...
275   TH2F*     fHistMeanDedxNeg2D;                            //! histogram ...
276   // -
277   TH1F*     fHistChi2TRD;                                  //! histogram ...
278   TH1F*     fHistChi2normTRD;                              //! histogram ...
279   TH1F*     fHistFitPtsTRD;                                //! histogram ...
280   TH1F*     fHistMaxPtsTRD;                                //! histogram ...
281   TH2F*     fHistMeanDedxPos2DTRD;                         //! histogram ...
282   TH2F*     fHistMeanDedxNeg2DTRD;                         //! histogram ...
283   // -
284   TH1F*     fHistChi2TOF;                                  //! histogram ...
285   TH1F*     fHistChi2normTOF;                              //! histogram ...
286   TH1F*     fHistFitPtsTOF;                                //! histogram ...
287   TH1F*     fHistMaxPtsTOF;                                //! histogram ...
288   TH2F*     fHistMeanDedxPos2DTOF;                         //! histogram ...
289   TH2F*     fHistMeanDedxNeg2DTOF;                         //! histogram ...
290   // detector response for particle type (all tracks, based on Pid)
291   TH2F*     fHistMeanTPCPiPlus ;                           //! histogram ...
292   TH2F*     fHistMeanTPCPiMinus ;                          //! histogram ...
293   TH2F*     fHistMeanTPCProton ;                           //! histogram ...
294   TH2F*     fHistMeanTPCPbar ;                             //! histogram ...
295   TH2F*     fHistMeanTPCKplus ;                            //! histogram ...
296   TH2F*     fHistMeanTPCKminus ;                           //! histogram ...
297   TH2F*     fHistMeanTPCDeuteron ;                         //! histogram ...
298   TH2F*     fHistMeanTPCAntiDeuteron ;                     //! histogram ...
299   TH2F*     fHistMeanTPCPositron ;                         //! histogram ...
300   TH2F*     fHistMeanTPCElectron ;                         //! histogram ...
301   TH2F*     fHistMeanTPCMuonPlus ;                         //! histogram ...
302   TH2F*     fHistMeanTPCMuonMinus ;                        //! histogram ...
303   // -
304   TH2F*     fHistMeanITSPiPlus ;                           //! histogram ...
305   TH2F*     fHistMeanITSPiMinus ;                          //! histogram ...
306   TH2F*     fHistMeanITSProton ;                           //! histogram ...
307   TH2F*     fHistMeanITSPbar ;                             //! histogram ...
308   TH2F*     fHistMeanITSKplus ;                            //! histogram ...
309   TH2F*     fHistMeanITSKminus ;                           //! histogram ...
310   TH2F*     fHistMeanITSDeuteron ;                         //! histogram ...
311   TH2F*     fHistMeanITSAntiDeuteron ;                     //! histogram ...
312   TH2F*     fHistMeanITSPositron ;                         //! histogram ...
313   TH2F*     fHistMeanITSElectron ;                         //! histogram ...
314   TH2F*     fHistMeanITSMuonPlus ;                         //! histogram ...
315   TH2F*     fHistMeanITSMuonMinus ;                        //! histogram ...
316   // -
317   TH2F*     fHistMeanTOFPiPlus ;                           //! histogram ...
318   TH2F*     fHistMeanTOFPiMinus ;                          //! histogram ...
319   TH2F*     fHistMeanTOFProton ;                           //! histogram ...
320   TH2F*     fHistMeanTOFPbar ;                             //! histogram ...
321   TH2F*     fHistMeanTOFKplus ;                            //! histogram ...
322   TH2F*     fHistMeanTOFKminus ;                           //! histogram ...
323   TH2F*     fHistMeanTOFDeuteron ;                         //! histogram ...
324   TH2F*     fHistMeanTOFAntiDeuteron ;                     //! histogram ...
325   TH2F*     fHistMeanTOFPositron ;                         //! histogram ...
326   TH2F*     fHistMeanTOFElectron ;                         //! histogram ...
327   TH2F*     fHistMeanTOFMuonPlus ;                         //! histogram ...
328   TH2F*     fHistMeanTOFMuonMinus ;                        //! histogram ...
329   // -
330   TH2F*     fHistMeanTRDPiPlus ;                           //! histogram ...
331   TH2F*     fHistMeanTRDPiMinus ;                          //! histogram ...
332   TH2F*     fHistMeanTRDProton ;                           //! histogram ...
333   TH2F*     fHistMeanTRDPbar ;                             //! histogram ...
334   TH2F*     fHistMeanTRDKplus ;                            //! histogram ...
335   TH2F*     fHistMeanTRDKminus ;                           //! histogram ...
336   TH2F*     fHistMeanTRDDeuteron ;                         //! histogram ...
337   TH2F*     fHistMeanTRDAntiDeuteron ;                     //! histogram ...
338   TH2F*     fHistMeanTRDPositron ;                         //! histogram ...
339   TH2F*     fHistMeanTRDElectron ;                         //! histogram ...
340   TH2F*     fHistMeanTRDMuonPlus ;                         //! histogram ...
341   TH2F*     fHistMeanTRDMuonMinus ;                        //! histogram ...
342   // pid probability for all particle (all tracks)
343   TH1F*     fHistPidPiPlus;                                //! histogram ...
344   TH1F*     fHistPidPiMinus;                               //! histogram ...
345   TH1F*     fHistPidProton;                                //! histogram ...
346   TH1F*     fHistPidAntiProton;                            //! histogram ...
347   TH1F*     fHistPidKplus;                                 //! histogram ...
348   TH1F*     fHistPidKminus;                                //! histogram ...
349   TH1F*     fHistPidDeuteron;                              //! histogram ...
350   TH1F*     fHistPidAntiDeuteron;                          //! histogram ...
351   TH1F*     fHistPidElectron;                              //! histogram ...
352   TH1F*     fHistPidPositron;                              //! histogram ...
353   TH1F*     fHistPidMuonMinus;                             //! histogram ...
354   TH1F*     fHistPidMuonPlus;                              //! histogram ...
355   // pid probability for particle type (all tracks, based on Pid)
356   TH1F*     fHistPidPiPlusPart;                            //! histogram ...
357   TH1F*     fHistPidPiMinusPart;                           //! histogram ...
358   TH1F*     fHistPidProtonPart;                            //! histogram ...
359   TH1F*     fHistPidAntiProtonPart;                        //! histogram ...
360   TH1F*     fHistPidKplusPart;                             //! histogram ...
361   TH1F*     fHistPidKminusPart;                            //! histogram ...
362   TH1F*     fHistPidDeuteronPart;                          //! histogram ...
363   TH1F*     fHistPidAntiDeuteronPart;                      //! histogram ...
364   TH1F*     fHistPidElectronPart;                          //! histogram ...
365   TH1F*     fHistPidPositronPart;                          //! histogram ...
366   TH1F*     fHistPidMuonMinusPart;                         //! histogram ...
367   TH1F*     fHistPidMuonPlusPart;                          //! histogram ...
368   // MC labels from the simulation (all tracks)
369   //TH2F*     fLabHist;                                    //! histogram ... 
370  // *****************
371  // selected TRACKS
372  // *****************
373   TProfile* fHistBinEta;                                   //! histogram ...
374   TProfile* fHistBinPt;                                    //! histogram ...
375   //
376   TH3F*     fHistEtaPtPhi3DPart ;                          //! histogram ...
377   TH2D*     fHistYieldPart2D;                              //! histogram ...
378   TH1F*     fHistDcaGlobalPart ;                           //! histogram ...
379   TH1F*     fHistInvMassPart ;                             //! histogram ...
380   TH3F*     fHistEtaPtPhi3DOut ;                           //! histogram ...
381   TH2D*     fHistYieldOut2D;                               //! histogram ...
382   TH1F*     fHistDcaGlobalOut ;                            //! histogram ...
383   TH1F*     fHistInvMassOut ;                              //! histogram ...
384   TH3F*     fHistMeanDedxPos3DPart ;                       //! histogram ...
385   TH3F*     fHistMeanDedxNeg3DPart ;                       //! histogram ...
386   TH3F*     fHistMeanDedxPos3DPartITS ;                    //! histogram ...
387   TH3F*     fHistMeanDedxNeg3DPartITS ;                    //! histogram ...
388 //
389
390  // *****************
391  // V0s HISTOGRAMS (all v0s)
392  // *****************
393   TH1F*     fHistV0Mass;                                   //! histogram ...
394   TH3F*     fHistV0EtaPtPhi3D;                             //! histogram ...
395   TH2D*     fHistV0YieldAll2D;                             //! histogram ...
396   TH2D*     fHistV0PYall2D;                                //! histogram ...
397   TH1F*     fHistV0Dca;                                    //! histogram ...
398   TH1F*     fHistV0Chi2;                                   //! histogram ...
399   TH1F*     fHistV0Lenght;                                 //! histogram ...
400   TH1F*     fHistV0Sigma;                                  //! histogram ...
401   TProfile* fHistV0CosPhi;                                 //! histogram ... 
402   TH2D*     fHistV0MassPtSlices;                           //! histogram ...
403  // *****************
404  // selected V0s
405  // *****************
406   TProfile* fHistV0BinEta;                                 //! histogram ... 
407   TProfile* fHistV0BinPt;                                  //! histogram ... 
408   TProfile* fHistV0sbBinEta;                               //! histogram ... 
409   TProfile* fHistV0sbBinPt;                                //! histogram ...
410   //
411   TH1F*     fHistV0MassWin ;                               //! histogram ...
412   TH3F*     fHistV0EtaPtPhi3DPart ;                        //! histogram ...
413   TH2D*     fHistV0YieldPart2D;                            //! histogram ...
414   TH1F*     fHistV0DcaPart ;                               //! histogram ...
415   TH1F*     fHistV0LenghtPart ;                            //! histogram ...
416   TH1F*     fHistV0sbMassSide ;                            //! histogram ...
417   TH3F*     fHistV0sbEtaPtPhi3DPart ;                      //! histogram ...
418   TH2D*     fHistV0sbYieldPart2D;                          //! histogram ...
419   TH1F*     fHistV0sbDcaPart ;                             //! histogram ...
420   TH1F*     fHistV0sbLenghtPart ;                          //! histogram ...
421
422 // for each harmonic, each selection, and each sub-event
423
424  // *****************
425  // SUB-EVENTs HISTOGRAMS
426  // *****************
427   struct AliHistSubHars {
428    TH1F*     fHistPsiSubs;                                 //! histogram ...
429   };
430
431   struct AliHistSubs {
432    struct AliHistSubHars fHistSubHar[AliFlowConstants::kHars];         //! structure array ... 
433   };
434   struct AliHistSubs fHistSub[AliFlowConstants::kSels*AliFlowConstants::kSubs];    //! structure ...
435
436 // for each harmonic and each selection
437
438   struct AliHistFullHars 
439   {
440    // weights
441     TH1D*       fHistPhiPlus;                              //! histogram ...
442     TH1D*       fHistPhiMinus;                             //! histogram ...
443     TH1D*       fHistPhiAll;                               //! histogram ...
444     TH1D*       fHistPhiWgtPlus;                           //! histogram ...
445     TH1D*       fHistPhiWgtMinus;                          //! histogram ...
446     TH1D*       fHistPhiWgtAll;                            //! histogram ...
447     TH1D*       fHistPhiFlatPlus;                          //! histogram ...
448     TH1D*       fHistPhiFlatMinus;                         //! histogram ...
449     TH1D*       fHistPhiFlatAll;                           //! histogram ...
450     TH1D*       fHistPhi;                                  //! histogram ...
451     TH1D*       fHistPhiWgt;                               //! histogram ...
452     TH1D*       fHistPhiFlat;                              //! histogram ...
453    // flow (events)
454     TH1F*       fHistPsi;                                  //! histogram ...
455     TH1F*       fHistPsiSubCorr;                           //! histogram ...
456     TH1F*       fHistPsiSubCorrDiff;                       //! histogram ...
457     TH1F*       fHistPsiDiff;                              //! histogram ...
458     TH1F*       fHistMult;                                 //! histogram ...
459     TH1F*       fHistQnorm;                                //! histogram ...
460    // flow (tracks)
461     TH1F*       fHistPhiCorr;                              //! histogram ...
462     TProfile2D* fHistvObs2D;                               //! histogram ...
463     TProfile*   fHistvObsEta;                              //! histogram ...
464     TProfile*   fHistvObsPt;                               //! histogram ...
465     TH2D*       fHistv2D;                                  //! histogram ...
466     TH1D*       fHistvEta;                                 //! histogram ...
467     TH1D*       fHistvPt;                                  //! histogram ...
468    // flow (v0s)                                           
469     TH1F*       fHistV0PhiCorr;                            //! histogram ...
470     TProfile2D* fHistV0vObs2D;                             //! histogram ...
471     TProfile*   fHistV0vObsEta;                            //! histogram ...
472     TProfile*   fHistV0vObsPt;                             //! histogram ...
473     TH2D*       fHistV0v2D;                                //! histogram ...
474     TH1D*       fHistV0vEta;                               //! histogram ...     
475     TH1D*       fHistV0vPt;                                //! histogram ...     
476    // flow (v0s sidebands)
477     TProfile*   fHistV0sbvObsEtaSx ;                       //! histogram ...  
478     TProfile*   fHistV0sbvObsPtSx ;                        //! histogram ...
479     TProfile*   fHistV0sbvObsEtaDx ;                       //! histogram ...
480     TProfile*   fHistV0sbvObsPtDx ;                        //! histogram ...
481     TH1F*       fHistV0sbPhiCorr ;                         //! histogram ...
482     TProfile2D* fHistV0sbvObs2D ;                          //! histogram ...
483     TProfile*   fHistV0sbvObsEta ;                         //! histogram ...
484     TProfile*   fHistV0sbvObsPt ;                          //! histogram ...
485     TH2D*       fHistV0sbv2D ;                             //! histogram ...
486     TH1D*       fHistV0sbvEta ;                            //! histogram ...
487     TH1D*       fHistV0sbvPt ;                             //! histogram ...
488    // check (tracks used for R.P.)
489     TH1F*       fHistYieldPt ;                             //! histogram ...
490     TH3F*       fHistEtaPtPhi3D ;                          //! histogram ...
491     TH2D*       fHistYield2D ;                             //! histogram ...
492     TH1F*       fHistDcaGlob ;                             //! histogram ...
493    // check (tracks excluded)
494     TH1F*       fHistYieldPtout;                           //! histogram ...
495     TH3F*       fHistEtaPtPhi3Dout ;                       //! histogram ...
496     TH2D*       fHistYield2Dout ;                          //! histogram ...
497     TH1F*       fHistDcaGlobout ;                          //! histogram ...
498   };
499
500 // for each selection
501
502   struct AliHistFulls 
503   {
504    TH1F*     fHistBayPidMult;                             //! histogram ...
505   // flow (events)
506    TProfile* fHistCos;                                    //! histogram ...
507    TH1F*     fHistRes;                                    //! histogram ...
508    TProfile* fHistvObs;                                   //! histogram ...
509    TH1D*     fHistv;                                      //! histogram ...
510    TProfile* fHistV0vObs;                                 //! histogram ...
511    TProfile* fHistV0sbvObsSx;                             //! histogram ...
512    TProfile* fHistV0sbvObsDx;                             //! histogram ...
513    TH1D*     fHistV0v;                                    //! histogram ...
514   // wgt, evts, trks, v0s (as defined above)
515    struct AliHistFullHars  fHistFullHar[AliFlowConstants::kHars];         //! structure array ...
516   };
517   struct AliHistFulls fHistFull[AliFlowConstants::kSels];             //! structure array ...
518
519   ClassDef(AliFlowAnalyser,0)              // macro for rootcint
520 };
521
522 #endif
523
524
525
526 // lame = not productive; poorly designed; uncool ...