ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Utils/src/MVATools.cc
(Generate patch)

Comparing UserCode/MitPhysics/Utils/src/MVATools.cc (file contents):
Revision 1.6 by mingyang, Wed Dec 7 00:45:17 2011 UTC vs.
Revision 1.7 by bendavid, Sun Dec 11 00:03:05 2011 UTC

# Line 168 | Line 168 | void MVATools::InitializeMVA(int Variabl
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){
# Line 211 | Line 211 | Int_t MVATools::PassElectronVetoInt(cons
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;
# Line 229 | Line 230 | Int_t MVATools::PassElectronVetoInt(cons
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();
# Line 238 | Line 239 | Float_t MVATools::GetMVAbdtValue(const P
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;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines