#include <NuclearLikelihood.h>
Public Member Functions | |
void | calculate (const reco::Vertex &vtx) |
NuclearLikelihood () | |
double | result () const |
Private Member Functions | |
int | secondaryTrackMaxHits (const reco::Vertex &vtx, int &id) |
Private Attributes | |
double | likelihood_ |
Definition at line 6 of file NuclearLikelihood.h.
NuclearLikelihood::NuclearLikelihood | ( | ) | [inline] |
Definition at line 9 of file NuclearLikelihood.h.
:likelihood_(0.0) { }
void NuclearLikelihood::calculate | ( | const reco::Vertex & | vtx | ) |
Definition at line 3 of file NuclearLikelihood.cc.
References reco::Vertex::isValid(), likelihood_, secondaryTrackMaxHits(), reco::Vertex::tracks_begin(), and reco::Vertex::tracksSize().
{ likelihood_ = 0.0; if( vtx.isValid() ) { if(vtx.tracksSize() > 1) { likelihood_ = 0.3; int idBest; int secMaxHits = secondaryTrackMaxHits( vtx, idBest ); if( secMaxHits > 3 ) likelihood_ =0.5; if( secMaxHits > 4 ) likelihood_ =0.7; if( (*(vtx.tracks_begin()+idBest))->normalizedChi2() < 3.0) likelihood_=1.0; } } }
double NuclearLikelihood::result | ( | ) | const [inline] |
int NuclearLikelihood::secondaryTrackMaxHits | ( | const reco::Vertex & | vtx, |
int & | id | ||
) | [private] |
Definition at line 17 of file NuclearLikelihood.cc.
References i, reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), and reco::Vertex::tracksSize().
Referenced by calculate().
{ int maxHits = 0; if( vtx.tracksSize() < 2 ) return 0; int i=1; for( reco::Vertex::trackRef_iterator it = vtx.tracks_begin()+1; it != vtx.tracks_end(); ++it){ int nhits = (*it)->numberOfValidHits(); if( nhits > maxHits ) { maxHits = nhits; id=i; } i++; } return maxHits; }
double NuclearLikelihood::likelihood_ [private] |
Definition at line 15 of file NuclearLikelihood.h.
Referenced by calculate(), and result().