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) {}
const TrackProbabilityCalibration * m_calibration2D
const TrackProbabilityCalibration * m_calibration3D

◆ ~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.

References c, newFWLiteAna::found, input, metsig::jet, quality, met_cff::significance, HLT_2022v12_cff::track, muon::trackProbability(), and bphysicsOniaDQM_cfi::vertex.

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

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 }
const TrackProbabilityCalibration * m_calibration2D
static std::string const input
Definition: EdmProvDump.cc:47
const TrackProbabilityCalibration * m_calibration3D
significance
Definition: met_cff.py:18
double trackProbability(const reco::TrackRef track)
string quality

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.