]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG/FLOW/Base/AliFlowVector.h
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWG / FLOW / Base / AliFlowVector.h
CommitLineData
f1d945a1 1/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2* See cxx source for full Copyright notice */
3/* $Id$ */
4
ae733b3b 5#ifndef ALIFLOWVECTOR_H
6#define ALIFLOWVECTOR_H
f1d945a1 7
8#include "TVector2.h"
8fa6a5fa 9#include "AliFlowTrackSimple.h"
f1d945a1 10
19f888a6 11//********************************************************************
12// AliFlowVector: *
13// Class to hold the flow vector and multiplicity for flow analysis. *
14// Author: A. Bilandzic (anteb@nikhef.nl) *
15//********************************************************************
8fa6a5fa 16class AliFlowTrackSimple;
f1d945a1 17
18class AliFlowVector: public TVector2 {
19 public:
20 AliFlowVector();
868536da 21 AliFlowVector(const AliFlowVector& aVector);
8fa6a5fa
MK
22 AliFlowVector(const TVector2 &p, Double_t m, Int_t h=2, Int_t poiType=0, Int_t s=1); // constructor: Add a weight to the TVector
23 AliFlowVector(Double_t *y, Double_t m=1, Int_t h=2, Int_t poiType=0, Int_t s=-1); // constructor: Analogue to TVector2(y) with multiplicity
24 AliFlowVector(Double_t x, Double_t y, Double_t m=1, Int_t h=2, Int_t poiType=0, Int_t s=-1); // constructor: Sets the components individually
f1d945a1 25 virtual ~AliFlowVector();
868536da 26
7b5556ef 27 void SetMagPhi(Double_t size, Double_t angle, Double_t mult=1); // Set vector and weighted multiplicity
03740a6b 28
7b5556ef 29 AliFlowVector& operator=(const AliFlowVector& aVector); // Assign to self
30 AliFlowVector& operator+=(const AliFlowVector& aVector); // Add to self
31 AliFlowVector& operator-=(const AliFlowVector& aVector); // Subtract from self
8fa6a5fa
MK
32 AliFlowVector& operator*=(Double_t w); // Multiply by a weight
33 AliFlowVector& operator/=(Double_t w){ (*this)*=(1.0/w); return *this;}; // Divide by a weight
7b5556ef 34 const AliFlowVector operator+(const AliFlowVector&a) const { AliFlowVector v(*this); return v+=a; }; // Add and return by value
35 const AliFlowVector operator-(const AliFlowVector&a) const { AliFlowVector v(*this); return v-=a; }; // Subtract and return by value
8fa6a5fa
MK
36 const AliFlowVector operator*(Double_t w) const { AliFlowVector v(*this); return v*=w; }; // Scale and return by value
37 const AliFlowVector operator/(Double_t w) const { AliFlowVector v(*this); return v/=w; }; // Scale and return by value
38
39 Int_t SubtractTrackWithDaughters( const AliFlowTrackSimple* track,
40 Double_t extraWeight=1.
41 ); //subtract a track with all its daughters
868536da 42
c076fda8 43 Bool_t IsFolder() const {return kTRUE;};
44
52990716 45 void SetMult(Double_t mult) {fMult = mult;}; // Set sum of weights
7b5556ef 46 Double_t GetMult() const {return fMult;}; // Get sum of weights
8fa6a5fa
MK
47 void SetHarmonic(Int_t h) {fHarmonic = h;} //set the harmonic
48 Int_t GetHarmonic() const {return fHarmonic;} //get the harmonic
5c8e53c4
MK
49 void SetPOItype(Int_t t) {fPOItype=t;}
50 Int_t GetPOItype() const {return fPOItype;}
8fa6a5fa
MK
51 void SetSubeventNumber(Int_t n) {fSubeventNumber=n;}
52 Int_t GetSubeventNumber() const {return fSubeventNumber;}
53 void Clear(Option_t* option="");
cbbaf54a 54
f1d945a1 55 private:
ae733b3b 56 Double_t fMult; // multiplicity = sum of weights = w_1 + w_2 + ... + w_n
8fa6a5fa
MK
57 Int_t fHarmonic; // harmonic for which the vector is constructed
58 Int_t fPOItype; //which tracks are used to construct? RP=0, POIn=n,...
59 Int_t fSubeventNumber; //for which subevent is this vector constructed? (-1 for no subevent in particular)
cbbaf54a 60
8fa6a5fa 61 ClassDef(AliFlowVector, 2)
f1d945a1 62};
f1d945a1 63
7b5556ef 64
65/* Old, less efficient code
cbbaf54a 66inline AliFlowVector operator+(const AliFlowVector& aVector,const AliFlowVector& bVector) {
67 AliFlowVector cVector;
68 Double_t x = aVector.X() + bVector.X();
69 Double_t y = aVector.Y() + bVector.Y();
70 Double_t mult = aVector.GetMult() + bVector.GetMult();
71 cVector.Set(x,y);
72 cVector.SetMult(mult);
73
74 return cVector;
75}
19f888a6 76
03740a6b 77inline AliFlowVector operator-(const AliFlowVector& aVector,const AliFlowVector& bVector)
78{
79 // Difference between two vectors
80 AliFlowVector cVector;
81 Double_t x = aVector.X() - bVector.X();
82 Double_t y = aVector.Y() - bVector.Y();
83 Double_t mult = aVector.GetMult() - bVector.GetMult();
84 cVector.Set(x,y);
85 cVector.SetMult(mult);
86
87 return cVector;
88}
7b5556ef 89*/
03740a6b 90
cbbaf54a 91#endif