15 bool splitBackgroundPdfs) :
22 m_eleIDSwitches (eleIDSwitches) ,
23 m_signalWeightSplitting (signalWeightSplitting),
24 m_backgroundWeightSplitting (backgroundWeightSplitting)
27 signalWeightSplitting, backgroundWeightSplitting,
28 splitSignalPdfs, splitBackgroundPdfs) ;
56 bool splitBackgroundPdfs)
65 if(signalWeightSplitting.compare(
"class")==0) {
70 throw cms::Exception(
"BadConfig") <<
"Only class (non-showering / showering)"
71 <<
" and fullclass (golden / bigbrem / narrow / showering)"
72 <<
" splitting is implemented right now";
84 if(backgroundWeightSplitting.compare(
"class")==0) {
89 throw cms::Exception(
"BadConfig") <<
"Only class (0 brem clusters / >=1 brem clusters)"
90 <<
" splitting is implemented right now";
108 if(signalWeightSplitting.compare(
"class")==0) {
113 throw cms::Exception(
"BadConfig") <<
"Only class (0 brem clusters / >=1 brem clusters)"
114 <<
" splitting is implemented right now";
126 if(backgroundWeightSplitting.compare(
"class")==0) {
131 throw cms::Exception(
"BadConfig") <<
"Only class (0 brem clusters / >=1 brem clusters)"
132 <<
" splitting is implemented right now";
151 if(signalWeightSplitting.compare(
"class")==0) {
156 throw cms::Exception(
"BadConfig") <<
"Only class (non-showering / showering)"
157 <<
" and fullclass (golden / bigbrem / narrow / showering)"
158 <<
" splitting is implemented right now";
170 if(backgroundWeightSplitting.compare(
"class")==0) {
175 throw cms::Exception(
"BadConfig") <<
"Only class (0 brem clusters / >=1 brem clusters)"
176 <<
" splitting is implemented right now";
194 if(signalWeightSplitting.compare(
"class")==0) {
199 throw cms::Exception(
"BadConfig") <<
"Only class (0 brem clusters / >=1 brem clusters)"
200 <<
" splitting is implemented right now";
212 if(backgroundWeightSplitting.compare(
"class")==0) {
217 throw cms::Exception(
"BadConfig") <<
"Only class (0 brem clusters / >=1 brem clusters)"
218 <<
" splitting is implemented right now";
236 if(signalWeightSplitting.compare(
"class")==0) {
241 throw cms::Exception(
"BadConfig") <<
"Only class (0 brem clusters / >=1 brem clusters)"
242 <<
" splitting is implemented right now";
254 if(backgroundWeightSplitting.compare(
"class")==0) {
259 throw cms::Exception(
"BadConfig") <<
"Only class (0 brem clusters / >=1 brem clusters)"
260 <<
" splitting is implemented right now";
278 if(signalWeightSplitting.compare(
"class")==0) {
283 throw cms::Exception(
"BadConfig") <<
"Only class (0 brem clusters / >=1 brem clusters)"
284 <<
" splitting is implemented right now";
296 if(backgroundWeightSplitting.compare(
"class")==0) {
301 throw cms::Exception(
"BadConfig") <<
"Only class (0 brem clusters / >=1 brem clusters)"
302 <<
" splitting is implemented right now";
323 std::vector<float> &measurements,
332 std::vector<float> vCov = myEcalCluster.localCovariances(*(electron.
superCluster()->seed())) ;
338 float OneOverEMinusOneOverP = 1.0/(electron.
eSuperClusterOverP() * trkRef->p()) - 1.0/trkRef->p();
360 std::vector<float> measurements ;
361 getInputVar (electron, measurements, myEcalCluster) ;
368 snprintf(className, 20,
"class%d", bitVal);
370 throw cms::Exception(
"BadConfig") <<
"Only class (0 brem clusters / >=1 brem clusters)"
371 <<
" splitting is implemented right now";
376 float thisPt = electron.
pt();
378 if (subdet==
EcalBarrel && fabs(electron.
eta())<=1.0 && thisPt<15.)
380 else if (subdet==
EcalBarrel && fabs(electron.
eta())<=1.0 && thisPt>=15.)
382 else if (subdet==
EcalBarrel && fabs(electron.
eta())>1.0 && thisPt<15.)
384 else if (subdet==
EcalBarrel && fabs(electron.
eta())>1.0 && thisPt>=15.)
404 std::vector<float> measurements ;
405 getInputVar (electron, measurements, myEcalCluster) ;
412 snprintf(className, 20,
"class%d", bitVal);
414 throw cms::Exception(
"BadConfig") <<
"Only class (0 brem clusters / >=1 brem clusters)"
415 <<
" splitting is implemented right now";
420 float thisPt = electron.
pt();
424 if (subdet==
EcalBarrel && fabs(electron.
eta())<=1.0 && thisPt<15.)
426 else if (subdet==
EcalBarrel && fabs(electron.
eta())<=1.0 && thisPt>=15.)
428 else if (subdet==
EcalBarrel && fabs(electron.
eta())>1.0 && thisPt<15.)
430 else if (subdet==
EcalBarrel && fabs(electron.
eta())>1.0 && thisPt>=15.)
438 if(lh<=0)
return -20.;
439 else if(lh==1)
return 20.;
440 else return log(lh/(1.0-lh));
virtual ~ElectronLikelihood()
dtor
void initFromDB(const ElectronLikelihoodCalibration *calibration)
initialize the PDFs from CondDB
float result(const reco::GsfElectron &electron, const EcalClusterLazyTools &) const
get the result of the algorithm
float eSuperClusterOverP() const
LikelihoodPdfProductPtr _EEgt15lh
LikelihoodPdfProductPtr _EB1gt15lh
void setSplitFrac(const char *specname, const char *catName, float frac=1.0)
set the fraction of one category for a given species
ElectronLikelihood()
ctor, not used for this algo (need initialization from ES)
void addSpecies(const char *name, float priorWeight=1.)
add a species (hypothesis) to the likelihood, with a priori probability
LikelihoodPdfProduct * get()
LikelihoodPdfProductPtr _EB0gt15lh
likelihood above 15GeV/c
bool m_useOneOverEMinusOneOverP
float deltaEtaSuperClusterTrackAtVtx() const
float hadronicOverEm() const
LikelihoodSwitches m_eleIDSwitches
general parameters of all the ele id algorithms
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
float deltaPhiSuperClusterTrackAtVtx() const
int numberOfBrems() const
T get() const
get a component
float resultLog(const reco::GsfElectron &electron, const EcalClusterLazyTools &) const
get the log-expanded result of the algorithm
LikelihoodPdfProductPtr _EElt15lh
void getInputVar(const reco::GsfElectron &electron, std::vector< float > &measuremnts, const EcalClusterLazyTools &) const
get the input variables from the electron and the e-Setup
std::string m_signalWeightSplitting
splitting rule for PDF's
void addPdf(const char *specname, const char *name, bool splitPdf=false)
add a pdf for a species, splitted or not
LikelihoodPdfProductPtr _EB0lt15lh
likelihood below 15GeV/c
void Setup(const ElectronLikelihoodCalibration *calibration, std::string signalWeightSplitting, std::string backgroundWeightSplitting, bool splitSignalPdfs, bool splitBackgroundPdfs)
virtual double eta() const final
momentum pseudorapidity
float getRatio(const char *specName, const std::vector< float > &measurements, const std::string &) const
get the likelihood ratio p(a priori) * L(specName) / L_tot
LikelihoodPdfProductPtr _EB1lt15lh
std::string className(const T &t)
virtual double pt() const final
transverse momentum