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::HistogramProbabilityEstimator ( const TrackProbabilityCalibration calib3D,
const TrackProbabilityCalibration calib2D 
)
inline

Definition at line 20 of file HistogramProbabilityEstimator.h.

21  : m_calibration3D(calib3D), m_calibration2D(calib2D) {}

◆ ~HistogramProbabilityEstimator()

HistogramProbabilityEstimator::~HistogramProbabilityEstimator ( )
inline

Definition at line 31 of file HistogramProbabilityEstimator.h.

31  {
32  // if(m_calibration3D!=0) delete m_calibration3D;
33  // if(m_calibration2D!=0) delete m_calibration2D;
34  }

Member Function Documentation

◆ probability()

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.

12  {
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 }

References HltBtagPostValidation_cff::c, newFWLiteAna::found, input, metsig::jet, PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::normalizedIntegral(), qcdUeDQM_cfi::quality, met_cff::significance, HLT_FULL_cff::track, muon::trackProbability(), and bphysicsOniaDQM_cfi::vertex.

Referenced by btagbtvdeep::SeedingTrackInfoBuilder::buildSeedingTrackInfo().

Member Data Documentation

◆ m_calibration2D

const TrackProbabilityCalibration* HistogramProbabilityEstimator::m_calibration2D
private

Definition at line 40 of file HistogramProbabilityEstimator.h.

◆ m_calibration3D

const TrackProbabilityCalibration* HistogramProbabilityEstimator::m_calibration3D
private

Definition at line 39 of file HistogramProbabilityEstimator.h.

PhysicsTools::Calibration::Histogram::normalizedIntegral
Value_t normalizedIntegral(Axis_t hBound, Axis_t lBound=0.0, int mode=1) const
Definition: Histogram.h:96
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11779
input
static const std::string input
Definition: EdmProvDump.cc:48
HistogramProbabilityEstimator::m_calibration2D
const TrackProbabilityCalibration * m_calibration2D
Definition: HistogramProbabilityEstimator.h:40
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
TrackClassFilter::Input
Definition: TrackClassFilter.h:16
muon::trackProbability
double trackProbability(const reco::TrackRef track)
Definition: MuonCocktails.cc:122
HistogramProbabilityEstimator::m_calibration3D
const TrackProbabilityCalibration * m_calibration3D
Definition: HistogramProbabilityEstimator.h:39
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
PhysicsTools::Calibration::Histogram< float >
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
qcdUeDQM_cfi.quality
quality
Definition: qcdUeDQM_cfi.py:31
metsig::jet
Definition: SignAlgoResolutions.h:47
TrackClassFilter
Definition: TrackClassFilter.h:12
TrackProbabilityCalibration::data
std::vector< Entry > data
Definition: TrackProbabilityCalibration.h:19
met_cff.significance
significance
Definition: met_cff.py:18