CMS 3D CMS Logo

TrackingParticle Class Reference

#include <SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h>

Inheritance diagram for TrackingParticle:

reco::Particle

List of all members.

Public Types

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
typedef std::vector
< TrackingVertex
TrackingVertexCollection
typedef edm::Ref
< TrackingVertexCollection
TrackingVertexRef
typedef edm::RefVector
< TrackingVertexCollection
TrackingVertexRefVector
typedef
TrackingVertexRefVector::iterator 
tv_iterator

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
void fillSubDetHitVectors ()
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
genp_iterator genParticle_end () const
int matchedHit () const
const std::vector< PSimHit > & muonPSimHit ()
 The vector of the Muon PSimHits of the TrackingParticle.
const std::vector< PSimHit >
::const_iterator 
muonPSimHit_begin ()
 Returns the begin of the vector the Muon PSimHits of the TrackingParticle.
const std::vector< PSimHit >
::const_iterator 
muonPSimHit_end ()
 Returns the end of the vector the Muon PSimHits of the TrackingParticle.
const TrackingVertexRefparentVertex () const
int pdgId () const
 PDG id, signal source, crossing number.
const std::vector< PSimHit >
::const_iterator 
pSimHit_begin () const
 Returns the begin of the vector of ALL the PSimHits of the TrackingParticle.
const std::vector< PSimHit >
::const_iterator 
pSimHit_end () const
 Returns the end of the vector of ALL the PSimHits of the TrackingParticle.
void setMatchedHit (const int &)
void setParentVertex (const TrackingVertexRef &)
void setVertex (const Point &vtx, double t)
const std::vector< PSimHit > & trackerPSimHit ()
 The vector of the Tracker PSimHits of the TrackingParticle.
const std::vector< PSimHit >
::const_iterator 
trackerPSimHit_begin ()
 Returns the begin of the vector the Tracker PSimHits of the TrackingParticle.
const std::vector< PSimHit >
::const_iterator 
trackerPSimHit_end ()
 Returns the end of the vector the Tracker PSimHits of the 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
 TrackingParticle ()
 default constructor
const std::vector< PSimHit > & trackPSimHit () const
 The vector of ALL the PSimHits of the TrackingParticle.
 ~TrackingParticle ()

Private Attributes

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

Friends

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


Detailed Description

Definition at line 22 of file TrackingParticle.h.


Member Typedef Documentation

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

Definition at line 31 of file TrackingParticle.h.

typedef GenParticleRefVector::iterator TrackingParticle::genp_iterator

Definition at line 30 of file TrackingParticle.h.

typedef edm::Ref<edm::HepMCProduct, HepMC::GenParticle > TrackingParticle::GenParticleRef

Definition at line 29 of file TrackingParticle.h.

typedef edm::RefVector<edm::HepMCProduct, HepMC::GenParticle > TrackingParticle::GenParticleRefVector

reference to HepMC::GenParticle

Definition at line 28 of file TrackingParticle.h.

typedef std::vector<TrackingVertex> TrackingParticle::TrackingVertexCollection

Definition at line 33 of file TrackingParticle.h.

typedef edm::Ref<TrackingVertexCollection> TrackingParticle::TrackingVertexRef

Definition at line 34 of file TrackingParticle.h.

typedef edm::RefVector<TrackingVertexCollection> TrackingParticle::TrackingVertexRefVector

Definition at line 35 of file TrackingParticle.h.

typedef TrackingVertexRefVector::iterator TrackingParticle::tv_iterator

Definition at line 36 of file TrackingParticle.h.


Constructor & Destructor Documentation

TrackingParticle::TrackingParticle (  )  [inline]

default constructor

Definition at line 39 of file TrackingParticle.h.

References subdetVectorFill_.

00039 { subdetVectorFill_ = false; }

TrackingParticle::~TrackingParticle (  ) 

Definition at line 13 of file TrackingParticle.cc.

00013                                     {
00014 }

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.

00009                                                                                                                :
00010   reco::Particle( q, p4, vtx,pdgId,status ), t_( t ), pdgId_( pdgId ), eventId_( eventId ), subdetVectorFill_( false ) {
00011 }


Member Function Documentation

void TrackingParticle::addDecayVertex ( const TrackingVertexRef ref  ) 

Definition at line 144 of file TrackingParticle.cc.

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

Referenced by TrackingTruthProducer::mergeBremsstrahlung(), and MergedTruthProducer::produce().

00144                                                                  {
00145   decayVertices_.push_back(ref);
00146 }

void TrackingParticle::addG4Track ( const SimTrack t  ) 

Definition at line 20 of file TrackingParticle.cc.

References g4Tracks_.

Referenced by TrackingElectronProducer::addG4Track(), TrackingTruthProducer::mergeBremsstrahlung(), and TrackingTruthProducer::trackingParticleAssembler().

00020                                                     {
00021   g4Tracks_.push_back(t);
00022 }

void TrackingParticle::addGenParticle ( const GenParticleRef  ) 

Referenced by TrackingTruthProducer::trackingParticleAssembler().

void TrackingParticle::addPSimHit ( const PSimHit hit  ) 

Definition at line 24 of file TrackingParticle.cc.

References trackPSimHit_.

Referenced by TrackingElectronProducer::addG4Track(), TrackingTruthProducer::mergeBremsstrahlung(), and TrackingTruthProducer::trackingParticleAssembler().

00024                                                     {
00025   trackPSimHit_.push_back(hit);
00026 }

void TrackingParticle::clearDecayVertices (  ) 

Definition at line 152 of file TrackingParticle.cc.

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

Referenced by TrackingTruthProducer::mergeBremsstrahlung(), and MergedTruthProducer::produce().

00152                                           {
00153   decayVertices_.clear();
00154 }

void TrackingParticle::clearParentVertex (  ) 

Definition at line 148 of file TrackingParticle.cc.

References parentVertex_.

Referenced by TrackingTruthProducer::mergeBremsstrahlung(), and MergedTruthProducer::produce().

00148                                          {
00149   parentVertex_ = TrackingVertexRef();
00150 }

const TrackingVertexRefVector& TrackingParticle::decayVertices (  )  const [inline]

Definition at line 98 of file TrackingParticle.h.

References decayVertices_.

Referenced by TkNavigableSimElectronAssembler::findChild(), and operator<<().

00098 { return decayVertices_; }

tv_iterator TrackingParticle::decayVertices_begin (  )  const [inline]

Definition at line 99 of file TrackingParticle.h.

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

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

00099 { return decayVertices_.begin(); }

tv_iterator TrackingParticle::decayVertices_end (  )  const [inline]

Definition at line 100 of file TrackingParticle.h.

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

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

00100 { return decayVertices_.end(); }

EncodedEventId TrackingParticle::eventId (  )  const [inline]

Definition at line 48 of file TrackingParticle.h.

References eventId_.

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

00048 { return eventId_; }

void TrackingParticle::fillSubDetHitVectors (  ) 

Definition at line 112 of file TrackingParticle.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), DetId::Muon, muonPSimHit_, subdetVectorFill_, DetId::Tracker, trackerPSimHit_, and trackPSimHit_.

Referenced by muonPSimHit(), muonPSimHit_begin(), muonPSimHit_end(), trackerPSimHit(), trackerPSimHit_begin(), and trackerPSimHit_end().

00112                                             {
00113   trackerPSimHit_.clear();
00114   muonPSimHit_.clear();
00115   subdetVectorFill_ = true;
00116   //
00117   for(std::vector<PSimHit>::const_iterator aHit = trackPSimHit_.begin(); aHit != trackPSimHit_.end(); ++aHit) {
00118     unsigned int subDet_enum = DetId( (uint32_t)((*aHit).detUnitId()) ).det();
00119     switch (subDet_enum) {
00120     case DetId::Tracker:
00121       {
00122         trackerPSimHit_.push_back((*aHit));
00123         break;
00124       }
00125     case DetId::Muon:
00126       {
00127         muonPSimHit_.push_back((*aHit));
00128         break;
00129       }
00130     default: 
00131       {
00132       std::cout << "TrackingParticle WARNING - Not Tracker or Muon Subdetector " << subDet_enum << std::endl;
00133       break;
00134       }
00135     } // switch
00136   }
00137 }

TrackingParticle::g4t_iterator TrackingParticle::g4Track_begin (  )  const

Definition at line 36 of file TrackingParticle.cc.

References g4Tracks_.

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

00036                                                                    {
00037   return g4Tracks_.begin();
00038 }

TrackingParticle::g4t_iterator TrackingParticle::g4Track_end (  )  const

Definition at line 40 of file TrackingParticle.cc.

References g4Tracks_.

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

00040                                                                  {
00041   return g4Tracks_.end();
00042 }

const std::vector<SimTrack>& TrackingParticle::g4Tracks (  )  const [inline]

Definition at line 86 of file TrackingParticle.h.

References g4Tracks_.

00086 { return g4Tracks_ ;    }

const GenParticleRefVector& TrackingParticle::genParticle (  )  const [inline]

Definition at line 85 of file TrackingParticle.h.

References genParticles_.

00085 { return genParticles_; }

TrackingParticle::genp_iterator TrackingParticle::genParticle_begin (  )  const

iterators

Definition at line 28 of file TrackingParticle.cc.

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

Referenced by operator<<().

00028                                                                         {
00029   return genParticles_.begin();
00030 }

TrackingParticle::genp_iterator TrackingParticle::genParticle_end (  )  const

Definition at line 32 of file TrackingParticle.cc.

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

Referenced by operator<<().

00032                                                                       {
00033   return genParticles_.end();
00034 }

int TrackingParticle::matchedHit (  )  const [inline]

Definition at line 101 of file TrackingParticle.h.

References matchedHit_.

Referenced by TrackingParticleSelector::operator()().

00101 {return matchedHit_;}

const std::vector< PSimHit > & TrackingParticle::muonPSimHit (  ) 

The vector of the Muon PSimHits of the TrackingParticle.

Definition at line 102 of file TrackingParticle.cc.

References fillSubDetHitVectors(), muonPSimHit_, and subdetVectorFill_.

00102                                                         {
00103   /* do it because PSimHit vectors
00104      trackerPSimHit_ and muonPSimHit_
00105      are transient */
00106   if(!subdetVectorFill_)
00107     fillSubDetHitVectors();
00108   
00109   return muonPSimHit_;
00110 }

const std::vector< PSimHit >::const_iterator TrackingParticle::muonPSimHit_begin (  ) 

Returns the begin of the vector the Muon PSimHits of the TrackingParticle.

Definition at line 72 of file TrackingParticle.cc.

References fillSubDetHitVectors(), muonPSimHit_, and subdetVectorFill_.

00072                                                                            {
00073   /* do it because PSimHit vectors
00074      trackerPSimHit_ and muonPSimHit_
00075      are transient */
00076   if(!subdetVectorFill_)
00077     fillSubDetHitVectors();
00078   
00079   return muonPSimHit_.begin();
00080 }

const std::vector< PSimHit >::const_iterator TrackingParticle::muonPSimHit_end (  ) 

Returns the end of the vector the Muon PSimHits of the TrackingParticle.

Definition at line 82 of file TrackingParticle.cc.

References fillSubDetHitVectors(), muonPSimHit_, and subdetVectorFill_.

00082                                                                          {
00083   /* do it because PSimHit vectors
00084      trackerPSimHit_ and muonPSimHit_
00085      are transient */
00086   if(!subdetVectorFill_)
00087     fillSubDetHitVectors();
00088   
00089   return muonPSimHit_.end();
00090 }

const TrackingVertexRef& TrackingParticle::parentVertex (  )  const [inline]

Definition at line 87 of file TrackingParticle.h.

References parentVertex_.

Referenced by TkNavigableSimElectronAssembler::findParent(), RecoTracktoTP::numTPMothers(), TPtoRecoTrack::numTPMothers(), RecoTracktoTP::numTPSourceTracks(), TPtoRecoTrack::numTPSourceTracks(), operator<<(), RecoTracktoTP::TPMother(), and TPtoRecoTrack::TPMother().

00087 { return parentVertex_; }

int TrackingParticle::pdgId (  )  const [inline]

PDG id, signal source, crossing number.

Reimplemented from reco::Particle.

Definition at line 47 of file TrackingParticle.h.

References pdgId_.

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

00047 { return pdgId_; }

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 44 of file TrackingParticle.cc.

References trackPSimHit_.

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

00044                                                                              {
00045   return trackPSimHit_.begin();
00046 }

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 48 of file TrackingParticle.cc.

References trackPSimHit_.

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

00048                                                                            {
00049   return trackPSimHit_.end();
00050 }

void TrackingParticle::setMatchedHit ( const int hitnumb  ) 

Definition at line 156 of file TrackingParticle.cc.

References matchedHit_.

Referenced by TrackingTruthProducer::trackingParticleAssembler().

00156                                                        {
00157   matchedHit_ = hitnumb;
00158 }

void TrackingParticle::setParentVertex ( const TrackingVertexRef ref  ) 

Definition at line 140 of file TrackingParticle.cc.

References parentVertex_.

Referenced by TrackingTruthProducer::mergeBremsstrahlung(), and MergedTruthProducer::produce().

00140                                                                    {
00141   parentVertex_ = ref;
00142 }

void TrackingParticle::setVertex ( const Point vtx,
double  t 
)

Definition at line 160 of file TrackingParticle.cc.

References reco::Particle::setVertex(), and t_.

00160                                                            {
00161   t_ = t;
00162   reco::Particle::setVertex(vtx);
00163 }

const std::vector< PSimHit > & TrackingParticle::trackerPSimHit (  ) 

The vector of the Tracker PSimHits of the TrackingParticle.

Definition at line 92 of file TrackingParticle.cc.

References fillSubDetHitVectors(), subdetVectorFill_, and trackerPSimHit_.

00092                                                            {
00093   /* do it because PSimHit vectors
00094      trackerPSimHit_ and muonPSimHit_
00095      are transient */
00096   if(!subdetVectorFill_)
00097     fillSubDetHitVectors();
00098   
00099   return trackerPSimHit_;
00100 }

const std::vector< PSimHit >::const_iterator TrackingParticle::trackerPSimHit_begin (  ) 

Returns the begin of the vector the Tracker PSimHits of the TrackingParticle.

Definition at line 52 of file TrackingParticle.cc.

References fillSubDetHitVectors(), subdetVectorFill_, and trackerPSimHit_.

Referenced by MultiTrackValidator::analyze(), and TrackAssociatorByPosition::getState().

00052                                                                               {
00053   /* do it because PSimHit vectors
00054      trackerPSimHit_ and muonPSimHit_
00055      are transient */
00056   if(!subdetVectorFill_)
00057     fillSubDetHitVectors();
00058   
00059   return trackerPSimHit_.begin();
00060 }

const std::vector< PSimHit >::const_iterator TrackingParticle::trackerPSimHit_end (  ) 

Returns the end of the vector the Tracker PSimHits of the TrackingParticle.

Definition at line 62 of file TrackingParticle.cc.

References fillSubDetHitVectors(), subdetVectorFill_, and trackerPSimHit_.

Referenced by MultiTrackValidator::analyze(), and TrackAssociatorByPosition::getState().

00062                                                                             {
00063   /* do it because PSimHit vectors
00064      trackerPSimHit_ and muonPSimHit_
00065      are transient */
00066   if(!subdetVectorFill_)
00067     fillSubDetHitVectors();
00068   
00069   return trackerPSimHit_.end();
00070 }

const std::vector<PSimHit>& TrackingParticle::trackPSimHit (  )  const [inline]

The vector of ALL the PSimHits of the TrackingParticle.

Definition at line 89 of file TrackingParticle.h.

References trackPSimHit_.

Referenced by operator<<().

00089 { return trackPSimHit_; }


Friends And Related Function Documentation

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

Concrete TrackingParticle.

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

Definition at line 12 of file TrackingDataPrint.h.

00012                                                                     {
00013 
00014   // Compare momenta from sources
00015   s << "T.P.   Track Momentum, q , ID, & Event # " 
00016     << tp.p4()    << " " << tp.charge() << " "
00017     << tp.pdgId() << " " 
00018     << tp.eventId().bunchCrossing() << "." << tp.eventId().event() 
00019     << std::endl;
00020   s << " Hits for this track: " << tp.trackPSimHit().size() 
00021     << std::endl;
00022   
00023   for (TrackingParticle::genp_iterator hepT = tp.genParticle_begin();
00024        hepT !=  tp.genParticle_end(); ++hepT) {
00025     s << " HepMC Track Momentum " << (*hepT)->momentum().mag() << std::endl;    
00026   }
00027   for (TrackingParticle::g4t_iterator g4T = tp.g4Track_begin();
00028        g4T !=  tp.g4Track_end(); ++g4T) {
00029     s << " Geant Track Momentum  " << g4T->momentum() << std::endl;   
00030     s << " Geant Track ID & type " << g4T->trackId() << " " 
00031       << g4T->type() << std::endl;   
00032     if (g4T->type() !=  tp.pdgId()) {
00033       s << " Mismatch b/t TrackingParticle and Geant types" 
00034         << std::endl;
00035     }
00036   }
00037   return s;
00038 }


Member Data Documentation

TrackingVertexRefVector TrackingParticle::decayVertices_ [private]

Definition at line 126 of file TrackingParticle.h.

Referenced by addDecayVertex(), clearDecayVertices(), decayVertices(), decayVertices_begin(), and decayVertices_end().

EncodedEventId TrackingParticle::eventId_ [private]

Definition at line 108 of file TrackingParticle.h.

Referenced by eventId().

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

references to G4 and HepMC tracks

Definition at line 114 of file TrackingParticle.h.

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

GenParticleRefVector TrackingParticle::genParticles_ [private]

Definition at line 115 of file TrackingParticle.h.

Referenced by genParticle(), genParticle_begin(), and genParticle_end().

int TrackingParticle::matchedHit_ [private]

Total Number of Hits belonging to the TrackingParticle.

Definition at line 111 of file TrackingParticle.h.

Referenced by matchedHit(), and setMatchedHit().

std::vector<PSimHit> TrackingParticle::muonPSimHit_ [private]

Definition at line 121 of file TrackingParticle.h.

Referenced by fillSubDetHitVectors(), muonPSimHit(), muonPSimHit_begin(), muonPSimHit_end(), and operator<<().

TrackingVertexRef TrackingParticle::parentVertex_ [private]

Definition at line 125 of file TrackingParticle.h.

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

int TrackingParticle::pdgId_ [private]

PDG identifier, signal source, crossing number.

Reimplemented from reco::Particle.

Definition at line 107 of file TrackingParticle.h.

Referenced by pdgId().

bool TrackingParticle::subdetVectorFill_ [private]

Definition at line 122 of file TrackingParticle.h.

Referenced by fillSubDetHitVectors(), muonPSimHit(), muonPSimHit_begin(), muonPSimHit_end(), trackerPSimHit(), trackerPSimHit_begin(), trackerPSimHit_end(), and TrackingParticle().

double TrackingParticle::t_ [private]

production time

Definition at line 105 of file TrackingParticle.h.

Referenced by setVertex().

std::vector<PSimHit> TrackingParticle::trackerPSimHit_ [private]

Definition at line 120 of file TrackingParticle.h.

Referenced by fillSubDetHitVectors(), operator<<(), trackerPSimHit(), trackerPSimHit_begin(), and trackerPSimHit_end().

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

Definition at line 118 of file TrackingParticle.h.

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


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:34:12 2009 for CMSSW by  doxygen 1.5.4