1 |
econte |
1.1 |
#ifndef RECOTRACKER_TRANSIENTRACKINGRECHIT_TRecHit1DMomConstraint_H
|
2 |
|
|
#define RECOTRACKER_TRANSIENTRACKINGRECHIT_TRecHit1DMomConstraint_H
|
3 |
|
|
|
4 |
|
|
#include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
|
5 |
|
|
|
6 |
|
|
class GeomDetUnit;
|
7 |
|
|
|
8 |
|
|
class TRecHit1DMomConstraint : public TransientTrackingRecHit {
|
9 |
|
|
public:
|
10 |
|
|
|
11 |
|
|
virtual ~TRecHit1DMomConstraint() {}
|
12 |
|
|
|
13 |
|
|
virtual AlgebraicVector parameters() const {
|
14 |
|
|
AlgebraicVector result(1);
|
15 |
|
|
result[0] = charge_/fabs(mom_);
|
16 |
|
|
return result;
|
17 |
|
|
}
|
18 |
|
|
|
19 |
|
|
virtual AlgebraicSymMatrix parametersError() const {
|
20 |
|
|
AlgebraicSymMatrix m(1);
|
21 |
|
|
m[0][0] = err_/(mom_*mom_);//parametersErrors are squared
|
22 |
|
|
m[0][0] *= m[0][0];
|
23 |
|
|
return m;
|
24 |
|
|
}
|
25 |
|
|
|
26 |
|
|
virtual AlgebraicMatrix projectionMatrix() const {
|
27 |
|
|
AlgebraicMatrix theProjectionMatrix;
|
28 |
|
|
theProjectionMatrix = AlgebraicMatrix( 1, 5, 0);
|
29 |
|
|
theProjectionMatrix[0][0] = 1;
|
30 |
|
|
return theProjectionMatrix;
|
31 |
|
|
}
|
32 |
|
|
virtual int dimension() const {return 1;}
|
33 |
|
|
|
34 |
|
|
virtual LocalPoint localPosition() const {return LocalPoint(0,0,0);}
|
35 |
|
|
virtual LocalError localPositionError() const {return LocalError(0,0,0);}
|
36 |
|
|
|
37 |
|
|
double mom() const {return mom_;}
|
38 |
|
|
double err() const {return err_;}
|
39 |
|
|
int charge() const {return charge_;}
|
40 |
|
|
|
41 |
|
|
virtual const TrackingRecHit * hit() const {return 0;}//fixme return invalid
|
42 |
|
|
|
43 |
|
|
|
44 |
|
|
|
45 |
|
|
virtual std::vector<const TrackingRecHit*> recHits() const {
|
46 |
|
|
return hit()->recHits();
|
47 |
|
|
}
|
48 |
|
|
virtual std::vector<TrackingRecHit*> recHits() {
|
49 |
|
|
return std::vector<TrackingRecHit*>();
|
50 |
|
|
}
|
51 |
|
|
|
52 |
|
|
virtual bool canImproveWithTrack() const {return false;}
|
53 |
|
|
|
54 |
|
|
virtual RecHitPointer clone (const TrajectoryStateOnSurface& ts) const {return clone();}
|
55 |
|
|
|
56 |
|
|
virtual const GeomDetUnit* detUnit() const {return 0;}
|
57 |
|
|
virtual const GeomDet* det() const {return 0;}
|
58 |
|
|
|
59 |
|
|
static RecHitPointer build(const int charge,
|
60 |
|
|
const double mom,
|
61 |
|
|
const double err,//not sqared!!!
|
62 |
|
|
const Surface* surface) {
|
63 |
|
|
return RecHitPointer( new TRecHit1DMomConstraint( charge, mom, err, surface));
|
64 |
|
|
}
|
65 |
|
|
|
66 |
|
|
virtual const Surface * surface() const {return surface_;}
|
67 |
|
|
|
68 |
|
|
private:
|
69 |
|
|
const int charge_;
|
70 |
|
|
const double mom_;
|
71 |
|
|
const double err_;
|
72 |
|
|
const Surface* surface_;
|
73 |
|
|
/// Creates the TrackingRecHit internally, avoids redundent cloning
|
74 |
|
|
TRecHit1DMomConstraint(const int charge,
|
75 |
|
|
const double mom,
|
76 |
|
|
const double err,//notsquared
|
77 |
|
|
const Surface* surface):
|
78 |
|
|
charge_(charge),mom_(mom),err_(err),surface_(surface) {}
|
79 |
|
|
|
80 |
|
|
TRecHit1DMomConstraint( const TRecHit1DMomConstraint& other ):
|
81 |
|
|
charge_( other.charge() ), mom_( other.mom() ),err_( other.err() ), surface_((other.surface())) {}
|
82 |
|
|
|
83 |
|
|
virtual TRecHit1DMomConstraint * clone() const {
|
84 |
|
|
return new TRecHit1DMomConstraint(*this);
|
85 |
|
|
}
|
86 |
|
|
|
87 |
|
|
};
|
88 |
|
|
|
89 |
|
|
#endif
|