CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/DataFormats/TrackCandidate/interface/TrackCandidate.h

Go to the documentation of this file.
00001 #ifndef DATAFORMATS_TRACKCANDIDATE_TRACKCANDIDATE_H
00002 #define DATAFORMATS_TRACKCANDIDATE_TRACKCANDIDATE_H
00003 
00004 #include "DataFormats/Common/interface/RefToBase.h"
00005 #include "DataFormats/Common/interface/OwnVector.h"
00006 #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h"
00007 #include "DataFormats/TrajectorySeed/interface/TrajectorySeed.h"
00008 
00009 
00010 #include <utility>
00011 
00023 class TrackCandidate{
00024 public:
00025   typedef edm::OwnVector<TrackingRecHit> RecHitContainer;
00026   typedef RecHitContainer::const_iterator const_iterator;
00027   typedef std::pair<const_iterator,const_iterator> range;
00028   
00029  TrackCandidate(): rh_(),  seed_(), state_(), seedRef_(), nLoops_(0) {}
00030   virtual ~TrackCandidate(){}
00031 
00032   TrackCandidate(RecHitContainer & rh) :
00033   rh_(),  seed_(), state_(), seedRef_(), nLoops_(0) {rh_.swap(rh);}
00034   
00035   TrackCandidate(RecHitContainer & rh,
00036                  TrajectorySeed const & s,
00037                  PTrajectoryStateOnDet const & st,
00038                  signed char nLoops=0):
00039     rh_(), seed_(s), state_(st), seedRef_(),nLoops_(nLoops) {rh_.swap(rh);}
00040 
00041   
00042   TrackCandidate(RecHitContainer & rh,
00043                  TrajectorySeed const & s,
00044                  PTrajectoryStateOnDet const & st,
00045                  const edm::RefToBase<TrajectorySeed> & seedRef,
00046                  signed char nLoops=0) :
00047     rh_(), seed_(s), state_(st), seedRef_(seedRef),nLoops_(nLoops) {rh_.swap(rh);}
00048 
00049 
00050 
00051   
00052   PTrajectoryStateOnDet const & trajectoryStateOnDet() const { return state_;}
00053   
00054   range recHits() const {return std::make_pair(rh_.begin(), rh_.end());}
00055   
00056   TrajectorySeed const & seed() const {return seed_;}
00057  
00058 
00059   bool isLooper() const {return (nLoops_>0);}
00060   signed char nLoops() const {return nLoops_;}
00061 
00062   void setNLoops(signed char value) {nLoops_=value;}
00063 
00069   edm::RefToBase<TrajectorySeed> seedRef() const { return seedRef_; }
00070 
00071   void setSeedRef(edm::RefToBase<TrajectorySeed> & seedRef) { seedRef_ = seedRef ; } 
00072   
00073 private:
00074   RecHitContainer rh_;
00075   TrajectorySeed seed_;
00076   PTrajectoryStateOnDet state_;
00077   edm::RefToBase<TrajectorySeed> seedRef_;
00078   signed char nLoops_;
00079 };
00080 #endif