-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCHit2D.hxx
76 lines (43 loc) · 1.46 KB
/
CHit2D.hxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef CHit2D_hxx_seen
#define CHit2D_hxx_seen
#include "TROOT.h"
#include "TObject.h"
#include "TMath.h"
#include <iostream>
#include <vector>
/// The base class for a hit detector element 2D. Works like fiber map.
class CHit2D : public TObject {
public:
CHit2D() {}
virtual ~CHit2D() {}
void SetId(int id){fId=id;}
void SetConstituents(const std::vector<int>& id){
for(std::size_t i=0;i<id.size();++i){
fConstituents.push_back(id[i]);
}
}
void SetRow(double r){fRow=r;}
void SetColumn(double c){fColumn=c;}
void SetTime(double time){fTime=time;}
void SetCharge(double charge){fCharge=charge;}
void SetPlane(double plane){fPlane=plane;}
int GetId() const {return fId;}
std::vector<int> GetConstituents() const {return fConstituents;}
double GetRow() const {return fRow;}
double GetColumn() const {return fColumn;}
double GetTime() const {return fTime;}
double GetCharge()const {return fCharge;}
int GetPlane() const {return fPlane;}
bool operator==(const CHit2D& rhs) const { return this->GetId() == rhs.GetId() && this->GetPlane() == rhs.GetPlane();}
private:
int fId;
std::vector<int> fConstituents;
double fTime;
double fRow;
double fColumn;
double fCharge;
//0=YZ, 1=XZ, 2=XY
double fPlane;
ClassDef(CHit2D,1);
};
#endif