CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_6/src/DataFormats/TrackerRecHit2D/interface/SiTrackerMultiRecHit.h

Go to the documentation of this file.
00001 #ifndef SiTrackerMultiRecHit_H
00002 #define SiTrackerMultiRecHit_H
00003 
00004 #include "DataFormats/TrackerRecHit2D/interface/BaseTrackerRecHit.h"
00005 #include "DataFormats/TrackingRecHit/interface/TrackingRecHitFwd.h"
00006 #include <vector>
00007 #include <map>
00008 /*
00009 A rechit type suitable for tracking algorithm that use soft hit-to-track assignement, 
00010 such as the Deterministic Annealing Filter (DAF) or the Multi Track Filter (MTF).
00011 it contains an OwnVector with the component rechits and a vector of weights     
00012 */
00013 class SiTrackerMultiRecHit : public BaseTrackerRecHit
00014 {
00015 public:
00016   typedef BaseTrackerRecHit Base;
00017   SiTrackerMultiRecHit():
00018     theHits(),
00019     theWeights(){}
00020   virtual ~SiTrackerMultiRecHit(){}     
00021   
00022   
00023   SiTrackerMultiRecHit(const LocalPoint&, const LocalError&, const DetId&, 
00024                        const std::vector< std::pair<const TrackingRecHit*, float> >&);
00025   
00026   virtual SiTrackerMultiRecHit* clone() const {return new SiTrackerMultiRecHit(*this);}
00027   
00028   virtual int dimension() const {return 2;}
00029   virtual void getKfComponents( KfComponentsHolder & holder ) const { getKfComponents2D(holder); }
00030 
00031   // at the momement nobody care of MultiHit!!!
00032   // used by trackMerger (to be improved)
00033   virtual OmniClusterRef const & firstClusterRef() const { return static_cast<BaseTrackerRecHit const *>(&theHits.front())->firstClusterRef();}
00034 
00035   
00036   //vector of component rechits
00037   virtual std::vector<const TrackingRecHit*> recHits() const;
00038   
00039   virtual std::vector<TrackingRecHit*> recHits() ;
00040   
00041   //vector of weights
00042   std::vector<float> const & weights() const {return theWeights;}
00043   std::vector<float>  & weights() {return theWeights;}
00044 
00045   //returns the weight for the i component
00046   float  weight(unsigned int i) const {return theWeights[i];}
00047   float  & weight(unsigned int i) {return theWeights[i];}
00048         
00049   bool sharesInput(const TrackingRecHit* other,
00050                    SharedInputType what) const;
00051 private:
00052   
00053   edm::OwnVector<TrackingRecHit> theHits;
00054   std::vector<float> theWeights;
00055         
00056 
00057 };
00058 
00059 // Comparison operators
00060 inline bool operator<( const SiTrackerMultiRecHit& one, const SiTrackerMultiRecHit& other) {
00061   if ( one.geographicalId() < other.geographicalId() ) {
00062     return true;
00063   } else {
00064     return false;
00065   }
00066 }
00067 
00068 #endif