55 |
|
RelIsoHcal(0), |
56 |
|
tIso1(0), |
57 |
|
tIso3(0), |
58 |
< |
tIso2(0) |
58 |
> |
tIso2(0), |
59 |
> |
ScEta(0.) |
60 |
|
{ |
61 |
|
// Constructor. |
62 |
|
} |
158 |
|
readers[i]->AddVariable( "RelPreshowerEnergy", &RelPreshowerEnergy ); |
159 |
|
} |
160 |
|
} |
161 |
+ |
|
162 |
+ |
if(VariableType==7){ |
163 |
+ |
readers[i]->AddVariable( "HoE", &HoE ); |
164 |
+ |
readers[i]->AddVariable( "covIEtaIEta", &covIEtaIEta ); |
165 |
+ |
readers[i]->AddVariable( "tIso1abs", &tIso1abs ); |
166 |
+ |
readers[i]->AddVariable( "tIso3abs", &tIso3abs ); |
167 |
+ |
readers[i]->AddVariable( "tIso2abs", &tIso2abs ); |
168 |
+ |
readers[i]->AddVariable( "R9", &R9 ); |
169 |
+ |
readers[i]->AddVariable( "absIsoEcal", &absIsoEcal ); |
170 |
+ |
readers[i]->AddVariable( "absIsoHcal", &absIsoHcal ); |
171 |
+ |
readers[i]->AddVariable( "NVertexes", &NVertexes ); |
172 |
+ |
readers[i]->AddVariable( "ScEta", &ScEta ); |
173 |
+ |
} |
174 |
+ |
|
175 |
+ |
if(VariableType==10){ |
176 |
+ |
readers[i]->AddVariable( "HoE", &HoE ); |
177 |
+ |
readers[i]->AddVariable( "covIEtaIEta", &covIEtaIEta ); |
178 |
+ |
readers[i]->AddVariable( "tIso1abs", &tIso1abs ); |
179 |
+ |
readers[i]->AddVariable( "tIso3abs", &tIso3abs ); |
180 |
+ |
readers[i]->AddVariable( "tIso2abs", &tIso2abs ); |
181 |
+ |
readers[i]->AddVariable( "R9", &R9 ); |
182 |
+ |
readers[i]->AddVariable( "absIsoEcal", &absIsoEcal ); |
183 |
+ |
readers[i]->AddVariable( "absIsoHcal", &absIsoHcal ); |
184 |
+ |
readers[i]->AddVariable( "NVertexes", &NVertexes ); |
185 |
+ |
readers[i]->AddVariable( "ScEta", &ScEta ); |
186 |
+ |
readers[i]->AddVariable( "EtaWidth", &EtaWidth ); |
187 |
+ |
readers[i]->AddVariable( "PhiWidth", &PhiWidth ); |
188 |
+ |
} |
189 |
|
|
190 |
|
} |
191 |
|
|
197 |
|
|
198 |
|
} |
199 |
|
|
200 |
< |
Bool_t MVATools::PassMVASelection(const Photon* p,const Vertex* vtx,const TrackCol* trackCol,const VertexCol* vtxCol,Double_t _tRho,Float_t bdtCutBarrel, Float_t bdtCutEndcap) { |
200 |
> |
Bool_t MVATools::PassMVASelection(const Photon* p,const Vertex* vtx,const TrackCol* trackCol,const VertexCol* vtxCol,Double_t _tRho,Float_t bdtCutBarrel, Float_t bdtCutEndcap, const ElectronCol* els, Bool_t applyElectronVeto) { |
201 |
|
|
202 |
|
//initilize the bool value |
203 |
|
PassMVA=kFALSE; |
204 |
|
|
205 |
< |
Float_t photon_bdt = MVATools::GetMVAbdtValue(p,vtx,trackCol,vtxCol, _tRho); |
205 |
> |
Float_t photon_bdt = MVATools::GetMVAbdtValue(p,vtx,trackCol,vtxCol, _tRho, els, applyElectronVeto); |
206 |
|
|
207 |
|
if (isbarrel) { |
208 |
|
if(bdt>bdtCutBarrel){ |
241 |
|
isbarrel = (fabs(ScEta_MVA)<1.4442); |
242 |
|
|
243 |
|
R9 = p->R9(); |
244 |
+ |
//R9 = p->E33()/p->SCluster()->RawEnergy(); |
245 |
|
|
246 |
|
// check which category it is ... |
247 |
|
_tCat = 1; |
259 |
|
|
260 |
|
//-------------------------------------------------------------------------------------------------- |
261 |
|
|
262 |
< |
Float_t MVATools::GetMVAbdtValue(const Photon* p,const Vertex* vtx,const TrackCol* trackCol,const VertexCol* vtxCol,Double_t _tRho) { |
262 |
> |
Float_t MVATools::GetMVAbdtValue(const Photon* p,const Vertex* vtx,const TrackCol* trackCol,const VertexCol* vtxCol,Double_t _tRho, const ElectronCol* els, Bool_t applyElectronVeto) { |
263 |
|
|
264 |
|
//get the variables used to compute MVA variables |
265 |
|
ecalIso3 = p->EcalRecHitIsoDr03(); |
268 |
|
|
269 |
|
wVtxInd = 0; |
270 |
|
|
271 |
< |
trackIso1 = IsolationTools::CiCTrackIsolation(p,vtx, 0.3, 0.02, 0.0, 0.0, 0.1, 1.0, trackCol);//Question Ming:whyfPV->At(0) instead of selected vertex using ranking method? |
272 |
< |
|
243 |
< |
// track iso only |
244 |
< |
trackIso3 = IsolationTools::CiCTrackIsolation(p,vtx, 0.3, 0.02, 0.0, 0.0, 0.1, 1.0, trackCol); |
245 |
< |
|
271 |
> |
trackIso1 = IsolationTools::CiCTrackIsolation(p,vtx, 0.3, 0.02, 0.0, 0.0, 0.1, 1.0, trackCol, NULL, NULL, (!applyElectronVeto ? els : NULL) );//Question Ming:whyfPV->At(0) instead of selected vertex using ranking method? |
272 |
> |
|
273 |
|
// track iso worst vtx |
274 |
< |
trackIso2 = IsolationTools::CiCTrackIsolation(p,vtx, 0.4, 0.02, 0.0, 0.0, 0.1, 1.0, trackCol, &wVtxInd,vtxCol); |
274 |
> |
trackIso2 = IsolationTools::CiCTrackIsolation(p,vtx, 0.4, 0.02, 0.0, 0.0, 0.1, 1.0, trackCol, &wVtxInd,vtxCol, (!applyElectronVeto ? els : NULL) ); |
275 |
|
|
276 |
|
combIso1 = ecalIso3+hcalIso4+trackIso1 - 0.17*_tRho; |
277 |
|
combIso2 = ecalIso4+hcalIso4+trackIso2 - 0.52*_tRho; |
278 |
|
|
279 |
|
RawEnergy = p->SCluster()->RawEnergy(); |
280 |
|
|
281 |
+ |
ScEta = p->SCluster()->Eta(); |
282 |
+ |
|
283 |
|
//mva varialbes v1 and v2 |
284 |
|
tIso1 = (combIso1) *50./p->Et(); |
285 |
< |
tIso3 = (trackIso3)*50./p->Et(); |
285 |
> |
tIso3 = (trackIso1)*50./p->Et(); |
286 |
|
tIso2 = (combIso2) *50./(p->MomVtx(vtxCol->At(wVtxInd)->Position()).Pt()); |
287 |
|
RelIsoEcal=(ecalIso3-0.17*_tRho)/p->Et(); |
288 |
|
RelIsoHcal=(hcalIso4-0.17*_tRho)/p->Et(); |
291 |
|
HoE = p->HadOverEm(); |
292 |
|
covIEtaIEta = p->CoviEtaiEta(); |
293 |
|
tIso1abs = combIso1; |
294 |
< |
tIso3abs = trackIso3; |
294 |
> |
tIso3abs = trackIso1; |
295 |
|
tIso2abs = combIso2; |
296 |
|
R9 = p->R9(); |
297 |
|
|
309 |
|
RelE2x5Right=p->SCluster()->Seed()->E2x5Right()/RawEnergy; |
310 |
|
RelE5x5=p->SCluster()->Seed()->E5x5()/RawEnergy; |
311 |
|
|
312 |
< |
EtaWidth=p->SCluster()->EtaWidth(); |
313 |
< |
PhiWidth=p->SCluster()->PhiWidth(); |
312 |
> |
EtaWidth=p->EtaWidth(); |
313 |
> |
PhiWidth=p->PhiWidth(); |
314 |
|
CoviEtaiPhi=p->SCluster()->Seed()->CoviEtaiPhi(); |
315 |
|
CoviPhiiPhi=p->SCluster()->Seed()->CoviPhiiPhi(); |
316 |
|
|