CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TSiStripMatchedRecHit.h
Go to the documentation of this file.
1 #ifndef RECOTRACKER_TRANSIENTRACKINGRECHIT_TSiStripMatchedRecHit_H
2 #define RECOTRACKER_TRANSIENTRACKINGRECHIT_TSiStripMatchedRecHit_H
3 
8 #include<memory>
9 
12 
13 class TSiStripMatchedRecHit GCC11_FINAL : public GenericTransientTrackingRecHit{
14 public:
15 
16  virtual void getKfComponents( KfComponentsHolder & holder ) const {
18  }
19 
22  }
23 
24  const GeomDetUnit* detUnit() const {return 0;}
25 
26  static RecHitPointer build( const GeomDet * geom, const TrackingRecHit * rh,
27  const SiStripRecHitMatcher *matcher,
28  const StripClusterParameterEstimator* cpe=0,
29  bool computeCoarseLocalPosition=false) {
30  return RecHitPointer( new TSiStripMatchedRecHit( geom, rh, matcher,cpe, computeCoarseLocalPosition));
31  }
32 
33  static RecHitPointer build( const GeomDet * geom, std::auto_ptr<TrackingRecHit> rh,
34  const SiStripRecHitMatcher *matcher,
35  const StripClusterParameterEstimator* cpe=0,
36  bool computeCoarseLocalPosition=false) {
37  return RecHitPointer( new TSiStripMatchedRecHit( geom, rh, matcher,cpe, computeCoarseLocalPosition));
38  }
39 
40  virtual RecHitPointer clone( const TrajectoryStateOnSurface& ts) const;
41  virtual bool canImproveWithTrack() const {return (theMatcher != 0);}
42  virtual ConstRecHitContainer transientHits () const;
43 
45  struct DontCloneRecHit {};
46 
51  static void buildInPlace(std::auto_ptr<TSiStripMatchedRecHit> &memory,
52  const GeomDet * geom, const TrackingRecHit * rh,
53  const SiStripRecHitMatcher *matcher,
54  const StripClusterParameterEstimator* cpe=0,
55  bool computeCoarseLocalPosition=false) {
56  if (memory.get()) {
57  memory->~TSiStripMatchedRecHit(); // call destructor
58  new (memory.get()) TSiStripMatchedRecHit( geom, rh, matcher,cpe, computeCoarseLocalPosition, DontCloneRecHit());
59  } else {
60  memory.reset(new TSiStripMatchedRecHit( geom, rh, matcher,cpe,computeCoarseLocalPosition, DontCloneRecHit()));
61  }
62  }
63 
65  void clonePersistentHit() { trackingRecHit_ = trackingRecHit_->clone(); }
68  void clearPersistentHit() { trackingRecHit_ = 0; }
69 
70 private:
71  const SiStripRecHitMatcher* theMatcher;
72  const StripClusterParameterEstimator* theCPE;
73 
74 private:
76  const SiStripRecHitMatcher *matcher,
78  bool computeCoarseLocalPosition) :
79  GenericTransientTrackingRecHit(geom, *rh), theMatcher(matcher),theCPE(cpe) {
80  if (computeCoarseLocalPosition) ComputeCoarseLocalPosition();
81  }
82 
83  TSiStripMatchedRecHit (const GeomDet * geom, std::auto_ptr<TrackingRecHit> rh,
84  const SiStripRecHitMatcher *matcher,
86  bool computeCoarseLocalPosition) :
87  GenericTransientTrackingRecHit(geom, rh.release()), theMatcher(matcher),theCPE(cpe) {
88  if (computeCoarseLocalPosition) ComputeCoarseLocalPosition();
89  }
91  const SiStripRecHitMatcher *matcher,
93  bool computeCoarseLocalPosition,
94  const DontCloneRecHit &) :
95  GenericTransientTrackingRecHit(geom, const_cast<TrackingRecHit *>(rh)), theMatcher(matcher),theCPE(cpe) {
96  if (computeCoarseLocalPosition) ComputeCoarseLocalPosition();
97  }
98 
99 private:
100  void ComputeCoarseLocalPosition();
101 
102  virtual TSiStripMatchedRecHit* clone() const {
103  return new TSiStripMatchedRecHit(*this);
104  }
105 
106 };
107 
108 
109 
110 #endif
virtual void getKfComponents(KfComponentsHolder &holder) const
TSiStripMatchedRecHit(const GeomDet *geom, const TrackingRecHit *rh, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe, bool computeCoarseLocalPosition)
virtual AlgebraicSymMatrix parametersError() const
Definition: vlib.h:187
static RecHitPointer build(const GeomDet *geom, std::auto_ptr< TrackingRecHit > rh, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe=0, bool computeCoarseLocalPosition=false)
virtual const TrackingRecHit * hit() const
TSiStripMatchedRecHit(const GeomDet *geom, std::auto_ptr< TrackingRecHit > rh, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe, bool computeCoarseLocalPosition)
static void getKfComponents(KfComponentsHolder &holder, const TrackingRecHit &hit2dLocalPos, const GeomDet &det)
virtual const GeomDet * det() const GCC11_FINAL
The GomeDet* can be zero for InvalidTransientRecHits and for TConstraintRecHit2Ds.
virtual bool canImproveWithTrack() const
ReferenceCountingPointer< TransientTrackingRecHit > RecHitPointer
virtual TSiStripMatchedRecHit * clone() const
TSiStripMatchedRecHit(const GeomDet *geom, const TrackingRecHit *rh, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe, bool computeCoarseLocalPosition, const DontCloneRecHit &)
virtual LocalError localPositionError() const
static void buildInPlace(std::auto_ptr< TSiStripMatchedRecHit > &memory, const GeomDet *geom, const TrackingRecHit *rh, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe=0, bool computeCoarseLocalPosition=false)
static RecHitPointer build(const GeomDet *geom, const TrackingRecHit *rh, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe=0, bool computeCoarseLocalPosition=false)
Dummy struct to pass to the constructor to say &#39;please don&#39;t clone the hit&#39;.
virtual GenericTransientTrackingRecHit * clone() const
const GeomDetUnit * detUnit() const
CLHEP::HepSymMatrix AlgebraicSymMatrix
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
void clonePersistentHit()
take ownership of the hit, if it wasn&#39;t owned (note: if it was owned, this code will leak it) ...
virtual ConstRecHitContainer transientHits() const
Composite interface: returns the component hits, if any.
static AlgebraicSymMatrix parError(const LocalError &le, const GeomDet &det)
Unlimited (trivial) bounds.