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 | Private Attributes | Friends
TrackingParticle Class Reference

#include <TrackingParticle.h>

Inheritance diagram for TrackingParticle:
ParticleBase

Public Types

typedef std::multimap
< DetId::Detector, PSimHit
DetectorToPSimHit
 
typedef std::vector< SimTrack >
::const_iterator 
g4t_iterator
 
typedef
GenParticleRefVector::iterator 
genp_iterator
 
typedef edm::Ref
< edm::HepMCProduct,
HepMC::GenParticle > 
GenParticleRef
 
typedef edm::RefVector
< edm::HepMCProduct,
HepMC::GenParticle > 
GenParticleRefVector
 reference to HepMC::GenParticle More...
 
typedef std::vector
< TrackingVertex
TrackingVertexCollection
 
typedef edm::Ref
< TrackingVertexCollection
TrackingVertexRef
 
typedef edm::RefVector
< TrackingVertexCollection
TrackingVertexRefVector
 
typedef
TrackingVertexRefVector::iterator 
tv_iterator
 
- Public Types inherited from ParticleBase
typedef int Charge
 electric charge type 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 &)
 
void addG4Track (const SimTrack &)
 
void addGenParticle (const GenParticleRef &)
 
void addPSimHit (const PSimHit &)
 
void clearDecayVertices ()
 
void clearParentVertex ()
 
const TrackingVertexRefVectordecayVertices () const
 
tv_iterator decayVertices_begin () const
 
tv_iterator decayVertices_end () const
 
EncodedEventId eventId () const
 
g4t_iterator g4Track_begin () const
 
g4t_iterator g4Track_end () const
 
const std::vector< SimTrack > & g4Tracks () const
 
const GenParticleRefVectorgenParticle () const
 
genp_iterator genParticle_begin () const
 iterators More...
 
genp_iterator genParticle_end () const
 
int matchedHit () const
 
const TrackingVertexRefparentVertex () const
 
int pdgId () const
 PDG id, signal source, crossing number. More...
 
const std::vector< PSimHit >
::const_iterator 
pSimHit_begin () const
 
const std::vector< PSimHit >
::const_iterator 
pSimHit_end () const
 
void setMatchedHit (const int &)
 
void setParentVertex (const TrackingVertexRef &)
 
void setVertex (const Point &vtx, double t)
 
 TrackingParticle ()
 default constructor More...
 
 TrackingParticle (char q, const LorentzVector &p4, const Point &vtx, double t, const int pdgId, const int status, const EncodedEventId eventId)
 constructor from pointer to generator particle More...
 
const std::vector< PSimHit > & trackPSimHit () const
 
std::vector< PSimHittrackPSimHit (DetId::Detector) const
 
 ~TrackingParticle ()
 
- Public Member Functions inherited from ParticleBase
Vector boostToCM () const
 
int charge () const
 electric charge More...
 
double energy () const
 energy More...
 
double et () const
 transverse energy More...
 
double eta () const
 momentum pseudorapidity More...
 
bool longLived () const
 is long lived? More...
 
double mass () const
 mass More...
 
double massSqr () const
 mass squared More...
 
Vector momentum () const
 spatial momentum vector More...
 
double mt () const
 transverse mass More...
 
double mtSqr () const
 transverse mass squared More...
 
double p () const
 magnitude of momentum vector More...
 
const LorentzVectorp4 () const
 four-momentum Lorentz vector More...
 
 ParticleBase ()
 default constructor More...
 
 ParticleBase (Charge q, const LorentzVector &p4, const Point &vertex=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
 constructor from values More...
 
 ParticleBase (Charge q, const PolarLorentzVector &p4, const Point &vertex=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
 constructor from values More...
 
int pdgId () const
 PDG identifier. More...
 
double phi () const
 momentum azimuthal angle More...
 
const PolarLorentzVectorpolarP4 () const
 four-momentum Lorentz vector More...
 
double pt () const
 transverse momentum More...
 
double px () const
 x coordinate of momentum vector More...
 
double py () const
 y coordinate of momentum vector More...
 
double pz () const
 z coordinate of momentum vector More...
 
double rapidity () const
 repidity More...
 
void setCharge (Charge q)
 set electric charge More...
 
void setLongLived ()
 set long lived flag More...
 
void setMass (double m)
 set particle mass More...
 
void setP4 (const LorentzVector &p4)
 set 4-momentum More...
 
void setP4 (const PolarLorentzVector &p4)
 set 4-momentum More...
 
void setPdgId (int pdgId)
 
void setPz (double pz)
 
void setStatus (int status)
 set status word More...
 
void setThreeCharge (Charge qx3)
 set electric charge More...
 
void setVertex (const Point &vertex)
 set vertex More...
 
int status () const
 status word More...
 
double theta () const
 momentum polar angle More...
 
int threeCharge () const
 electric charge More...
 
const Pointvertex () const
 vertex position More...
 
double vx () const
 x coordinate of vertex position More...
 
double vy () const
 y coordinate of vertex position More...
 
double vz () const
 z coordinate of vertex position More...
 
double y () const
 repidity More...
 
virtual ~ParticleBase ()
 destructor More...
 

Private Attributes

TrackingVertexRefVector decayVertices_
 
EncodedEventId eventId_
 
std::vector< SimTrackg4Tracks_
 references to G4 and HepMC tracks More...
 
GenParticleRefVector genParticles_
 
int matchedHit_
 Total Number of Hits belonging to the TrackingParticle. More...
 
TrackingVertexRef parentVertex_
 
int pdgId_
 PDG identifier, signal source, crossing number. More...
 
float t_
 production time More...
 
std::vector< PSimHittrackPSimHit_
 

Friends

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

Additional Inherited Members

- Static Public Attributes inherited from ParticleBase
static const unsigned int longLivedTag = 65536
 long lived flag More...
 
- Protected Member Functions inherited from ParticleBase
void cacheCartesian () const
 set internal cache More...
 
void cachePolar () const
 set internal cache More...
 
void clearCache () const
 clear internal cache More...
 
- Protected Attributes inherited from ParticleBase
edm::BoolCache cacheCartesianFixed_
 
edm::BoolCache cachePolarFixed_
 has cache been set? More...
 
float eta_
 
float mass_
 
LorentzVector p4Cartesian_
 internal cache for p4 More...
 
PolarLorentzVector p4Polar_
 internal cache for p4 More...
 
int pdgId_
 PDG identifier. More...
 
float phi_
 
float pt_
 four-momentum Lorentz vector More...
 
Charge qx3_
 electric charge More...
 
int status_
 status word More...
 
Point vertex_
 vertex position More...
 

Detailed Description

Definition at line 25 of file TrackingParticle.h.

Member Typedef Documentation

Definition at line 43 of file TrackingParticle.h.

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

Definition at line 36 of file TrackingParticle.h.

Definition at line 35 of file TrackingParticle.h.

Definition at line 34 of file TrackingParticle.h.

reference to HepMC::GenParticle

Definition at line 33 of file TrackingParticle.h.

Definition at line 38 of file TrackingParticle.h.

Definition at line 39 of file TrackingParticle.h.

Definition at line 40 of file TrackingParticle.h.

Definition at line 41 of file TrackingParticle.h.

Constructor & Destructor Documentation

TrackingParticle::TrackingParticle ( )
inline

default constructor

Definition at line 46 of file TrackingParticle.h.

46 {}
TrackingParticle::TrackingParticle ( char  q,
const LorentzVector p4,
const Point vtx,
double  t,
const int  pdgId,
const int  status,
const EncodedEventId  eventId 
)

constructor from pointer to generator particle

Definition at line 8 of file TrackingParticle.cc.

9  :
10  ParticleBase( q, p4, vtx,pdgId,status ), t_( t ), pdgId_( pdgId ), eventId_( eventId )
11 {
12 }
int pdgId() const
PDG id, signal source, crossing number.
float t_
production time
int pdgId_
PDG identifier, signal source, crossing number.
const LorentzVector & p4() const
four-momentum Lorentz vector
Definition: ParticleBase.h:75
int status() const
status word
Definition: ParticleBase.h:264
ParticleBase()
default constructor
Definition: ParticleBase.h:33
EncodedEventId eventId_
TrackingParticle::~TrackingParticle ( )

Definition at line 14 of file TrackingParticle.cc.

15 {
16 }

Member Function Documentation

void TrackingParticle::addDecayVertex ( const TrackingVertexRef ref)

Definition at line 77 of file TrackingParticle.cc.

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

Referenced by TrackingTruthProducer::mergeBremsstrahlung().

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

Definition at line 23 of file TrackingParticle.cc.

References g4Tracks_.

Referenced by TrackingTruthProducer::mergeBremsstrahlung(), and TrackingTruthProducer::setTrackingParticle().

24 {
25  g4Tracks_.push_back(t);
26 }
std::vector< SimTrack > g4Tracks_
references to G4 and HepMC tracks
void TrackingParticle::addGenParticle ( const GenParticleRef )

Definition at line 18 of file TrackingParticle.cc.

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

Referenced by TrackingTruthProducer::setTrackingParticle().

19 {
21 }
GenParticleRefVector genParticles_
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:61
void TrackingParticle::addPSimHit ( const PSimHit hit)

Definition at line 28 of file TrackingParticle.cc.

References trackPSimHit_.

Referenced by TrackingTruthProducer::mergeBremsstrahlung(), and TrackingTruthProducer::setTrackingParticle().

29 {
30  trackPSimHit_.push_back(hit);
31 }
std::vector< PSimHit > trackPSimHit_
void TrackingParticle::clearDecayVertices ( )

Definition at line 87 of file TrackingParticle.cc.

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

Referenced by TrackingTruthProducer::mergeBremsstrahlung().

88 {
90 }
TrackingVertexRefVector decayVertices_
void clear()
Clear the vector.
Definition: RefVector.h:129
void TrackingParticle::clearParentVertex ( )

Definition at line 82 of file TrackingParticle.cc.

References parentVertex_.

Referenced by TrackingTruthProducer::mergeBremsstrahlung().

83 {
85 }
edm::Ref< TrackingVertexCollection > TrackingVertexRef
TrackingVertexRef parentVertex_
const TrackingVertexRefVector& TrackingParticle::decayVertices ( ) const
inline

Definition at line 111 of file TrackingParticle.h.

References decayVertices_.

Referenced by TrackingTruthProducer::mergeBremsstrahlung(), and operator<<().

112  {
113  return decayVertices_;
114  }
TrackingVertexRefVector decayVertices_
tv_iterator TrackingParticle::decayVertices_begin ( ) const
inline

Definition at line 115 of file TrackingParticle.h.

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

Referenced by TrackingTruthProducer::mergeBremsstrahlung(), and operator<<().

116  {
117  return decayVertices_.begin();
118  }
TrackingVertexRefVector decayVertices_
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:237
tv_iterator TrackingParticle::decayVertices_end ( ) const
inline

Definition at line 119 of file TrackingParticle.h.

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

Referenced by TrackingTruthProducer::mergeBremsstrahlung(), and operator<<().

120  {
121  return decayVertices_.end();
122  }
TrackingVertexRefVector decayVertices_
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:242
EncodedEventId TrackingParticle::eventId ( ) const
inline

Definition at line 60 of file TrackingParticle.h.

References eventId_.

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

61  {
62  return eventId_;
63  }
EncodedEventId eventId_
TrackingParticle::g4t_iterator TrackingParticle::g4Track_begin ( ) const

Definition at line 43 of file TrackingParticle.cc.

References g4Tracks_.

Referenced by TrackingTruthProducer::mergeBremsstrahlung(), and operator<<().

44 {
45  return g4Tracks_.begin();
46 }
std::vector< SimTrack > g4Tracks_
references to G4 and HepMC tracks
TrackingParticle::g4t_iterator TrackingParticle::g4Track_end ( ) const

Definition at line 48 of file TrackingParticle.cc.

References g4Tracks_.

Referenced by TrackingTruthProducer::mergeBremsstrahlung(), and operator<<().

49 {
50  return g4Tracks_.end();
51 }
std::vector< SimTrack > g4Tracks_
references to G4 and HepMC tracks
const std::vector<SimTrack>& TrackingParticle::g4Tracks ( ) const
inline

Definition at line 93 of file TrackingParticle.h.

References g4Tracks_.

94  {
95  return g4Tracks_ ;
96  }
std::vector< SimTrack > g4Tracks_
references to G4 and HepMC tracks
const GenParticleRefVector& TrackingParticle::genParticle ( ) const
inline

Definition at line 89 of file TrackingParticle.h.

References genParticles_.

90  {
91  return genParticles_;
92  }
GenParticleRefVector genParticles_
TrackingParticle::genp_iterator TrackingParticle::genParticle_begin ( ) const

iterators

Definition at line 33 of file TrackingParticle.cc.

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

Referenced by operator<<().

34 {
35  return genParticles_.begin();
36 }
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:237
GenParticleRefVector genParticles_
TrackingParticle::genp_iterator TrackingParticle::genParticle_end ( ) const

Definition at line 38 of file TrackingParticle.cc.

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

Referenced by operator<<().

39 {
40  return genParticles_.end();
41 }
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:242
GenParticleRefVector genParticles_
int TrackingParticle::matchedHit ( ) const
inline

Definition at line 123 of file TrackingParticle.h.

References matchedHit_.

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

124  {
125  return matchedHit_;
126  }
int matchedHit_
Total Number of Hits belonging to the TrackingParticle.
const TrackingVertexRef& TrackingParticle::parentVertex ( ) const
inline
int TrackingParticle::pdgId ( ) const
inline

PDG id, signal source, crossing number.

Definition at line 56 of file TrackingParticle.h.

References pdgId_.

Referenced by V0Validator::analyze(), TrackingTruthProducer::mergeBremsstrahlung(), TrackingParticleSelector::operator()(), CosmicTrackingParticleSelector::operator()(), operator<<(), and ShallowSimTracksProducer::produce().

57  {
58  return pdgId_;
59  }
int pdgId_
PDG identifier, signal source, crossing number.
const std::vector< PSimHit >::const_iterator TrackingParticle::pSimHit_begin ( ) const

Returns the begin of the vector of ALL the PSimHits of the TrackingParticle

Definition at line 53 of file TrackingParticle.cc.

References trackPSimHit_.

Referenced by RecoMuonValidator::MuonME::fill(), and TrackingTruthProducer::mergeBremsstrahlung().

54 {
55  return trackPSimHit_.begin();
56 }
std::vector< PSimHit > trackPSimHit_
const std::vector< PSimHit >::const_iterator TrackingParticle::pSimHit_end ( ) const

Returns the end of the vector of ALL the PSimHits of the TrackingParticle

Definition at line 58 of file TrackingParticle.cc.

References trackPSimHit_.

Referenced by RecoMuonValidator::MuonME::fill(), and TrackingTruthProducer::mergeBremsstrahlung().

59 {
60  return trackPSimHit_.end();
61 }
std::vector< PSimHit > trackPSimHit_
void TrackingParticle::setMatchedHit ( const int &  hitnumb)

Definition at line 92 of file TrackingParticle.cc.

References matchedHit_.

Referenced by TrackingTruthProducer::setTrackingParticle().

93 {
94  matchedHit_ = hitnumb;
95 }
int matchedHit_
Total Number of Hits belonging to the TrackingParticle.
void TrackingParticle::setParentVertex ( const TrackingVertexRef ref)

Definition at line 72 of file TrackingParticle.cc.

References parentVertex_.

Referenced by TrackingTruthProducer::mergeBremsstrahlung().

73 {
74  parentVertex_ = ref;
75 }
TrackingVertexRef parentVertex_
void TrackingParticle::setVertex ( const Point vtx,
double  t 
)

Definition at line 97 of file TrackingParticle.cc.

References ParticleBase::setVertex(), matplotRender::t, and t_.

98 {
99  t_ = t;
101 }
float t_
production time
void setVertex(const Point &vertex)
set vertex
Definition: ParticleBase.h:249
const std::vector<PSimHit>& TrackingParticle::trackPSimHit ( ) const
inline
std::vector< PSimHit > TrackingParticle::trackPSimHit ( DetId::Detector  detector) const

Definition at line 63 of file TrackingParticle.cc.

References DetId::det(), query::result, and trackPSimHit_.

64 {
65  std::vector<PSimHit> result;
66  for (std::vector<PSimHit>::const_iterator iHit = trackPSimHit_.begin(); iHit != trackPSimHit_.end(); ++iHit)
67  if ( detector == DetId( (uint32_t)((*iHit).detUnitId()) ).det() )
68  result.push_back(*iHit);
69  return result;
70 }
tuple result
Definition: query.py:137
Definition: DetId.h:20
std::vector< PSimHit > trackPSimHit_
Detector det() const
get the detector field from this detid
Definition: DetId.h:37

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
string s
Definition: asciidump.py:422

Member Data Documentation

TrackingVertexRefVector TrackingParticle::decayVertices_
private
EncodedEventId TrackingParticle::eventId_
private

Definition at line 134 of file TrackingParticle.h.

Referenced by eventId().

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

references to G4 and HepMC tracks

Definition at line 140 of file TrackingParticle.h.

Referenced by addG4Track(), g4Track_begin(), g4Track_end(), and g4Tracks().

GenParticleRefVector TrackingParticle::genParticles_
private
int TrackingParticle::matchedHit_
private

Total Number of Hits belonging to the TrackingParticle.

Definition at line 137 of file TrackingParticle.h.

Referenced by matchedHit(), and setMatchedHit().

TrackingVertexRef TrackingParticle::parentVertex_
private

Definition at line 147 of file TrackingParticle.h.

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

int TrackingParticle::pdgId_
private

PDG identifier, signal source, crossing number.

Definition at line 133 of file TrackingParticle.h.

Referenced by pdgId().

float TrackingParticle::t_
private

production time

Definition at line 131 of file TrackingParticle.h.

Referenced by setVertex().

std::vector<PSimHit> TrackingParticle::trackPSimHit_
private

Definition at line 144 of file TrackingParticle.h.

Referenced by addPSimHit(), pSimHit_begin(), pSimHit_end(), and trackPSimHit().