CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/RecoTracker/TransientTrackingRecHit/interface/TSiTrackerMultiRecHit.h

Go to the documentation of this file.
00001 #ifndef TSiTrackerMultiRecHit_h
00002 #define TSiTrackerMultiRecHit_h
00003 
00004 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
00005 #include "DataFormats/TrackerRecHit2D/interface/SiTrackerMultiRecHit.h"
00006 #include "TrackingTools/TransientTrackingRecHit/interface/HelpertRecHit2DLocalPos.h"
00007 #include "Geometry/CommonDetUnit/interface/GeomDetUnit.h"
00008 
00009 /*
00010 A TransientTrackingRecHit for the SiTrackerMultiRecHit
00011 */
00012 
00013 class TSiTrackerMultiRecHit GCC11_FINAL : public TransientTrackingRecHit {
00014 public:
00015   //virtual ~TSiTrackerMultiRecHit() {delete theHitData;}
00016   virtual ~TSiTrackerMultiRecHit() {}
00017   
00018   virtual AlgebraicVector parameters() const {return theHitData.parameters();}
00019   virtual AlgebraicSymMatrix parametersError() const {
00020     return HelpertRecHit2DLocalPos().parError( theHitData.localPositionError(), *det());
00021     //return theHitData.parametersError();
00022   }
00023   
00024   virtual void getKfComponents( KfComponentsHolder & holder ) const {
00025     HelpertRecHit2DLocalPos().getKfComponents(holder, theHitData, *det()); 
00026   }
00027   virtual DetId geographicalId() const {return theHitData.geographicalId();}
00028   virtual AlgebraicMatrix projectionMatrix() const {return theHitData.projectionMatrix();}
00029   virtual int dimension() const {return theHitData.dimension();}
00030   
00031   virtual LocalPoint localPosition() const {return theHitData.localPosition();}
00032   virtual LocalError localPositionError() const {return theHitData.localPositionError();}
00033   
00034   virtual const TrackingRecHit * hit() const {return &theHitData;};
00035   const SiTrackerMultiRecHit* specificHit() const {return &theHitData;}
00036   
00037   virtual bool isValid() const{return theHitData.isValid();}
00038   
00039   virtual std::vector<const TrackingRecHit*> recHits() const {
00040     return theHitData.recHits();
00041   } 
00042   virtual std::vector<TrackingRecHit*> recHits() {
00043     return theHitData.recHits();
00044   }     
00045   
00046   
00049   void setAnnealingFactor(float annealing) {annealing_ = annealing;} 
00050   float getAnnealingFactor() const {return annealing_;} 
00051   
00052 
00053   //vector of weights
00054   std::vector<float> const & weights() const {return theHitData.weights();}
00055   std::vector<float>  & weights() {return theHitData.weights();}
00056 
00057   //returns the weight for the i component
00058   float  weight(unsigned int i) const {return theHitData.weight(i);}
00059   float  & weight(unsigned int i) {return theHitData.weight(i);}
00060 
00061   
00062   virtual const GeomDetUnit* detUnit() const;
00063   
00064   virtual bool canImproveWithTrack() const {return true;}
00065   
00066   virtual RecHitPointer clone(const TrajectoryStateOnSurface& ts) const;
00067   
00068   virtual ConstRecHitContainer transientHits() const {return theComponents;};
00069   
00070   static RecHitPointer build( const GeomDet * geom, const SiTrackerMultiRecHit* rh, 
00071                               const ConstRecHitContainer& components, float annealing=1.){
00072     return RecHitPointer(new TSiTrackerMultiRecHit( geom, rh, components, annealing));
00073   }
00074   
00075   
00076   
00077 private:
00078   SiTrackerMultiRecHit theHitData;
00079   //holds the TransientTrackingRecHit components of the MultiRecHit 
00080   ConstRecHitContainer theComponents;   
00081   float annealing_;
00082  
00083   TSiTrackerMultiRecHit(const GeomDet * geom, const SiTrackerMultiRecHit* rh,  
00084                         const ConstRecHitContainer& components, float annealing):
00085     TransientTrackingRecHit(geom), theHitData(*rh), theComponents(components), annealing_(annealing){}
00086   
00087   virtual TSiTrackerMultiRecHit* clone() const {
00088     return new TSiTrackerMultiRecHit(*this);
00089   }
00090   
00091   
00092 };              
00093 
00094 #endif