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...
 
float 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
 Gives charge in unit of quark charge (should be 3 times "charge()") 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 127 of file TrackingParticle.cc.

References p4().

128 {
129  return p4().BoostToCM();
130 }
const LorentzVector & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
float TrackingParticle::charge ( void  ) const
inline
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 137 of file TrackingParticle.cc.

References p4().

138 {
139  return p4().E();
140 }
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 142 of file TrackingParticle.cc.

References p4().

143 {
144  return p4().Et();
145 }
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 197 of file TrackingParticle.cc.

References p4().

Referenced by Particle.Particle::__str__(), Muon.Muon::absEffAreaIso(), RecoMuonValidator::MuonME::fill(), Jet.Jet::jetID(), ShallowSimTracksProducer::produce(), and Jet.Jet::puJetId().

198 {
199  return p4().Eta();
200 }
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(), TrackAssociatorByHits::getShared(), TrackAssociatorByHitsImpl::getShared(), TrackingParticleSelector::operator()(), and operator<<().

32 {
33  return g4Tracks_[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<<(), QuickTrackAssociatorByHitsImpl::trackingParticleContainsIdentifier(), 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<<(), QuickTrackAssociatorByHitsImpl::trackingParticleContainsIdentifier(), 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
inline

is long lived?

Definition at line 138 of file TrackingParticle.h.

References longLivedTag, and status().

138 { return status()&longLivedTag;}
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 147 of file TrackingParticle.cc.

References p4().

Referenced by Particle.Particle::__str__(), DiObject.DiMuon::__str__(), and massSqr().

148 {
149  return p4().M();
150 }
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 152 of file TrackingParticle.cc.

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

153 {
154  return pow( mass(), 2 );
155 }
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 231 of file TrackingParticle.cc.

References numberOfTrackerLayers_.

232 {
233  edm::LogWarning("TrackingParticle") << "The method matchedHit() has been deprecated. Use numberOfTrackerLayers() instead.";
234  return numberOfTrackerLayers_;
235 }
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 122 of file TrackingParticle.cc.

References p4().

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

123 {
124  return p4().Vect();
125 }
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 157 of file TrackingParticle.cc.

References p4().

158 {
159  return p4().Mt();
160 }
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 162 of file TrackingParticle.cc.

References p4().

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

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 143 of file TrackingParticle.h.

References numberOfHits_.

Referenced by QuickTrackAssociatorByHitsImpl::associateTrack(), QuickTrackAssociatorByHits::associateTrack(), TrackAssociatorByHits::getShared(), TrackAssociatorByHitsImpl::getShared(), and setNumberOfHits().

143 {return numberOfHits_;}
int numberOfHits_
The total number of hits.
int TrackingParticle::numberOfTrackerHits ( ) const
inline

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 148 of file TrackingParticle.h.

References numberOfTrackerHits_.

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

148 {return numberOfTrackerHits_;}
int numberOfTrackerHits_
The number of tracker only hits.
int TrackingParticle::numberOfTrackerLayers ( ) const
inline

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 156 of file TrackingParticle.h.

References numberOfTrackerLayers_.

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

156 {return numberOfTrackerLayers_;}
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 132 of file TrackingParticle.cc.

References p4().

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

133 {
134  return p4().P();
135 }
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 117 of file TrackingParticle.cc.

References g4Tracks_.

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

118 {
119  return g4Tracks_[0].momentum();
120 }
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 Particle.Particle::__str__(), V0Validator::analyze(), MuonMCClassifier::convertAndPush(), TrackingParticleSelector::operator()(), operator<<(), and ShallowSimTracksProducer::produce().

26 {
27  if( genParticles_.empty() ) return g4Tracks_[0].type();
28  else return (*genParticles_.begin())->pdgId();
29 }
type
Definition: HCALResponse.h:21
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 187 of file TrackingParticle.cc.

References p4().

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

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

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

Definition at line 182 of file TrackingParticle.cc.

References p4().

Referenced by Particle.Particle::__str__(), DiObject.DiMuon::__str__(), Photon.Photon::calScaledIsoValue(), RecoMuonValidator::MuonME::fill(), Electron.Electron::mvaIDLoose(), Electron.Electron::mvaIDTight(), ShallowSimTracksProducer::produce(), Lepton.Lepton::relEffAreaIso(), and Lepton.Lepton::relIso().

183 {
184  return p4().Pt();
185 }
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 167 of file TrackingParticle.cc.

References p4().

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

168 {
169  return p4().Px();
170 }
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 172 of file TrackingParticle.cc.

References p4().

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

173 {
174  return p4().Py();
175 }
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 177 of file TrackingParticle.cc.

References p4().

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

178 {
179  return p4().Pz();
180 }
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 202 of file TrackingParticle.cc.

References p4().

Referenced by y().

203 {
204  return p4().Rapidity();
205 }
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 238 of file TrackingParticle.cc.

References numberOfHits(), and numberOfHits_.

239 {
241 }
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 243 of file TrackingParticle.cc.

References numberOfTrackerHits(), and numberOfTrackerHits_.

244 {
246 }
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 248 of file TrackingParticle.cc.

References numberOfTrackerLayers(), and numberOfTrackerLayers_.

249 {
251 }
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
inline

Status word.

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

Definition at line 131 of file TrackingParticle.h.

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

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

131  {
132  return genParticles_.empty() ? -99 : (*genParticles_[0]).status();
133  }
bool empty() const
Is the RefVector empty.
Definition: RefVector.h:86
int status() const
Status word.
reco::GenParticleRefVector genParticles_
double TrackingParticle::theta ( void  ) const

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

Definition at line 192 of file TrackingParticle.cc.

References p4().

Referenced by ShallowSimTracksProducer::produce(), and Tau.Tau::zImpact().

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

Gives charge in unit of quark charge (should be 3 times "charge()")

Definition at line 94 of file TrackingParticle.h.

References charge(), and f.

94 { return lrintf(3.f*charge()); }
float charge() const
Electric charge. Note this is taken from the first SimTrack only.
double f[11][100]
Point TrackingParticle::vertex ( ) const
inline

Parent vertex position.

Definition at line 120 of file TrackingParticle.h.

References p().

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

120  {
121  const TrackingVertex::LorentzVector & p = (*parentVertex_).position();
122  return Point(p.x(),p.y(),p.z());
123  }
math::XYZPointD Point
point in the space
math::XYZTLorentzVectorD LorentzVector
double p() const
Magnitude of momentum vector. Note this is taken from the first SimTrack only.
double TrackingParticle::vx ( ) const

x coordinate of parent vertex position

Definition at line 212 of file TrackingParticle.cc.

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

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

213 {
214  const TrackingVertex& r=( *parentVertex_);
215  return r.position().X();
216 }
const LorentzVector & position() const
double TrackingParticle::vy ( ) const

y coordinate of parent vertex position

Definition at line 218 of file TrackingParticle.cc.

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

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

219 {
220  const TrackingVertex& r=( *parentVertex_);
221  return r.position().Y();
222 }
const LorentzVector & position() const
double TrackingParticle::vz ( ) const

z coordinate of parent vertex position

Definition at line 224 of file TrackingParticle.cc.

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

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

225 {
226  const TrackingVertex& r=( *parentVertex_);
227  return r.position().Z();
228 }
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 167 of file TrackingParticle.h.

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

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

long lived flag

Definition at line 135 of file TrackingParticle.h.

Referenced by longLived().

int TrackingParticle::numberOfHits_
private

The total number of hits.

Definition at line 162 of file TrackingParticle.h.

Referenced by numberOfHits(), and setNumberOfHits().

int TrackingParticle::numberOfTrackerHits_
private

The number of tracker only hits.

Definition at line 163 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 164 of file TrackingParticle.h.

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

TrackingVertexRef TrackingParticle::parentVertex_
private

Definition at line 171 of file TrackingParticle.h.

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