]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/FLOW/Base/AliFlowEventSimple.h
initial checkin of the new flow development - from an OLD diff!
[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 fNumberOfFlowTags[0]; } 
54   void     SetEventNSelTracksRP(Int_t nr)           { fNumberOfFlowTags[0] = nr; }  
55   Int_t    GetEventNSelTracksPOI() const            { return fNumberOfFlowTags[0]; } 
56   void     SetEventNSelTracksPOI(Int_t np)          { fNumberOfFlowTags[0] = np; }  
57   Int_t    GetNumberOfRPs() const                   { return fNumberOfFlowTags[0]; }
58   void     SetNumberOfRPs( Int_t nr )               { fNumberOfFlowTags[0]=nr; }
59   Int_t    GetNumberOfPOIs(Int_t i=1) const         { return (i<fNumberOfFlowTagClasses)?fNumberOfFlowTags[i]:0; }
60   void     SetNumberOfPOIs( Int_t np, Int_t tagClass=1 );
61   void     IncrementNumberOfPOIs(Int_t poiType);
62   void     SetNumberOfFlowTagClasses(Int_t n);
63
64   void     SetUseGlauberMCSymmetryPlanes()          { fUseGlauberMCSymmetryPlanes = kTRUE; }
65   void     SetUseExternalSymmetryPlanes(TF1 *gPsi1Psi3 = 0x0,
66                                         TF1 *gPsi2Psi4 = 0x0,
67                                         TF1 *gPsi3Psi5 = 0x0);
68   void     SetPsi1(Double_t gPsi1)                  { fPsi1 = gPsi1; }
69   void     SetPsi2(Double_t gPsi2)                  { fPsi2 = gPsi2; }
70   void     SetPsi3(Double_t gPsi3)                  { fPsi3 = gPsi3; }
71   void     SetPsi4(Double_t gPsi4)                  { fPsi4 = gPsi4; }
72   void     SetPsi5(Double_t gPsi5)                  { fPsi5 = gPsi5; }
73   Double_t GetPsi1() const                          { return fPsi1; }
74   Double_t GetPsi2() const                          { return fPsi2; }
75   Double_t GetPsi3() const                          { return fPsi3; }
76   Double_t GetPsi4() const                          { return fPsi4; }
77   Double_t GetPsi5() const                          { return fPsi5; }
78
79   Double_t GetMCReactionPlaneAngle() const          { return fMCReactionPlaneAngle; }
80   void     SetMCReactionPlaneAngle(Double_t fPhiRP) { fMCReactionPlaneAngle=fPhiRP; fMCReactionPlaneAngleIsSet=kTRUE; }
81   Bool_t   IsSetMCReactionPlaneAngle() const        { return fMCReactionPlaneAngleIsSet; }
82   void     SetAfterBurnerPrecision(Double_t p)      { fAfterBurnerPrecision=p; }
83   Double_t GetAfterBurnerPrecision() const          { return fAfterBurnerPrecision; }
84   void     SetUserModified(Bool_t s=kTRUE)          { fUserModified=s; }
85   Bool_t   IsUserModified() const                   { return fUserModified; }
86   void     SetShuffleTracks(Bool_t b)               {fShuffleTracks=b;}
87   void     ShuffleTracks();
88
89   void ResolutionPt(Double_t res);
90   void TagSubeventsInEta(Double_t etaMinA, Double_t etaMaxA, Double_t etaMinB, Double_t etaMaxB );
91   void TagSubeventsByCharge();
92   void TagRP(const AliFlowTrackSimpleCuts* cuts );
93   void TagPOI(const AliFlowTrackSimpleCuts* cuts, Int_t poiType=0);
94   void CloneTracks(Int_t n);
95   void AddV1( Double_t v1 );
96   void AddV2( Double_t v2 );
97   void AddV3( Double_t v3 );
98   void AddV4( Double_t v4 );
99   void AddV5( Double_t v5 );
100   void AddFlow( Double_t v1, Double_t v2, Double_t v3, Double_t v4, Double_t v5 );
101   void AddFlow(Double_t v1, Double_t v2, Double_t v3, Double_t v4, Double_t v5,
102                Double_t rp1, Double_t rp2, Double_t rp3, Double_t rp4, Double_t rp5 );
103   void AddV2( TF1* ptDepV2 );
104   void DefineDeadZone( Double_t etaMin, Double_t etaMax, Double_t phiMin, Double_t phiMax );
105   Int_t CleanUpDeadTracks();
106   void ClearFast();
107  
108   static TF1* SimplePtSpectrum();
109   static TF1* SimplePtDepV2();
110
111   AliFlowTrackSimple* GetTrack(Int_t i);
112   void AddTrack( AliFlowTrackSimple* track ); 
113   void TrackAdded();
114   AliFlowTrackSimple* MakeNewTrack();
115  
116   virtual AliFlowVector GetQ(Int_t n=2, TList *weightsList=NULL, Bool_t usePhiWeights=kFALSE, Bool_t usePtWeights=kFALSE, Bool_t useEtaWeights=kFALSE);
117   virtual void Get2Qsub(AliFlowVector* Qarray, Int_t n=2, TList *weightsList=NULL, Bool_t usePhiWeights=kFALSE, Bool_t usePtWeights=kFALSE, Bool_t useEtaWeights=kFALSE);  
118
119   void SetCentrality(Double_t c) {fCentrality=c;}
120   Double_t GetCentrality() const {return fCentrality;}
121
122  protected:
123   virtual void Generate( Int_t nParticles,
124                          TF1* ptDist=NULL,
125                          Double_t phiMin=0.0,
126                          Double_t phiMax=TMath::TwoPi(),
127                          Double_t etaMin=-1.0,
128                          Double_t etaMax= 1.0 );
129
130   //data members
131   TObjArray*              fTrackCollection;           //-> collection of tracks
132   Int_t                   fReferenceMultiplicity;     // reference multiplicity
133   Int_t                   fNumberOfTracks;            // number of tracks
134   Bool_t                  fUseGlauberMCSymmetryPlanes;// Use symmetry planes (Glauber MC)
135   Bool_t                  fUseExternalSymmetryPlanes; // Use symmetry planes (external)
136   Double_t                fPsi1;                      // Psi_1
137   Double_t                fPsi2;                      // Psi_2
138   Double_t                fPsi3;                      // Psi_3
139   Double_t                fPsi4;                      // Psi_4
140   Double_t                fPsi5;                      // Psi_5
141   TF1*                    fPsi1Psi3;                  // Correlation between Psi_1 and Psi_3
142   TF1*                    fPsi2Psi4;                  // Correlation between Psi_2 and Psi_4
143   TF1*                    fPsi3Psi5;                  // Correlation between Psi_3 and Psi_5
144   Double_t                fMCReactionPlaneAngle;      // the angle of the reaction plane from the MC truth
145   Bool_t                  fMCReactionPlaneAngleIsSet; // did we set it from MC?
146   Double_t                fAfterBurnerPrecision;      // iteration precision in afterburner
147   Bool_t                  fUserModified;              // did we modify the event in any way (afterburner etc) ?
148   TParameter<Int_t>*      fNumberOfTracksWrap;        //! number of tracks in TBrowser
149   TParameter<Int_t>*      fNumberOfRPsWrap;           //! number of tracks that have passed the RP selection in TBrowser
150   TParameter<Int_t>*      fNumberOfFlowTagsWrap;          //! number of tracks that have passed the POI selection in TBrowser
151   TParameter<Double_t>*   fMCReactionPlaneAngleWrap;  //! the angle of the reaction plane from the MC truth in TBrowser
152   Int_t*                  fShuffledIndexes;           //! placeholder for randomized indexes
153   Bool_t                  fShuffleTracks;             // do we shuffle tracks on get?
154   TObjArray*              fMothersCollection;         //!cache the particles with daughters
155   Double_t                fCentrality;                //centrality
156  
157  private:
158   Int_t                   fNumberOfFlowTagClasses;    // how many different flow particle types do we have? (RP,POI,POI_2,...)
159   Int_t*                  fNumberOfFlowTags;          //[fNumberOfFlowTagClasses] number of tracks that have passed the POI selection
160
161   ClassDef(AliFlowEventSimple,1)
162 };
163
164 #endif
165
166