warning fixed
[u/mrichter/AliRoot.git] / RALICE / Ali3Vector.h
CommitLineData
d88f97cc 1#ifndef ALI3VECTOR_H
2#define ALI3VECTOR_H
3da30618 3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
f531a546 6// $Id$
3da30618 7
d88f97cc 8#include <math.h>
9
10#include "TObject.h"
11#include "TString.h"
261c0caf 12#include "TRotMatrix.h"
d88f97cc 13
14class Ali3Vector
15{
16 public:
17 Ali3Vector(); // Default constructor
18 virtual ~Ali3Vector(); // Destructor
c72198f1 19 Ali3Vector(const Ali3Vector& v); // Copy constructor
1fbffa23 20 virtual void Load(Ali3Vector& q); // Load all attributes of input Ali3Vector
c72198f1 21 virtual void SetZero(); // (Re)set all attributes to zero.
1f241680 22 void SetVector(Double_t* v,TString f,TString u="rad"); // Store vector v in frame f with ang units u
23 void GetVector(Double_t* v,TString f,TString u="rad") const; // Provide vector v in frame f in ang units u
24 void SetVector(Float_t* v,TString f,TString u="rad"); // Store vector v in frame f with ang units u
25 void GetVector(Float_t* v,TString f,TString u="rad") const; // Provide vector v in frame f in ang units u
26 void SetErrors(Double_t* e,TString f,TString u="rad"); // Store errors of vector in frame f with ang units u
27 void GetErrors(Double_t* e,TString f,TString u="rad") const; // Provide errors of vector in frame f in ang units u
28 void SetErrors(Float_t* e,TString f,TString u="rad"); // Store errors of vector in frame f with ang units u
29 void GetErrors(Float_t* e,TString f,TString u="rad") const; // Provide errors of vector in frame f in ang units u
30 virtual void Data(TString f="car",TString u="rad") const; // Print vector components in frame f in ang units u
d88f97cc 31 Double_t GetNorm(); // Provide norm of the vector
32 Double_t Dot(Ali3Vector& q); // Provide dot product with q
959fbac5 33 Double_t GetPseudoRapidity(); // Provide the pseudorapidity w.r.t z-axis
261c0caf 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
d88f97cc 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
261c0caf 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
c5555bc0 47 Ali3Vector GetUnprimed(TRotMatrix* m) const; // Provide original vector components from a rotated one
1f241680 48 Double_t GetX(Int_t i,TString f,TString u="rad"); // Provide i-th vector component in frame f in units u
49 virtual Double_t GetOpeningAngle(Ali3Vector& q,TString u="rad"); // Provide opening angle with q in units u
d88f97cc 50
51 protected:
d0120ca2 52 Double32_t fV,fTheta,fPhi; // Vector in spherical coordinates
53 Double32_t fDx,fDy,fDz; // Errors on Cartesian coordinates
54 Double32_t fDresult; //! Error on scalar result (e.g. norm or dotproduct)
d88f97cc 55
d0120ca2 56 ClassDef(Ali3Vector,11) // Handling of 3-vectors in various reference frames.
d88f97cc 57};
58#endif