CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h

Go to the documentation of this file.
00001 #ifndef TransientTrackingRecHit_H
00002 #define TransientTrackingRecHit_H
00003 
00004 #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h"
00005 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
00006 #include <TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h>
00007 #include "DataFormats/GeometrySurface/interface/Surface.h" 
00008 //RC #include "DataFormats/Common/interface/OwnVector.h"
00009 #include "DataFormats/GeometrySurface/interface/ReferenceCounted.h"
00010 #include "DataFormats/GeometrySurface/interface/BlockWipedAllocator.h"
00011 
00012 
00013 // make tis default
00014 #define TTRH_NOGE
00015 
00016 
00017 class GeomDetUnit;
00018 
00019 class TransientTrackingRecHit : public TrackingRecHit, 
00020                                 public ReferenceCountedInEvent {
00021 public:
00022 
00023   //RC typedef edm::OwnVector<const TransientTrackingRecHit>        RecHitContainer;
00024 
00025   typedef ReferenceCountingPointer< TransientTrackingRecHit>        RecHitPointer;
00026   typedef ConstReferenceCountingPointer< TransientTrackingRecHit>   ConstRecHitPointer;
00027   typedef std::vector<ConstRecHitPointer>                           RecHitContainer;
00028   typedef std::vector<ConstRecHitPointer>                           ConstRecHitContainer;
00029 
00030   explicit TransientTrackingRecHit(const GeomDet * geom=0) : 
00031     TrackingRecHit(geom ? geom->geographicalId().rawId() : 0), 
00032     globalPosition_(0,0,0),
00033     geom_(geom),
00034     errorR_(0),errorZ_(0),errorRPhi_(0),
00035     hasGlobalPosition_(false), hasGlobalError_(false){}
00036 
00037   explicit TransientTrackingRecHit(const GeomDet * geom, DetId id, Type type=valid) : 
00038     TrackingRecHit(id, type), 
00039     globalPosition_(0,0,0),
00040     geom_(geom),
00041     errorR_(0),errorZ_(0),errorRPhi_(0),
00042     hasGlobalPosition_(false),hasGlobalError_(false){}
00043 
00044   explicit TransientTrackingRecHit(const GeomDet * geom, TrackingRecHit::id_type id, Type type=valid) : 
00045     TrackingRecHit(id, type),
00046     globalPosition_(0,0,0),
00047     geom_(geom),
00048     errorR_(0),errorZ_(0),errorRPhi_(0),
00049     hasGlobalPosition_(false),hasGlobalError_(false){}
00050   
00051   explicit TransientTrackingRecHit(const GeomDet * geom, TrackingRecHit const & rh) : 
00052     TrackingRecHit(rh.geographicalId(), rh.type()),
00053     globalPosition_(0,0,0),
00054     geom_(geom),
00055     errorR_(0),errorZ_(0),errorRPhi_(0),
00056     hasGlobalPosition_(false),hasGlobalError_(false){}
00057 
00058 
00059 
00060   // Extension of the TrackingRecHit interface
00061 
00063   const GeomDet * det() const {return geom_;}
00064   virtual const Surface * surface() const {return &(geom_->surface());}
00065 
00069   virtual const GeomDetUnit * detUnit() const;
00070 
00071   virtual GlobalPoint globalPosition() const ;
00072   virtual GlobalError globalPositionError() const ;
00073 
00074   float errorGlobalR() const;
00075   float errorGlobalZ() const;
00076   float errorGlobalRPhi() const;
00077 
00082   virtual RecHitPointer clone (const TrajectoryStateOnSurface& ts) const;
00083 
00088   virtual bool canImproveWithTrack() const {return false;}
00089 
00090   virtual const TrackingRecHit * hit() const = 0;
00091   
00093   virtual ConstRecHitContainer transientHits() const;
00094 
00095   
00097   virtual float clusterProbability() const { return 1; }
00098 
00099 private:
00100   void setPositionErrors() const;
00101 
00102   // caching of some variable for fast access
00103   mutable GlobalPoint globalPosition_;  
00104 #ifndef TTRH_NOGE
00105   mutable GlobalError globalError_;
00106 #endif
00107 
00108   const GeomDet * geom_ ;
00109 
00110   mutable float errorR_,errorZ_,errorRPhi_;
00111   mutable bool hasGlobalPosition_;
00112   mutable bool hasGlobalError_;
00113  
00114   // hide the clone method for ReferenceCounted. Warning: this method is still 
00115   // accessible via the bas class TrackingRecHit interface!
00116   virtual TransientTrackingRecHit * clone() const = 0;
00117 
00118 };
00119 
00120 #endif
00121