ROOT logo
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/* $Id$ */

#ifndef ALIFLOWVECTOR_H
#define ALIFLOWVECTOR_H

#include "TVector2.h"
#include "AliFlowTrackSimple.h"

//********************************************************************
// AliFlowVector:                                                    *
// Class to hold the flow vector and multiplicity for flow analysis. *
// Author: A. Bilandzic (anteb@nikhef.nl)                            *
//********************************************************************
class AliFlowTrackSimple;

class AliFlowVector: public TVector2 {
 public:
  AliFlowVector();
  AliFlowVector(const AliFlowVector& aVector);
  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
  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
  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
  virtual ~AliFlowVector();

  void SetMagPhi(Double_t size, Double_t angle, Double_t mult=1);          // Set vector and weighted multiplicity

  AliFlowVector& operator=(const AliFlowVector& aVector);                        // Assign to self
  AliFlowVector& operator+=(const AliFlowVector& aVector);                       // Add to self
  AliFlowVector& operator-=(const AliFlowVector& aVector);                       // Subtract from self
  AliFlowVector& operator*=(Double_t w);                                     // Multiply by a weight
  AliFlowVector& operator/=(Double_t w){ (*this)*=(1.0/w); return *this;};      // Divide by a weight
  const AliFlowVector operator+(const AliFlowVector&a) const { AliFlowVector v(*this); return v+=a; };   // Add and return by value
  const AliFlowVector operator-(const AliFlowVector&a) const { AliFlowVector v(*this); return v-=a; };   // Subtract and return by value
  const AliFlowVector operator*(Double_t w) const { AliFlowVector v(*this); return v*=w; };          // Scale and return by value
  const AliFlowVector operator/(Double_t w) const { AliFlowVector v(*this); return v/=w; };          // Scale and return by value

  Int_t SubtractTrackWithDaughters( const AliFlowTrackSimple* track,
                                   Double_t extraWeight=1.
                                 );  //subtract a track with all its daughters

  Bool_t  IsFolder() const {return kTRUE;};

  void SetMult(Double_t mult) {fMult = mult;};           // Set sum of weights
  Double_t GetMult() const {return fMult;};                    // Get sum of weights
  void SetHarmonic(Int_t h) {fHarmonic = h;}             //set the harmonic
  Int_t GetHarmonic() const {return fHarmonic;}          //get the harmonic
  void SetPOItype(Int_t t) {fPOItype=t;}
  Int_t GetPOItype() const {return fPOItype;}
  void SetSubeventNumber(Int_t n) {fSubeventNumber=n;}
  Int_t GetSubeventNumber() const {return fSubeventNumber;}
  void Clear(Option_t* option="");
        
 private:
  Double_t fMult;                 // multiplicity = sum of weights = w_1 + w_2 + ... + w_n
  Int_t fHarmonic;                // harmonic for which the vector is constructed
  Int_t fPOItype;             //which tracks are used to construct? RP=0, POIn=n,...
  Int_t fSubeventNumber;          //for which subevent is this vector constructed? (-1 for no subevent in particular)
   
  ClassDef(AliFlowVector, 2) 
};


/* Old, less efficient code
inline  AliFlowVector operator+(const AliFlowVector& aVector,const AliFlowVector& bVector) {
  AliFlowVector cVector;
  Double_t x = aVector.X() + bVector.X(); 
  Double_t y = aVector.Y() + bVector.Y(); 
  Double_t mult = aVector.GetMult() + bVector.GetMult();
  cVector.Set(x,y);
  cVector.SetMult(mult);
  
  return cVector;
}

inline  AliFlowVector operator-(const AliFlowVector& aVector,const AliFlowVector& bVector) 
{
   // Difference between two vectors
  AliFlowVector cVector;
  Double_t x = aVector.X() - bVector.X(); 
  Double_t y = aVector.Y() - bVector.Y(); 
  Double_t mult = aVector.GetMult() - bVector.GetMult();
  cVector.Set(x,y);
  cVector.SetMult(mult);
  
  return cVector;
}
*/

#endif
 AliFlowVector.h:1
 AliFlowVector.h:2
 AliFlowVector.h:3
 AliFlowVector.h:4
 AliFlowVector.h:5
 AliFlowVector.h:6
 AliFlowVector.h:7
 AliFlowVector.h:8
 AliFlowVector.h:9
 AliFlowVector.h:10
 AliFlowVector.h:11
 AliFlowVector.h:12
 AliFlowVector.h:13
 AliFlowVector.h:14
 AliFlowVector.h:15
 AliFlowVector.h:16
 AliFlowVector.h:17
 AliFlowVector.h:18
 AliFlowVector.h:19
 AliFlowVector.h:20
 AliFlowVector.h:21
 AliFlowVector.h:22
 AliFlowVector.h:23
 AliFlowVector.h:24
 AliFlowVector.h:25
 AliFlowVector.h:26
 AliFlowVector.h:27
 AliFlowVector.h:28
 AliFlowVector.h:29
 AliFlowVector.h:30
 AliFlowVector.h:31
 AliFlowVector.h:32
 AliFlowVector.h:33
 AliFlowVector.h:34
 AliFlowVector.h:35
 AliFlowVector.h:36
 AliFlowVector.h:37
 AliFlowVector.h:38
 AliFlowVector.h:39
 AliFlowVector.h:40
 AliFlowVector.h:41
 AliFlowVector.h:42
 AliFlowVector.h:43
 AliFlowVector.h:44
 AliFlowVector.h:45
 AliFlowVector.h:46
 AliFlowVector.h:47
 AliFlowVector.h:48
 AliFlowVector.h:49
 AliFlowVector.h:50
 AliFlowVector.h:51
 AliFlowVector.h:52
 AliFlowVector.h:53
 AliFlowVector.h:54
 AliFlowVector.h:55
 AliFlowVector.h:56
 AliFlowVector.h:57
 AliFlowVector.h:58
 AliFlowVector.h:59
 AliFlowVector.h:60
 AliFlowVector.h:61
 AliFlowVector.h:62
 AliFlowVector.h:63
 AliFlowVector.h:64
 AliFlowVector.h:65
 AliFlowVector.h:66
 AliFlowVector.h:67
 AliFlowVector.h:68
 AliFlowVector.h:69
 AliFlowVector.h:70
 AliFlowVector.h:71
 AliFlowVector.h:72
 AliFlowVector.h:73
 AliFlowVector.h:74
 AliFlowVector.h:75
 AliFlowVector.h:76
 AliFlowVector.h:77
 AliFlowVector.h:78
 AliFlowVector.h:79
 AliFlowVector.h:80
 AliFlowVector.h:81
 AliFlowVector.h:82
 AliFlowVector.h:83
 AliFlowVector.h:84
 AliFlowVector.h:85
 AliFlowVector.h:86
 AliFlowVector.h:87
 AliFlowVector.h:88
 AliFlowVector.h:89
 AliFlowVector.h:90
 AliFlowVector.h:91