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) ;
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,
334 std::vector<float> vCov = myEcalCluster.localCovariances(*(electron.
superCluster()->seed())) ;
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 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
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
LikelihoodPdfProduct * _EElt15lh
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
float resultLog(const reco::GsfElectron &electron, const EcalClusterLazyTools &) const
get the log-expanded result of the algorithm
void getInputVar(const reco::GsfElectron &electron, std::vector< float > &measuremnts, const EcalClusterLazyTools &) const
get the input variables from the electron and the e-Setup
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
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
float getRatio(const char *specName, const std::vector< float > &measurements, std::string)
get the likelihood ratio p(a priori) * L(specName) / L_tot
void Setup(const ElectronLikelihoodCalibration *calibration, std::string signalWeightSplitting, std::string backgroundWeightSplitting, bool splitSignalPdfs, bool splitBackgroundPdfs)
LikelihoodPdfProduct * _EEgt15lh
virtual float pt() const GCC11_FINAL
transverse momentum
std::string className(const T &t)