]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FLOW/AliFlowCommon/AliFlowVector.h
414aba7b5fff24bbf7fbabec43fbfa37993ae17a
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowCommon / AliFlowVector.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 #ifndef ALIFLOWVECTOR_H
6 #define ALIFLOWVECTOR_H
7
8 #include "TVector2.h"
9
10 //********************************************************************
11 // AliFlowVector:                                                    *
12 // Class to hold the flow vector and multiplicity for flow analysis. *
13 // Author: A. Bilandzic (anteb@nikhef.nl)                            *
14 //********************************************************************
15
16 class AliFlowVector: public TVector2 {
17  public:
18   AliFlowVector();
19   AliFlowVector(const AliFlowVector& aVector);
20   AliFlowVector(const TVector2 &p, const Double_t m);
21   virtual ~AliFlowVector();
22
23   AliFlowVector& operator=(const AliFlowVector& aVector);
24   AliFlowVector& operator+=(const AliFlowVector& aVector);
25
26   Bool_t  IsFolder() const {return kTRUE;};
27
28   void SetMult(Double_t const mult) {this->fMult = mult;};
29   Double_t GetMult() const {return this->fMult;};
30         
31  private:
32   Double_t fMult;                 // multiplicity = sum of weights = w_1 + w_2 + ... + w_n
33    
34   ClassDef(AliFlowVector, 1) 
35 };
36
37 inline  AliFlowVector operator+(const AliFlowVector& aVector,const AliFlowVector& bVector) {
38   AliFlowVector cVector;
39   Double_t x = aVector.X() + bVector.X(); 
40   Double_t y = aVector.Y() + bVector.Y(); 
41   Double_t mult = aVector.GetMult() + bVector.GetMult();
42   cVector.Set(x,y);
43   cVector.SetMult(mult);
44   
45   return cVector;
46 }
47
48 #endif