test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
NuclearLikelihood.cc
Go to the documentation of this file.
2 
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 }
16 
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 }
int i
Definition: DBlmapReader.cc:9
trackRef_iterator tracks_end() const
last iterator over tracks
Definition: Vertex.cc:44
bool isValid() const
Tells whether the vertex is valid.
Definition: Vertex.h:60
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector&lt;TrackRef&gt;
Definition: Vertex.h:37
trackRef_iterator tracks_begin() const
first iterator over tracks
Definition: Vertex.cc:39
int secondaryTrackMaxHits(const reco::Vertex &vtx, int &id)
size_t tracksSize() const
number of tracks
Definition: Vertex.cc:34
void calculate(const reco::Vertex &vtx)