12 std::string signalWeightSplitting,
13 std::string backgroundWeightSplitting,
15 bool splitBackgroundPdfs) :
22 m_eleIDSwitches (eleIDSwitches) ,
23 m_signalWeightSplitting (signalWeightSplitting),
24 m_backgroundWeightSplitting (backgroundWeightSplitting),
25 m_splitSignalPdfs (splitSignalPdfs),
26 m_splitBackgroundPdfs (splitBackgroundPdfs)
29 signalWeightSplitting, backgroundWeightSplitting,
30 splitSignalPdfs, splitBackgroundPdfs) ;
55 std::string signalWeightSplitting,
56 std::string backgroundWeightSplitting,
58 bool splitBackgroundPdfs)
67 if(signalWeightSplitting.compare(
"class")==0) {
72 throw cms::Exception(
"BadConfig") <<
"Only class (non-showering / showering)"
73 <<
" and fullclass (golden / bigbrem / narrow / showering)"
74 <<
" splitting is implemented right now";
86 if(backgroundWeightSplitting.compare(
"class")==0) {
91 throw cms::Exception(
"BadConfig") <<
"Only class (0 brem clusters / >=1 brem clusters)"
92 <<
" splitting is implemented right now";
110 if(signalWeightSplitting.compare(
"class")==0) {
115 throw cms::Exception(
"BadConfig") <<
"Only class (0 brem clusters / >=1 brem clusters)"
116 <<
" splitting is implemented right now";
128 if(backgroundWeightSplitting.compare(
"class")==0) {
133 throw cms::Exception(
"BadConfig") <<
"Only class (0 brem clusters / >=1 brem clusters)"
134 <<
" splitting is implemented right now";
153 if(signalWeightSplitting.compare(
"class")==0) {
158 throw cms::Exception(
"BadConfig") <<
"Only class (non-showering / showering)"
159 <<
" and fullclass (golden / bigbrem / narrow / showering)"
160 <<
" splitting is implemented right now";
172 if(backgroundWeightSplitting.compare(
"class")==0) {
177 throw cms::Exception(
"BadConfig") <<
"Only class (0 brem clusters / >=1 brem clusters)"
178 <<
" splitting is implemented right now";
196 if(signalWeightSplitting.compare(
"class")==0) {
201 throw cms::Exception(
"BadConfig") <<
"Only class (0 brem clusters / >=1 brem clusters)"
202 <<
" splitting is implemented right now";
214 if(backgroundWeightSplitting.compare(
"class")==0) {
219 throw cms::Exception(
"BadConfig") <<
"Only class (0 brem clusters / >=1 brem clusters)"
220 <<
" splitting is implemented right now";
238 if(signalWeightSplitting.compare(
"class")==0) {
243 throw cms::Exception(
"BadConfig") <<
"Only class (0 brem clusters / >=1 brem clusters)"
244 <<
" splitting is implemented right now";
256 if(backgroundWeightSplitting.compare(
"class")==0) {
261 throw cms::Exception(
"BadConfig") <<
"Only class (0 brem clusters / >=1 brem clusters)"
262 <<
" splitting is implemented right now";
280 if(signalWeightSplitting.compare(
"class")==0) {
285 throw cms::Exception(
"BadConfig") <<
"Only class (0 brem clusters / >=1 brem clusters)"
286 <<
" splitting is implemented right now";
298 if(backgroundWeightSplitting.compare(
"class")==0) {
303 throw cms::Exception(
"BadConfig") <<
"Only class (0 brem clusters / >=1 brem clusters)"
304 <<
" splitting is implemented right now";
325 std::vector<float> &measurements,
340 float OneOverEMinusOneOverP = 1.0/(electron.
eSuperClusterOverP() * trkRef->p()) - 1.0/trkRef->p();
362 std::vector<float> measurements ;
363 getInputVar (electron, measurements, myEcalCluster) ;
370 snprintf(className, 20,
"class%d", bitVal);
372 throw cms::Exception(
"BadConfig") <<
"Only class (0 brem clusters / >=1 brem clusters)"
373 <<
" splitting is implemented right now";
378 float thisPt = electron.
pt();
380 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.)
386 else if (subdet==
EcalBarrel && fabs(electron.
eta())>1.0 && thisPt>=15.)
406 std::vector<float> measurements ;
407 getInputVar (electron, measurements, myEcalCluster) ;
414 snprintf(className, 20,
"class%d", bitVal);
416 throw cms::Exception(
"BadConfig") <<
"Only class (0 brem clusters / >=1 brem clusters)"
417 <<
" splitting is implemented right now";
422 float thisPt = electron.
pt();
426 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.)
432 else if (subdet==
EcalBarrel && fabs(electron.
eta())>1.0 && thisPt>=15.)
440 if(lh<=0)
return -20.;
441 else if(lh==1)
return 20.;
442 else return log(lh/(1.0-lh));
virtual ~ElectronLikelihood()
dtor
LikelihoodPdfProduct * _EB0gt15lh
likelihood above 15GeV/c
void getInputVar(const reco::GsfElectron &electron, std::vector< float > &measuremnts, EcalClusterLazyTools) const
get the input variables from the electron and the e-Setup
void initFromDB(const ElectronLikelihoodCalibration *calibration)
initialize the PDFs from CondDB
float eSuperClusterOverP() const
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 * _EB0lt15lh
likelihood below 15GeV/c
float getRatio(const char *specName, std::vector< float > measurements, std::string)
get the likelihood ratio p(a priori) * L(specName) / L_tot
LikelihoodPdfProduct * _EElt15lh
virtual double eta() const
momentum pseudorapidity
LikelihoodPdfProduct * _EB1gt15lh
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
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
LikelihoodPdfProduct * _EB1lt15lh
virtual double pt() const
transverse momentum
void Setup(const ElectronLikelihoodCalibration *calibration, std::string signalWeightSplitting, std::string backgroundWeightSplitting, bool splitSignalPdfs, bool splitBackgroundPdfs)
LikelihoodPdfProduct * _EEgt15lh
float resultLog(const reco::GsfElectron &electron, EcalClusterLazyTools) const
get the log-expanded result of the algorithm
float result(const reco::GsfElectron &electron, EcalClusterLazyTools) const
get the result of the algorithm
std::string className(const T &t)