CMS 3D CMS Logo

Public Member Functions | Private Attributes

HistogramProbabilityEstimator Class Reference

#include <HistogramProbabilityEstimator.h>

List of all members.

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.

   :   m_calibration3D(calib3D),m_calibration2D(calib2D)
    {}
HistogramProbabilityEstimator::~HistogramProbabilityEstimator ( ) [inline]

Definition at line 36 of file HistogramProbabilityEstimator.h.

 {

//  if(m_calibration3D!=0) delete m_calibration3D;
//  if(m_calibration2D!=0) delete m_calibration2D;
 }

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 newFWLiteAna::found, LaserDQM_cfg::input, and muon::trackProbability().

{
 
  TrackClassFilter::Input input(quality, track, jet, vertex);
 
  double trackProbability=0;
 
     double absSignificance= fabs(significance);
  
       
      const CalibratedHistogram * probabilityHistogram  = 0;
      vector<TrackProbabilityCalibration::Entry>::const_iterator found;
      vector<TrackProbabilityCalibration::Entry>::const_iterator it;
      vector<TrackProbabilityCalibration::Entry>::const_iterator it_end;
      if(ipType==0) {it=m_calibration3D->data.begin(); it_end=m_calibration3D->data.end(); }
      else if(ipType==1) {it=m_calibration2D->data.begin(); it_end=m_calibration2D->data.end(); }
      else return pair<bool,double>(probabilityHistogram ,trackProbability);

      found = std::find_if(it,it_end,bind1st(TrackClassFilter(),input));
      if(found!=it_end) probabilityHistogram = &found->histogram;
     if(!probabilityHistogram)
       {
//        edm::LogWarning ("TrackProbability|HistogramMissing") << " PDF Histogram not found for this track" ;
       } else {
          trackProbability = 1. - probabilityHistogram->normalizedIntegral(absSignificance);
       }             
      if(absSignificance!=0)  
        trackProbability*=significance/absSignificance;   //Return a "signed" probability
    
    return pair<bool,double>(probabilityHistogram ,trackProbability);

}

Member Data Documentation

Definition at line 46 of file HistogramProbabilityEstimator.h.

Definition at line 45 of file HistogramProbabilityEstimator.h.