Neutral Particle Spectrometer analysis code
Loading...
Searching...
No Matches
THcNPSCluster.h
Go to the documentation of this file.
1#ifndef ROOT_THcNPSCluster
2#define ROOT_THcNPSCluster
3
5//
6// THcNPSCluster
7//
9
10#include "THaCluster.h"
11
12class THcNPSCluster : public THaCluster {
13 public:
16 virtual ~THcNPSCluster() = default;
17
18 virtual void Clear( Option_t* opt="" );
19 virtual void Print( Option_t* opt="" ) const;
20
21 // Coordinate transformation from detector plane to lab
22 virtual void RotateToLab(Double_t angle, TVector3& vertex, TVector3& pvect);
23
24 void AddBlock(Int_t blockID) { fBlocks.push_back(blockID); fSize = fBlocks.size(); }
25 std::vector<Int_t> GetBlocks() { return fBlocks; }
26
27 // Getter/Setter functions
28 bool HasVertex() const { return fHasVertex; }
29 Double_t E() const { return fE; }
30 Double_t T() const { return fT; }
31 Double_t GetTime() const { return fT; }
32 TVector3& GetPvect() { return fPvect; }
33 TVector3& GetVertex() { return fVertex; }
34 Double_t GetTheta() { return fPvect.Theta(); } // in lab frame
35 Double_t GetPhi() { return fPvect.Phi(); } // in lab frame
36 Double_t GetP() const { return fP; }
37 Int_t GetSize() const { return fSize; } // cluster size
38 void SetSize(Int_t nhits) { fSize = nhits; } // cluster size
39 void SetVertexFlag(bool vertex_flag) { fHasVertex = vertex_flag; }
41 void SetTime(Double_t time) { fT = time; }
42 void SetMomentum( Double_t p ) { fP = p; }
43 void SetPvect(const TVector3& pvect) { fPvect = pvect; }
45 { fVertex = vertex; fHasVertex = true; }
47 { fVertex.SetXYZ(vx, vy, vz); fHasVertex = true; }
48
49 protected:
50
51 Double_t fE; // Cluster energy deposit
52 Double_t fT; // Cluster time
53 Double_t fP; // momentum
55 TVector3 fVertex; // vertex information from other spectrometer
56 TVector3 fPvect; // momentum vector
58 Int_t fSize; // Cluster size
59
60 std::vector<Int_t> fBlocks; // Blocks
61
63
64};
65
66#endif
int Int_t
uint32_t time
#define e(i)
double Double_t
const char Option_t
#define ClassDef(name, id)
winID h TVirtualViewer3D TVirtualGLPainter p
std::vector< uint32_t > energy
Definition VTPModule.h:0
std::vector< Int_t > fBlocks
TVector3 fCenterLab
virtual void RotateToLab(Double_t angle, TVector3 &vertex, TVector3 &pvect)
Double_t E() const
void SetEnergy(Double_t energy)
TVector3 & GetPvect()
TVector3 & GetVertex()
void SetVertex(const TVector3 &vertex)
Int_t GetSize() const
void SetSize(Int_t nhits)
virtual void Print(Option_t *opt="") const
bool HasVertex() const
std::vector< Int_t > GetBlocks()
TVector3 fPvect
void SetMomentum(Double_t p)
Double_t GetPhi()
void SetVertex(Double_t vx, Double_t vy, Double_t vz)
TVector3 fVertex
virtual void Clear(Option_t *opt="")
void SetVertexFlag(bool vertex_flag)
void SetTime(Double_t time)
void AddBlock(Int_t blockID)
void SetPvect(const TVector3 &pvect)
Double_t GetTime() const
Double_t T() const
Double_t GetTheta()
virtual ~THcNPSCluster()=default
Double_t GetP() const
void SetXYZ(Double_t x, Double_t y, Double_t z)
Double_t Phi() const
Double_t Theta() const
Double_t y[n]
Double_t x[n]
double * vertex