CMS 3D CMS Logo

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 {
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 }
PhysicsTools::Calibration::Histogram::normalizedIntegral
Value_t normalizedIntegral(Axis_t hBound, Axis_t lBound=0.0, int mode=1) const
Definition: Histogram.h:96
input
static const std::string input
Definition: EdmProvDump.cc:48
MessageLogger.h
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
TrackClassFilter::Input
Definition: TrackClassFilter.h:16
Jet
Definition: Jet.py:1
muon::trackProbability
double trackProbability(const reco::TrackRef track)
Definition: MuonCocktails.cc:122
reco::Track
Definition: Track.h:27
HistogramProbabilityEstimator.h
HistogramProbabilityEstimator::probability
std::pair< bool, double > probability(bool quality, int ipType, float significance, const reco::Track &, const reco::Jet &, const reco::Vertex &) const
Definition: HistogramProbabilityEstimator.cc:11
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
PhysicsTools::Calibration::Histogram< float >
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
std
Definition: JetResolutionObject.h:76
qcdUeDQM_cfi.quality
quality
Definition: qcdUeDQM_cfi.py:31
metsig::jet
Definition: SignAlgoResolutions.h:47
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
TrackClassFilter
Definition: TrackClassFilter.h:12
CalibratedHistogram.h
TrackClassFilter.h
reco::Vertex
Definition: Vertex.h:35
met_cff.significance
significance
Definition: met_cff.py:19