#include <RecoBTag/TrackProbability/interface/HistogramProbabilityEstimator.h>
Public Member Functions | |
HistogramProbabilityEstimator (const TrackProbabilityCalibration *calib3D, const TrackProbabilityCalibration *calib2D) | |
std::pair< bool, double > | probability (bool quality, int ipType, float significance, const reco::Track &, const reco::Jet &, const reco::Vertex &) const |
~HistogramProbabilityEstimator () | |
Private Attributes | |
const TrackProbabilityCalibration * | m_calibration2D |
const TrackProbabilityCalibration * | m_calibration3D |
Definition at line 18 of file HistogramProbabilityEstimator.h.
HistogramProbabilityEstimator::HistogramProbabilityEstimator | ( | const TrackProbabilityCalibration * | calib3D, | |
const TrackProbabilityCalibration * | calib2D | |||
) | [inline] |
Definition at line 23 of file HistogramProbabilityEstimator.h.
00025 : m_calibration3D(calib3D),m_calibration2D(calib2D) 00026 {}
HistogramProbabilityEstimator::~HistogramProbabilityEstimator | ( | ) | [inline] |
Definition at line 36 of file HistogramProbabilityEstimator.h.
00037 { 00038 00039 // if(m_calibration3D!=0) delete m_calibration3D; 00040 // if(m_calibration2D!=0) delete m_calibration2D; 00041 }
pair< bool, double > HistogramProbabilityEstimator::probability | ( | bool | quality, | |
int | ipType, | |||
float | significance, | |||
const reco::Track & | track, | |||
const reco::Jet & | jet, | |||
const reco::Vertex & | vertex | |||
) | const |
Definition at line 11 of file HistogramProbabilityEstimator.cc.
References TrackProbabilityCalibration::data, iggi_31X_cfg::input, it, m_calibration2D, m_calibration3D, and muon::trackProbability().
Referenced by TrackIPProducer::produce().
00012 { 00013 00014 TrackClassFilter::Input input(quality, track, jet, vertex); 00015 00016 double trackProbability=0; 00017 00018 double absSignificance= fabs(significance); 00019 00020 00021 const CalibratedHistogram * probabilityHistogram = 0; 00022 vector<TrackProbabilityCalibration::Entry>::const_iterator found; 00023 vector<TrackProbabilityCalibration::Entry>::const_iterator it; 00024 vector<TrackProbabilityCalibration::Entry>::const_iterator it_end; 00025 if(ipType==0) {it=m_calibration3D->data.begin(); it_end=m_calibration3D->data.end(); } 00026 else if(ipType==1) {it=m_calibration2D->data.begin(); it_end=m_calibration2D->data.end(); } 00027 else return pair<bool,double>(probabilityHistogram ,trackProbability); 00028 00029 found = std::find_if(it,it_end,bind1st(TrackClassFilter(),input)); 00030 if(found!=it_end) probabilityHistogram = &found->histogram; 00031 if(!probabilityHistogram) 00032 { 00033 // edm::LogWarning ("TrackProbability|HistogramMissing") << " PDF Histogram not found for this track" ; 00034 } else { 00035 trackProbability = 1. - probabilityHistogram->normalizedIntegral(absSignificance); 00036 } 00037 if(absSignificance!=0) 00038 trackProbability*=significance/absSignificance; //Return a "signed" probability 00039 00040 return pair<bool,double>(probabilityHistogram ,trackProbability); 00041 00042 }