-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVsdBase.h
204 lines (169 loc) · 5.54 KB
/
VsdBase.h
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
#ifndef VsdBase_h
#define VsdBase_h
#include "nlohmann/json.hpp"
#include "TStyle.h"
#include "Rtypes.h"
#include "TTree.h"
class VsdProvider;
// VsdProvider *g_provider = nullptr;
/////////////////////////////////////////////////
class VsdBase
{
public:
virtual ~VsdBase(){}
virtual void dump() { printf("dump VSD Base class\n"); }
};
/////////////////////////////////////////////////
class VsdVertex : public VsdBase
{
public:
//ROOT::Math::Polar3DPoint location;
float m_x;
float m_y;
float m_z;
double m_error[3][3];
public:
VsdVertex() = default;
VsdVertex &operator=(const VsdVertex &) = default;
VsdVertex(float ix, float iy, float iz)
{
m_x = ix;
m_y = iy;
m_z = iz;
for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++)
m_error[i][j] = 0;
}
virtual ~VsdVertex(){}
void dump() { printf("VsdVertex x:%.2f, y:%.2f, z:%.2f \n", m_x, m_y,m_z); }
float x() const { return m_x; }
float y() const { return m_y; }
float z() const { return m_z; }
void setX(float x) {m_x = x;}
void setY(float x) {m_y = x;}
void setZ(float x) {m_z = x;}
void setErr(int i, int j, double val) { m_error[i][j] = val; }
float getErr(int i, int j) { return m_error[i][j];}
};
/////////////////////////////////////////////////
class VsdCandidate : public VsdBase
{
// protected:
public:
// ROOT::Math::Polar3DPoint momentum;
float m_eta{0.f}; float m_phi{0.f}; float m_pt{0.f};
float m_posX{0.f}; float m_posY{0.f}; float m_posZ{0.f};
int m_charge{0};
public:
VsdCandidate() = default;
VsdCandidate& operator=(const VsdCandidate&) = default;
VsdCandidate(float ipt, float ieta, float iphi, int charge = 0) :
m_pt(ipt), m_eta(ieta), m_phi(iphi), m_charge(charge) {}
virtual ~VsdCandidate(){}
float phi() const { return m_phi; }
float eta() const { return m_eta; }
float pt() const { return m_pt; }
float charge() const { return m_charge; }
float posX() const { return m_posX;}
float posY() const { return m_posY;}
float posZ() const { return m_posZ;}
void setPt(float x) { m_pt = x;}
void setEta(float x) { m_eta = x;}
void setPhi(float x) { m_phi = x;}
void setCharge(float x) { m_charge = x;}
void setPos(float ix, float iy, float iz) {m_posX = ix, m_posY = iy, m_posZ = iz;}
void dump() { printf("VsdCanidate pt = %f, charge = %d \n", m_pt, m_charge); }
};
/////////////////////////////////////////////////
// Simple class to separate the purpose of calorimiter
// tower visualization.
class VsdCaloTower : public VsdCandidate
{
public:
VsdCaloTower() = default;
VsdCaloTower& operator=(const VsdCaloTower&) = default;
VsdCaloTower(float pt, float eta, float phi) : VsdCandidate(pt, eta, phi){}
};
/////////////////////////////////////////////////
class VsdJet : public VsdCandidate
{
// private:
public:
float m_hadFraction{0.f};
float m_coneR{0.2f}; // cone radius in eta phi space
public:
VsdJet() = default;
VsdJet& operator=(const VsdJet&) = default;
VsdJet(float pt, float eta, float phi, int charge, float had_fraction, float coneR = 0.2) :
VsdCandidate(pt, eta, phi, charge), m_hadFraction(had_fraction), m_coneR(coneR) {}
virtual ~VsdJet(){}
float hadFraction() const { return m_hadFraction; }
float coneR() const { return m_coneR; }
using VsdBase::dump;
void dump() { printf("VsdJet pt:%.2f, eta:%.2f, phi:%.2f / had_frac: %.2f\n", m_pt, m_eta, m_phi, m_hadFraction); }
};
/////////////////////////////////////////////////
class VsdMuon : public VsdCandidate
{
bool m_global{false};
public:
float global() const { return m_global; }
void setGlobal(bool x) { m_global = x; }
VsdMuon() = default;
VsdMuon& operator=(const VsdMuon&) = default;
virtual ~VsdMuon(){}
VsdMuon(float pt, float eta, float phi, int charge=0, bool global=false) : VsdCandidate(pt, eta, phi, charge), m_global(global) {}
};
////////////////////////////////////////////////
class VsdMET : public VsdCandidate
{
public:
float m_sumEt{0.f};
public:
VsdMET() = default;
VsdMET& operator=(const VsdMET&) = default;
VsdMET(float pt, float eta, float phi, float sumEt) : VsdCandidate(pt, eta, phi), m_sumEt(sumEt) {}
virtual ~VsdMET(){}
float sumEt() { return m_sumEt; }
void setSumEt(float x) { m_sumEt = x;}
using VsdBase::dump;
void dump() { printf("VsdMET: phi: 2f, sumEt:%.2f / pt: %.2f\n", m_phi, m_sumEt); }
};
////////////////////////////////////////////////
class VsdEventInfo : public VsdBase
{
uint m_run{99};
uint m_lumi{99};
Long64_t m_event{99};
public:
VsdEventInfo() = default;
VsdEventInfo& operator=(const VsdEventInfo&) = default;
VsdEventInfo(uint r, uint l, long e) {m_run = r; m_lumi=l; m_event=e; }
uint run() {return m_run;}
uint lumi() {return m_lumi;}
Long64_t event() {return m_event;}
using VsdBase::dump;
void dump() { printf("run %d lumi %d event %lld \n", m_run, m_lumi, m_event);}
};
/////////////////////////////////////////////////
// Event structs
/////////////////////////////////////////////////
//typedef std::vector<VsdBase *> VsdCollection;
class VsdCollection
{
public:
VsdCollection(const std::string &n, const std::string &p, Color_t c = kBlue, std::string f = "") : m_name(n), m_type(p), m_color(c), m_filter(f) {
m_purpose = m_type;
}
VsdCollection() {}
virtual ~VsdCollection() {}
std::string m_name;
std::string m_purpose;
std::string m_type;
Color_t m_color{kBlue};
std::string m_filter;
std::string m_varConfig;
std::vector<VsdBase *> m_list;
virtual void fill() {}
};
#endif // #ifdef VsdBase