CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TransientTrackingRecHit.h
Go to the documentation of this file.
1 #ifndef TransientTrackingRecHit_H
2 #define TransientTrackingRecHit_H
3 
8 //RC #include "DataFormats/Common/interface/OwnVector.h"
11 
12 class GeomDetUnit;
13 
16 public:
17 
18  //RC typedef edm::OwnVector<const TransientTrackingRecHit> RecHitContainer;
19 
22  typedef std::vector<ConstRecHitPointer> RecHitContainer;
23  typedef std::vector<ConstRecHitPointer> ConstRecHitContainer;
24 
25  explicit TransientTrackingRecHit(const GeomDet * geom=0, float weight=1., float annealing=1.) :
26  TrackingRecHit(geom ? geom->geographicalId().rawId() : 0),
27  geom_(geom), weight_(weight), annealing_(annealing),
28  globalPosition_(0,0,0),
29  globalError_(GlobalError::NullMatrix()),errorR_(0),errorZ_(0),errorRPhi_(0),
31 
32  explicit TransientTrackingRecHit(const GeomDet * geom, DetId id, Type type=valid, float weight=1., float annealing=1. ) :
33  TrackingRecHit(id, type),
34  geom_(geom), weight_(weight), annealing_(annealing),
35  globalPosition_(0,0,0),
36  globalError_(GlobalError::NullMatrix()),errorR_(0),errorZ_(0),errorRPhi_(0),
38 
39  explicit TransientTrackingRecHit(const GeomDet * geom, TrackingRecHit::id_type id, Type type=valid, float weight=1., float annealing=1. ) :
40  TrackingRecHit(id, type),
41  geom_(geom), weight_(weight), annealing_(annealing),
42  globalPosition_(0,0,0),
43  globalError_(GlobalError::NullMatrix()),errorR_(0),errorZ_(0),errorRPhi_(0),
45 
46  explicit TransientTrackingRecHit(const GeomDet * geom, TrackingRecHit const & rh, float weight=1., float annealing=1. ) :
48  geom_(geom), weight_(weight), annealing_(annealing),
49  globalPosition_(0,0,0),
50  globalError_(GlobalError::NullMatrix()),errorR_(0),errorZ_(0),errorRPhi_(0),
52 
53 
54 
55  // Extension of the TrackingRecHit interface
56 
58  const GeomDet * det() const {return geom_;}
59  virtual const Surface * surface() const {return &(geom_->surface());}
60 
64  virtual const GeomDetUnit * detUnit() const;
65 
66  virtual GlobalPoint globalPosition() const ;
67  virtual GlobalError globalPositionError() const ;
68 
69  float errorGlobalR() const;
70  float errorGlobalZ() const;
71  float errorGlobalRPhi() const;
72 
77  virtual RecHitPointer clone (const TrajectoryStateOnSurface& ts) const;
78 
83  virtual bool canImproveWithTrack() const {return false;}
84 
85  virtual const TrackingRecHit * hit() const = 0;
86 
88  virtual ConstRecHitContainer transientHits() const;
89 
91  void setWeight(float weight){weight_ = weight;}
92 
93  float weight() const {return weight_;}
94 
97 
98  void setAnnealingFactor(float annealing) {annealing_ = annealing;}
99 
100  float getAnnealingFactor() const {return annealing_;}
101 
103  virtual float clusterProbability() const { return 1; }
104 
105 private:
106  void setPositionErrors() const;
107 
108  const GeomDet * geom_ ;
109 
110  float weight_;
111  float annealing_;
112 
113  // caching of some variable for fast access
116  mutable float errorR_,errorZ_,errorRPhi_;
117  mutable bool hasGlobalPosition_;
118  mutable bool hasGlobalError_;
119 
120  // hide the clone method for ReferenceCounted. Warning: this method is still
121  // accessible via the bas class TrackingRecHit interface!
122  virtual TransientTrackingRecHit * clone() const = 0;
123 
124 };
125 
126 #endif
127 
ReferenceCountingPointer< TransientTrackingRecHit > RecHitPointer
type
Definition: HCALResponse.h:22
ConstReferenceCountingPointer< TransientTrackingRecHit > ConstRecHitPointer
unsigned int id_type
virtual TransientTrackingRecHit * clone() const =0
virtual const TrackingRecHit * hit() const =0
TransientTrackingRecHit(const GeomDet *geom, TrackingRecHit const &rh, float weight=1., float annealing=1.)
std::vector< ConstRecHitPointer > RecHitContainer
void setWeight(float weight)
interface needed to set the transient hit weight and to read it back
virtual GlobalError globalPositionError() const
virtual float clusterProbability() const
cluster probability, overloaded by pixel rechits.
std::vector< ConstRecHitPointer > ConstRecHitContainer
Definition: DetId.h:20
TransientTrackingRecHit(const GeomDet *geom, TrackingRecHit::id_type id, Type type=valid, float weight=1., float annealing=1.)
virtual bool canImproveWithTrack() const
virtual GlobalPoint globalPosition() const
const GeomDet * det() const
The GomeDet* can be zero for InvalidTransientRecHits and for TConstraintRecHit2Ds.
virtual const Surface * surface() const
TransientTrackingRecHit(const GeomDet *geom=0, float weight=1., float annealing=1.)
virtual const GeomDetUnit * detUnit() const
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
DetId geographicalId() const
TransientTrackingRecHit(const GeomDet *geom, DetId id, Type type=valid, float weight=1., float annealing=1.)
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
virtual ConstRecHitContainer transientHits() const
Composite interface: returns the component hits, if any.
void setAnnealingFactor(float annealing)