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.7 by bendavid, Sun Dec 11 00:03:05 2011 UTC vs.
Revision 1.10 by bendavid, Mon Dec 19 23:45:00 2011 UTC

# Line 55 | Line 55 | MVATools::MVATools():
55    RelIsoHcal(0),
56    tIso1(0),
57    tIso3(0),
58 <  tIso2(0)
58 >  tIso2(0),
59 >  ScEta(0.)
60   {
61    // Constructor.
62   }
# Line 157 | Line 158 | void MVATools::InitializeMVA(int Variabl
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    
# Line 211 | Line 240 | Int_t MVATools::PassElectronVetoInt(cons
240    
241    isbarrel = (fabs(ScEta_MVA)<1.4442);
242  
243 <  //R9 = p->R9();
244 <  R9 = p->E33()/p->SCluster()->RawEnergy();
243 >  R9 = p->R9();
244 >  //R9 = p->E33()/p->SCluster()->RawEnergy();
245    
246    // check which category it is ...
247    _tCat = 1;
# Line 240 | Line 269 | Float_t MVATools::GetMVAbdtValue(const P
269    wVtxInd = 0;
270    
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 <  
244 <  // track iso only
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 <  
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, (!applyElectronVeto ? els : NULL) );
275    
# Line 252 | Line 278 | Float_t MVATools::GetMVAbdtValue(const P
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();
# Line 263 | Line 291 | Float_t MVATools::GetMVAbdtValue(const P
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  
# Line 281 | Line 309 | Float_t MVATools::GetMVAbdtValue(const P
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  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines