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 TrackingVertexRefVector & | decayVertices () 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::GenParticleRefVector & | genParticles () 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 LorentzVector & | p4 () const |
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only. More... | |
const TrackingVertexRef & | parentVertex () 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< SimTrack > | g4Tracks_ |
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) |
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.
Definition at line 29 of file TrackingParticle.h.
typedef int TrackingParticle::Charge |
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.
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.
TrackingParticle::TrackingParticle | ( | const SimTrack & | simtrk, |
const TrackingVertexRef & | parentVertex | ||
) |
Definition at line 15 of file TrackingParticle.cc.
References addG4Track(), and setParentVertex().
TrackingParticle::~TrackingParticle | ( | ) |
Definition at line 21 of file TrackingParticle.cc.
void TrackingParticle::addDecayVertex | ( | const TrackingVertexRef & | ref | ) |
Definition at line 71 of file TrackingParticle.cc.
References decayVertices_, and edm::RefVector< C, T, F >::push_back().
void TrackingParticle::addG4Track | ( | const SimTrack & | t | ) |
Definition at line 41 of file TrackingParticle.cc.
References g4Tracks_.
Referenced by TrackingParticle().
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().
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().
|
inline |
Electric charge. Note this is taken from the first SimTrack only.
Definition at line 92 of file TrackingParticle.h.
References g4Tracks_.
Referenced by FWTrackingParticleProxyBuilder::build(), FWTrackingParticleProxyBuilderFullFramework::build(), MuonMCClassifier::convertAndPush(), RecoMuonValidator::MuonME::fill(), TrackingParticleSelector::operator()(), operator<<(), ShallowSimTracksProducer::produce(), RecoTracktoTP::s_qoverp(), TPtoRecoTrack::s_qoverp(), and threeCharge().
void TrackingParticle::clearDecayVertices | ( | ) |
Definition at line 81 of file TrackingParticle.cc.
References edm::RefVector< C, T, F >::clear(), and decayVertices_.
void TrackingParticle::clearParentVertex | ( | ) |
Definition at line 76 of file TrackingParticle.cc.
References parentVertex_.
const TrackingVertexRefVector & TrackingParticle::decayVertices | ( | ) | const |
Definition at line 101 of file TrackingParticle.cc.
References decayVertices_.
Referenced by operator<<().
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<<().
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<<().
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().
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().
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().
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<<().
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().
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().
const std::vector< SimTrack > & TrackingParticle::g4Tracks | ( | ) | const |
Definition at line 91 of file TrackingParticle.cc.
References g4Tracks_.
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<<().
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<<().
const reco::GenParticleRefVector & TrackingParticle::genParticles | ( | ) | const |
Definition at line 86 of file TrackingParticle.cc.
References genParticles_.
|
inline |
is long lived?
Definition at line 138 of file TrackingParticle.h.
References longLivedTag, and status().
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().
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().
int TrackingParticle::matchedHit | ( | ) | const |
Definition at line 231 of file TrackingParticle.cc.
References numberOfTrackerLayers_.
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<<().
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().
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().
|
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().
|
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().
|
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().
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().
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().
const TrackingVertexRef & TrackingParticle::parentVertex | ( | ) | const |
Definition at line 96 of file TrackingParticle.cc.
References parentVertex_.
Referenced by V0Validator::analyze(), RecoTracktoTP::numTPMothers(), TPtoRecoTrack::numTPMothers(), RecoTracktoTP::numTPSourceTracks(), TPtoRecoTrack::numTPSourceTracks(), operator<<(), ShallowSimTracksProducer::produce(), RecoTracktoTP::TPMother(), and TPtoRecoTrack::TPMother().
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().
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().
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().
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().
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().
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().
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().
void TrackingParticle::setNumberOfHits | ( | int | numberOfHits | ) |
Definition at line 238 of file TrackingParticle.cc.
References numberOfHits(), and numberOfHits_.
void TrackingParticle::setNumberOfTrackerHits | ( | int | numberOfTrackerHits | ) |
Definition at line 243 of file TrackingParticle.cc.
References numberOfTrackerHits(), and numberOfTrackerHits_.
void TrackingParticle::setNumberOfTrackerLayers | ( | const int | numberOfTrackerLayers | ) |
Definition at line 248 of file TrackingParticle.cc.
References numberOfTrackerLayers(), and numberOfTrackerLayers_.
void TrackingParticle::setParentVertex | ( | const TrackingVertexRef & | ref | ) |
Definition at line 66 of file TrackingParticle.cc.
References parentVertex_.
Referenced by TrackingParticle().
|
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()().
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().
|
inline |
Gives charge in unit of quark charge (should be 3 times "charge()")
Definition at line 94 of file TrackingParticle.h.
|
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<<().
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().
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().
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().
double TrackingParticle::y | ( | ) | const |
Same as rapidity().
Definition at line 207 of file TrackingParticle.cc.
References rapidity().
Referenced by svgfig.Ellipse::__repr__(), Vispa.Gui.WidgetContainer.WidgetContainer::autosize(), Vispa.Gui.VispaWidget.VispaWidget::boundingRect(), geometryXMLparser.Alignable::pos(), and Vispa.Gui.ConnectableWidget.ConnectableWidget::positionizeMenuWidget().
|
friend |
Concrete TrackingParticle. All track parameters are passed in the constructor and stored internally.
Definition at line 12 of file TrackingDataPrint.h.
|
private |
Definition at line 172 of file TrackingParticle.h.
Referenced by addDecayVertex(), clearDecayVertices(), decayVertices(), decayVertices_begin(), and decayVertices_end().
|
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().
|
private |
Definition at line 168 of file TrackingParticle.h.
Referenced by addGenParticle(), genParticle_begin(), genParticle_end(), genParticles(), pdgId(), and status().
|
static |
|
private |
The total number of hits.
Definition at line 162 of file TrackingParticle.h.
Referenced by numberOfHits(), and setNumberOfHits().
|
private |
The number of tracker only hits.
Definition at line 163 of file TrackingParticle.h.
Referenced by numberOfTrackerHits(), and setNumberOfTrackerHits().
|
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().
|
private |
Definition at line 171 of file TrackingParticle.h.
Referenced by clearParentVertex(), parentVertex(), and setParentVertex().