CMS 3D CMS Logo

TRecHit1DMomConstraint.h
Go to the documentation of this file.
1 #ifndef RECOTRACKER_TRANSIENTRACKINGRECHIT_TRecHit1DMomConstraint_H
2 #define RECOTRACKER_TRANSIENTRACKINGRECHIT_TRecHit1DMomConstraint_H
3 
6 
7 
8 
10  public:
11 
13 
14  AlgebraicVector parameters() const override {
16  result[0] = charge_/fabs(mom_);
17  return result;
18  }
19 
22  m[0][0] = err_/(mom_*mom_);//parametersErrors are squared
23  m[0][0] *= m[0][0];
24  return m;
25  }
26 
27  AlgebraicMatrix projectionMatrix() const override {
29  theProjectionMatrix = AlgebraicMatrix( 1, 5, 0);
30  theProjectionMatrix[0][0] = 1;
31  return theProjectionMatrix;
32  }
33  int dimension() const override {return 1;}
34 
35  LocalPoint localPosition() const override {return LocalPoint(0,0,0);}
36  LocalError localPositionError() const override {return LocalError(0,0,0);}
37 
38  double mom() const {return mom_;}
39  double err() const {return err_;}
40  int charge() const {return charge_;}
41 
42 
43  const TrackingRecHit * hit() const override {return nullptr;}//fixme return invalid
44  TrackingRecHit * cloneHit() const override { return nullptr;}
45 
46  std::vector<const TrackingRecHit*> recHits() const override { return std::vector<const TrackingRecHit*>(); }
47  std::vector<TrackingRecHit*> recHits() override { return std::vector<TrackingRecHit*>(); }
48  bool sharesInput( const TrackingRecHit*, SharedInputType) const override { return false;}
49 
50  bool canImproveWithTrack() const override {return false;}
51 
52  virtual RecHitPointer clone (const TrajectoryStateOnSurface& ts) const {return RecHitPointer(clone());}
53 
54  const GeomDetUnit* detUnit() const override {return nullptr;}
55 
56  static RecHitPointer build(const int charge,
57  const double mom,
58  const double err,//not sqared!!!
59  const Surface* surface) {
60  return RecHitPointer( new TRecHit1DMomConstraint( charge, mom, err, surface));
61  }
62 
63  const Surface * surface() const override {return surface_;}
64 
65  GlobalPoint globalPosition() const override { return GlobalPoint(); }
66  GlobalError globalPositionError() const override { return GlobalError();}
67  float errorGlobalR() const override { return 0;}
68  float errorGlobalZ() const override { return 0; }
69  float errorGlobalRPhi() const override { return 0; }
70 
71 
72  private:
73  const int charge_;
74  const double mom_;
75  const double err_;
76  const Surface* surface_;
79  const double mom,
80  const double err,//notsquared
81  const Surface* surface):
82  charge_(charge),mom_(mom),err_(err),surface_(surface) {}
83 
85  charge_( other.charge() ), mom_( other.mom() ),err_( other.err() ), surface_((other.surface())) {}
86 
87  TRecHit1DMomConstraint * clone() const override {
88  return new TRecHit1DMomConstraint(*this);
89  }
90 
91 };
92 
93 #endif
SharedInputType
definition of equality via shared input
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:32
std::vector< TrackingRecHit * > recHits() override
Non-const access to component RecHits (if any)
AlgebraicMatrix projectionMatrix() const override
TRecHit1DMomConstraint(const int charge, const double mom, const double err, const Surface *surface)
Creates the TrackingRecHit internally, avoids redundent cloning.
GlobalPoint globalPosition() const override
TRecHit1DMomConstraint * clone() const override
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
TRecHit1DMomConstraint(const TRecHit1DMomConstraint &other)
GlobalErrorBase< double, ErrorMatrixTag > GlobalError
Definition: GlobalError.h:13
bool canImproveWithTrack() const override
static const AlgebraicMatrix theProjectionMatrix
Definition: CSCSegment.cc:80
const Surface * surface() const override
GlobalError globalPositionError() const override
AlgebraicVector parameters() const override
CLHEP::HepMatrix AlgebraicMatrix
TrackingRecHit * cloneHit() const override
bool sharesInput(const TrackingRecHit *, SharedInputType) const override
std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
const GeomDetUnit * detUnit() const override
const TrackingRecHit * hit() const override
std::shared_ptr< TrackingRecHit const > RecHitPointer
CLHEP::HepVector AlgebraicVector
int dimension() const override
LocalPoint localPosition() const override
AlgebraicSymMatrix parametersError() const override
float errorGlobalR() const override
float errorGlobalZ() const override
CLHEP::HepSymMatrix AlgebraicSymMatrix
LocalError localPositionError() const override
virtual RecHitPointer clone(const TrajectoryStateOnSurface &ts) const
static RecHitPointer build(const int charge, const double mom, const double err, const Surface *surface)
float errorGlobalRPhi() const override