NCFS-Pack
A generic (astro)particle physics analysis framework
 
Loading...
Searching...
No Matches
Nc4Vector.h
Go to the documentation of this file.
1#ifndef Nc4Vector_h
2#define Nc4Vector_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 "Nc3Vector.h"
9#include "NcSignal.h"
10
12
14{
15 public:
16 Nc4Vector(); // Default constructor for contravariant vector
17 virtual ~Nc4Vector(); // Destructor
18 Nc4Vector(const Nc4Vector& v); // Copy constructor
19 Nc4Vector& operator=(const Nc4Vector& q); // Set equal to vector q
20 virtual void Load(Nc4Vector& q); // Load all attributes of input Nc4Vector
21 virtual void SetZero(); // (Re)set all attributes to zero
22 void SetVector(Double_t v0,Nc3Vector& v); // Store contravariant vector
23 void SetVector(Double_t* v,TString f,TString u="rad"); // Store contravariant vector v^i in frame f with ang units u
24 void SetVector(Double_t v0,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"); // Provide contravariant vector v^i in frame f in ang units u
26 void SetVector(Float_t* v,TString f,TString u="rad"); // Store contravariant vector v^i in frame f with ang units u
27 void GetVector(Float_t* v,TString f,TString u="rad"); // Provide contravariant vector v^i in frame f in ang units u
28 void SetScalar(Double_t v0,Double_t dv0=0); // Set the scalar part (with error) of v
29 void SetScalarError(Double_t dv0); // Set error on the scalar part of v
30 Double_t GetScalar(); // Provide the scalar part of v
31 void Set3Vector(Nc3Vector& v); // Set the 3-vector part of v
32 void Set3Vector(Double_t* v,TString f,TString u="rad"); // Set the 3-vector part of v in frame f with ang units u
33 void Set3Vector(Float_t* v,TString f,TString u="rad"); // Set the 3-vector part of v in frame f with ang units u
34 void Set3Vector(Double_t v1,Double_t v2,Double_t v3,TString f,TString u="rad"); // Set 3-vector part of v
35 Nc3Vector Get3Vector() const; // Provide the 3-vector part of v
36 void SetInvariant(Double_t v2,Double_t dv2=0); // Set the Lorentz invariant (with error)
37 void SetInvariantError(Double_t dv2); // Set error on the Lorentz invariant
38 Double_t GetInvariant(); // Provide the Lorentz invariant
39 Int_t HasVector() const; // Check whether the 3-vector components have been set
40 Int_t HasErrors() const; // Check whether errors on the 3-vector components have been set
41 void SetErrors(Double_t* v,TString f,TString u="rad"); // Store errors of vector v^i in frame f with ang units u
42 void SetErrors(Double_t e0,Double_t e1,Double_t e2,Double_t e3,TString f,TString u="rad"); // Store errors of vector v
43 void GetErrors(Double_t* v,TString f,TString u="rad"); // Provide errors of vector v^i in frame f in ang units u
44 void SetErrors(Float_t* v,TString f,TString u="rad"); // Store errors of vector v^i in frame f with ang units u
45 void GetErrors(Float_t* v,TString f,TString u="rad"); // Provide errors of vector v^i in frame f in ang units u
46 virtual void Data(TString f="car",TString u="rad"); // Print contravariant components in frame f in ang units u
47 Double_t Dot(Nc4Vector& q); // Provide dot product v^i*q_i
48 Double_t GetResultError() const; // Provide error on scalar result (e.g. Dot)
49 Nc4Vector operator+(Nc4Vector& q); // Add contravariant vector q
50 Nc4Vector operator-(Nc4Vector& q); // Subtract contravariant vector q
51 Nc4Vector operator*(Double_t s); // Multiply contravariant vector with scalar s
52 Nc4Vector operator/(Double_t s); // Divide contravariant vector by scalar s
53 Nc4Vector& operator+=(Nc4Vector& q); // Add contravariant vector q
54 Nc4Vector& operator-=(Nc4Vector& q); // Subtract contravariant vector q
55 Nc4Vector& operator*=(Double_t s); // Multiply with scalar s
56 Nc4Vector& operator/=(Double_t s); // Divide by scalar s
57 Int_t GetScalarFlag() const; // Provide the fScalar flag value
58 Nc3Vector GetVecTrans() const; // Provide transverse vector part w.r.t. z-axis
59 Nc3Vector GetVecLong() const; // Provide longitudinal vector part w.r.t. z-axis
60 Double_t GetPseudoRapidity(); // Provide pseudorapidity of vector part w.r.t z-axis
61 Nc3Vector GetBetaVector() const; // Provide the beta 3-vector
62 Double_t GetBeta(); // Provide the norm of the beta 3-vector, i.e. v/c
63 Double_t GetGamma(); // Provide the Lorentz gamma factor
64 Double_t GetX(Int_t i,TString f,TString u="rad"); // Provide i-th vector component in frame f in units u
65 virtual Double_t GetOpeningAngle(Nc4Vector& q,TString u="rad"); // Opening angle between 3-vector parts in units u
66 virtual Double_t GetOpeningAngle(Nc3Vector& q,TString u="rad"); // Opening angle with 3-vector q in units u
67 void SetUserData(NcSignal* s); // Enter the object containing the user data
69 NcSignal* GetUserData() const; // Provide pointer to the object containing the user data
70
71 protected:
72 Double32_t fV2; // The Lorentz invariant (v^i*v_i)
73 Double32_t fV0; // The scalar part
74 Nc3Vector fV; // The 3-vector part
75 Double32_t fDv2; // The error on the Lorentz invariant
76 Double32_t fDv0; // The error on the scalar part
77 Double32_t fDresult;
78 Int_t fScalar; // Flag denoting scalar mode
79 Double_t GetScaTrans(); // Provide "transverse value" of scalar part w.r.t. z-axis
80 Double_t GetScaLong(); // Provide "longitudinal value" of scalar part w.r.t. z-axis
81 NcSignal* fUser; // NcSignal object containing user data
82
83 ClassDef(Nc4Vector,3) // Handling of Lorentz 4-vectors in various reference frames.
84};
85#endif
Handling of 3-vectors in various reference frames.
Definition Nc3Vector.h:15
Double32_t fV2
Definition Nc4Vector.h:72
Double_t GetPseudoRapidity()
void SetInvariant(Double_t v2, Double_t dv2=0)
Nc4Vector & operator-=(Nc4Vector &q)
Double_t GetScaTrans()
Int_t HasErrors() const
Nc4Vector operator*(Double_t s)
void SetScalar(Double_t v0, Double_t dv0=0)
Nc4Vector operator+(Nc4Vector &q)
virtual void SetZero()
Double_t GetX(Int_t i, TString f, TString u="rad")
Nc4Vector & operator=(const Nc4Vector &q)
Nc3Vector GetBetaVector() const
Double_t Dot(Nc4Vector &q)
Int_t fScalar
Definition Nc4Vector.h:78
virtual Double_t GetOpeningAngle(Nc4Vector &q, TString u="rad")
virtual ~Nc4Vector()
virtual void Load(Nc4Vector &q)
Double_t GetScaLong()
Nc4Vector operator/(Double_t s)
void SetUserData(NcSignal *s)
void SetVector(Double_t v0, Nc3Vector &v)
Nc3Vector GetVecLong() const
Double_t GetGamma()
Double32_t fDv0
Definition Nc4Vector.h:76
NcSignal * fUser
Definition Nc4Vector.h:81
Double_t GetResultError() const
void SetErrors(Double_t *v, TString f, TString u="rad")
Nc4Vector & operator+=(Nc4Vector &q)
Double_t GetInvariant()
Int_t GetScalarFlag() const
void GetVector(Double_t *v, TString f, TString u="rad")
Double_t GetBeta()
virtual void Data(TString f="car", TString u="rad")
void SetUserData(NcSignal &s)
Definition Nc4Vector.h:68
Nc4Vector operator-(Nc4Vector &q)
void Set3Vector(Nc3Vector &v)
Double32_t fV0
Definition Nc4Vector.h:73
void GetErrors(Double_t *v, TString f, TString u="rad")
Nc4Vector & operator/=(Double_t s)
Double_t GetScalar()
Int_t HasVector() const
Nc3Vector GetVecTrans() const
Nc3Vector Get3Vector() const
Nc4Vector & operator*=(Double_t s)
Nc3Vector fV
Definition Nc4Vector.h:74
NcSignal * GetUserData() const
Double32_t fDv2
Definition Nc4Vector.h:75
void SetInvariantError(Double_t dv2)
void SetScalarError(Double_t dv0)
Double32_t fDresult
! The error on the scalar result of an operation (e.g. dotproduct)
Definition Nc4Vector.h:77
Generic handling of (extrapolated) detector signals.
Definition NcSignal.h:23