CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HistogramProbabilityEstimator.cc
Go to the documentation of this file.
1 
5 
7 #include <algorithm>
8 using namespace reco;
9 using namespace std;
10 
12  bool quality, int ipType, float significance, const Track& track, const Jet& jet, const Vertex& vertex) const {
13  TrackClassFilter::Input input(quality, track, jet, vertex);
14 
15  double trackProbability = 0;
16 
17  double absSignificance = fabs(significance);
18 
19  const CalibratedHistogram* probabilityHistogram = nullptr;
20  vector<TrackProbabilityCalibration::Entry>::const_iterator found;
21  vector<TrackProbabilityCalibration::Entry>::const_iterator it;
22  vector<TrackProbabilityCalibration::Entry>::const_iterator it_end;
23  if (ipType == 0) {
24  it = m_calibration3D->data.begin();
25  it_end = m_calibration3D->data.end();
26  } else if (ipType == 1) {
27  it = m_calibration2D->data.begin();
28  it_end = m_calibration2D->data.end();
29  } else
30  return pair<bool, double>(probabilityHistogram, trackProbability);
31 
32  found = std::find_if(it, it_end, [&input](auto const& c) { return TrackClassFilter()(input, c); });
33  if (found != it_end)
34  probabilityHistogram = &found->histogram;
35  if (!probabilityHistogram) {
36  // edm::LogWarning ("TrackProbability|HistogramMissing") << " PDF Histogram not found for this track" ;
37  } else {
38  trackProbability = 1. - probabilityHistogram->normalizedIntegral(absSignificance);
39  }
40  if (absSignificance != 0)
41  trackProbability *= significance / absSignificance; //Return a "signed" probability
42 
43  return pair<bool, double>(probabilityHistogram, trackProbability);
44 }
const edm::EventSetup & c
Base class for all types of Jets.
Definition: Jet.h:20
string quality
static std::string const input
Definition: EdmProvDump.cc:47
double trackProbability(const reco::TrackRef track)
std::pair< bool, double > probability(bool quality, int ipType, float significance, const reco::Track &, const reco::Jet &, const reco::Vertex &) const