CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

NuclearLikelihood Class Reference

#include <NuclearLikelihood.h>

List of all members.

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.

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

                                                         {
      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]

Definition at line 11 of file NuclearLikelihood.h.

References likelihood_.

{ return likelihood_; }
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;
}

Member Data Documentation

Definition at line 15 of file NuclearLikelihood.h.

Referenced by calculate(), and result().