CMS 3D CMS Logo

TrackingParticle.h

Go to the documentation of this file.
00001 #ifndef SimDataFormats_TrackingParticle_h
00002 #define SimDataFormats_TrackingParticle_h
00003 
00007 #include "DataFormats/Candidate/interface/Particle.h"
00008 
00009 #include "SimDataFormats/EncodedEventId/interface/EncodedEventId.h"
00010 #include "SimDataFormats/HepMCProduct/interface/HepMCProduct.h"
00011 #include "SimDataFormats/TrackingAnalysis/interface/TrackingVertex.h"
00012 #include "SimDataFormats/TrackingAnalysis/interface/TrackingParticleFwd.h"
00013 #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h"
00014 #include "SimDataFormats/Track/interface/SimTrackContainer.h"
00015 #include "DataFormats/DetId/interface/DetId.h"
00016 
00017 namespace HepMC {
00018   class GenParticle;
00019 }
00020 class TrackingVertex;
00021 
00022 class TrackingParticle : public reco::Particle {
00023   
00024   friend std::ostream& operator<< (std::ostream& s, const TrackingParticle & tp);
00025   
00026 public:
00028   typedef edm::RefVector<edm::HepMCProduct, HepMC::GenParticle > GenParticleRefVector;
00029   typedef edm::Ref<edm::HepMCProduct, HepMC::GenParticle >       GenParticleRef;
00030   typedef GenParticleRefVector::iterator                         genp_iterator;
00031   typedef std::vector<SimTrack>::const_iterator                  g4t_iterator;
00032   
00033   typedef std::vector<TrackingVertex>                TrackingVertexCollection;
00034   typedef edm::Ref<TrackingVertexCollection>         TrackingVertexRef;
00035   typedef edm::RefVector<TrackingVertexCollection>   TrackingVertexRefVector;
00036   typedef TrackingVertexRefVector::iterator   tv_iterator;
00037   
00039   TrackingParticle() { subdetVectorFill_ = false; }
00040   // destructor
00041   ~TrackingParticle();
00043   TrackingParticle( char q, const LorentzVector & p4, const Point & vtx,
00044                     double t, const int pdgId,  const int status, const EncodedEventId eventId);
00045   
00047   int pdgId() const { return pdgId_; }
00048   EncodedEventId eventId() const { return eventId_; }
00049   
00051   genp_iterator genParticle_begin() const;
00052   genp_iterator genParticle_end()   const;
00053   g4t_iterator  g4Track_begin()     const;
00054   g4t_iterator  g4Track_end()       const;
00055   
00057   const std::vector<PSimHit>::const_iterator  pSimHit_begin() const;
00059   const std::vector<PSimHit>::const_iterator  pSimHit_end()   const;
00060   
00062   const std::vector<PSimHit>::const_iterator  trackerPSimHit_begin();
00064   const std::vector<PSimHit>::const_iterator  trackerPSimHit_end();
00065   
00067   const std::vector<PSimHit>::const_iterator  muonPSimHit_begin();
00069   const std::vector<PSimHit>::const_iterator  muonPSimHit_end();
00070   
00071   // Setters for G4 and HepMC
00072   void addG4Track(    const SimTrack&);
00073   void addGenParticle(const GenParticleRef&);
00074   
00075   void addPSimHit(const PSimHit&);
00076   void setParentVertex(const TrackingVertexRef&);
00077   void addDecayVertex(const TrackingVertexRef&);
00078   void clearParentVertex();
00079   void clearDecayVertices();
00080   void setMatchedHit(const int&);
00081   void setVertex(const Point & vtx, double t);
00082   void fillSubDetHitVectors();
00083 
00084   // Getters for Embd and Sim Tracks
00085   const GenParticleRefVector&     genParticle() const { return genParticles_; }
00086   const std::vector<SimTrack>&       g4Tracks() const { return g4Tracks_ ;    }
00087   const TrackingVertexRef&       parentVertex() const { return parentVertex_; }
00089   const std::vector<PSimHit>&    trackPSimHit() const { return trackPSimHit_; }
00090 
00091   // Sub-detectors details
00093   const std::vector<PSimHit>& trackerPSimHit();
00095   const std::vector<PSimHit>&    muonPSimHit();
00096   
00097   // Accessors for vector of decay vertices
00098   const TrackingVertexRefVector& decayVertices() const { return decayVertices_; }
00099   tv_iterator decayVertices_begin()       const { return decayVertices_.begin(); }
00100   tv_iterator decayVertices_end()         const { return decayVertices_.end(); }
00101   int matchedHit() const {return matchedHit_;}
00102   
00103 private:
00105   double t_;
00107   int pdgId_;
00108   EncodedEventId eventId_;
00109   
00111   int matchedHit_;
00112   
00114   std::vector<SimTrack> g4Tracks_;
00115   GenParticleRefVector  genParticles_;
00116   
00117   //  TrackPSimHitRefVector trackPSimHit_;
00118   std::vector<PSimHit> trackPSimHit_;
00119   // TrackPSimHitRefVector for Tracker and Muon (not persistent)
00120   std::vector<PSimHit> trackerPSimHit_;
00121   std::vector<PSimHit> muonPSimHit_;
00122   bool subdetVectorFill_;
00123   
00124   // Source and decay vertices
00125   TrackingVertexRef       parentVertex_;
00126   TrackingVertexRefVector decayVertices_;
00127 };
00128 
00129 #endif // SimDataFormats_TrackingParticle_H

Generated on Tue Jun 9 17:46:47 2009 for CMSSW by  doxygen 1.5.4