CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Attributes | Private Attributes | Friends
TrackingParticle Class Reference

Monte Carlo truth information used for tracking validation. More...

#include <TrackingParticle.h>

Public Types

typedef int Charge
 electric charge type More...
 
typedef std::vector< SimTrack >
::const_iterator 
g4t_iterator
 
typedef
reco::GenParticleRefVector::iterator 
genp_iterator
 reference to reco::GenParticle More...
 
typedef math::XYZTLorentzVectorD LorentzVector
 Lorentz vector. More...
 
typedef math::XYZPointD Point
 point in the space More...
 
typedef
math::PtEtaPhiMLorentzVector 
PolarLorentzVector
 Lorentz vector. More...
 
typedef math::XYZVectorD Vector
 point in the space More...
 

Public Member Functions

void addDecayVertex (const TrackingVertexRef &ref)
 
void addG4Track (const SimTrack &t)
 
void addGenParticle (const reco::GenParticleRef &ref)
 
Vector boostToCM () const
 Vector to boost to the particle centre of mass frame. More...
 
int charge () const
 Electric charge. Note this is taken from the first SimTrack only. More...
 
void clearDecayVertices ()
 
void clearParentVertex ()
 
const TrackingVertexRefVectordecayVertices () const
 
tv_iterator decayVertices_begin () const
 
tv_iterator decayVertices_end () const
 
double energy () const
 Energy. Note this is taken from the first SimTrack only. More...
 
double et () const
 Transverse energy. Note this is taken from the first SimTrack only. More...
 
double eta () const
 Momentum pseudorapidity. Note this is taken from the first SimTrack only. More...
 
EncodedEventId eventId () const
 Signal source, crossing number. More...
 
g4t_iterator g4Track_begin () const
 
g4t_iterator g4Track_end () const
 
const std::vector< SimTrack > & g4Tracks () const
 
genp_iterator genParticle_begin () const
 iterators More...
 
genp_iterator genParticle_end () const
 
const reco::GenParticleRefVectorgenParticles () const
 
bool longLived () const
 is long lived? More...
 
double mass () const
 Mass. Note this is taken from the first SimTrack only. More...
 
double massSqr () const
 Mass squared. Note this is taken from the first SimTrack only. More...
 
int matchedHit () const
 
Vector momentum () const
 spatial momentum vector More...
 
double mt () const
 Transverse mass. Note this is taken from the first SimTrack only. More...
 
double mtSqr () const
 Transverse mass squared. Note this is taken from the first SimTrack only. More...
 
int numberOfHits () const
 Gives the total number of hits, including muon hits. Hits on overlaps in the same layer count separately. More...
 
int numberOfTrackerHits () const
 The number of hits in the tracker. Hits on overlaps in the same layer count separately. More...
 
int numberOfTrackerLayers () const
 The number of tracker layers with a hit. More...
 
double p () const
 Magnitude of momentum vector. Note this is taken from the first SimTrack only. More...
 
const LorentzVectorp4 () const
 Four-momentum Lorentz vector. Note this is taken from the first SimTrack only. More...
 
const TrackingVertexRefparentVertex () const
 
int pdgId () const
 PDG ID. More...
 
double phi () const
 Momentum azimuthal angle. Note this is taken from the first SimTrack only. More...
 
double pt () const
 Transverse momentum. Note this is taken from the first SimTrack only. More...
 
double px () const
 x coordinate of momentum vector. Note this is taken from the first SimTrack only. More...
 
double py () const
 y coordinate of momentum vector. Note this is taken from the first SimTrack only. More...
 
double pz () const
 z coordinate of momentum vector. Note this is taken from the first SimTrack only. More...
 
double rapidity () const
 Rapidity. Note this is taken from the first SimTrack only. More...
 
void setNumberOfHits (int numberOfHits)
 
void setNumberOfTrackerHits (int numberOfTrackerHits)
 
void setNumberOfTrackerLayers (const int numberOfTrackerLayers)
 
void setParentVertex (const TrackingVertexRef &ref)
 
int status () const
 Status word. More...
 
double theta () const
 Momentum polar angle. Note this is taken from the first SimTrack only. More...
 
int threeCharge () const
 Kept for backwards compatibility. Gives 3*charge(), don't know why. More...
 
 TrackingParticle ()
 Default constructor. Note that the object will be useless until it is provided with a SimTrack and parent TrackingVertex. More...
 
 TrackingParticle (const SimTrack &simtrk, const TrackingVertexRef &parentVertex)
 
Point vertex () const
 Parent vertex position. More...
 
double vx () const
 x coordinate of parent vertex position More...
 
double vy () const
 y coordinate of parent vertex position More...
 
double vz () const
 z coordinate of parent vertex position More...
 
double y () const
 Same as rapidity(). More...
 
 ~TrackingParticle ()
 

Static Public Attributes

static const unsigned int longLivedTag = 65536
 long lived flag More...
 

Private Attributes

TrackingVertexRefVector decayVertices_
 
std::vector< SimTrackg4Tracks_
 references to G4 and reco::GenParticle tracks More...
 
reco::GenParticleRefVector genParticles_
 
int numberOfHits_
 The total number of hits. More...
 
int numberOfTrackerHits_
 The number of tracker only hits. More...
 
int numberOfTrackerLayers_
 The number of tracker layers with hits. Equivalent to the old matchedHit. More...
 
TrackingVertexRef parentVertex_
 

Friends

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

Detailed Description

Monte Carlo truth information used for tracking validation.

Object with references to the original SimTrack and parent and daughter TrackingVertices. Simulation with high (~100) pileup was taking too much memory so the class was slimmed down and copies of the SimHits were removed.

Author
original author unknown, re-engineering and slimming by Subir Sarkar (subir.nosp@m..sar.nosp@m.kar@c.nosp@m.ern..nosp@m.ch), some tweaking and documentation by Mark Grimes (mark..nosp@m.grim.nosp@m.es@br.nosp@m.isto.nosp@m.l.ac..nosp@m.uk).
Date
original date unknown, re-engineering Jan-May 2013

Definition at line 29 of file TrackingParticle.h.

Member Typedef Documentation

electric charge type

Definition at line 33 of file TrackingParticle.h.

typedef std::vector<SimTrack>::const_iterator TrackingParticle::g4t_iterator

Definition at line 41 of file TrackingParticle.h.

reference to reco::GenParticle

Definition at line 40 of file TrackingParticle.h.

Lorentz vector.

Definition at line 34 of file TrackingParticle.h.

point in the space

Definition at line 36 of file TrackingParticle.h.

Lorentz vector.

Definition at line 35 of file TrackingParticle.h.

point in the space

Definition at line 37 of file TrackingParticle.h.

Constructor & Destructor Documentation

TrackingParticle::TrackingParticle ( )

Default constructor. Note that the object will be useless until it is provided with a SimTrack and parent TrackingVertex.

Most of the methods assume there is a SimTrack and parent TrackingVertex set, so will either crash or give undefined results if this isn't true. This constructor should only be used to create a placeholder until setParentVertex() and addG4Track() can be called.

Definition at line 10 of file TrackingParticle.cc.

11 {
12  // No operation
13 }
TrackingParticle::TrackingParticle ( const SimTrack simtrk,
const TrackingVertexRef parentVertex 
)

Definition at line 15 of file TrackingParticle.cc.

References addG4Track(), and setParentVertex().

16 {
17  addG4Track( simtrk );
18  setParentVertex( parentVertex );
19 }
void setParentVertex(const TrackingVertexRef &ref)
void addG4Track(const SimTrack &t)
TrackingParticle::~TrackingParticle ( )

Definition at line 21 of file TrackingParticle.cc.

22 {
23 }

Member Function Documentation

void TrackingParticle::addDecayVertex ( const TrackingVertexRef ref)

Definition at line 71 of file TrackingParticle.cc.

References decayVertices_, and edm::RefVector< C, T, F >::push_back().

72 {
74 }
TrackingVertexRefVector decayVertices_
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:64
void TrackingParticle::addG4Track ( const SimTrack t)

Definition at line 41 of file TrackingParticle.cc.

References g4Tracks_.

Referenced by TrackingParticle().

42 {
43  g4Tracks_.push_back( t );
44 }
std::vector< SimTrack > g4Tracks_
references to G4 and reco::GenParticle tracks
void TrackingParticle::addGenParticle ( const reco::GenParticleRef ref)

Definition at line 36 of file TrackingParticle.cc.

References genParticles_, and edm::RefVector< C, T, F >::push_back().

37 {
38  genParticles_.push_back( ref );
39 }
reco::GenParticleRefVector genParticles_
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:64
TrackingParticle::Vector TrackingParticle::boostToCM ( ) const

Vector to boost to the particle centre of mass frame.

Definition at line 136 of file TrackingParticle.cc.

References p4().

137 {
138  return p4().BoostToCM();
139 }
const LorentzVector & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
int TrackingParticle::charge ( void  ) const

Electric charge. Note this is taken from the first SimTrack only.

Definition at line 116 of file TrackingParticle.cc.

References g4Tracks_.

Referenced by FWTrackingParticleProxyBuilder::build(), FWTrackingParticleProxyBuilderFullFramework::build(), MuonMCClassifier::convertAndPush(), RecoMuonValidator::MuonME::fill(), TrackingParticleSelector::operator()(), operator<<(), ShallowSimTracksProducer::produce(), RecoTracktoTP::s_qoverp(), and TPtoRecoTrack::s_qoverp().

117 {
118  return g4Tracks_.at( 0 ).charge();
119 }
std::vector< SimTrack > g4Tracks_
references to G4 and reco::GenParticle tracks
void TrackingParticle::clearDecayVertices ( )

Definition at line 81 of file TrackingParticle.cc.

References edm::RefVector< C, T, F >::clear(), and decayVertices_.

82 {
84 }
TrackingVertexRefVector decayVertices_
void clear()
Clear the vector.
Definition: RefVector.h:133
void TrackingParticle::clearParentVertex ( )

Definition at line 76 of file TrackingParticle.cc.

References parentVertex_.

77 {
79 }
edm::Ref< TrackingVertexCollection > TrackingVertexRef
TrackingVertexRef parentVertex_
const TrackingVertexRefVector & TrackingParticle::decayVertices ( ) const

Definition at line 101 of file TrackingParticle.cc.

References decayVertices_.

Referenced by operator<<().

102 {
103  return decayVertices_;
104 }
TrackingVertexRefVector decayVertices_
tv_iterator TrackingParticle::decayVertices_begin ( ) const

Definition at line 106 of file TrackingParticle.cc.

References edm::RefVector< C, T, F >::begin(), and decayVertices_.

Referenced by operator<<().

107 {
108  return decayVertices_.begin();
109 }
TrackingVertexRefVector decayVertices_
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:244
tv_iterator TrackingParticle::decayVertices_end ( ) const

Definition at line 111 of file TrackingParticle.cc.

References decayVertices_, and edm::RefVector< C, T, F >::end().

Referenced by operator<<().

112 {
113  return decayVertices_.end();
114 }
TrackingVertexRefVector decayVertices_
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:249
double TrackingParticle::energy ( void  ) const

Energy. Note this is taken from the first SimTrack only.

Definition at line 146 of file TrackingParticle.cc.

References p4().

147 {
148  return p4().E();
149 }
const LorentzVector & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
double TrackingParticle::et ( ) const

Transverse energy. Note this is taken from the first SimTrack only.

Definition at line 151 of file TrackingParticle.cc.

References p4().

152 {
153  return p4().Et();
154 }
const LorentzVector & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
double TrackingParticle::eta ( void  ) const

Momentum pseudorapidity. Note this is taken from the first SimTrack only.

Definition at line 206 of file TrackingParticle.cc.

References p4().

Referenced by RecoMuonValidator::MuonME::fill(), and ShallowSimTracksProducer::produce().

207 {
208  return p4().Eta();
209 }
const LorentzVector & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
EncodedEventId TrackingParticle::eventId ( ) const

Signal source, crossing number.

Note this is taken from the first SimTrack only, but there shouldn't be any SimTracks from different crossings in the TrackingParticle.

Definition at line 31 of file TrackingParticle.cc.

References g4Tracks_.

Referenced by MultiTrackValidator::analyze(), TrackerSeedValidator::analyze(), PrimaryVertexAnalyzer4PU::analyzeVertexCollectionTP(), TrackingParticleSelector::operator()(), and operator<<().

32 {
33  return g4Tracks_.at( 0 ).eventId();
34 }
std::vector< SimTrack > g4Tracks_
references to G4 and reco::GenParticle tracks
TrackingParticle::g4t_iterator TrackingParticle::g4Track_begin ( ) const

Definition at line 56 of file TrackingParticle.cc.

References g4Tracks_.

Referenced by operator<<(), and QuickTrackAssociatorByHits::trackingParticleContainsIdentifier().

57 {
58  return g4Tracks_.begin();
59 }
std::vector< SimTrack > g4Tracks_
references to G4 and reco::GenParticle tracks
TrackingParticle::g4t_iterator TrackingParticle::g4Track_end ( ) const

Definition at line 61 of file TrackingParticle.cc.

References g4Tracks_.

Referenced by operator<<(), and QuickTrackAssociatorByHits::trackingParticleContainsIdentifier().

62 {
63  return g4Tracks_.end();
64 }
std::vector< SimTrack > g4Tracks_
references to G4 and reco::GenParticle tracks
const std::vector< SimTrack > & TrackingParticle::g4Tracks ( ) const

Definition at line 91 of file TrackingParticle.cc.

References g4Tracks_.

92 {
93  return g4Tracks_;
94 }
std::vector< SimTrack > g4Tracks_
references to G4 and reco::GenParticle tracks
TrackingParticle::genp_iterator TrackingParticle::genParticle_begin ( ) const

iterators

Definition at line 46 of file TrackingParticle.cc.

References edm::RefVector< C, T, F >::begin(), and genParticles_.

Referenced by TrackingParticleSelector::operator()(), and operator<<().

47 {
48  return genParticles_.begin();
49 }
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:244
reco::GenParticleRefVector genParticles_
TrackingParticle::genp_iterator TrackingParticle::genParticle_end ( ) const

Definition at line 51 of file TrackingParticle.cc.

References edm::RefVector< C, T, F >::end(), and genParticles_.

Referenced by TrackingParticleSelector::operator()(), and operator<<().

52 {
53  return genParticles_.end();
54 }
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:249
reco::GenParticleRefVector genParticles_
const reco::GenParticleRefVector & TrackingParticle::genParticles ( ) const

Definition at line 86 of file TrackingParticle.cc.

References genParticles_.

87 {
88  return genParticles_;
89 }
reco::GenParticleRefVector genParticles_
bool TrackingParticle::longLived ( ) const

is long lived?

Definition at line 250 of file TrackingParticle.cc.

References longLivedTag, and status().

251 {
252  return status()&longLivedTag;
253 }
int status() const
Status word.
static const unsigned int longLivedTag
long lived flag
double TrackingParticle::mass ( ) const

Mass. Note this is taken from the first SimTrack only.

Definition at line 156 of file TrackingParticle.cc.

References p4().

Referenced by massSqr().

157 {
158  return p4().M();
159 }
const LorentzVector & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
double TrackingParticle::massSqr ( ) const

Mass squared. Note this is taken from the first SimTrack only.

Definition at line 161 of file TrackingParticle.cc.

References mass(), and funct::pow().

162 {
163  return pow( mass(), 2 );
164 }
double mass() const
Mass. Note this is taken from the first SimTrack only.
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
int TrackingParticle::matchedHit ( ) const

Definition at line 265 of file TrackingParticle.cc.

References numberOfTrackerLayers_.

266 {
267  edm::LogWarning("TrackingParticle") << "The method matchedHit() has been deprecated. Use numberOfTrackerLayers() instead.";
268  return numberOfTrackerLayers_;
269 }
int numberOfTrackerLayers_
The number of tracker layers with hits. Equivalent to the old matchedHit.
TrackingParticle::Vector TrackingParticle::momentum ( ) const

spatial momentum vector

Definition at line 131 of file TrackingParticle.cc.

References p4().

Referenced by MultiTrackValidator::analyze(), V0Validator::analyze(), MuonTrackValidator::analyze(), RecoMuonValidator::MuonME::fill(), TrackingParticleSelector::operator()(), and operator<<().

132 {
133  return p4().Vect();
134 }
const LorentzVector & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
double TrackingParticle::mt ( ) const

Transverse mass. Note this is taken from the first SimTrack only.

Definition at line 166 of file TrackingParticle.cc.

References p4().

167 {
168  return p4().Mt();
169 }
const LorentzVector & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
double TrackingParticle::mtSqr ( ) const

Transverse mass squared. Note this is taken from the first SimTrack only.

Definition at line 171 of file TrackingParticle.cc.

References p4().

172 {
173  return p4().Mt2();
174 }
const LorentzVector & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
int TrackingParticle::numberOfHits ( void  ) const

Gives the total number of hits, including muon hits. Hits on overlaps in the same layer count separately.

Equivalent to trackPSimHit().size() in the old TrackingParticle implementation.

Definition at line 255 of file TrackingParticle.cc.

References numberOfHits_.

Referenced by QuickTrackAssociatorByHits::associateTrack(), and setNumberOfHits().

256 {
257  return numberOfHits_;
258 }
int numberOfHits_
The total number of hits.
int TrackingParticle::numberOfTrackerHits ( ) const

The number of hits in the tracker. Hits on overlaps in the same layer count separately.

Equivalent to trackPSimHit(DetId::Tracker).size() in the old TrackingParticle implementation.

Definition at line 260 of file TrackingParticle.cc.

References numberOfTrackerHits_.

Referenced by MultiTrackValidator::analyze(), and setNumberOfTrackerHits().

261 {
262  return numberOfTrackerHits_;
263 }
int numberOfTrackerHits_
The number of tracker only hits.
int TrackingParticle::numberOfTrackerLayers ( ) const

The number of tracker layers with a hit.

Different from numberOfTrackerHits because this method counts multiple hits on overlaps in the layer as one hit.

Definition at line 271 of file TrackingParticle.cc.

References numberOfTrackerLayers_.

Referenced by TrackingParticleSelector::operator()(), and setNumberOfTrackerLayers().

272 {
273  return numberOfTrackerLayers_;
274 }
int numberOfTrackerLayers_
The number of tracker layers with hits. Equivalent to the old matchedHit.
double TrackingParticle::p ( ) const

Magnitude of momentum vector. Note this is taken from the first SimTrack only.

Definition at line 141 of file TrackingParticle.cc.

References p4().

Referenced by RecoMuonValidator::MuonME::fill(), and ShallowSimTracksProducer::produce().

142 {
143  return p4().P();
144 }
const LorentzVector & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
const TrackingParticle::LorentzVector & TrackingParticle::p4 ( ) const

Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.

Definition at line 126 of file TrackingParticle.cc.

References g4Tracks_.

Referenced by boostToCM(), MuonMCClassifier::convertAndPush(), energy(), et(), eta(), mass(), momentum(), mt(), mtSqr(), operator<<(), p(), phi(), pt(), px(), py(), pz(), rapidity(), and theta().

127 {
128  return g4Tracks_.at( 0 ).momentum();
129 }
std::vector< SimTrack > g4Tracks_
references to G4 and reco::GenParticle tracks
const TrackingVertexRef & TrackingParticle::parentVertex ( ) const
int TrackingParticle::pdgId ( ) const

PDG ID.

Returns the PDG ID of the first associated gen particle. If there are no gen particles associated then it returns type() from the first SimTrack.

Definition at line 25 of file TrackingParticle.cc.

References edm::RefVector< C, T, F >::begin(), edm::RefVector< C, T, F >::empty(), g4Tracks_, and genParticles_.

Referenced by V0Validator::analyze(), MuonMCClassifier::convertAndPush(), TrackingParticleSelector::operator()(), operator<<(), and ShallowSimTracksProducer::produce().

26 {
27  if( genParticles_.empty() ) return g4Tracks_.at( 0 ).type();
28  else return (*genParticles_.begin())->pdgId();
29 }
int pdgId() const
PDG ID.
bool empty() const
Is the RefVector empty.
Definition: RefVector.h:86
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:244
reco::GenParticleRefVector genParticles_
std::vector< SimTrack > g4Tracks_
references to G4 and reco::GenParticle tracks
double TrackingParticle::phi ( void  ) const

Momentum azimuthal angle. Note this is taken from the first SimTrack only.

Definition at line 196 of file TrackingParticle.cc.

References p4().

Referenced by RecoMuonValidator::MuonME::fill(), and ShallowSimTracksProducer::produce().

197 {
198  return p4().Phi();
199 }
const LorentzVector & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
double TrackingParticle::pt ( ) const

Transverse momentum. Note this is taken from the first SimTrack only.

Definition at line 191 of file TrackingParticle.cc.

References p4().

Referenced by RecoMuonValidator::MuonME::fill(), and ShallowSimTracksProducer::produce().

192 {
193  return p4().Pt();
194 }
const LorentzVector & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
double TrackingParticle::px ( ) const

x coordinate of momentum vector. Note this is taken from the first SimTrack only.

Definition at line 176 of file TrackingParticle.cc.

References p4().

Referenced by FWTrackingParticleProxyBuilder::build(), and FWTrackingParticleProxyBuilderFullFramework::build().

177 {
178  return p4().Px();
179 }
const LorentzVector & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
double TrackingParticle::py ( ) const

y coordinate of momentum vector. Note this is taken from the first SimTrack only.

Definition at line 181 of file TrackingParticle.cc.

References p4().

Referenced by FWTrackingParticleProxyBuilder::build(), and FWTrackingParticleProxyBuilderFullFramework::build().

182 {
183  return p4().Py();
184 }
const LorentzVector & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
double TrackingParticle::pz ( ) const

z coordinate of momentum vector. Note this is taken from the first SimTrack only.

Definition at line 186 of file TrackingParticle.cc.

References p4().

Referenced by FWTrackingParticleProxyBuilder::build(), and FWTrackingParticleProxyBuilderFullFramework::build().

187 {
188  return p4().Pz();
189 }
const LorentzVector & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
double TrackingParticle::rapidity ( ) const

Rapidity. Note this is taken from the first SimTrack only.

Definition at line 211 of file TrackingParticle.cc.

References p4().

Referenced by y().

212 {
213  return p4().Rapidity();
214 }
const LorentzVector & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
void TrackingParticle::setNumberOfHits ( int  numberOfHits)

Definition at line 276 of file TrackingParticle.cc.

References numberOfHits(), and numberOfHits_.

277 {
279 }
int numberOfHits_
The total number of hits.
int numberOfHits() const
Gives the total number of hits, including muon hits. Hits on overlaps in the same layer count separat...
void TrackingParticle::setNumberOfTrackerHits ( int  numberOfTrackerHits)

Definition at line 281 of file TrackingParticle.cc.

References numberOfTrackerHits(), and numberOfTrackerHits_.

282 {
284 }
int numberOfTrackerHits_
The number of tracker only hits.
int numberOfTrackerHits() const
The number of hits in the tracker. Hits on overlaps in the same layer count separately.
void TrackingParticle::setNumberOfTrackerLayers ( const int  numberOfTrackerLayers)

Definition at line 286 of file TrackingParticle.cc.

References numberOfTrackerLayers(), and numberOfTrackerLayers_.

287 {
289 }
int numberOfTrackerLayers() const
The number of tracker layers with a hit.
int numberOfTrackerLayers_
The number of tracker layers with hits. Equivalent to the old matchedHit.
void TrackingParticle::setParentVertex ( const TrackingVertexRef ref)

Definition at line 66 of file TrackingParticle.cc.

References parentVertex_.

Referenced by TrackingParticle().

67 {
68  parentVertex_=ref;
69 }
TrackingVertexRef parentVertex_
int TrackingParticle::status ( void  ) const

Status word.

Returns status() from the first gen particle, or -99 if there are no gen particles attached.

Definition at line 244 of file TrackingParticle.cc.

References edm::RefVector< C, T, F >::begin(), edm::RefVector< C, T, F >::empty(), and genParticles_.

Referenced by MuonMCClassifier::convertAndPush(), longLived(), and TrackingParticleSelector::operator()().

245 {
246  if( genParticles_.empty() ) return -99; // Use the old invalid status flag that used to be set by TrackingTruthProducer.
247  else return (*genParticles_.begin())->status();
248 }
bool empty() const
Is the RefVector empty.
Definition: RefVector.h:86
int status() const
Status word.
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:244
reco::GenParticleRefVector genParticles_
double TrackingParticle::theta ( void  ) const

Momentum polar angle. Note this is taken from the first SimTrack only.

Definition at line 201 of file TrackingParticle.cc.

References p4().

Referenced by ShallowSimTracksProducer::produce().

202 {
203  return p4().Theta();
204 }
const LorentzVector & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
int TrackingParticle::threeCharge ( ) const

Kept for backwards compatibility. Gives 3*charge(), don't know why.

Definition at line 121 of file TrackingParticle.cc.

References g4Tracks_.

122 {
123  return g4Tracks_.at( 0 ).charge()*3;
124 }
std::vector< SimTrack > g4Tracks_
references to G4 and reco::GenParticle tracks
TrackingParticle::Point TrackingParticle::vertex ( ) const

Parent vertex position.

Definition at line 221 of file TrackingParticle.cc.

References vx(), vy(), and vz().

Referenced by MultiTrackValidator::analyze(), V0Validator::analyze(), MuonTrackValidator::analyze(), MuonMCClassifier::convertAndPush(), RecoMuonValidator::MuonME::fill(), TrackingParticleSelector::operator()(), and operator<<().

222 {
223  return Point( vx(), vy(), vz() );
224 }
math::XYZPointD Point
point in the space
double vy() const
y coordinate of parent vertex position
double vx() const
x coordinate of parent vertex position
double vz() const
z coordinate of parent vertex position
double TrackingParticle::vx ( ) const

x coordinate of parent vertex position

Definition at line 226 of file TrackingParticle.cc.

References TrackingVertex::position(), and alignCSCRings::r.

Referenced by FWTrackingParticleProxyBuilder::build(), FWTrackingParticleProxyBuilderFullFramework::build(), and vertex().

227 {
228  const TrackingVertex& r=( *parentVertex_);
229  return r.position().X();
230 }
const LorentzVector & position() const
double TrackingParticle::vy ( ) const

y coordinate of parent vertex position

Definition at line 232 of file TrackingParticle.cc.

References TrackingVertex::position(), and alignCSCRings::r.

Referenced by FWTrackingParticleProxyBuilder::build(), FWTrackingParticleProxyBuilderFullFramework::build(), and vertex().

233 {
234  const TrackingVertex& r=( *parentVertex_);
235  return r.position().Y();
236 }
const LorentzVector & position() const
double TrackingParticle::vz ( ) const

z coordinate of parent vertex position

Definition at line 238 of file TrackingParticle.cc.

References TrackingVertex::position(), and alignCSCRings::r.

Referenced by FWTrackingParticleProxyBuilder::build(), FWTrackingParticleProxyBuilderFullFramework::build(), and vertex().

239 {
240  const TrackingVertex& r=( *parentVertex_);
241  return r.position().Z();
242 }
const LorentzVector & position() const
double TrackingParticle::y ( ) const

Friends And Related Function Documentation

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

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

Definition at line 12 of file TrackingDataPrint.h.

13 {
14 
15  // Compare momenta from sources
16  s << "T.P. Track Momentum, q , ID, & Event # "
17  << tp.p4() << " " << tp.charge() << " "
18  << tp.pdgId() << " "
19  << tp.eventId().bunchCrossing() << "." << tp.eventId().event()
20  << std::endl;
21  s << " Hits for this track: " << tp.trackPSimHit().size()
22  << std::endl;
23 
24  for (TrackingParticle::genp_iterator hepT = tp.genParticle_begin();
25  hepT != tp.genParticle_end(); ++hepT)
26  {
27  s << " HepMC Track Momentum " << (*hepT)->momentum().mag() << std::endl;
28  }
29  for (TrackingParticle::g4t_iterator g4T = tp.g4Track_begin();
30  g4T != tp.g4Track_end(); ++g4T)
31  {
32  s << " Geant Track Momentum " << g4T->momentum() << std::endl;
33  s << " Geant Track ID & type " << g4T->trackId() << " "
34  << g4T->type() << std::endl;
35  if (g4T->type() != tp.pdgId())
36  {
37  s << " Mismatch b/t TrackingParticle and Geant types"
38  << std::endl;
39  }
40  }
41  return s;
42 }
std::vector< SimTrack >::const_iterator g4t_iterator

Member Data Documentation

TrackingVertexRefVector TrackingParticle::decayVertices_
private
std::vector<SimTrack> TrackingParticle::g4Tracks_
private

references to G4 and reco::GenParticle tracks

Definition at line 156 of file TrackingParticle.h.

Referenced by addG4Track(), charge(), eventId(), g4Track_begin(), g4Track_end(), g4Tracks(), p4(), pdgId(), and threeCharge().

reco::GenParticleRefVector TrackingParticle::genParticles_
private
const unsigned int TrackingParticle::longLivedTag = 65536
static

long lived flag

Definition at line 125 of file TrackingParticle.h.

Referenced by longLived().

int TrackingParticle::numberOfHits_
private

The total number of hits.

Definition at line 151 of file TrackingParticle.h.

Referenced by numberOfHits(), and setNumberOfHits().

int TrackingParticle::numberOfTrackerHits_
private

The number of tracker only hits.

Definition at line 152 of file TrackingParticle.h.

Referenced by numberOfTrackerHits(), and setNumberOfTrackerHits().

int TrackingParticle::numberOfTrackerLayers_
private

The number of tracker layers with hits. Equivalent to the old matchedHit.

Definition at line 153 of file TrackingParticle.h.

Referenced by matchedHit(), numberOfTrackerLayers(), and setNumberOfTrackerLayers().

TrackingVertexRef TrackingParticle::parentVertex_
private

Definition at line 160 of file TrackingParticle.h.

Referenced by clearParentVertex(), parentVertex(), and setParentVertex().