]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGDQ/dielectron/AliReducedEvent.h
additional bug fix from Ionut
[u/mrichter/AliRoot.git] / PWGDQ / dielectron / AliReducedEvent.h
1 // Classes used for creating a reduced information tree
2 // Author: Ionut-Cristian Arsene (i.c.arsene@gsi.de)
3 // 
4 //  Basic structure:
5 //  1. Event wise information
6 //  2. List of tracks in the event
7 //  3. List of resonance candidates
8
9 #ifndef ALIREDUCEDEVENT_H
10 #define ALIREDUCEDEVENT_H
11
12 #include <TClonesArray.h>
13 #include <TBits.h>
14 #include <TMath.h>
15
16
17 const Int_t fgkNMaxHarmonics = 10;
18 /*class AliCorrelationReducedTrack;
19 class AliCorrelationReducedPair;
20 class AliReducedEventFriend;
21 class AliReducedEvent;
22 class AliCorrelationReducedCaloCluster;*/
23
24 //_____________________________________________________________________
25 class AliReducedTrack : public TObject {
26
27   friend class AliAnalysisTaskReducedTree;  // friend analysis task which fills the object
28
29  public:
30   AliReducedTrack();
31   ~AliReducedTrack();
32
33   // getters
34   UShort_t TrackId()                     const {return fTrackId;}
35   ULong_t  Status()                      const {return fStatus;}
36   Bool_t   CheckTrackStatus(UInt_t flag) const {return (flag<8*sizeof(ULong_t) ? (fStatus&(1<<flag)) : kFALSE);}
37   Int_t    Charge()                      const {return (fGlobalPt>0.0 ? +1 : -1);}
38   Float_t  Px()                          const {return TMath::Abs(fGlobalPt)*TMath::Cos(fGlobalPhi);}
39   Float_t  Py()                          const {return TMath::Abs(fGlobalPt)*TMath::Sin(fGlobalPhi);}
40   Float_t  Pz()                          const {return TMath::Abs(fGlobalPt)*TMath::SinH(fGlobalEta);}
41   Float_t  P()                           const {return TMath::Abs(fGlobalPt)*TMath::CosH(fGlobalEta);};
42   Float_t  Phi()                         const {return fGlobalPhi;}
43   Float_t  Pt()                          const {return TMath::Abs(fGlobalPt);}
44   Float_t  Eta()                         const {return fGlobalEta;}
45   Float_t  Theta()                       const {return TMath::ACos(TMath::TanH(fGlobalEta));}
46   Float_t  PxTPC()                       const {return fTPCPt*TMath::Cos(fTPCPhi);}
47   Float_t  PyTPC()                       const {return fTPCPt*TMath::Sin(fTPCPhi);}
48   Float_t  PzTPC()                       const {return fTPCPt*TMath::SinH(fTPCEta);}
49   Float_t  PTPC()                        const {return fTPCPt*TMath::CosH(fTPCEta);};
50   Float_t  PhiTPC()                      const {return fTPCPhi;}
51   Float_t  PtTPC()                       const {return fTPCPt;}
52   Float_t  EtaTPC()                      const {return fTPCEta;}
53   Float_t  ThetaTPC()                    const {return TMath::ACos(TMath::TanH(fTPCEta));}
54   Float_t  Pin()                         const {return fMomentumInner;}
55   Float_t  DCAxy()                       const {return fDCA[0];}
56   Float_t  DCAz()                        const {return fDCA[1];}
57   
58   UShort_t ITSncls()                const;
59   UChar_t  ITSclusterMap()          const {return fITSclusterMap;}
60   Bool_t   ITSLayerHit(Int_t layer) const {return (layer>=0 && layer<6 ? (fITSclusterMap&(1<<layer)) : kFALSE);};
61   Float_t  ITSsignal()              const {return fITSsignal;}
62   
63   UChar_t TPCncls()                        const {return fTPCNcls;}
64   UChar_t TPCFindableNcls()                const {return fTPCNclsF;}
65   UChar_t TPCCrossedRows()                 const {return fTPCCrossedRows;}
66   UChar_t TPCnclsIter1()                   const {return fTPCNclsIter1;}
67   UChar_t TPCClusterMap()                  const {return fTPCClusterMap;}
68   Int_t   TPCClusterMapBitsFired()         const;
69   Bool_t  TPCClusterMapBitFired(Int_t bit) const {return (bit>=0 && bit<8 ? (fTPCClusterMap&(1<<bit)) : kFALSE);};
70   Float_t TPCsignal()                      const {return fTPCsignal;}
71   Float_t TPCnSig(Int_t specie)            const {return (specie>=0 && specie<=3 ? fTPCnSig[specie] : -999.);}
72   
73   Float_t  TOFbeta()             const {return fTOFbeta;}    
74   Float_t  TOFnSig(Int_t specie) const {return (specie>=0 && specie<=3 ? fTOFnSig[specie] : -999.);}
75   
76   Int_t    TRDntracklets(Int_t type)  const {return (type==0 || type==1 ? fTRDntracklets[type] : -1);}
77   Float_t  TRDpid(Int_t specie)       const {return (specie>=0 && specie<=1 ? fTRDpid[specie] : -999.);}
78   
79   Int_t    CaloClusterId() const {return fCaloClusterId;}
80   //Float_t  CaloEnergy(AliReducedEvent* event) const {if(fCaloClusterId>0) return event->GetCaloCluster(fCaloClusterId)->Energy();}
81   //Float_t  CaloDx(AliReducedEvent* event) const {if(fCaloClusterId>0) return event->GetCaloCluster(fCaloClusterId)->Dx();}
82   //Float_t  CaloDz(AliReducedEvent* event) const {if(fCaloClusterId>0) return event->GetCaloCluster(fCaloClusterId)->Dz();}
83   
84   Float_t  BayesPID(Int_t specie) const {return (specie>=0 && specie<=2 ? fBayesPID[specie] : -999.);}
85   Bool_t   UsedForQvector()       const {return fFlags&(1<<0);}
86   
87  private:
88   UShort_t fTrackId;            // track id 
89   ULong_t fStatus;              // tracking status
90   Float_t fGlobalPhi;           // phi at the vertex from global track, in the [0,2pi) interval
91   Float_t fGlobalPt;            // pt*charge at the vertex from global track
92   Float_t fGlobalEta;           // eta at the vertex from global track
93   Float_t fTPCPhi;              // phi at the vertex from TPC alone tracking , in the [0,2pi) interval
94   Float_t fTPCPt;               // pt at the vertex from TPC alone tracking  
95   Float_t fTPCEta;              // eta at the vertex from TPC alone tracking 
96   Float_t fMomentumInner;       // inner param momentum (only the magnitude)
97   Float_t fDCA[2];              // DCA xy,z
98   
99   // ITS
100   UChar_t  fITSclusterMap;      // ITS cluster map
101   Float_t  fITSsignal;          // ITS signal
102   
103   // TPC
104   UChar_t fTPCNcls;            // TPC ncls                          
105   UChar_t fTPCCrossedRows;     // TPC crossed rows                  
106   UChar_t fTPCNclsF;           // TPC findable ncls                 
107   UChar_t fTPCNclsIter1;       // TPC no clusters after first iteration
108   UChar_t fTPCClusterMap;      // TPC cluster distribution map
109   Float_t fTPCsignal;          // TPC de/dx
110   Float_t fTPCnSig[4];         // 0-electron; 1-pion; 2-kaon; 3-proton
111     
112   // TOF
113   Float_t fTOFbeta;             // TOF pid info
114   Float_t fTOFnSig[4];          // TOF n-sigma deviation from expected signal
115   
116   // TRD
117   UChar_t fTRDntracklets[2];       // 0 - AliESDtrack::GetTRDntracklets(); 1 - AliESDtrack::GetTRDntrackletsPID()   TODO: use only 1 char
118   Float_t fTRDpid[2];              // TRD pid probabilities, [0]-electron, [1]-pion
119   
120   // EMCAL/PHOS
121   Int_t  fCaloClusterId;          // ID for the calorimeter cluster (if any)
122   
123   // Bayesian PID
124   Float_t fBayesPID[3];            // Combined Bayesian PID   pi/K/p
125   
126   UShort_t fFlags;                // BIT0 toggled if track used for TPC event plane   TODO combine with other posible flags, use for MC pid?
127   // TODO flag for which TPC part used for pid  --> Char_t  used in 2011 data
128   
129   AliReducedTrack(const AliReducedTrack &c);
130   AliReducedTrack& operator= (const AliReducedTrack &c);
131
132   ClassDef(AliReducedTrack, 2);
133 };
134
135
136 //_____________________________________________________________________
137 class AliReducedPair : public TObject {
138
139   friend class AliAnalysisTaskReducedTree;  // friend analysis task which fills the object
140
141  public:
142   enum CandidateType {
143     kK0sToPiPi=0,
144     kPhiToKK,
145     kLambda0ToPPi,
146     kALambda0ToPPi,
147     kJpsiToEE,
148     kUpsilon,
149     kNMaxCandidateTypes
150   };
151   AliReducedPair();
152   AliReducedPair(const AliReducedPair &c);
153   ~AliReducedPair();
154
155   // getters
156   Char_t   CandidateId()         const {return fCandidateId;}
157   Char_t   PairType()            const {return fPairType;}
158   Int_t    LegId(Int_t leg)      const {return (leg==0 || leg==1 ? fLegIds[leg] : -1);}
159   Float_t  Mass(Int_t idx=0)     const {return (idx>=0 && idx<3 ? fMass[idx] : -999.);}
160   Float_t  Px()                  const {return fPt*TMath::Cos(fPhi);}
161   Float_t  Py()                  const {return fPt*TMath::Sin(fPhi);}
162   Float_t  Pz()                  const {return fPt*TMath::SinH(fEta);}
163   Float_t  P()                   const {return fPt*TMath::CosH(fEta);}
164   Float_t  Phi()                 const {return fPhi;}
165   Float_t  Pt()                  const {return fPt;}
166   Float_t  Eta()                 const {return fEta;}
167   Float_t  Energy()              const;
168   Float_t  Rapidity()            const;
169   Float_t  Theta()               const {return TMath::ACos(TMath::TanH(fEta));}
170   Float_t  Lxy()                 const {return fLxy;}
171   Float_t  LxyErr()              const {return fLxyErr;}
172   Float_t  OpeningAngle()        const {return fOpeningAngle;}
173   Bool_t   IsOnTheFly()          const {return fPairType;}
174   UInt_t   MCid()                const {return fMCid;}
175   Bool_t   CheckMC(const Int_t flag) const {return (flag<32 ? (fMCid&(1<<flag)) : kFALSE);}
176   
177  private:
178   Char_t  fCandidateId;         // candidate type (K0s, Lambda, J/psi, phi, etc)
179   Char_t  fPairType;            // 0 ++; 1 +-; 2 -- for dielectron pairs; 0- offline, 1- on the fly for V0 candidates
180   UShort_t fLegIds[2];          // leg ids 
181   Float_t fMass[3];             // invariant mass for pairs (2 extra mass values for other V0 pid assumptions)
182                                 // idx=0 -> K0s assumption; idx=1 -> Lambda; idx=2 -> anti-Lambda
183   Float_t fPhi;                 // pair phi in the [0,2*pi) interval
184   Float_t fPt;                  // pair pt
185   Float_t fEta;                 // pair eta 
186   Float_t fLxy;                 // pseudo-proper decay length
187   Float_t fLxyErr;              // error on Lxy
188   Float_t fOpeningAngle;        // opening angle                TODO remove   ???
189   UInt_t  fMCid;                // Bit map with Monte Carlo info about the pair
190
191   AliReducedPair& operator= (const AliReducedPair &c);
192
193   ClassDef(AliReducedPair, 1);
194 };
195
196
197 //_________________________________________________________________________
198 class AliReducedEventFriend : public TObject {
199   
200   friend class AliAnalysisTaskReducedTree;    // friend analysis task which fills the object
201   
202  public: 
203   enum EventPlaneStatus {
204     kRaw=0,
205     kCalibrated,
206     kRecentered,
207     kShifted,
208     kNMaxFlowFlags
209   };
210   enum EventPlaneDetector {
211     kTPC=0,       
212     kTPCptWeights,
213     kTPCpos,
214     kTPCneg,
215     kVZEROA,
216     kVZEROC,
217     kFMD,
218     kZDCA,
219     kZDCC,
220     kNdetectors
221   };
222   
223   AliReducedEventFriend();
224   ~AliReducedEventFriend();
225   
226   Double_t Qx(Int_t det, Int_t harmonic)  const {return (det>=0 && det<kNdetectors && harmonic>0 && harmonic<=fgkNMaxHarmonics ? fQvector[det][harmonic-1][0] : -999.);}
227   Double_t Qy(Int_t det, Int_t harmonic)  const {return (det>=0 && det<kNdetectors && harmonic>0 && harmonic<=fgkNMaxHarmonics ? fQvector[det][harmonic-1][1] : -999.);}
228   Double_t EventPlane(Int_t det, Int_t h) const;
229   UChar_t GetEventPlaneStatus(Int_t det, Int_t h) const {return (det>=0 && det<kNdetectors && h>0 && h<=fgkNMaxHarmonics ? fEventPlaneStatus[det][h] : 999);} 
230   Bool_t  CheckEventPlaneStatus(Int_t det, Int_t h, EventPlaneStatus flag) const;
231   void    CopyEvent(const AliReducedEventFriend* event);
232
233   void SetQx(Int_t det, Int_t harmonic, Float_t qx) { if(det>=0 && det<kNdetectors && harmonic>0 && harmonic<=fgkNMaxHarmonics) fQvector[det][harmonic-1][0]=qx;}
234   void SetQy(Int_t det, Int_t harmonic, Float_t qy) { if(det>=0 && det<kNdetectors && harmonic>0 && harmonic<=fgkNMaxHarmonics) fQvector[det][harmonic-1][1]=qy;}
235   void SetEventPlaneStatus(Int_t det, Int_t harmonic, EventPlaneStatus status) { 
236     if(det>=0 && det<kNdetectors && harmonic>0 && harmonic<=fgkNMaxHarmonics) 
237       fEventPlaneStatus[det][harmonic-1] |= (1<<status);
238   }
239   
240  private:
241   // Q-vectors for the first 10 harmonics from TPC, VZERO, FMD and ZDC detectors
242   Double_t fQvector[kNdetectors][fgkNMaxHarmonics][2];     // Q vector components for all detectors and 6 harmonics
243   UChar_t fEventPlaneStatus[kNdetectors][fgkNMaxHarmonics];  // Bit maps for the event plane status (1 char per detector and per harmonic)
244    
245   void ClearEvent();
246   AliReducedEventFriend(const AliReducedEventFriend &c);
247   AliReducedEventFriend& operator= (const AliReducedEventFriend &c);
248
249   ClassDef(AliReducedEventFriend, 1);
250 };
251
252
253 //_________________________________________________________________________
254 class AliReducedCaloCluster : public TObject {
255   
256   friend class AliAnalysisTaskReducedTree;         // friend analysis task which fills the object
257   
258  public:
259   enum ClusterType {
260     kUndefined=0, kEMCAL, kPHOS  
261   };
262    
263   AliReducedCaloCluster();
264   ~AliReducedCaloCluster();
265   
266   Bool_t  IsEMCAL() const {return (fType==kEMCAL ? kTRUE : kFALSE);}
267   Bool_t  IsPHOS()  const {return (fType==kPHOS ? kTRUE : kFALSE);}
268   Float_t Energy()  const {return fEnergy;}
269   Float_t Dx()      const {return fTrackDx;}
270   Float_t Dz()      const {return fTrackDz;}
271   
272  private:
273   Char_t  fType;         // cluster type (EMCAL/PHOS)
274   Float_t fEnergy;       // cluster energy
275   Float_t fTrackDx;      // distance to closest track in phi
276   Float_t fTrackDz;      // distance to closest track in z
277   
278   AliReducedCaloCluster(const AliReducedCaloCluster &c);
279   AliReducedCaloCluster& operator= (const AliReducedCaloCluster &c);
280
281   ClassDef(AliReducedCaloCluster, 1);
282 };
283
284
285 //_________________________________________________________________________
286 class AliReducedEvent : public TObject {
287
288   friend class AliAnalysisTaskReducedTree;     // friend analysis task which fills the object
289
290  public:
291   AliReducedEvent();
292   AliReducedEvent(const Char_t* name);
293   ~AliReducedEvent();
294
295   // getters
296   Int_t     RunNo()                           const {return fRunNo;}
297   UShort_t  BC()                              const {return fBC;}
298   ULong64_t TriggerMask()                     const {return fTriggerMask;}
299   Bool_t    IsPhysicsSelection()              const {return fIsPhysicsSelection;}
300   Float_t   Vertex(Int_t axis)                const {return (axis>=0 && axis<=2 ? fVtx[axis] : 0);}
301   Int_t     VertexNContributors()             const {return fNVtxContributors;}
302   Float_t   VertexTPC(Int_t axis)             const {return (axis>=0 && axis<=2 ? fVtxTPC[axis] : 0);}
303   Int_t     VertexTPCContributors()           const {return fNVtxTPCContributors;}
304   Float_t   CentralityVZERO()                 const {return fCentrality[0];}
305   Float_t   CentralitySPD()                   const {return fCentrality[1];}
306   Float_t   CentralityTPC()                   const {return fCentrality[2];}
307   Float_t   CentralityZEMvsZDC()              const {return fCentrality[3];}
308   Int_t     CentralityQuality()               const {return fCentQuality;}
309   Int_t     NV0CandidatesTotal()              const {return fNV0candidates[0];}
310   Int_t     NV0Candidates()                   const {return fNV0candidates[1];}
311   Int_t     NDielectrons()                    const {return fNDielectronCandidates;}
312   Int_t     NTracksTotal()                    const {return fNtracks[0];}
313   Int_t     NTracks()                         const {return fNtracks[1];}
314   Int_t     SPDntracklets()                   const {return fSPDntracklets;}
315   
316   Float_t   MultChannelVZERO(Int_t channel)   const {return (channel>=0 && channel<=63 ? fVZEROMult[channel] : -999.);}
317   Float_t   MultVZEROA()                      const;
318   Float_t   MultVZEROC()                      const;
319   Float_t   MultVZERO()                       const;
320   Float_t   MultRingVZEROA(Int_t ring)        const;
321   Float_t   MultRingVZEROC(Int_t ring)        const;
322   
323   Float_t   EnergyZDC(Int_t channel)   const {return (channel>=0 && channel<8 ? fZDCnEnergy[channel] : -999.);}
324   Float_t   EnergyZDCnA(Int_t channel) const {return (channel>=0 && channel<4 ? fZDCnEnergy[channel+4] : -999.);}
325   Float_t   EnergyZDCnC(Int_t channel) const {return (channel>=0 && channel<4 ? fZDCnEnergy[channel] : -999.);}
326   
327   AliReducedTrack* GetTrack(Int_t i)         const 
328     {return (i<fNtracks[1] ? (AliReducedTrack*)fTracks->At(i) : 0x0);}
329   AliReducedPair* GetV0Pair(Int_t i)         const 
330     {return (i>=0 && i<fNV0candidates[1] ? (AliReducedPair*)fCandidates->At(i) : 0x0);}
331   AliReducedPair* GetDielectronPair(Int_t i) const 
332     {return (i>=0 && i<fNDielectronCandidates ? (AliReducedPair*)fCandidates->At(i+fNV0candidates[1]) : 0x0);}
333   TClonesArray* GetPairs()                              const {return fCandidates;}
334   TClonesArray* GetTracks()                             const {return fTracks;}
335
336   Int_t GetNCaloClusters() const {return fNCaloClusters;}
337   AliReducedCaloCluster* GetCaloCluster(Int_t i) const 
338     {return (i>=0 && i<fNCaloClusters ? (AliReducedCaloCluster*)fCaloClusters->At(i) : 0x0);}
339   
340   void  GetQvector(Double_t Qvec[][2], Int_t det, Float_t etaMin=-0.8, Float_t etaMax=+0.8, Bool_t (*IsTrackSelected)(AliReducedTrack*)=NULL);
341   Int_t GetTPCQvector(Double_t Qvec[][2], Int_t det, Float_t etaMin=-0.8, Float_t etaMax=+0.8, Bool_t (*IsTrackSelected)(AliReducedTrack*)=NULL);
342   void  GetVZEROQvector(Double_t Qvec[][2], Int_t det) ;
343   void  GetVZEROQvector(Double_t Qvec[][2], Int_t det, Float_t* vzeroMult);
344   void  GetZDCQvector(Double_t Qvec[][2], Int_t det) const;
345   void  SubtractParticleFromQvector(AliReducedTrack* particle, Double_t Qvec[][2], Int_t det, 
346                                     Float_t etaMin=-0.8, Float_t etaMax=+0.8, Bool_t (*IsTrackSelected)(AliReducedTrack*)=NULL);
347
348  private:
349   Int_t     fRunNo;                 // run number
350   UShort_t  fBC;                    // bunch crossing
351   ULong64_t fTriggerMask;           // trigger mask
352   Bool_t    fIsPhysicsSelection;    // PhysicsSelection passed event
353   Float_t   fVtx[3];                // global event vertex vector in cm
354   Int_t     fNVtxContributors;      // global event vertex contributors
355   Float_t   fVtxTPC[3];             // TPC only event vertex           
356   Int_t     fNVtxTPCContributors;   // TPC only event vertex contributors
357   Float_t   fCentrality[4];         // centrality; 0-VZERO, 1-SPD, 2-TPC, 3-ZEMvsZDC 
358   Int_t     fCentQuality;           // quality flag for the centrality 
359   Int_t     fNV0candidates[2];      // number of V0 candidates, [0]-total, [1]-selected for the tree
360   Int_t     fNDielectronCandidates; // number of pairs selected as dielectrons
361   Int_t     fNtracks[2];            // number of tracks, [0]-total, [1]-selected for the tree
362   Int_t     fSPDntracklets;         // number of SPD tracklets in |eta|<1.0 
363
364   Float_t   fVZEROMult[64];         // VZERO multiplicity in all 64 channels
365   Float_t   fZDCnEnergy[8];         // neutron ZDC energy in all 8 channels
366     
367   TClonesArray* fTracks;            //->   array containing global tracks
368   static TClonesArray* fgTracks;    //       global tracks
369   
370   TClonesArray* fCandidates;        //->   array containing pair candidates
371   static TClonesArray* fgCandidates;  // pair candidates
372   
373   Int_t     fNCaloClusters;         // number of calorimeter clusters  
374   TClonesArray* fCaloClusters;        //->   array containing calorimeter clusters
375   static TClonesArray* fgCaloClusters;     // calorimeter clusters
376   
377   void ClearEvent();
378   AliReducedEvent(const AliReducedEvent &c);
379   AliReducedEvent& operator= (const AliReducedEvent &c);
380
381   ClassDef(AliReducedEvent, 2);
382 };
383
384 //_______________________________________________________________________________
385 inline UShort_t AliReducedTrack::ITSncls() const
386 {
387   //
388   // ITS number of clusters from the cluster map
389   //
390   UShort_t ncls=0;
391   for(Int_t i=0; i<6; ++i) ncls += (ITSLayerHit(i) ? 1 : 0);
392   return ncls;
393 }
394
395
396 //_______________________________________________________________________________
397 inline Int_t AliReducedTrack::TPCClusterMapBitsFired()  const
398 {
399   //
400   // Count the number of bits fired in the TPC cluster map
401   //
402   Int_t nbits=0;
403   for(Int_t i=0; i<8; ++i) nbits += (TPCClusterMapBitFired(i) ? 1 : 0);
404   return nbits;
405 }
406
407
408 //_______________________________________________________________________________
409 inline Float_t AliReducedPair::Energy() const 
410 {
411   //
412   // Return the energy
413   //
414   Float_t mass=fMass[0];
415   switch (fCandidateId) {
416     case kK0sToPiPi:
417       mass = fMass[0];
418       break;
419     case kLambda0ToPPi:
420       mass = fMass[1];
421       break;
422     case kALambda0ToPPi:
423       mass = fMass[2];
424       break;
425     default:
426       mass = fMass[0];
427       break;    
428   }
429   Float_t p = P();
430   return TMath::Sqrt(mass*mass+p*p);
431 }
432
433
434 //_______________________________________________________________________________
435 inline Float_t AliReducedPair::Rapidity() const
436 {
437   //
438   // return rapidity
439   //
440   Float_t e = Energy();
441   Float_t pz = Pz();
442   if(e-TMath::Abs(pz)>1.0e-10)
443     return 0.5*TMath::Log((e+pz)/(e-pz));
444   else 
445     return -999.;
446 }
447
448
449 //_______________________________________________________________________________
450 inline Double_t AliReducedEventFriend::EventPlane(Int_t det, Int_t harmonic) const
451 {
452   //
453   // Event plane from detector "det" and harmonic "harmonic"
454   //
455   if(det<0 || det>=kNdetectors || harmonic<1 || harmonic>fgkNMaxHarmonics) return -999.;
456   return TMath::ATan2(fQvector[det][harmonic-1][1], fQvector[det][harmonic-1][0])/Double_t(harmonic);
457 }
458
459 //_______________________________________________________________________________
460 inline Bool_t AliReducedEventFriend::CheckEventPlaneStatus(Int_t det, Int_t h, EventPlaneStatus flag) const {
461   //
462   // Check the status of the event plane for a given detector and harmonic
463   //
464   if(det<0 || det>=kNdetectors || h<1 || h>fgkNMaxHarmonics) return kFALSE;
465   return (flag<kNMaxFlowFlags ? (fEventPlaneStatus[det][h]&(1<<flag)) : kFALSE);
466 }
467
468 #endif