CMS 3D CMS Logo

TrajectorySeed.h

Go to the documentation of this file.
00001 #ifndef DATAFORMATS_TRAJECTORYSEED_TRAJECTORYSEED_h
00002 #define DATAFORMATS_TRAJECTORYSEED_TRAJECTORYSEED_h
00003 
00004 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
00005 #include "DataFormats/Common/interface/OwnVector.h"
00006 #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h"
00007 #include "DataFormats/TrajectoryState/interface/PTrajectoryStateOnDet.h"
00008 #include <utility>
00009 #include <algorithm>
00010 
00017 class TrajectorySeed {
00018  public:
00019   typedef edm::OwnVector<TrackingRecHit> recHitContainer;
00020   typedef recHitContainer::const_iterator const_iterator;
00021   typedef std::pair<const_iterator,const_iterator> range;
00022   
00023   
00024   TrajectorySeed(){}
00025   virtual ~TrajectorySeed(){}
00026 
00027   TrajectorySeed(PTrajectoryStateOnDet const & ptsos, 
00028                  recHitContainer const & rh, 
00029                  PropagationDirection  dir) : 
00030     hits_(rh),  tsos_(ptsos), dir_(dir) {}
00031   
00032   void swap(PTrajectoryStateOnDet & ptsos, 
00033                  recHitContainer & rh, 
00034             PropagationDirection & dir) { 
00035     hits_.swap(rh);
00036     std::swap(tsos_,ptsos);
00037     std::swap(dir_,dir);
00038   }
00039 
00040   void swap(TrajectorySeed & rh) { 
00041     hits_.swap(rh.hits_);
00042     std::swap(tsos_,rh.tsos_);
00043     std::swap(dir_,rh.dir_);
00044   }
00045 
00046   range recHits() const {
00047     return std::make_pair(hits_.begin(), hits_.end());
00048   }
00049   unsigned int nHits() const {return hits_.size();}
00050   PropagationDirection direction() const {return  dir_;}
00051   PTrajectoryStateOnDet const & startingState() const {return tsos_;}
00052 
00053   virtual TrajectorySeed * clone() const {return new TrajectorySeed( * this); }
00054 
00055  
00056  private:
00057   edm::OwnVector<TrackingRecHit> hits_;
00058   PTrajectoryStateOnDet tsos_;
00059   PropagationDirection dir_;
00060 };
00061 
00062 typedef TrajectorySeed BasicTrajectorySeed;
00063 
00064 #endif

Generated on Tue Jun 9 17:31:48 2009 for CMSSW by  doxygen 1.5.4