CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_4/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 #include "FWCore/Utilities/interface/GCC11Compatibility.h"
00013 
00014 
00015 // make tis default
00016 #define TTRH_NOGE
00017 
00018 
00019 class GeomDetUnit;
00020 
00021 class TransientTrackingRecHit : public TrackingRecHit, 
00022                                 public ReferenceCountedInEvent {
00023 public:
00024 
00025   //RC typedef edm::OwnVector<const TransientTrackingRecHit>        RecHitContainer;
00026 
00027   typedef ReferenceCountingPointer< TransientTrackingRecHit>        RecHitPointer;
00028   typedef ConstReferenceCountingPointer< TransientTrackingRecHit>   ConstRecHitPointer;
00029   typedef std::vector<ConstRecHitPointer>                           RecHitContainer;
00030   typedef std::vector<ConstRecHitPointer>                           ConstRecHitContainer;
00031 
00032   explicit TransientTrackingRecHit(const GeomDet * geom=0) : 
00033     TrackingRecHit(geom ? geom->geographicalId().rawId() : 0), 
00034     globalPosition_(0,0,0),
00035     geom_(geom),
00036     errorR_(0),errorZ_(0),errorRPhi_(0),
00037     hasGlobalPosition_(false), hasGlobalError_(false){}
00038 
00039   explicit TransientTrackingRecHit(const GeomDet * geom, DetId id, Type type=valid) : 
00040     TrackingRecHit(id, type), 
00041     globalPosition_(0,0,0),
00042     geom_(geom),
00043     errorR_(0),errorZ_(0),errorRPhi_(0),
00044     hasGlobalPosition_(false),hasGlobalError_(false){}
00045 
00046   explicit TransientTrackingRecHit(const GeomDet * geom, TrackingRecHit::id_type id, Type type=valid) : 
00047     TrackingRecHit(id, type),
00048     globalPosition_(0,0,0),
00049     geom_(geom),
00050     errorR_(0),errorZ_(0),errorRPhi_(0),
00051     hasGlobalPosition_(false),hasGlobalError_(false){}
00052   
00053   explicit TransientTrackingRecHit(const GeomDet * geom, TrackingRecHit const & rh) : 
00054     TrackingRecHit(rh.geographicalId(), rh.type()),
00055     globalPosition_(0,0,0),
00056     geom_(geom),
00057     errorR_(0),errorZ_(0),errorRPhi_(0),
00058     hasGlobalPosition_(false),hasGlobalError_(false){}
00059 
00060 
00061 
00062   // Extension of the TrackingRecHit interface
00063 
00065   const GeomDet * det() const {return geom_;}
00066   virtual const Surface * surface() const {return &(geom_->surface());}
00067 
00071   virtual const GeomDetUnit * detUnit() const;
00072 
00073   virtual GlobalPoint globalPosition() const ;
00074   virtual GlobalError globalPositionError() const ;
00075 
00076   float errorGlobalR() const;
00077   float errorGlobalZ() const;
00078   float errorGlobalRPhi() const;
00079 
00084   virtual RecHitPointer clone (const TrajectoryStateOnSurface& ts) const;
00085 
00090   virtual bool canImproveWithTrack() const {return false;}
00091 
00092   virtual const TrackingRecHit * hit() const = 0;
00093   
00095   virtual ConstRecHitContainer transientHits() const;
00096 
00097   
00099   virtual float clusterProbability() const { return 1; }
00100 
00101 private:
00102   void setPositionErrors() const;
00103 
00104   // caching of some variable for fast access
00105   mutable GlobalPoint globalPosition_;  
00106 #ifndef TTRH_NOGE
00107   mutable GlobalError globalError_;
00108 #endif
00109 
00110   const GeomDet * geom_ ;
00111 
00112   mutable float errorR_,errorZ_,errorRPhi_;
00113   mutable bool hasGlobalPosition_;
00114   mutable bool hasGlobalError_;
00115  
00116   // hide the clone method for ReferenceCounted. Warning: this method is still 
00117   // accessible via the bas class TrackingRecHit interface!
00118   virtual TransientTrackingRecHit * clone() const = 0;
00119 
00120 };
00121 
00122 #endif
00123