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 }
TrackingParticle::numberOfTrackerHits
int numberOfTrackerHits() const
The number of hits in the tracker. Hits on overlaps in the same layer count separately.
Definition: TrackingParticle.h:200
TrackingParticle::numberOfTrackerLayers
int numberOfTrackerLayers() const
The number of tracker layers with a hit.
Definition: TrackingParticle.h:209
TrackingParticle::addGenParticle
void addGenParticle(const reco::GenParticleRef &ref)
Definition: TrackingParticle.cc:21
edm::RefVector::clear
void clear()
Clear the vector.
Definition: RefVector.h:142
MessageLogger.h
TrackingParticle::g4Track_begin
g4t_iterator g4Track_begin() const
Definition: TrackingParticle.cc:29
TrackingParticle::clearDecayVertices
void clearDecayVertices()
Definition: TrackingParticle.cc:39
TrackingParticle::numberOfHits_
int numberOfHits_
The total number of hits.
Definition: TrackingParticle.h:216
TrackingParticle::addDecayVertex
void addDecayVertex(const TrackingVertexRef &ref)
Definition: TrackingParticle.cc:35
TrackingParticle::g4Tracks_
std::vector< SimTrack > g4Tracks_
references to G4 and reco::GenParticle tracks
Definition: TrackingParticle.h:221
edm::RefVector::begin
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:223
TrackingParticle::g4t_iterator
std::vector< SimTrack >::const_iterator g4t_iterator
Definition: TrackingParticle.h:41
TrackingParticle::matchedHit
int matchedHit() const
Definition: TrackingParticle.cc:41
TrackingParticle::parentVertex
const TrackingVertexRef & parentVertex() const
Definition: TrackingParticle.h:90
TrackingVertex.h
TrackingParticle::setNumberOfTrackerLayers
void setNumberOfTrackerLayers(const int numberOfTrackerLayers)
Definition: TrackingParticle.cc:51
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
TrackingParticle::numberOfTrackerLayers_
int numberOfTrackerLayers_
The number of tracker layers with hits. Equivalent to the old matchedHit.
Definition: TrackingParticle.h:218
TrackingParticle::longLivedTag
static const unsigned int longLivedTag
long lived flag
Definition: TrackingParticle.h:187
edm::Ref< TrackingVertexCollection >
TrackingParticle::parentVertex_
TrackingVertexRef parentVertex_
Definition: TrackingParticle.h:225
GenParticle.h
alignCSCRings.s
s
Definition: alignCSCRings.py:92
edm::RefVector::end
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:228
TrackingParticle::numberOfHits
int numberOfHits() const
Gives the total number of hits, including muon hits. Hits on overlaps in the same layer count separat...
Definition: TrackingParticle.h:195
TrackingParticle::genParticle_end
genp_iterator genParticle_end() const
Definition: TrackingParticle.cc:27
TrackingParticle::clearParentVertex
void clearParentVertex()
Definition: TrackingParticle.cc:37
TrackingParticle::setNumberOfTrackerHits
void setNumberOfTrackerHits(int numberOfTrackerHits)
Definition: TrackingParticle.cc:49
TrackingParticle
Monte Carlo truth information used for tracking validation.
Definition: TrackingParticle.h:29
TrackingVertexRef
edm::Ref< TrackingVertexCollection > TrackingVertexRef
Definition: TrackingVertexContainer.h:9
cmsswSequenceInfo.tp
tp
Definition: cmsswSequenceInfo.py:17
TrackingParticle::decayVertices_
TrackingVertexRefVector decayVertices_
Definition: TrackingParticle.h:226
TrackingParticle::~TrackingParticle
~TrackingParticle()
Definition: TrackingParticle.cc:19
TrackingParticle::setNumberOfHits
void setNumberOfHits(int numberOfHits)
Definition: TrackingParticle.cc:47
TrackingParticle::TrackingParticle
TrackingParticle()
Default constructor. Note that the object will be useless until it is provided with a SimTrack and pa...
Definition: TrackingParticle.cc:10
edm::RefVector::push_back
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:67
TrackingParticle::setParentVertex
void setParentVertex(const TrackingVertexRef &ref)
Definition: TrackingParticle.cc:33
TrackingParticle.h
TrackingParticle::genParticles_
reco::GenParticleRefVector genParticles_
Definition: TrackingParticle.h:222
SimTrack
Definition: SimTrack.h:6
TrackingParticle::g4Track_end
g4t_iterator g4Track_end() const
Definition: TrackingParticle.cc:31
edm::RefVectorIterator
Definition: EDProductfwd.h:33
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
TrackingParticle::numberOfTrackerHits_
int numberOfTrackerHits_
The number of tracker only hits.
Definition: TrackingParticle.h:217
operator<<
std::ostream & operator<<(std::ostream &s, TrackingParticle const &tp)
Definition: TrackingParticle.cc:55
TrackingParticle::addG4Track
void addG4Track(const SimTrack &t)
Definition: TrackingParticle.cc:23
TrackingParticle::genParticle_begin
genp_iterator genParticle_begin() const
iterators
Definition: TrackingParticle.cc:25