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.18 by fabstoec, Thu Aug 2 13:57:32 2012 UTC vs.
Revision 1.21 by mingyang, Tue Jul 30 21:08:50 2013 UTC

# Line 198 | Line 198 | void MVATools::InitializeMVA(MVATools::I
198      mvaVarMapEE.insert( std::pair<std::string,unsigned int> ( varNames[mvaVars.size() - 1], mvaVars.size() - 1) );
199  
200      break;
201 +
202 +  case k2013FinalIdMVA:
203 +    
204 +    EndcapWeights =      (gSystem->Getenv("CMSSW_BASE")+
205 +                          TString("/src/MitPhysics/data/")+
206 +                          TString("2013FinalPaper_PhotonID_Endcap_BDT_TrainRangePT15.")+
207 +                          TString("weights.xml"));
208 +    BarrelWeights =      (gSystem->Getenv("CMSSW_BASE")+
209 +                          TString("/src/MitPhysics/data/")+
210 +                          TString("2013FinalPaper_PhotonID_Barrel_BDT_TrainRangePT15.")+
211 +                          TString("weights.xml"));
212 +
213 +    mvaVars.resize(13);
214 +    varNames.push_back("ph.scrawe"                    );
215 +    varNames.push_back("ph.r9"                        );
216 +    varNames.push_back("ph.sigietaieta"               );
217 +    varNames.push_back("ph.scetawidth"                );
218 +    varNames.push_back("ph.scphiwidth"                );
219 +    varNames.push_back("ph.idmva_CoviEtaiPhi"         );
220 +    varNames.push_back("ph.idmva_s4ratio"             );
221 +    varNames.push_back("ph.idmva_GammaIso"            );
222 +    varNames.push_back("ph.idmva_ChargedIso_selvtx"   );
223 +    varNames.push_back("ph.idmva_ChargedIso_worstvtx" );
224 +    varNames.push_back("ph.sceta"                     );
225 +    varNames.push_back("rho"                          );
226 +    varNames.push_back("ph.idmva_PsEffWidthSigmaRR"   );
227 +
228 +    for( unsigned int iV = 0; iV < mvaVars.size() - 1; ++iV) {
229 +      mvaVarMapEB.insert(  std::pair<std::string,unsigned int>(varNames[iV], iV) );
230 +      mvaVarMapEE.insert(  std::pair<std::string,unsigned int>(varNames[iV], iV) );
231 +    }
232 +    
233 +    // pre-shower only used for Endcaps
234 +    mvaVarMapEE.insert( std::pair<std::string,unsigned int> ( varNames[mvaVars.size() - 1], mvaVars.size() - 1) );
235 +
236 +    break;
237      
238    default:
239      // no variables... better never called..
# Line 467 | Line 503 | Double_t MVATools::GetMVAbdtValue(const
503    // check if it's a Barrel or EE photon
504    bool isBarrel = ( p->SCluster()->AbsEta() < 1.5 );
505  
506 <  std::map<std::string,unsigned int>* theVars = ( isBarrel ? &mvaVarMapEB : &mvaVarMapEB );  
506 >  std::map<std::string,unsigned int>* theVars = ( isBarrel ? &mvaVarMapEB : &mvaVarMapEE );  
507    
508    // loop over all the variables in the map... and keep count (to make sure we have filled all variables)
509    unsigned int varCounter = 0;
# Line 561 | Line 597 | Double_t MVATools::GetMVAbdtValue(const
597                 !theVarName.CompareTo("ph.idmva_s4ratio") || !theVarName.CompareTo("s4r")
598                 ) {
599        (*theVarValue) = p->S4Ratio();
600 +      //(*theVarValue) = p->SCluster()->Seed()->E2x2()/p->E55();
601        varCounter++;
602      } else if (
603                 !theVarName.CompareTo("ph.idmva_GammaIso") || !theVarName.CompareTo("pfgiso")
# Line 584 | Line 621 | Double_t MVATools::GetMVAbdtValue(const
621        (*theVarValue) = p->EffSigmaRR();
622        varCounter++;
623      } else if (
624 <               !theVarName.CompareTo("rawe")
624 >               !theVarName.CompareTo("rawe")|| !theVarName.CompareTo("ph.scrawe")
625                 ) {
626        (*theVarValue) = p->SCluster()->RawEnergy();
627        varCounter++;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines