CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackerRecHit.h
Go to the documentation of this file.
1 #ifndef FastSimulation_Tracking_TrackerRecHit_H_
2 #define FastSimulation_Tracking_TrackerRecHit_H_
3 
17 
19 
20 #include <vector>
21 
26 public:
27 
30  theSplitHit(0),
31  theMatchedHit(0),
32  theGeomDet(0),
33  theSubDetId(0),
34  theLayerNumber(0),
35  theRingNumber(0),
37  theLocalError(0.),
38  theLargerError(0.),
39  forward(false) {}
40 
43  const TrackerRecHit& other ) :
44  theSplitHit(theSplitHit),
45  theMatchedHit(0),
46  theGeomDet(other.geomDet()),
47  theSubDetId(other.subDetId()),
48  theLayerNumber(other.layerNumber()),
49  theRingNumber(other.ringNumber()),
51  theLocalError(0.),
52  theLargerError(0.),
53  forward(other.isForward()) {}
54 
56  TrackerRecHit(const SiTrackerGSRecHit2D* theHit,
57  const TrackerGeometry* theGeometry);
58 
60  const TrackerGeometry* theGeometry);
61 
63  void init(const TrackerGeometry* theGeometry);
64 
65  // TrackerRecHit(const SiTrackerGSMatchedRecHit2D* theHit,
66  // const TrackerGeometry* theGeometry);
67 
69  // const SiTrackerGSRecHit2D* hit() const { return theHit; }
70  inline const SiTrackerGSMatchedRecHit2D* matchedHit() const { return theMatchedHit; }
71  inline const SiTrackerGSRecHit2D* splitHit() const { return theSplitHit; }
72 
73  inline const GSSiTrackerRecHit2DLocalPos* hit() const {
76 
78  inline unsigned int subDetId() const { return theSubDetId; }
79 
81  inline unsigned int layerNumber() const { return theLayerNumber; }
82 
84  inline unsigned int ringNumber() const { return theRingNumber; }
85 
87  unsigned int cylinderNumber() const { return theCylinderNumber; }
88 
90  inline bool isForward() const { return forward; }
91 
93  inline const GeomDet* geomDet() const { return theGeomDet; }
94 
96  inline GlobalPoint globalPosition() const {
98  }
99 
101  inline LocalPoint localPosition() const { return hit()->localPosition(); }
102 
104  // bool isOnRequestedDet(const std::vector<unsigned int>& whichDet) const;
105  bool isOnRequestedDet(const std::vector<unsigned int>& whichDet, const std::string& seedingAlgo) const;
106 
108  bool makesAPairWith(const TrackerRecHit& anotherHit) const;
109  bool makesAPairWith3rd(const TrackerRecHit& anotherHit) const;
110 
112  bool makesATripletWith(const TrackerRecHit& anotherHit,
113  const TrackerRecHit& yetAnotherHit) const;
114 
116  inline bool isOnTheSameLayer(const TrackerRecHit& other) const {
117 
118  return
119  theSubDetId == other.subDetId() &&
120  theLayerNumber == other.layerNumber();
121  }
122 
123  // The smaller local error
124  double localError() {
125 
126  // Check if it has been already computed
127  if ( theLocalError != 0. ) return theLocalError;
128 
129  // Otherwise, compute it!
130  double xx = hit()->localPositionError().xx();
131  double yy = hit()->localPositionError().yy();
132  double xy = hit()->localPositionError().xy();
133  double delta = std::sqrt((xx-yy)*(xx-yy)+4.*xy*xy);
134  theLocalError = 0.5 * (xx+yy-delta);
135  return theLocalError;
136 
137  }
138 
139  // The larger local error
140  double largerError() {
141 
142  // Check if it has been already computed
143  if ( theLargerError != 0. ) return theLargerError;
144 
145  // Otherwise, compute it!
146  double xx = hit()->localPositionError().xx();
147  double yy = hit()->localPositionError().yy();
148  double xy = hit()->localPositionError().xy();
149  double delta = std::sqrt((xx-yy)*(xx-yy)+4.*xy*xy);
150  theLargerError = 0.5 * (xx+yy+delta);
151  return theLargerError;
152 
153  }
154 
155  inline bool operator!=(const TrackerRecHit& aHit) const {
156  return
157  aHit.geomDet() != this->geomDet() ||
158  aHit.hit()->localPosition().x() != this->hit()->localPosition().x() ||
159  aHit.hit()->localPosition().y() != this->hit()->localPosition().y() ||
160  aHit.hit()->localPosition().z() != this->hit()->localPosition().z();
161  }
162 
163  private:
164 
168  unsigned int theSubDetId;
169  unsigned int theLayerNumber;
170  unsigned int theRingNumber;
171  unsigned int theCylinderNumber;
174  bool forward;
175 
176 };
177 
178 #endif
179 
dbl * delta
Definition: mlp_gen.cc:36
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:78
float xx() const
Definition: LocalError.h:19
unsigned int theLayerNumber
const SiTrackerGSRecHit2D * theSplitHit
virtual LocalError localPositionError() const
unsigned int cylinderNumber() const
The global layer number in the nested cylinder geometry.
Definition: TrackerRecHit.h:87
T y() const
Definition: PV3DBase.h:57
const SiTrackerGSMatchedRecHit2D * theMatchedHit
unsigned int theCylinderNumber
GlobalPoint globalPosition() const
The global position.
Definition: TrackerRecHit.h:96
unsigned int ringNumber() const
The Ring Number.
Definition: TrackerRecHit.h:84
double largerError()
bool isOnTheSameLayer(const TrackerRecHit &other) const
Check if two hits are on the same layer of the same subdetector.
TrackerRecHit()
Default Constructor.
Definition: TrackerRecHit.h:29
double theLargerError
unsigned int theRingNumber
bool makesATripletWith(const TrackerRecHit &anotherHit, const TrackerRecHit &yetAnotherHit) const
Check if a triplet is on the proper combination of detectors.
const SiTrackerGSRecHit2D * splitHit() const
Definition: TrackerRecHit.h:71
float xy() const
Definition: LocalError.h:20
const SiTrackerGSMatchedRecHit2D * matchedHit() const
The Hit itself.
Definition: TrackerRecHit.h:70
float yy() const
Definition: LocalError.h:21
T sqrt(T t)
Definition: SSEVec.h:28
unsigned int theSubDetId
T z() const
Definition: PV3DBase.h:58
const GeomDet * theGeomDet
double theLocalError
bool makesAPairWith3rd(const TrackerRecHit &anotherHit) const
bool operator!=(const TrackerRecHit &aHit) const
bool isForward() const
Is it a forward hit ?
Definition: TrackerRecHit.h:90
unsigned int layerNumber() const
The Layer Number.
Definition: TrackerRecHit.h:81
const GSSiTrackerRecHit2DLocalPos * hit() const
Definition: TrackerRecHit.h:73
bool makesAPairWith(const TrackerRecHit &anotherHit) const
Check if a pair is on the proper combination of detectors.
bool isOnRequestedDet(const std::vector< unsigned int > &whichDet, const std::string &seedingAlgo) const
Check if the hit is on one of the requested detector.
virtual LocalPoint localPosition() const
unsigned int subDetId() const
The subdet Id.
Definition: TrackerRecHit.h:78
double localError()
const GeomDet * geomDet() const
The GeomDet.
Definition: TrackerRecHit.h:93
void init(const TrackerGeometry *theGeometry)
Initialization at construction time.
TrackerRecHit(const SiTrackerGSRecHit2D *theSplitHit, const TrackerRecHit &other)
Soft Copy Constructor from private members.
Definition: TrackerRecHit.h:42
T x() const
Definition: PV3DBase.h:56
LocalPoint localPosition() const
The local position.
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
Basic2DVector< T > xy() const