CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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);
16  setParentVertex(parentVertex);
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 }
const LorentzVector & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
genp_iterator genParticle_begin() const
iterators
tv_iterator decayVertices_end() const
int event() const
get the contents of the subdetector field (should be protected?)
tv_iterator decayVertices_begin() const
TrackingVertexRefVector decayVertices_
g4t_iterator g4Track_begin() const
int pdgId() const
PDG ID.
TrackingParticle()
Default constructor. Note that the object will be useless until it is provided with a SimTrack and pa...
int matchedHit() const
int numberOfTrackerHits_
The number of tracker only hits.
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:228
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:223
void setParentVertex(const TrackingVertexRef &ref)
void addGenParticle(const reco::GenParticleRef &ref)
reco::GenParticleRefVector genParticles_
float charge() const
Electric charge. Note this is taken from the first SimTrack only.
int bunchCrossing() const
get the detector field from this detid
void addG4Track(const SimTrack &t)
int numberOfTrackerLayers() const
The number of tracker layers with a hit.
int numberOfHits_
The total number of hits.
std::vector< SimTrack > g4Tracks_
references to G4 and reco::GenParticle tracks
const TrackingVertexRef & parentVertex() const
std::vector< SimTrack >::const_iterator g4t_iterator
edm::Ref< TrackingVertexCollection > TrackingVertexRef
genp_iterator genParticle_end() const
void clear()
Clear the vector.
Definition: RefVector.h:142
void addDecayVertex(const TrackingVertexRef &ref)
int numberOfHits() const
Gives the total number of hits, including muon hits. Hits on overlaps in the same layer count separat...
Point vertex() const
Parent vertex position.
EncodedEventId eventId() const
Signal source, crossing number.
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
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:67
size_type size() const
Size of the RefVector.
Definition: RefVector.h:102
Monte Carlo truth information used for tracking validation.
int numberOfTrackerHits() const
The number of hits in the tracker. Hits on overlaps in the same layer count separately.
Log< level::Warning, false > LogWarning
void setNumberOfTrackerLayers(const int numberOfTrackerLayers)
g4t_iterator g4Track_end() const
const TrackingVertexRefVector & decayVertices() const
TrackingVertexRef parentVertex_
void setNumberOfHits(int numberOfHits)