3 |
|
|
4 |
|
#include <string> |
5 |
|
#include <iostream> |
6 |
+ |
#include <vector> |
7 |
+ |
#include <map> |
8 |
+ |
#include <cmath> |
9 |
|
|
10 |
|
#include "Rtypes.h" |
11 |
|
#include "TObject.h" |
17 |
|
{ |
18 |
|
|
19 |
|
public: |
20 |
< |
//TRootEvent() : nb_(0), trigL1_(-999), trigHLT_(-999), primaryVertex_(), metCalo_() {;} |
21 |
< |
TRootEvent() : nb_(0), trigL1_(-999), trigHLT_(-999), nBasicClusters_(), nSuperClusters_(), primaryVertex_(), metCalo_() {;} |
20 |
> |
|
21 |
> |
TRootEvent() : |
22 |
> |
nb_(0) |
23 |
> |
,passGlobalL1_(false) |
24 |
> |
,passGlobalHLT_(false) |
25 |
> |
,trigHLT_(0) |
26 |
> |
,csa07id_(0) |
27 |
> |
,csa07weight_(0.) |
28 |
> |
,csa07process_() |
29 |
> |
,nBasicClusters_() |
30 |
> |
,nSuperClusters_() |
31 |
> |
,primaryVertex_(0) |
32 |
> |
,metCalo_() |
33 |
> |
{;} |
34 |
> |
|
35 |
|
~TRootEvent() {;} |
36 |
|
|
37 |
|
// Event number |
38 |
< |
Int_t nb() { return nb_; } |
38 |
> |
Int_t nb() const { return nb_; } |
39 |
|
|
40 |
|
// Trigger decision |
41 |
< |
Int_t trigL1() { return trigL1_; } |
42 |
< |
Int_t trigHLT() { return trigHLT_; } |
41 |
> |
Int_t passGlobalL1() const { return passGlobalL1_; } |
42 |
> |
Bool_t passGlobalHLT() const { return passGlobalHLT_; } |
43 |
> |
unsigned int nHLTPaths() const { return trigHLT_.size(); } |
44 |
> |
std::vector<Bool_t> trigHLT() const { return trigHLT_; } |
45 |
> |
Bool_t trigHLT(unsigned int i) const |
46 |
> |
{ |
47 |
> |
if (trigHLT_.size()>i) |
48 |
> |
{ |
49 |
> |
return trigHLT_.at(i); |
50 |
> |
} |
51 |
> |
else |
52 |
> |
{ |
53 |
> |
cout << "HLT path " << i << " not found" << endl; |
54 |
> |
return false; |
55 |
> |
} |
56 |
> |
} |
57 |
|
|
58 |
+ |
// CSA07 Process Id and Event Weight |
59 |
+ |
Int_t csa07id() const { return csa07id_; } |
60 |
+ |
Float_t csa07weight() const { return csa07weight_; } |
61 |
+ |
TString csa07process() const { return csa07process_; } |
62 |
+ |
|
63 |
|
// Nb of primary vertices |
64 |
< |
unsigned nPrimaryVertices() { return primaryVertex_.size(); } |
64 |
> |
unsigned nPrimaryVertices() const { return primaryVertex_.size(); } |
65 |
|
|
66 |
|
// Nb of BasicClusters of a given type |
67 |
|
Int_t nBasicClusters(Int_t type) |
79 |
|
|
80 |
|
|
81 |
|
// Primary Vertex as 3-vector |
82 |
< |
TVector3 primaryVertex() { return (primaryVertex_.size()>=0 ? primaryVertex_[0] : TVector3(0.,0.,0.) ); } |
83 |
< |
TVector3 primaryVertex(unsigned i) { return (primaryVertex_.size()>=i ? primaryVertex_[i] : TVector3(0.,0.,0.) ); } |
82 |
> |
TVector3 primaryVertex() const { return (primaryVertex_.size()>0 ? primaryVertex_.at(0) : TVector3(0.,0.,0.) ); } |
83 |
> |
TVector3 primaryVertex(unsigned i) const { return (primaryVertex_.size()>i ? primaryVertex_.at(i) : TVector3(0.,0.,0.) ); } |
84 |
|
// x, y, z of Primary Vertex |
85 |
< |
Double_t primaryVertex_x() { return (primaryVertex_.size()>=0 ? primaryVertex_[0].x() : 0. ); } |
86 |
< |
Double_t primaryVertex_y() { return (primaryVertex_.size()>=0 ? primaryVertex_[0].y() : 0. ); } |
87 |
< |
Double_t primaryVertex_z() { return (primaryVertex_.size()>=0 ? primaryVertex_[0].z() : 0. ); } |
88 |
< |
Double_t primaryVertex_x(unsigned i) { return (primaryVertex_.size()>=i ? primaryVertex_[i].x() : 0. ); } |
89 |
< |
Double_t primaryVertex_y(unsigned i) { return (primaryVertex_.size()>=i ? primaryVertex_[i].x() : 0. ); } |
90 |
< |
Double_t primaryVertex_z(unsigned i) { return (primaryVertex_.size()>=i ? primaryVertex_[i].x() : 0. ); } |
85 |
> |
Double_t primaryVertex_x() const { return (primaryVertex_.size()>0 ? primaryVertex_.at(0).x() : 0. ); } |
86 |
> |
Double_t primaryVertex_y() const { return (primaryVertex_.size()>0 ? primaryVertex_.at(0).y() : 0. ); } |
87 |
> |
Double_t primaryVertex_z() const { return (primaryVertex_.size()>0 ? primaryVertex_.at(0).z() : 0. ); } |
88 |
> |
Double_t primaryVertex_x(unsigned i) const { return (primaryVertex_.size()>i ? primaryVertex_.at(i).x() : 0. ); } |
89 |
> |
Double_t primaryVertex_y(unsigned i) const { return (primaryVertex_.size()>i ? primaryVertex_.at(i).x() : 0. ); } |
90 |
> |
Double_t primaryVertex_z(unsigned i) const { return (primaryVertex_.size()>i ? primaryVertex_.at(i).x() : 0. ); } |
91 |
|
|
92 |
|
// Missing Et as 3-vector |
93 |
< |
TVector3 metCaloVect() { return metCalo_; } |
93 |
> |
TVector3 metCaloVect() const { return metCalo_; } |
94 |
|
// Missing Et magnitude |
95 |
< |
Double_t metCalo() { return sqrt(metCalo_.Perp2()); } |
95 |
> |
Double_t metCalo() const { return sqrt(metCalo_.Perp2()); } |
96 |
|
|
97 |
|
|
98 |
|
void setNb(Int_t nb) { nb_ = nb; } |
99 |
< |
void setTrigL1(Int_t trigL1) { trigL1_ = trigL1; } |
100 |
< |
void setTrigHLT(Int_t trigHLT) { trigHLT_ = trigHLT; } |
99 |
> |
void setGlobalL1(Int_t passGlobalL1) { passGlobalL1_ = passGlobalL1; } |
100 |
> |
void setGlobalHLT(Bool_t passGlobalHLT) { passGlobalHLT_ = passGlobalHLT; } |
101 |
> |
void setTrigHLT(std::vector<Bool_t> trigHLT) |
102 |
> |
{ |
103 |
> |
trigHLT_.resize(trigHLT.size()); |
104 |
> |
for (unsigned int i=0; i!=trigHLT.size(); ++i) trigHLT_[i]=trigHLT[i]; |
105 |
> |
} |
106 |
> |
|
107 |
> |
void setCsa07id(Int_t csa07id) { csa07id_=csa07id; } |
108 |
> |
void setCsa07weight(Float_t csa07weight) { csa07weight_=csa07weight; } |
109 |
> |
void setCsa07process(TString csa07process) { csa07process_=csa07process; } |
110 |
> |
void setCsa07process(char* csa07process) { csa07process_=csa07process; } |
111 |
|
|
112 |
|
void setNBasicClusters(Int_t type,Int_t nBC) { nBasicClusters_[type]=nBC; } |
113 |
|
void setNSuperClusters(Int_t type,Int_t nSC) { nSuperClusters_[type]=nSC; } |
114 |
|
|
115 |
|
void addPrimaryVertex(TVector3 vertex) { primaryVertex_.push_back(vertex); } |
116 |
|
void clearPrimaryVertex(TVector3 vertex) { primaryVertex_.clear(); } |
72 |
– |
//void setPrimaryVertexVect(TVector3 primaryVertex) { primaryVertex_ = primaryVertex; } |
117 |
|
void setMetCaloVect(TVector3 metCaloVect) { metCalo_ = metCaloVect; } |
118 |
|
|
119 |
|
/* |
126 |
|
*/ |
127 |
|
|
128 |
|
private: |
129 |
< |
|
129 |
> |
|
130 |
|
Int_t nb_; |
131 |
< |
Int_t trigL1_; |
132 |
< |
Int_t trigHLT_; |
131 |
> |
Bool_t passGlobalL1_; |
132 |
> |
Bool_t passGlobalHLT_; |
133 |
> |
std::vector<Bool_t> trigHLT_; |
134 |
> |
|
135 |
> |
Int_t csa07id_; |
136 |
> |
Float_t csa07weight_; |
137 |
> |
TString csa07process_; |
138 |
|
|
139 |
|
map<Int_t,Int_t> nBasicClusters_; |
140 |
|
map<Int_t,Int_t> nSuperClusters_; |
141 |
|
std::vector<TVector3> primaryVertex_; |
93 |
– |
//TVector3 primaryVertex_; |
142 |
|
|
95 |
– |
|
143 |
|
TVector3 metCalo_; |
97 |
– |
// TODO - Add Global variables: Sphericity, F-W momenta.... |
144 |
|
|
145 |
< |
ClassDef (TRootEvent,1); |
145 |
> |
ClassDef (TRootEvent,2); |
146 |
|
}; |
147 |
|
|
148 |
|
#endif |