36 |
|
m_btag_jetProbability=0; |
37 |
|
m_JEC_uncertainty=0; |
38 |
|
m_JEC_factor_raw=0; |
39 |
< |
m_genjet_pt=0; |
40 |
< |
m_genjet_eta=0; |
41 |
< |
m_genjet_phi=0; |
42 |
< |
m_genjet_energy=0; |
39 |
> |
m_genjet_index=-1; |
40 |
|
m_genparticles_indices.clear(); |
41 |
< |
m_pfconstituents.clear(); |
41 |
> |
m_pfconstituents_indices.clear(); |
42 |
> |
m_genjet=NULL; |
43 |
|
}; |
44 |
|
|
45 |
|
~Jet(){ |
46 |
|
}; |
47 |
|
|
48 |
|
LorentzVector genjet_v4() const{ |
49 |
< |
LorentzVector v4; |
50 |
< |
v4.SetPt(m_genjet_pt); |
53 |
< |
v4.SetEta(m_genjet_eta); |
54 |
< |
v4.SetPhi(m_genjet_phi); |
55 |
< |
v4.SetE(m_genjet_energy); |
56 |
< |
return v4; |
49 |
> |
|
50 |
> |
return genjet().v4(); |
51 |
|
}; |
52 |
|
|
53 |
< |
std::vector<Particle> pfconstituents() const{return m_pfconstituents;} |
53 |
> |
Particle genjet() const{ |
54 |
> |
if(m_genjet) |
55 |
> |
return *m_genjet; |
56 |
> |
else{ |
57 |
> |
//return 0 particle |
58 |
> |
Particle p; |
59 |
> |
return p; |
60 |
> |
} |
61 |
> |
}; |
62 |
> |
|
63 |
> |
std::vector<unsigned int> pfconstituents_indices() const{return m_pfconstituents_indices;} |
64 |
|
|
65 |
< |
void add_pfconstituents(Particle p){m_pfconstituents.push_back(p);} |
65 |
> |
void add_pfconstituents_index(int ind){m_pfconstituents_indices.push_back(ind);} |
66 |
|
|
67 |
|
int nTracks() const{return m_nTracks;} |
68 |
|
float jetArea() const{return m_jetArea;} |
87 |
|
float btag_jetProbability() const{return m_btag_jetProbability;} |
88 |
|
float JEC_uncertainty() const{return m_JEC_uncertainty;} |
89 |
|
float JEC_factor_raw() const{return m_JEC_factor_raw;} |
90 |
< |
float genjet_pt() const{return m_genjet_pt;} |
91 |
< |
float genjet_eta() const{return m_genjet_eta;} |
92 |
< |
float genjet_phi() const{return m_genjet_phi;} |
93 |
< |
float genjet_energy() const{return m_genjet_energy;} |
90 |
> |
float genjet_pt() const{return genjet().pt();} |
91 |
> |
float genjet_eta() const{return genjet().eta();} |
92 |
> |
float genjet_phi() const{return genjet().phi();} |
93 |
> |
float genjet_energy() const{return genjet().energy();} |
94 |
> |
float genjet_index() const{return m_genjet_index;} |
95 |
|
std::vector<unsigned int> genparticles_indices() const{return m_genparticles_indices;} |
96 |
|
|
97 |
|
void set_nTracks(int x){m_nTracks=x;} |
117 |
|
void set_btag_jetProbability(float x){m_btag_jetProbability=x;} |
118 |
|
void set_JEC_uncertainty(float x){m_JEC_uncertainty=x;} |
119 |
|
void set_JEC_factor_raw(float x){m_JEC_factor_raw=x;} |
120 |
< |
void set_genjet_pt(float x){m_genjet_pt=x;} |
116 |
< |
void set_genjet_eta(float x){m_genjet_eta=x;} |
117 |
< |
void set_genjet_phi(float x){m_genjet_phi=x;} |
118 |
< |
void set_genjet_energy(float x){m_genjet_energy=x;} |
120 |
> |
void set_genjet_index(int x){m_genjet_index=x;} |
121 |
|
void add_genparticles_index(unsigned int x){m_genparticles_indices.push_back(x);} |
122 |
|
|
123 |
< |
bool has_genjet() const{return m_genjet_pt>0;} |
123 |
> |
bool has_genjet() const{return m_genjet_index>=0;} |
124 |
> |
|
125 |
> |
void set_genjet(std::vector<Particle>* genjets){ |
126 |
> |
if(!genjets) return; |
127 |
> |
if(m_genjet_index<0 || m_genjet_index>(int)genjets->size()) return; |
128 |
> |
m_genjet = &genjets->at(m_genjet_index); |
129 |
> |
} |
130 |
|
|
131 |
|
bool pfID(){ |
132 |
|
//pf ID has already been applied when using goodPatJets |
170 |
|
float m_btag_jetProbability; |
171 |
|
float m_JEC_uncertainty; |
172 |
|
float m_JEC_factor_raw; |
173 |
< |
float m_genjet_pt; |
174 |
< |
float m_genjet_eta; |
167 |
< |
float m_genjet_phi; |
168 |
< |
float m_genjet_energy; |
173 |
> |
int m_genjet_index; |
174 |
> |
Particle* m_genjet; |
175 |
|
|
176 |
|
std::vector<unsigned int> m_genparticles_indices; |
177 |
|
|
178 |
< |
std::vector<Particle> m_pfconstituents; |
178 |
> |
std::vector<unsigned int> m_pfconstituents_indices; |
179 |
> |
|
180 |
|
|
181 |
|
}; |
182 |
|
|