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 
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 
69 
70 private:
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:
101 
102  virtual TSiStripMatchedRecHit* clone() const {
103  return new TSiStripMatchedRecHit(*this);
104  }
105 
106 };
107 
108 
109 
110 #endif
TSiStripMatchedRecHit(const GeomDet *geom, const TrackingRecHit *rh, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe, bool computeCoarseLocalPosition)
ReferenceCountingPointer< TransientTrackingRecHit > RecHitPointer
virtual AlgebraicSymMatrix parametersError() const
void clonePersistentHit()
take ownership of the hit, if it wasn&#39;t owned (note: if it was owned, this code will leak it) ...
Definition: vlib.h:187
const GeomDetUnit * detUnit() const
virtual const TrackingRecHit * hit() const
static void getKfComponents(KfComponentsHolder &holder, const TrackingRecHit &hit2dLocalPos, const GeomDet &det)
const StripClusterParameterEstimator * theCPE
TSiStripMatchedRecHit(const GeomDet *geom, std::auto_ptr< TrackingRecHit > rh, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe, bool computeCoarseLocalPosition)
virtual LocalError localPositionError() const
#define GCC11_FINAL
const SiStripRecHitMatcher * theMatcher
virtual bool canImproveWithTrack() const
virtual void getKfComponents(KfComponentsHolder &holder) const
virtual TrackingRecHit * clone() const =0
TSiStripMatchedRecHit(const GeomDet *geom, const TrackingRecHit *rh, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe, bool computeCoarseLocalPosition, const DontCloneRecHit &)
Dummy struct to pass to the constructor to say &#39;please don&#39;t clone the hit&#39;.
static RecHitPointer build(const GeomDet *geom, std::auto_ptr< TrackingRecHit > rh, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe=0, bool computeCoarseLocalPosition=false)
const GeomDet * det() const
The GomeDet* can be zero for InvalidTransientRecHits and for TConstraintRecHit2Ds.
CLHEP::HepSymMatrix AlgebraicSymMatrix
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
static RecHitPointer build(const GeomDet *geom, const TrackingRecHit *rh, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe=0, bool computeCoarseLocalPosition=false)
static void buildInPlace(std::auto_ptr< TSiStripMatchedRecHit > &memory, const GeomDet *geom, const TrackingRecHit *rh, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe=0, bool computeCoarseLocalPosition=false)
virtual ConstRecHitContainer transientHits() const
Composite interface: returns the component hits, if any.
virtual TSiStripMatchedRecHit * clone() const
static AlgebraicSymMatrix parError(const LocalError &le, const GeomDet &det)