CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/RecoEgamma/EgammaElectronAlgos/src/ElectronClassification.cc

Go to the documentation of this file.
00001 #include "RecoEgamma/EgammaElectronAlgos/interface/ElectronClassification.h"
00002 
00003 #include "DataFormats/GsfTrackReco/interface/GsfTrack.h"
00004 #include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
00005 #include "DataFormats/EgammaReco/interface/SuperCluster.h"
00006 #include "DataFormats/EgammaReco/interface/BasicCluster.h"
00007 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
00008 
00009 
00010 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00011 
00012 //===================================================================
00013 // Author: Federico Ferri - INFN Milano, Bicocca university
00014 // 12/2005
00015 // See GsfElectron::Classification
00016 //===================================================================
00017 
00018 using namespace reco;
00019 
00020 void ElectronClassification::correct(GsfElectron &electron) {
00021   classify(electron);
00022   //  electron.classifyElectron(this);
00023   electron.classifyElectron(electronClass_);
00024 }
00025 
00026 void ElectronClassification::classify(const GsfElectron &electron)
00027  {
00028   electronClass_ = GsfElectron::UNKNOWN ;
00029 
00030 
00031    reco::SuperClusterRef sclRef=electron.superCluster();
00032 
00033   // use supercluster energy including f(Ncry) correction
00034   float scEnergy=sclRef->energy();
00035 
00036   // first look whether it's in crack, barrel or endcap
00037   if ((!electron.isEB())&&(!electron.isEE()))
00038    {
00039     edm::LogWarning("") << "ElectronClassification::init(): Undefined electron, eta = " <<
00040       electron.eta() << "!!!!" ;
00041     return ;
00042    }
00043 
00044   if (electron.isEBEEGap() || electron.isEBEtaGap() || electron.isEERingGap())
00045    {
00046         electronClass_ = GsfElectron::GAP ;
00047         return ;
00048    }
00049 
00050   float pin  = electron.trackMomentumAtVtx().R() ;
00051   float fbrem = electron.fbrem() ;
00052   int nbrem = electron.numberOfBrems() ;
00053 
00054   // golden
00055   if (nbrem == 0 && (pin - scEnergy)/pin < 0.1 && fbrem < 0.5) {
00056           electronClass_ = GsfElectron::GOLDEN ;
00057   }
00058   
00059   // big brem
00060   else if (nbrem == 0 && (pin - scEnergy)/pin < 0.1 && fbrem > 0.5) {
00061           electronClass_ = GsfElectron::BIGBREM ;
00062   }
00063   
00064   // showering
00065   else 
00066           electronClass_ = GsfElectron::SHOWERING ;
00067 
00068 }
00069 
00070 /*
00071 bool ElectronClassification::isInCrack(float eta) const{
00072 
00073   return (eta>1.460 && eta<1.558);
00074 
00075 }
00076 
00077 bool ElectronClassification::isInEtaGaps(float eta) const{
00078 
00079   return (eta < 0.018 ||
00080           (eta>0.423 && eta<0.461) ||
00081           (eta>0.770 && eta<0.806) ||
00082           (eta>1.127 && eta<1.163));
00083 
00084 }
00085 
00086 bool ElectronClassification::isInPhiGaps(float phi) const{
00087 
00088   return false;
00089 
00090 }
00091 */