]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RALICE/Ali3Vector.h
16-feb-2005 NvE Support for user selectable split level and buffer size of the output...
[u/mrichter/AliRoot.git] / RALICE / Ali3Vector.h
1 #ifndef ALI3VECTOR_H
2 #define ALI3VECTOR_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 // $Id$
7
8 #include <math.h>
9  
10 #include "TObject.h"
11 #include "TString.h"
12 #include "TRotMatrix.h"
13  
14 class Ali3Vector
15 {
16  public:
17   Ali3Vector();                                  // Default constructor
18   virtual ~Ali3Vector();                         // Destructor
19   Ali3Vector(const Ali3Vector& v);               // Copy constructor
20   virtual void Load(Ali3Vector& q);              // Load all attributes of input Ali3Vector
21   virtual void SetZero();                        // (Re)set all attributes to zero.
22   void SetVector(Double_t* v,TString f);         // Store vector v in frame f
23   void GetVector(Double_t* v,TString f) const;   // Provide vector v in frame f
24   void SetVector(Float_t*  v,TString f);         // Store vector v in frame f
25   void GetVector(Float_t*  v,TString f) const;   // Provide vector v in frame f
26   void SetErrors(Double_t* e,TString f);         // Store errors of vector in frame f
27   void GetErrors(Double_t* e,TString f) const;   // Provide errors of vector in frame f
28   void SetErrors(Float_t*  e,TString f);         // Store errors of vector in frame f
29   void GetErrors(Float_t*  e,TString f) const;   // Provide errors of vector in frame f
30   virtual void Data(TString f="car") const;      // Print vector components in frame f
31   Double_t GetNorm();                            // Provide norm of the vector
32   Double_t Dot(Ali3Vector& q);                   // Provide dot product with q
33   Double_t GetPseudoRapidity();                  // Provide the pseudorapidity w.r.t z-axis
34   Double_t GetResultError() const;               // Provide error on scalar result (e.g. norm)
35   Ali3Vector Cross(Ali3Vector& q) const;         // Provide cross product with q
36   Ali3Vector operator+(Ali3Vector& q) const;     // Add vector q
37   Ali3Vector operator-(Ali3Vector& q) const;     // Subtract vector q
38   Ali3Vector operator*(Double_t s) const;        // Multiply vector with scalar s
39   Ali3Vector operator/(Double_t s) const;        // Divide vector by scalar s
40   Ali3Vector& operator+=(Ali3Vector& q);         // Add vector q
41   Ali3Vector& operator-=(Ali3Vector& q);         // Subtract vector q
42   Ali3Vector& operator*=(Double_t s);            // Multiply with scalar s
43   Ali3Vector& operator/=(Double_t s);            // Divide by scalar s
44   Ali3Vector GetVecTrans() const;                // Provide transverse vector w.r.t. z-axis
45   Ali3Vector GetVecLong() const;                 // Provide longitudinal vector w.r.t. z-axis
46   Ali3Vector GetPrimed(TRotMatrix* m) const;     // Provide vector components in a rotated frame
47   Ali3Vector GetUnprimed(TRotMatrix* m) const;   // Provide original vector components from a rotated one
48
49  protected:
50   Double_t fV,fTheta,fPhi;    // Vector in spherical coordinates
51   Double_t fDx,fDy,fDz;       // Errors on Cartesian coordinates
52   Double_t fDresult;          // Error on scalar result (e.g. norm or dotproduct)
53
54  ClassDef(Ali3Vector,8) // Handling of 3-vectors in various reference frames.
55 };
56 #endif