CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
NuclearInteractionEDProducer.cc File Reference
#include "RecoVertex/NuclearInteractionProducer/interface/NuclearInteractionEDProducer.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "DataFormats/VertexReco/interface/NuclearInteractionFwd.h"
#include "RecoVertex/NuclearInteractionProducer/interface/NuclearVertexBuilder.h"
#include "RecoVertex/NuclearInteractionProducer/interface/NuclearLikelihood.h"
#include "FWCore/Framework/interface/EventSetup.h"

Go to the source code of this file.

Functions

void print (std::ostringstream &out, const reco::NuclearInteraction &nucl, const std::auto_ptr< NuclearVertexBuilder > &builder)
 

Function Documentation

void print ( std::ostringstream &  out,
const reco::NuclearInteraction nucl,
const std::auto_ptr< NuclearVertexBuilder > &  builder 
)

Definition at line 163 of file NuclearInteractionEDProducer.cc.

References ClosestApproachInRPhi::distance(), reco::NuclearInteraction::likelihood(), reco::Vertex::position(), reco::NuclearInteraction::primaryTrack(), reco::NuclearInteraction::secondaryTracks_begin(), reco::NuclearInteraction::secondaryTracks_end(), reco::NuclearInteraction::secondaryTracksSize(), reco::NuclearInteraction::seedsSize(), and reco::NuclearInteraction::vertex().

163  {
164  out<<"Nuclear Interaction with vertex position : (";
165  out<< nucl.vertex().position().x() << " , "
166  << nucl.vertex().position().y() << " , "
167  << nucl.vertex().position().z() << ")";
168  reco::TrackRef primTrack = (nucl.primaryTrack()).castTo<reco::TrackRef>();
169  out<<"\tLikelihood : " << nucl.likelihood() << std::endl;
170  out<<"\tPrimary Track : Pt = " << primTrack->pt() << " - Nhits = "
171  << primTrack->numberOfValidHits() << std::endl;
172  out << "\tNumber of seeds : " << nucl.seedsSize() << std::endl;
173  out << "\tNumber of secondary Tracks : " << nucl.secondaryTracksSize() << std::endl;
174  int it=0;
175  for( reco::NuclearInteraction::trackRef_iterator itr_=nucl.secondaryTracks_begin(); itr_ != nucl.secondaryTracks_end(); itr_++, it++) {
176  reco::TrackRef secTrack = (*itr_).castTo<reco::TrackRef>();
177  ClosestApproachInRPhi* theApproach = builder->closestApproach(primTrack, secTrack);
178  out << "\t\t Secondary track " << it << " : Pt = " << (*itr_)->pt()
179  << " - Nhits = " << (*itr_)->numberOfValidHits()
180  << " - Dist = " << theApproach->distance()
181  << " - chi2 = " << (*itr_)->normalizedChi2() << std::endl;
182  delete theApproach;
183  }
184  out << "----------------" << std::endl;
185 }
trackRef_iterator secondaryTracks_begin() const
first iterator over secondary tracks
const edm::RefToBase< reco::Track > & primaryTrack() const
return the base reference to the primary track
const Point & position() const
position
Definition: Vertex.h:106
int secondaryTracksSize() const
return the number of secondary tracks
reco::Vertex::trackRef_iterator trackRef_iterator
int seedsSize() const
return the number of seeds
double likelihood() const
return the likelihood ~ probability that the vertex is a real nuclear interaction ...
tuple out
Definition: dbtoconf.py:99
const reco::Vertex & vertex() const
return the vertex
trackRef_iterator secondaryTracks_end() const
last iterator over secondary tracks