CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
NuclearLikelihood Class Reference

#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_
 

Detailed Description

Definition at line 6 of file NuclearLikelihood.h.

Constructor & Destructor Documentation

NuclearLikelihood::NuclearLikelihood ( )
inline

Definition at line 9 of file NuclearLikelihood.h.

References calculate(), and extraflags_cff::vtx.

9 :likelihood_(0.0) { }

Member Function Documentation

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().

Referenced by NuclearLikelihood().

3  {
4  likelihood_ = 0.0;
5  if( vtx.isValid() ) {
6  if(vtx.tracksSize() > 1) {
7  likelihood_ = 0.3;
8  int idBest;
9  int secMaxHits = secondaryTrackMaxHits( vtx, idBest );
10  if( secMaxHits > 3 ) likelihood_ =0.5;
11  if( secMaxHits > 4 ) likelihood_ =0.7;
12  if( (*(vtx.tracks_begin()+idBest))->normalizedChi2() < 3.0) likelihood_=1.0;
13  }
14  }
15 }
bool isValid() const
Tells whether the vertex is valid.
Definition: Vertex.h:68
trackRef_iterator tracks_begin() const
first iterator over tracks
Definition: Vertex.cc:76
int secondaryTrackMaxHits(const reco::Vertex &vtx, int &id)
size_t tracksSize() const
number of tracks
Definition: Vertex.cc:71
double NuclearLikelihood::result ( ) const
inline

Definition at line 11 of file NuclearLikelihood.h.

References likelihood_, and secondaryTrackMaxHits().

11 { return likelihood_; }
int NuclearLikelihood::secondaryTrackMaxHits ( const reco::Vertex vtx,
int &  id 
)
private

Definition at line 17 of file NuclearLikelihood.cc.

References mps_fire::i, NuclearSeed_cfi::maxHits, nhits, reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), and reco::Vertex::tracksSize().

Referenced by calculate(), and result().

17  {
18  int maxHits = 0;
19  if( vtx.tracksSize() < 2 ) return 0;
20  int i=1;
21  for( reco::Vertex::trackRef_iterator it = vtx.tracks_begin()+1; it != vtx.tracks_end(); ++it){
22  int nhits = (*it)->numberOfValidHits();
23  if( nhits > maxHits ) { maxHits = nhits; id=i; }
24  i++;
25  }
26  return maxHits;
27 }
trackRef_iterator tracks_end() const
last iterator over tracks
Definition: Vertex.cc:81
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
Definition: Vertex.h:37
trackRef_iterator tracks_begin() const
first iterator over tracks
Definition: Vertex.cc:76
size_t tracksSize() const
number of tracks
Definition: Vertex.cc:71

Member Data Documentation

double NuclearLikelihood::likelihood_
private

Definition at line 15 of file NuclearLikelihood.h.

Referenced by calculate(), and result().