NCFS-Pack
A generic (astro)particle physics analysis framework
 
Loading...
Searching...
No Matches
Nc3Vector.h
Go to the documentation of this file.
1#ifndef Nc3Vector_h
2#define Nc3Vector_h
3// Copyright(c) 1999 NCFS/IIHE, All Rights Reserved.
4// See cxx source for full Copyright notice.
5
6#include <math.h>
7
8#include "TObject.h"
9#include "TString.h"
10#include "TRotMatrix.h"
11
13
15{
16 public:
17 Nc3Vector(); // Default constructor
18 virtual ~Nc3Vector(); // Destructor
19 Nc3Vector(const Nc3Vector& v); // Copy constructor
20 Nc3Vector& operator=(const Nc3Vector& q); // Set equal to vector q
21 virtual void Load(Nc3Vector& q); // Load all attributes of input Nc3Vector
22 virtual void SetZero(); // (Re)set all attributes to zero.
23 void SetVector(Double_t* v,TString f,TString u="rad"); // Store vector v in frame f with ang units u
24 void SetVector(Double_t v1,Double_t v2,Double_t v3,TString f,TString u="rad"); // Store vector v
25 void GetVector(Double_t* v,TString f,TString u="rad") const; // Provide vector v in frame f in ang units u
26 void SetVector(Float_t* v,TString f,TString u="rad"); // Store vector v in frame f with ang units u
27 void GetVector(Float_t* v,TString f,TString u="rad") const; // Provide vector v in frame f in ang units u
28 void SetErrors(Double_t* e,TString f,TString u="rad"); // Store errors of vector in frame f with ang units u
29 void SetErrors(Double_t e1,Double_t e2,Double_t e3,TString f,TString u="rad"); // Store errors of vector v
30 void GetErrors(Double_t* e,TString f,TString u="rad") const; // Provide errors of vector in frame f in ang units u
31 void SetErrors(Float_t* e,TString f,TString u="rad"); // Store errors of vector in frame f with ang units u
32 void GetErrors(Float_t* e,TString f,TString u="rad") const; // Provide errors of vector in frame f in ang units u
33 virtual void Data(TString f="car",TString u="rad") const; // Print vector components in frame f in ang units u
34 Int_t HasVector() const; // Check whether vector components have been set
35 Int_t HasErrors() const; // Check whether errors on the vector components have been set
36 Double_t GetNorm(); // Provide norm of the vector
37 Double_t Dot(Nc3Vector& q); // Provide dot product with q
38 Double_t GetPseudoRapidity(); // Provide the pseudorapidity w.r.t z-axis
39 Double_t GetResultError() const; // Provide error on scalar result (e.g. norm)
40 Nc3Vector Cross(Nc3Vector& q) const; // Provide cross product with q
41 Nc3Vector operator+(Nc3Vector& q) const; // Add vector q
42 Nc3Vector operator-(Nc3Vector& q) const; // Subtract vector q
43 Nc3Vector operator*(Double_t s) const; // Multiply vector with scalar s
44 Nc3Vector operator/(Double_t s) const; // Divide vector by scalar s
45 Nc3Vector& operator+=(Nc3Vector& q); // Add vector q
46 Nc3Vector& operator-=(Nc3Vector& q); // Subtract vector q
47 Nc3Vector& operator*=(Double_t s); // Multiply with scalar s
48 Nc3Vector& operator/=(Double_t s); // Divide by scalar s
49 Nc3Vector GetVecTrans() const; // Provide transverse vector w.r.t. z-axis
50 Nc3Vector GetVecLong() const; // Provide longitudinal vector w.r.t. z-axis
51 Nc3Vector GetPrimed(TRotMatrix* m) const; // Provide vector components in a rotated frame
52 Nc3Vector GetUnprimed(TRotMatrix* m) const; // Provide original vector components from a rotated one
53 Double_t GetX(Int_t i,TString f,TString u="rad"); // Provide i-th vector component in frame f in units u
54 virtual Double_t GetOpeningAngle(Nc3Vector& q,TString u="rad"); // Provide opening angle with q in units u
55 Double_t ConvertAngle(Double_t a,TString in,TString out) const; // Angular format conversions
56 void PrintAngle(Double_t a,TString in,TString out,Int_t ndig=1,Bool_t align=kFALSE) const;// Print angle in various formats
57
58 protected:
59 Int_t fNv; // The number of components of the array fV
60 Double32_t* fV; //[fNv] Vector in spherical (and errors in Cartesian) coordinates
61 Double32_t fDresult;
62
63 ClassDef(Nc3Vector,2) // Handling of 3-vectors in various reference frames.
64};
65#endif
Nc3Vector operator*(Double_t s) const
Double_t GetX(Int_t i, TString f, TString u="rad")
Double32_t fDresult
! Error on scalar result (e.g. norm or dotproduct)
Definition Nc3Vector.h:61
void GetErrors(Double_t *e, TString f, TString u="rad") const
void SetVector(Double_t *v, TString f, TString u="rad")
Nc3Vector & operator*=(Double_t s)
virtual void Load(Nc3Vector &q)
virtual void SetZero()
Nc3Vector & operator+=(Nc3Vector &q)
Nc3Vector Cross(Nc3Vector &q) const
virtual void Data(TString f="car", TString u="rad") const
Nc3Vector operator/(Double_t s) const
Nc3Vector & operator/=(Double_t s)
Nc3Vector operator+(Nc3Vector &q) const
Nc3Vector GetVecTrans() const
Nc3Vector operator-(Nc3Vector &q) const
Nc3Vector & operator=(const Nc3Vector &q)
void SetErrors(Double_t *e, TString f, TString u="rad")
virtual Double_t GetOpeningAngle(Nc3Vector &q, TString u="rad")
Double_t Dot(Nc3Vector &q)
Double_t GetPseudoRapidity()
Int_t fNv
Definition Nc3Vector.h:59
Double_t ConvertAngle(Double_t a, TString in, TString out) const
void PrintAngle(Double_t a, TString in, TString out, Int_t ndig=1, Bool_t align=kFALSE) const
Nc3Vector GetVecLong() const
Double_t GetResultError() const
void GetVector(Double_t *v, TString f, TString u="rad") const
Double32_t * fV
Definition Nc3Vector.h:60
Int_t HasErrors() const
Nc3Vector GetPrimed(TRotMatrix *m) const
Nc3Vector & operator-=(Nc3Vector &q)
virtual ~Nc3Vector()
Int_t HasVector() const
Nc3Vector GetUnprimed(TRotMatrix *m) const
Double_t GetNorm()