CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrajectorySeedHitCandidate.h
Go to the documentation of this file.
1 #ifndef FastSimulation_Tracking_TrajectorySeedHitCandidate_H_
2 #define FastSimulation_Tracking_TrajectorySeedHitCandidate_H_
3 
15 
16 
18 
19 #include <vector>
20 
21 class TrackerTopology;
22 class TrackerGeometry;
23 
25 public:
26 
29  theHit(0),
30  theGeomDet(0),
31  seedingLayer(),
32  theRingNumber(0),
34  theLocalError(0.),
35  theLargerError(0.),
36  forward(false)
37 
38  {
39 
40  }
41 
45  const TrajectorySeedHitCandidate& other ) :
46  theHit(hit),
47  theGeomDet(other.geomDet()),
49  theRingNumber(other.ringNumber()),
51  theLocalError(0.),
52  theLargerError(0.),
53  forward(other.isForward())
54 
55  {
56 
57  }
58 
61  const TrackerGeometry* theGeometry,
62  const TrackerTopology* tTopo);
63 
65  void init(const TrackerGeometry* theGeometry,
66  const TrackerTopology *tTopo);
67 
69  inline const FastTrackerRecHit * hit() const { return theHit; }
70 
71  inline const TrackingLayer& getTrackingLayer() const
72  {
73  return seedingLayer;
74  }
75 
77  inline unsigned int subDetId() const { return seedingLayer.getSubDetNumber(); }
78 
80  inline unsigned int layerNumber() const { return seedingLayer.getLayerNumber(); }
81 
83  inline unsigned int ringNumber() const { return theRingNumber; }
84 
86  unsigned int cylinderNumber() const { return theCylinderNumber; }
87 
89  inline bool isForward() const { return forward; }
90 
92  inline const GeomDet* geomDet() const { return theGeomDet; }
93 
95  inline GlobalPoint globalPosition() const {
97  }
98 
100  inline LocalPoint localPosition() const { return hit()->localPosition(); }
102  // bool isOnRequestedDet(const std::vector<unsigned int>& whichDet) const;
103 
105  bool isOnRequestedDet(const std::vector<std::vector<TrackingLayer> >& theLayersInSets) const;
106  bool isOnRequestedDet(const std::vector<std::vector<TrackingLayer> >& theLayersInSets, const TrajectorySeedHitCandidate& theSeedHitSecond) const;
107  bool isOnRequestedDet(const std::vector<std::vector<TrackingLayer> >& theLayersInSets, const TrajectorySeedHitCandidate& theSeedHitSecond, const TrajectorySeedHitCandidate& theSeedHitThird) const;
108 
109 
111  inline bool isOnTheSameLayer(const TrajectorySeedHitCandidate& other) const {
112 
113  return seedingLayer==other.seedingLayer;
114  }
115 
116  // The smaller local error
117  double localError() const
118  {
119 
120  // Check if it has been already computed
121  if ( theLocalError != 0. ) return theLocalError;
122 
123  // Otherwise, compute it!
124  double xx = hit()->localPositionError().xx();
125  double yy = hit()->localPositionError().yy();
126  double xy = hit()->localPositionError().xy();
127  double delta = std::sqrt((xx-yy)*(xx-yy)+4.*xy*xy);
128  theLocalError = 0.5 * (xx+yy-delta);
129  return theLocalError;
130 
131  }
132 
133  // The larger local error
134  double largerError() const
135  {
136 
137  // Check if it has been already computed
138  if ( theLargerError != 0. ) return theLargerError;
139 
140  // Otherwise, compute it!
141  double xx = hit()->localPositionError().xx();
142  double yy = hit()->localPositionError().yy();
143  double xy = hit()->localPositionError().xy();
144  double delta = std::sqrt((xx-yy)*(xx-yy)+4.*xy*xy);
145  theLargerError = 0.5 * (xx+yy+delta);
146  return theLargerError;
147 
148  }
149 
150  inline bool operator!=(const TrajectorySeedHitCandidate& aHit) const {
151  return
152  aHit.geomDet() != this->geomDet() ||
153  aHit.hit()->localPosition().x() != this->hit()->localPosition().x() ||
154  aHit.hit()->localPosition().y() != this->hit()->localPosition().y() ||
155  aHit.hit()->localPosition().z() != this->hit()->localPosition().z();
156  }
157 
158 
159 
160  private:
161 
165  unsigned int theRingNumber;
166  unsigned int theCylinderNumber;
167  mutable double theLocalError; //only for caching
168  mutable double theLargerError; //only for caching
169  bool forward;
170 
171 };
172 
173 #endif
174 
unsigned int getSubDetNumber() const
Definition: TrackingLayer.h:75
dbl * delta
Definition: mlp_gen.cc:36
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:114
float xx() const
Definition: LocalError.h:24
unsigned int cylinderNumber() const
The global layer number in the nested cylinder geometry.
bool operator!=(const TrajectorySeedHitCandidate &aHit) const
unsigned int getLayerNumber() const
Definition: TrackingLayer.h:85
bool isForward() const
Is it a forward hit ?
T y() const
Definition: PV3DBase.h:63
GlobalPoint globalPosition() const
The global position.
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
virtual LocalError localPositionError() const
float xy() const
Definition: LocalError.h:25
void init(const TrackerGeometry *theGeometry, const TrackerTopology *tTopo)
Initialization at construction time.
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:48
T z() const
Definition: PV3DBase.h:64
TrajectorySeedHitCandidate(const FastTrackerRecHit *hit, const TrajectorySeedHitCandidate &other)
const FastTrackerRecHit * theHit
TrajectorySeedHitCandidate()
Default Constructor.
bool isOnRequestedDet(const std::vector< std::vector< TrackingLayer > > &theLayersInSets) const
Check if the hit is on one of the requested detector.
unsigned int ringNumber() const
The Ring Number.
const GeomDet * geomDet() const
The GeomDet.
LocalPoint localPosition() const
The local position.
const FastTrackerRecHit * hit() const
The Hit itself.
unsigned int layerNumber() const
The Layer Number.
volatile std::atomic< bool > shutdown_flag false
const TrackingLayer & getTrackingLayer() const
bool isOnTheSameLayer(const TrajectorySeedHitCandidate &other) const
Check if two hits are on the same layer of the same subdetector.
unsigned int subDetId() const
The subdet Id.
T x() const
Definition: PV3DBase.h:62
virtual LocalPoint localPosition() const