CMS 3D CMS Logo

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