CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Typedefs | Functions
TrackingParticle.cc File Reference
#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h"

Go to the source code of this file.

Typedefs

typedef std::vector
< TrackingVertex
TrackingVertexCollection
 
typedef edm::Ref
< TrackingVertexCollection
TrackingVertexRef
 
typedef edm::RefVector
< TrackingVertexCollection
TrackingVertexRefVector
 
typedef
TrackingVertexRefVector::iterator 
tv_iterator
 

Functions

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

Typedef Documentation

Definition at line 3 of file TrackingParticle.cc.

Definition at line 4 of file TrackingParticle.cc.

Definition at line 5 of file TrackingParticle.cc.

Definition at line 6 of file TrackingParticle.cc.

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 103 of file TrackingParticle.cc.

References EncodedEventId::bunchCrossing(), DetId::Calo, ParticleBase::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(), i, ParticleBase::p4(), TrackingParticle::parentVertex(), TrackingParticle::pdgId(), alignCSCRings::s, edm::RefVector< C, T, F >::size(), TrackingParticle::trackPSimHit(), and ParticleBase::vertex().

104 {
105  s << "TP momentum, q, ID, & Event #: "
106  << tp.p4() << " " << tp.charge() << " " << tp.pdgId() << " "
107  << tp.eventId().bunchCrossing() << "." << tp.eventId().event() << std::endl;
108  s << " Hits for this track: " << tp.trackPSimHit().size() << std::endl;
109 
110  for (int i = 1; i < DetId::Calo + 1; ++i)
111  {
112  int numberOfHits = tp.trackPSimHit((DetId::Detector)i).size();
113  if (numberOfHits)
114  s << "\t sub-detector id : " << i << " -> " << numberOfHits << std::endl;
115  }
116 
117  for (TrackingParticle::genp_iterator hepT = tp.genParticle_begin(); hepT != tp.genParticle_end(); ++hepT)
118  {
119  s << " HepMC Track Momentum " << (*hepT)->momentum().rho() << std::endl;
120  }
121 
122  for (TrackingParticle::g4t_iterator g4T = tp.g4Track_begin(); g4T != tp.g4Track_end(); ++g4T)
123  {
124  s << " Geant Track Momentum " << g4T->momentum() << std::endl;
125  s << " Geant Track ID & type " << g4T->trackId() << " " << g4T->type() << std::endl;
126  if (g4T->type() != tp.pdgId())
127  {
128  s << " Mismatch b/t TrackingParticle and Geant types" << std::endl;
129  }
130  }
131  // Loop over decay vertices
132  s << " TP Vertex " << tp.vertex() << std::endl;
133  s << " Source vertex: " << tp.parentVertex()->position() << std::endl;
134  s << " " << tp.decayVertices().size() << " Decay vertices" << std::endl;
135  for (tv_iterator iTV = tp.decayVertices_begin(); iTV != tp.decayVertices_end(); ++iTV)
136  {
137  s << " Decay vertices: " << (**iTV).position() << std::endl;
138  }
139 
140  return s;
141 }
int i
Definition: DBlmapReader.cc:9
std::vector< SimTrack >::const_iterator g4t_iterator
Detector
Definition: DetId.h:26