]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/FLOW/Base/AliFlowEventSimple.h
add correlation coefficient equal to 1 in case of propagation of fully correlated...
[u/mrichter/AliRoot.git] / PWG / FLOW / Base / AliFlowEventSimple.h
1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
3 /* $Id$ */
4
5 /*****************************************************************
6   AliFlowEventSimple: A simple event 
7   for flow analysis                  
8                                      
9   origin: Naomi van der Kolk (kolk@nikhef.nl)           
10           Ante Bilandzic     (anteb@nikhef.nl)         
11           Raimond Snellings  (Raimond.Snellings@nikhef.nl)    
12   mods:   Mikolaj Krzewicki  (mikolaj.krzewicki@cern.ch)
13 *****************************************************************/
14
15 #ifndef ALIFLOWEVENTSIMPLE_H
16 #define ALIFLOWEVENTSIMPLE_H
17
18 #include "TObject.h"
19 #include "TParameter.h"
20 #include "TMath.h"
21 class TTree;
22 class TF1;
23 class AliFlowVector;
24 class AliFlowTrackSimple;
25 class AliFlowTrackSimpleCuts;
26
27 class AliFlowEventSimple: public TObject {
28
29  public:
30
31   enum ConstructionMethod {kEmpty,kGenerate};
32
33   AliFlowEventSimple();
34   AliFlowEventSimple( Int_t nParticles,
35                       ConstructionMethod m=kEmpty,
36                       TF1* ptDist=NULL,
37                       Double_t phiMin=0.0,
38                       Double_t phiMax=TMath::TwoPi(),
39                       Double_t etaMin=-1.0,
40                       Double_t etaMax= 1.0 );
41   AliFlowEventSimple(TTree* anInput, const AliFlowTrackSimpleCuts* rpCuts, const AliFlowTrackSimpleCuts* poiCuts);
42   AliFlowEventSimple(const AliFlowEventSimple& anEvent);
43   AliFlowEventSimple& operator=(const AliFlowEventSimple& anEvent);
44   virtual  ~AliFlowEventSimple();
45
46   Bool_t  IsFolder() const {return kTRUE;};
47   void    Browse(TBrowser *b); 
48   void    Print(Option_t* option = "") const;      //method to print stats
49   
50   Int_t    NumberOfTracks() const                   { return fNumberOfTracks; }
51   Int_t    GetReferenceMultiplicity() const         { return fReferenceMultiplicity; }
52   void     SetReferenceMultiplicity( Int_t m )      { fReferenceMultiplicity = m; }
53   Int_t    GetEventNSelTracksRP() const             { return GetNumberOfPOIs(0); } 
54   void     SetEventNSelTracksRP(Int_t nr)           { SetNumberOfPOIs(nr,0); }  
55   Int_t    GetEventNSelTracksPOI() const            { return GetNumberOfPOIs(1); } 
56   void     SetEventNSelTracksPOI(Int_t np)          { SetNumberOfPOIs(np,1); }  
57   Int_t    GetNumberOfRPs() const                   { return GetNumberOfPOIs(0); }
58   void     SetNumberOfRPs( Int_t nr )               { SetNumberOfPOIs(nr,0); }
59   Int_t    GetNumberOfPOIs(Int_t i=1) const         { return (i<fNumberOfPOItypes)?fNumberOfPOIs[i]:0; }
60   void     SetNumberOfPOIs( Int_t nubmerOfPOIs, Int_t poiType=1 );
61   void     IncrementNumberOfPOIs(Int_t poiType=1);
62
63   void     SetUseGlauberMCSymmetryPlanes()          { fUseGlauberMCSymmetryPlanes = kTRUE; }
64   void     SetUseExternalSymmetryPlanes(TF1 *gPsi1Psi3 = 0x0,
65                                         TF1 *gPsi2Psi4 = 0x0,
66                                         TF1 *gPsi3Psi5 = 0x0);
67   void     SetPsi1(Double_t gPsi1)                  { fPsi1 = gPsi1; }
68   void     SetPsi2(Double_t gPsi2)                  { fPsi2 = gPsi2; }
69   void     SetPsi3(Double_t gPsi3)                  { fPsi3 = gPsi3; }
70   void     SetPsi4(Double_t gPsi4)                  { fPsi4 = gPsi4; }
71   void     SetPsi5(Double_t gPsi5)                  { fPsi5 = gPsi5; }
72   Double_t GetPsi1() const                          { return fPsi1; }
73   Double_t GetPsi2() const                          { return fPsi2; }
74   Double_t GetPsi3() const                          { return fPsi3; }
75   Double_t GetPsi4() const                          { return fPsi4; }
76   Double_t GetPsi5() const                          { return fPsi5; }
77
78   Double_t GetMCReactionPlaneAngle() const          { return fMCReactionPlaneAngle; }
79   void     SetMCReactionPlaneAngle(Double_t fPhiRP) { fMCReactionPlaneAngle=fPhiRP; fMCReactionPlaneAngleIsSet=kTRUE; }
80   Bool_t   IsSetMCReactionPlaneAngle() const        { return fMCReactionPlaneAngleIsSet; }
81   void     SetAfterBurnerPrecision(Double_t p)      { fAfterBurnerPrecision=p; }
82   Double_t GetAfterBurnerPrecision() const          { return fAfterBurnerPrecision; }
83   void     SetUserModified(Bool_t s=kTRUE)          { fUserModified=s; }
84   Bool_t   IsUserModified() const                   { return fUserModified; }
85   void     SetShuffleTracks(Bool_t b)               {fShuffleTracks=b;}
86   void     ShuffleTracks();
87
88   void ResolutionPt(Double_t res);
89   void TagSubeventsInEta(Double_t etaMinA, Double_t etaMaxA, Double_t etaMinB, Double_t etaMaxB );
90   void TagSubeventsByCharge();
91   void TagRP(const AliFlowTrackSimpleCuts* cuts );
92   void TagPOI(const AliFlowTrackSimpleCuts* cuts, Int_t poiType=0);
93   void CloneTracks(Int_t n);
94   void AddV1( Double_t v1 );
95   void AddV2( Double_t v2 );
96   void AddV3( Double_t v3 );
97   void AddV4( Double_t v4 );
98   void AddV5( Double_t v5 );
99   void AddFlow( Double_t v1, Double_t v2, Double_t v3, Double_t v4, Double_t v5 );
100   void AddFlow(Double_t v1, Double_t v2, Double_t v3, Double_t v4, Double_t v5,
101                Double_t rp1, Double_t rp2, Double_t rp3, Double_t rp4, Double_t rp5 );
102   void AddV2( TF1* ptDepV2 );
103   void DefineDeadZone( Double_t etaMin, Double_t etaMax, Double_t phiMin, Double_t phiMax );
104   Int_t CleanUpDeadTracks();
105   virtual void ClearFast();
106  
107   static TF1* SimplePtSpectrum();
108   static TF1* SimplePtDepV2();
109
110   AliFlowTrackSimple* GetTrack(Int_t i);
111   void AddTrack( AliFlowTrackSimple* track ); 
112   void TrackAdded();
113   AliFlowTrackSimple* MakeNewTrack();
114  
115   virtual AliFlowVector GetQ(Int_t n=2, TList *weightsList=NULL, Bool_t usePhiWeights=kFALSE, Bool_t usePtWeights=kFALSE, Bool_t useEtaWeights=kFALSE);
116   virtual void Get2Qsub(AliFlowVector* Qarray, Int_t n=2, TList *weightsList=NULL, Bool_t usePhiWeights=kFALSE, Bool_t usePtWeights=kFALSE, Bool_t useEtaWeights=kFALSE);  
117
118   void SetCentrality(Double_t c) {fCentrality=c;}
119   Double_t GetCentrality() const {return fCentrality;}
120
121  protected:
122   virtual void Generate( Int_t nParticles,
123                          TF1* ptDist=NULL,
124                          Double_t phiMin=0.0,
125                          Double_t phiMax=TMath::TwoPi(),
126                          Double_t etaMin=-1.0,
127                          Double_t etaMax= 1.0 );
128
129   //data members
130   TObjArray*              fTrackCollection;           //-> collection of tracks
131   Int_t                   fReferenceMultiplicity;     // reference multiplicity
132   Int_t                   fNumberOfTracks;            // number of tracks
133   Bool_t                  fUseGlauberMCSymmetryPlanes;// Use symmetry planes (Glauber MC)
134   Bool_t                  fUseExternalSymmetryPlanes; // Use symmetry planes (external)
135   Double_t                fPsi1;                      // Psi_1
136   Double_t                fPsi2;                      // Psi_2
137   Double_t                fPsi3;                      // Psi_3
138   Double_t                fPsi4;                      // Psi_4
139   Double_t                fPsi5;                      // Psi_5
140   TF1*                    fPsi1Psi3;                  // Correlation between Psi_1 and Psi_3
141   TF1*                    fPsi2Psi4;                  // Correlation between Psi_2 and Psi_4
142   TF1*                    fPsi3Psi5;                  // Correlation between Psi_3 and Psi_5
143   Double_t                fMCReactionPlaneAngle;      // the angle of the reaction plane from the MC truth
144   Bool_t                  fMCReactionPlaneAngleIsSet; // did we set it from MC?
145   Double_t                fAfterBurnerPrecision;      // iteration precision in afterburner
146   Bool_t                  fUserModified;              // did we modify the event in any way (afterburner etc) ?
147   TParameter<Int_t>*      fNumberOfTracksWrap;        //! number of tracks in TBrowser
148   TParameter<Int_t>*      fNumberOfRPsWrap;           //! number of tracks that have passed the RP selection in TBrowser
149   TParameter<Int_t>*      fNumberOfPOIsWrap;          //! number of tracks that have passed the POI selection in TBrowser
150   TParameter<Double_t>*   fMCReactionPlaneAngleWrap;  //! the angle of the reaction plane from the MC truth in TBrowser
151   Int_t*                  fShuffledIndexes;           //! placeholder for randomized indexes
152   Bool_t                  fShuffleTracks;             // do we shuffle tracks on get?
153   TObjArray*              fMothersCollection;         //!cache the particles with daughters
154   Double_t                fCentrality;                //centrality
155  
156  private:
157   Int_t                   fNumberOfPOItypes;    // how many different flow particle types do we have? (RP,POI,POI_2,...)
158   Int_t*                  fNumberOfPOIs;          //[fNumberOfPOItypes] number of tracks that have passed the POI selection
159
160   ClassDef(AliFlowEventSimple,1)
161 };
162
163 #endif
164
165