CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HistogramProbabilityEstimator Class Reference

#include <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 TrackProbabilityCalibrationm_calibration2D
 
const TrackProbabilityCalibrationm_calibration3D
 

Detailed Description

provides the track probability to come from the primary vertex for a given track

Definition at line 18 of file HistogramProbabilityEstimator.h.

Constructor & Destructor Documentation

HistogramProbabilityEstimator::HistogramProbabilityEstimator ( const TrackProbabilityCalibration calib3D,
const TrackProbabilityCalibration calib2D 
)
inline

Definition at line 23 of file HistogramProbabilityEstimator.h.

25  : m_calibration3D(calib3D),m_calibration2D(calib2D)
26  {}
const TrackProbabilityCalibration * m_calibration2D
const TrackProbabilityCalibration * m_calibration3D
HistogramProbabilityEstimator::~HistogramProbabilityEstimator ( )
inline

Definition at line 36 of file HistogramProbabilityEstimator.h.

References probability(), jets_cff::quality, and met_cff::significance.

37  {
38 
39 // if(m_calibration3D!=0) delete m_calibration3D;
40 // if(m_calibration2D!=0) delete m_calibration2D;
41  }

Member Function Documentation

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 EnergyCorrector::c, runEdmFileComparison::found, input, and muon::trackProbability().

Referenced by ~HistogramProbabilityEstimator().

12 {
13 
14  TrackClassFilter::Input input(quality, track, jet, vertex);
15 
16  double trackProbability=0;
17 
18  double absSignificance= fabs(significance);
19 
20 
21  const CalibratedHistogram * probabilityHistogram = nullptr;
22  vector<TrackProbabilityCalibration::Entry>::const_iterator found;
23  vector<TrackProbabilityCalibration::Entry>::const_iterator it;
24  vector<TrackProbabilityCalibration::Entry>::const_iterator it_end;
25  if(ipType==0) {it=m_calibration3D->data.begin(); it_end=m_calibration3D->data.end(); }
26  else if(ipType==1) {it=m_calibration2D->data.begin(); it_end=m_calibration2D->data.end(); }
27  else return pair<bool,double>(probabilityHistogram ,trackProbability);
28 
29  found = std::find_if(it,it_end,[&input](auto const& c) {return TrackClassFilter()(input,c);});
30  if(found!=it_end) probabilityHistogram = &found->histogram;
31  if(!probabilityHistogram)
32  {
33 // edm::LogWarning ("TrackProbability|HistogramMissing") << " PDF Histogram not found for this track" ;
34  } else {
35  trackProbability = 1. - probabilityHistogram->normalizedIntegral(absSignificance);
36  }
37  if(absSignificance!=0)
38  trackProbability*=significance/absSignificance; //Return a "signed" probability
39 
40  return pair<bool,double>(probabilityHistogram ,trackProbability);
41 
42 }
const TrackProbabilityCalibration * m_calibration2D
static std::string const input
Definition: EdmProvDump.cc:48
const TrackProbabilityCalibration * m_calibration3D
significance
Definition: met_cff.py:19
double trackProbability(const reco::TrackRef track)

Member Data Documentation

const TrackProbabilityCalibration* HistogramProbabilityEstimator::m_calibration2D
private

Definition at line 46 of file HistogramProbabilityEstimator.h.

const TrackProbabilityCalibration* HistogramProbabilityEstimator::m_calibration3D
private

Definition at line 45 of file HistogramProbabilityEstimator.h.