168 |
|
|
169 |
|
} |
170 |
|
|
171 |
< |
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) { |
171 |
> |
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) { |
172 |
|
|
173 |
|
//initilize the bool value |
174 |
|
PassMVA=kFALSE; |
175 |
|
|
176 |
< |
Float_t photon_bdt = MVATools::GetMVAbdtValue(p,vtx,trackCol,vtxCol, _tRho); |
176 |
> |
Float_t photon_bdt = MVATools::GetMVAbdtValue(p,vtx,trackCol,vtxCol, _tRho, els, applyElectronVeto); |
177 |
|
|
178 |
|
if (isbarrel) { |
179 |
|
if(bdt>bdtCutBarrel){ |
211 |
|
|
212 |
|
isbarrel = (fabs(ScEta_MVA)<1.4442); |
213 |
|
|
214 |
< |
R9 = p->R9(); |
214 |
> |
//R9 = p->R9(); |
215 |
> |
R9 = p->E33()/p->SCluster()->RawEnergy(); |
216 |
|
|
217 |
|
// check which category it is ... |
218 |
|
_tCat = 1; |
230 |
|
|
231 |
|
//-------------------------------------------------------------------------------------------------- |
232 |
|
|
233 |
< |
Float_t MVATools::GetMVAbdtValue(const Photon* p,const Vertex* vtx,const TrackCol* trackCol,const VertexCol* vtxCol,Double_t _tRho) { |
233 |
> |
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) { |
234 |
|
|
235 |
|
//get the variables used to compute MVA variables |
236 |
|
ecalIso3 = p->EcalRecHitIsoDr03(); |
239 |
|
|
240 |
|
wVtxInd = 0; |
241 |
|
|
242 |
< |
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? |
242 |
> |
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? |
243 |
|
|
244 |
|
// track iso only |
245 |
< |
trackIso3 = IsolationTools::CiCTrackIsolation(p,vtx, 0.3, 0.02, 0.0, 0.0, 0.1, 1.0, trackCol); |
245 |
> |
trackIso3 = IsolationTools::CiCTrackIsolation(p,vtx, 0.3, 0.02, 0.0, 0.0, 0.1, 1.0, trackCol, NULL, NULL, (!applyElectronVeto ? els : NULL) ); |
246 |
|
|
247 |
|
// track iso worst vtx |
248 |
< |
trackIso2 = IsolationTools::CiCTrackIsolation(p,vtx, 0.4, 0.02, 0.0, 0.0, 0.1, 1.0, trackCol, &wVtxInd,vtxCol); |
248 |
> |
trackIso2 = IsolationTools::CiCTrackIsolation(p,vtx, 0.4, 0.02, 0.0, 0.0, 0.1, 1.0, trackCol, &wVtxInd,vtxCol, (!applyElectronVeto ? els : NULL) ); |
249 |
|
|
250 |
|
combIso1 = ecalIso3+hcalIso4+trackIso1 - 0.17*_tRho; |
251 |
|
combIso2 = ecalIso4+hcalIso4+trackIso2 - 0.52*_tRho; |