CMS 3D CMS Logo

TrackingParticle.cc
Go to the documentation of this file.
3 
5 
7 
8 const unsigned int TrackingParticle::longLivedTag = 65536;
9 
11  // No operation
12 }
13 
14 TrackingParticle::TrackingParticle(const SimTrack& simtrk, const TrackingVertexRef& parentVertex) {
15  addG4Track(simtrk);
17 }
18 
20 
22 
23 void TrackingParticle::addG4Track(const SimTrack& t) { g4Tracks_.push_back(t); }
24 
26 
28 
30 
32 
34 
36 
38 
40 
42  edm::LogWarning("TrackingParticle")
43  << "The method matchedHit() has been deprecated. Use numberOfTrackerLayers() instead.";
45 }
46 
48 
50 
51 void TrackingParticle::setNumberOfTrackerLayers(const int numberOfTrackerLayers) {
53 }
54 
55 std::ostream& operator<<(std::ostream& s, TrackingParticle const& tp) {
56  s << "TP momentum, q, ID, & Event #: " << tp.p4() << " " << tp.charge() << " " << tp.pdgId() << " "
57  << tp.eventId().bunchCrossing() << "." << tp.eventId().event() << std::endl;
58 
59  for (TrackingParticle::genp_iterator hepT = tp.genParticle_begin(); hepT != tp.genParticle_end(); ++hepT) {
60  s << " HepMC Track Momentum " << (*hepT)->momentum().rho() << std::endl;
61  }
62 
63  for (TrackingParticle::g4t_iterator g4T = tp.g4Track_begin(); g4T != tp.g4Track_end(); ++g4T) {
64  s << " Geant Track Momentum " << g4T->momentum() << std::endl;
65  s << " Geant Track ID & type " << g4T->trackId() << " " << g4T->type() << std::endl;
66  if (g4T->type() != tp.pdgId()) {
67  s << " Mismatch b/t TrackingParticle and Geant types" << std::endl;
68  }
69  }
70  // Loop over decay vertices
71  s << " TP Vertex " << tp.vertex() << std::endl;
72  s << " Source vertex: " << tp.parentVertex()->position() << std::endl;
73  s << " " << tp.decayVertices().size() << " Decay vertices" << std::endl;
74  for (tv_iterator iTV = tp.decayVertices_begin(); iTV != tp.decayVertices_end(); ++iTV) {
75  s << " Decay vertices: " << (**iTV).position() << std::endl;
76  }
77 
78  return s;
79 }
TrackingVertexRefVector decayVertices_
TrackingParticle()
Default constructor. Note that the object will be useless until it is provided with a SimTrack and pa...
int numberOfTrackerHits_
The number of tracker only hits.
g4t_iterator g4Track_end() const
void setParentVertex(const TrackingVertexRef &ref)
void addGenParticle(const reco::GenParticleRef &ref)
int numberOfTrackerLayers() const
The number of tracker layers with a hit.
reco::GenParticleRefVector genParticles_
genp_iterator genParticle_begin() const
iterators
int numberOfTrackerHits() const
The number of hits in the tracker. Hits on overlaps in the same layer count separately.
void addG4Track(const SimTrack &t)
std::ostream & operator<<(std::ostream &s, TrackingParticle const &tp)
int numberOfHits_
The total number of hits.
std::vector< SimTrack > g4Tracks_
references to G4 and reco::GenParticle tracks
int matchedHit() const
std::vector< SimTrack >::const_iterator g4t_iterator
edm::Ref< TrackingVertexCollection > TrackingVertexRef
g4t_iterator g4Track_begin() const
const TrackingVertexRef & parentVertex() const
void clear()
Clear the vector.
Definition: RefVector.h:142
void addDecayVertex(const TrackingVertexRef &ref)
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:228
int numberOfHits() const
Gives the total number of hits, including muon hits. Hits on overlaps in the same layer count separat...
void setNumberOfTrackerHits(int numberOfTrackerHits)
int numberOfTrackerLayers_
The number of tracker layers with hits. Equivalent to the old matchedHit.
static const unsigned int longLivedTag
long lived flag
genp_iterator genParticle_end() const
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:67
Monte Carlo truth information used for tracking validation.
Log< level::Warning, false > LogWarning
void setNumberOfTrackerLayers(const int numberOfTrackerLayers)
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:223
TrackingVertexRef parentVertex_
void setNumberOfHits(int numberOfHits)