CMS 3D CMS Logo

HistogramProbabilityEstimator Class Reference

provides the track probability to come from the primary vertex for a given track More...

#include <RecoBTag/TrackProbability/interface/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.

00025    :   m_calibration3D(calib3D),m_calibration2D(calib2D)
00026     {}

HistogramProbabilityEstimator::~HistogramProbabilityEstimator (  )  [inline]

Definition at line 36 of file HistogramProbabilityEstimator.h.

00037  {
00038 
00039 //  if(m_calibration3D!=0) delete m_calibration3D;
00040 //  if(m_calibration2D!=0) delete m_calibration2D;
00041  }


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 TrackProbabilityCalibration::data, iggi_31X_cfg::input, it, m_calibration2D, m_calibration3D, and muon::trackProbability().

Referenced by TrackIPProducer::produce().

00012 {
00013  
00014   TrackClassFilter::Input input(quality, track, jet, vertex);
00015  
00016   double trackProbability=0;
00017  
00018      double absSignificance= fabs(significance);
00019   
00020        
00021       const CalibratedHistogram * probabilityHistogram  = 0;
00022       vector<TrackProbabilityCalibration::Entry>::const_iterator found;
00023       vector<TrackProbabilityCalibration::Entry>::const_iterator it;
00024       vector<TrackProbabilityCalibration::Entry>::const_iterator it_end;
00025       if(ipType==0) {it=m_calibration3D->data.begin(); it_end=m_calibration3D->data.end(); }
00026       else if(ipType==1) {it=m_calibration2D->data.begin(); it_end=m_calibration2D->data.end(); }
00027       else return pair<bool,double>(probabilityHistogram ,trackProbability);
00028 
00029       found = std::find_if(it,it_end,bind1st(TrackClassFilter(),input));
00030       if(found!=it_end) probabilityHistogram = &found->histogram;
00031      if(!probabilityHistogram)
00032        {
00033 //        edm::LogWarning ("TrackProbability|HistogramMissing") << " PDF Histogram not found for this track" ;
00034        } else {
00035           trackProbability = 1. - probabilityHistogram->normalizedIntegral(absSignificance);
00036        }             
00037       if(absSignificance!=0)  
00038         trackProbability*=significance/absSignificance;   //Return a "signed" probability
00039     
00040     return pair<bool,double>(probabilityHistogram ,trackProbability);
00041 
00042 }


Member Data Documentation

const TrackProbabilityCalibration* HistogramProbabilityEstimator::m_calibration2D [private]

Definition at line 46 of file HistogramProbabilityEstimator.h.

Referenced by probability().

const TrackProbabilityCalibration* HistogramProbabilityEstimator::m_calibration3D [private]

Definition at line 45 of file HistogramProbabilityEstimator.h.

Referenced by probability().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:24:16 2009 for CMSSW by  doxygen 1.5.4