CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
TrackingParticle.cc File Reference
#include "SimDataFormats/TrackingAnalysis/interface/TrackingVertex.h"
#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h"
#include "DataFormats/HepMCCandidate/interface/GenParticle.h"
#include <FWCore/MessageLogger/interface/MessageLogger.h>

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &s, TrackingParticle const &tp)
 

Function Documentation

std::ostream& operator<< ( std::ostream &  s,
TrackingParticle const &  tp 
)

Concrete TrackingParticle. All track parameters are passed in the constructor and stored internally.

Definition at line 291 of file TrackingParticle.cc.

References EncodedEventId::bunchCrossing(), TrackingParticle::charge(), TrackingParticle::decayVertices(), TrackingParticle::decayVertices_begin(), TrackingParticle::decayVertices_end(), EncodedEventId::event(), TrackingParticle::eventId(), TrackingParticle::g4Track_begin(), TrackingParticle::g4Track_end(), TrackingParticle::genParticle_begin(), TrackingParticle::genParticle_end(), TrackingParticle::momentum(), TrackingParticle::p4(), TrackingParticle::parentVertex(), TrackingParticle::pdgId(), alignCSCRings::s, edm::RefVector< C, T, F >::size(), and TrackingParticle::vertex().

292 {
293  s << "TP momentum, q, ID, & Event #: "
294  << tp.p4() << " " << tp.charge() << " " << tp.pdgId() << " "
295  << tp.eventId().bunchCrossing() << "." << tp.eventId().event() << std::endl;
296 
297  for (TrackingParticle::genp_iterator hepT = tp.genParticle_begin(); hepT != tp.genParticle_end(); ++hepT)
298  {
299  s << " HepMC Track Momentum " << (*hepT)->momentum().rho() << std::endl;
300  }
301 
302  for (TrackingParticle::g4t_iterator g4T = tp.g4Track_begin(); g4T != tp.g4Track_end(); ++g4T)
303  {
304  s << " Geant Track Momentum " << g4T->momentum() << std::endl;
305  s << " Geant Track ID & type " << g4T->trackId() << " " << g4T->type() << std::endl;
306  if (g4T->type() != tp.pdgId())
307  {
308  s << " Mismatch b/t TrackingParticle and Geant types" << std::endl;
309  }
310  }
311  // Loop over decay vertices
312  s << " TP Vertex " << tp.vertex() << std::endl;
313  s << " Source vertex: " << tp.parentVertex()->position() << std::endl;
314  s << " " << tp.decayVertices().size() << " Decay vertices" << std::endl;
315  for (tv_iterator iTV = tp.decayVertices_begin(); iTV != tp.decayVertices_end(); ++iTV)
316  {
317  s << " Decay vertices: " << (**iTV).position() << std::endl;
318  }
319 
320  return s;
321 }
std::vector< SimTrack >::const_iterator g4t_iterator