CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TSiStripRecHit2DLocalPos.h
Go to the documentation of this file.
1 #ifndef RECOTRACKER_TRANSIENTRACKINGRECHIT_TSiStripRecHit2DLocalPos_H
2 #define RECOTRACKER_TRANSIENTRACKINGRECHIT_TSiStripRecHit2DLocalPos_H
3 
11 
13 public:
14 
16 
18 
20 
21 
22  virtual void getKfComponents( KfComponentsHolder & holder ) const {
24  }
25 
26  virtual AlgebraicVector parameters() const {return theHitData.parameters();}
29  // return theHitData->parametersError();
30  }
31 
33  virtual int dimension() const {return theHitData.dimension();}
34 
35  virtual LocalPoint localPosition() const {return theHitData.localPosition();}
37 
38  virtual const TrackingRecHit * hit() const {return &theHitData;};
39 
40  virtual std::vector<const TrackingRecHit*> recHits() const {
41  return hit()->recHits();
42  }
43  virtual std::vector<TrackingRecHit*> recHits() {
44  return theHitData.recHits();
45  }
46 
47  virtual const GeomDetUnit* detUnit() const;
48 
49  virtual bool canImproveWithTrack() const {return true;}
50 
51  //RC virtual TSiStripRecHit2DLocalPos* clone(const TrajectoryStateOnSurface& ts) const;
52  virtual RecHitPointer clone(const TrajectoryStateOnSurface& ts) const;
53 
54  // Extension of the TransientTrackingRecHit interface
55 
56  const SiStripRecHit2D* specificHit() const {return &theHitData;};
57  const StripClusterParameterEstimator* cpe() const {return theCPE;}
58 
59  static RecHitPointer build( const GeomDet * geom, const SiStripRecHit2D* rh,
61  float weight=1., float annealing=1.,
62  bool computeCoarseLocalPosition=false) {
63  return RecHitPointer( new TSiStripRecHit2DLocalPos( geom, rh, cpe, weight, annealing,computeCoarseLocalPosition));
64  }
65 
66  static RecHitPointer build( const LocalPoint& pos, const LocalError& err,
67  const GeomDet* det,
68  const SiStripClusterRef clust,
70  float weight=1., float annealing=1.) {
71  return RecHitPointer( new TSiStripRecHit2DLocalPos( pos, err, det, clust, cpe, weight, annealing));
72  }
73 
74  static RecHitPointer build( const LocalPoint& pos, const LocalError& err,
75  const GeomDet* det,
76  const SiStripRegionalClusterRef clust,
78  float weight=1., float annealing=1.) {
79  return RecHitPointer( new TSiStripRecHit2DLocalPos( pos, err, det, clust, cpe, weight, annealing));
80  }
81 
82 
83 
84 private:
85 
88 
91  float weight, float annealing,
92  bool computeCoarseLocalPosition) :
93  TransientTrackingRecHit(geom, weight, annealing), theCPE(cpe)
94  {
95  if (rh->hasPositionAndError() || !computeCoarseLocalPosition)
97  else{
98  if (computeCoarseLocalPosition && !cpe){
99  edm::LogError("TSiStripRecHit2DLocalPos")<<" trying to compute coarse local position but CPE is not provided. Not computing local position from disk for the transient tracking rechit.";
101  }
102  else{
103  const GeomDetUnit* gdu = dynamic_cast<const GeomDetUnit*>(geom);
104  LogDebug("TSiStripRecHit2DLocalPos")<<"calculating coarse position/error.";
105  if (gdu){
106  if (rh->cluster().isNonnull()){
108  theHitData = SiStripRecHit2D(lval.first, lval.second, geom->geographicalId(),rh->cluster());
109  }else{
111  theHitData = SiStripRecHit2D(lval.first, lval.second, geom->geographicalId(),rh->cluster_regional());
112  }
113  }else{
114  edm::LogError("TSiStripRecHit2DLocalPos")<<" geomdet does not cast into geomdet unit. cannot create strip local parameters.";
116  }
117  }
118  }
119  }
120 
123  const GeomDet* det,
124  const SiStripClusterRef clust,
126  float weight, float annealing) :
127  TransientTrackingRecHit(det, weight, annealing), theHitData(pos, err, det->geographicalId(), clust),
128  theCPE(cpe){}
129 
130  // TSiStripRecHit2DLocalPos( const TSiStripRecHit2DLocalPos& other ) :
131  // TransientTrackingRecHit( other.det()),
132  // theHitData( other.specificHit()->clone()),
133  // theCPE( other.cpe()) {}
134 
136  const GeomDet* det,
137  const SiStripRegionalClusterRef clust,
139  float weight, float annealing) :
140  TransientTrackingRecHit(det, weight, annealing), theHitData(pos, err, det->geographicalId(), clust),
141  theCPE(cpe){}
142 
143 
144 
145  virtual TSiStripRecHit2DLocalPos* clone() const {
146  return new TSiStripRecHit2DLocalPos(*this);
147  }
148 
149  virtual ConstRecHitContainer transientHits() const;
150 
151 };
152 
153 #endif
#define LogDebug(id)
ReferenceCountingPointer< TransientTrackingRecHit > RecHitPointer
virtual LocalPoint localPosition() const
const SiStripRecHit2D * specificHit() const
SiStripRecHit2D::ClusterRef SiStripClusterRef
virtual LocalError localPositionError() const
const StripClusterParameterEstimator * theCPE
virtual const GeomDetUnit * detUnit() const
virtual ConstRecHitContainer transientHits() const
Composite interface: returns the component hits, if any.
static void getKfComponents(KfComponentsHolder &holder, const TrackingRecHit &hit2dLocalPos, const GeomDet &det)
TSiStripRecHit2DLocalPos(const LocalPoint &pos, const LocalError &err, const GeomDet *det, const SiStripClusterRef clust, const StripClusterParameterEstimator *cpe, float weight, float annealing)
Creates the TrackingRecHit internally, avoids redundent cloning.
virtual AlgebraicMatrix projectionMatrix() const
virtual TSiStripRecHit2DLocalPos * clone() const
ClusterRegionalRef const & cluster_regional() const
static RecHitPointer build(const GeomDet *geom, const SiStripRecHit2D *rh, const StripClusterParameterEstimator *cpe, float weight=1., float annealing=1., bool computeCoarseLocalPosition=false)
virtual std::vector< const TrackingRecHit * > recHits() const
Access to component RecHits (if any)
std::pair< LocalPoint, LocalError > LocalValues
virtual bool canImproveWithTrack() const
virtual LocalPoint localPosition() const
TSiStripRecHit2DLocalPos(const LocalPoint &pos, const LocalError &err, const GeomDet *det, const SiStripRegionalClusterRef clust, const StripClusterParameterEstimator *cpe, float weight, float annealing)
virtual LocalValues localParameters(const T &, const GeomDetUnit &) const =0
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:248
virtual std::vector< const TrackingRecHit * > recHits() const
Access to component RecHits (if any)
CLHEP::HepMatrix AlgebraicMatrix
virtual AlgebraicVector parameters() const
const StripClusterParameterEstimator * cpe() const
virtual LocalError localPositionError() const
virtual std::vector< const TrackingRecHit * > recHits() const =0
Access to component RecHits (if any)
virtual AlgebraicMatrix projectionMatrix() const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:74
static RecHitPointer build(const LocalPoint &pos, const LocalError &err, const GeomDet *det, const SiStripRegionalClusterRef clust, const StripClusterParameterEstimator *cpe, float weight=1., float annealing=1.)
TSiStripRecHit2DLocalPos(const GeomDet *geom, const SiStripRecHit2D *rh, const StripClusterParameterEstimator *cpe, float weight, float annealing, bool computeCoarseLocalPosition)
virtual void getKfComponents(KfComponentsHolder &holder) const
CLHEP::HepVector AlgebraicVector
edm::LazyGetter< SiStripCluster >::value_ref SiStripRegionalClusterRef
virtual AlgebraicVector parameters() const
ClusterRef const & cluster() const
virtual std::vector< TrackingRecHit * > recHits()
Non-const access to component RecHits (if any)
static RecHitPointer build(const LocalPoint &pos, const LocalError &err, const GeomDet *det, const SiStripClusterRef clust, const StripClusterParameterEstimator *cpe, float weight=1., float annealing=1.)
virtual const TrackingRecHit * hit() const
const GeomDet * det() const
The GomeDet* can be zero for InvalidTransientRecHits and for TConstraintRecHit2Ds.
CLHEP::HepSymMatrix AlgebraicSymMatrix
virtual AlgebraicSymMatrix parametersError() const
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
DetId geographicalId() const
virtual int dimension() const
static AlgebraicSymMatrix parError(const LocalError &le, const GeomDet &det)