CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TempTrajectory.h
Go to the documentation of this file.
1 #ifndef CkfPattern_TempTrajectory_H
2 #define CkfPattern_TempTrajectory_H
3 
8 
9 #include <vector>
10 #include <algorithm>
12 
15 
40 {
41 public:
42 
46 
47 
54  theChiSquared(0),
58  {}
59 
60 
61 
67  theChiSquared(0),
71  {}
72 
73 
74 
76  theData(rh.theData),
80  ,theNLoops(rh.theNLoops)
82  {}
83 
84 
86  DataContainer aData(rh.theData);
87  using std::swap;
88  swap(theData,aData);
94  theValid=rh.theValid;
97 
98  return *this;
99 
100  }
101 
102 
104  theData(std::move(rh.theData)),
108  theValid(rh.theValid),
109  theNLoops(rh.theNLoops),
111 
113  using std::swap;
114  swap(theData,rh.theData);
115  theChiSquared=rh.theChiSquared;
116  theNumberOfFoundHits=rh.theNumberOfFoundHits;
117  theNumberOfLostHits=rh.theNumberOfLostHits;
118  theDirection=rh.theDirection;
119  theDirectionValidity=rh.theDirectionValidity;
120  theValid=rh.theValid;
121  theNLoops=rh.theNLoops;
122  theDPhiCache=rh.theDPhiCache;
123  return *this;
124 
125  }
126 
127 
129  explicit TempTrajectory(Trajectory && traj);
130 
131 
134 
139  void push( const TrajectoryMeasurement& tm){
140  push( tm, tm.estimate());
141  }
142 
144  push( std::forward<TrajectoryMeasurement>(tm), tm.estimate());
145  }
146 
147  template<typename... Args>
148  void emplace(Args && ...args) {
149  theData.emplace_back(std::forward<Args>(args)...);
151  }
152 
158  void push(TempTrajectory const & segment);
159 
160 
161 
166  void join( TempTrajectory & segment);
167 
168 
169 
173  void push( const TrajectoryMeasurement& tm, double chi2Increment) {
174  theData.push_back(tm);
175  pushAux(chi2Increment);
176  }
177 
178  void push( TrajectoryMeasurement&& tm, double chi2Increment) {
180  pushAux(chi2Increment);
181  }
182 
183 
184  template<typename... Args>
185  void emplace(double chi2Increment, Args && ...args) { // works only because the first Arg is never a double!
186  theData.emplace_back(std::forward<Args>(args)...);
187  pushAux(chi2Increment);
188  }
189 
190 
193  void pop();
194 
201  check(); return theData.back();
202  }
203 
211  check(); return theData.front();
212  }
213 
216  const DataContainer & measurements() const { return theData; }
217 
218 
224  int foundHits() const { return theNumberOfFoundHits;}
225 
230  int lostHits() const { return theNumberOfLostHits;}
231 
233  bool empty() const { return theData.empty();}
234 
236  float chiSquared() const { return theChiSquared;}
237 
243 
247  bool isValid() const { return theValid;}
248 
250  void invalidate() { theValid = false;}
251 
252 
255  static bool inactive(//const Det& det
256  ){return false;}//FIXME
257 
258 
260  const DetLayer* lastLayer() const {
261  check(); return theData.back().layer();
262  }
263 
265  Trajectory toTrajectory() const;
266 
268  void popInvalidTail() ;
269 
270 
274 
278 
279  bool isLooper() const { return (theNLoops>0);}
280  signed char nLoops() const {return theNLoops;}
281 
282  void setNLoops(signed char value) { theNLoops=value;}
284 
285 
286 private:
290  static bool lost( const TrackingRecHit& hit) dso_internal;
291 
292 
293  void pushAux(double chi2Increment);
294 
295 private:
296 
298 
300 
301  signed short theNumberOfFoundHits;
302  signed short theNumberOfLostHits;
303 
304  // PropagationDirection
305  signed char theDirection;
307  bool theValid;
308 
309  signed char theNLoops;
311 
312 
313  void check() const;
314 };
315 
316 #endif
const TrajectoryMeasurement & firstMeasurement() const
signed short theNumberOfFoundHits
void swap(ora::Record &rh, ora::Record &lh)
Definition: Record.h:70
TempTrajectory(TempTrajectory &&rh)
void join(TempTrajectory &segment)
bool empty() const
True if trajectory has no measurements.
ConstRecHitContainer RecHitContainer
void push(TrajectoryMeasurement &&tm)
TrackingRecHit::ConstRecHitContainer ConstRecHitContainer
bool empty() const
Definition: bqueue.h:168
const DataContainer & measurements() const
#define noexcept
void setNLoops(signed char value)
int foundHits() const
static bool lost(const TrackingRecHit &hit)
PropagationDirection
void emplace_back(Args &&...args)
Definition: bqueue.h:146
const T & front() const
Definition: bqueue.h:159
const TrajectoryMeasurement & lastMeasurement() const
PropagationDirection direction() const
void setDPhiCacheForLoopersReconstruction(float dphi)
DataContainer theData
bool isLooper() const
Trajectory toTrajectory() const
Convert to a standard Trajectory.
float dPhiCacheForLoopersReconstruction() const
signed short theNumberOfLostHits
void invalidate()
Method to invalidate a trajectory. Useful during ambiguity resolution.
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
void check() const
static bool inactive()
def move
Definition: eostools.py:508
const DetLayer * layer() const
TempTrajectory & operator=(TempTrajectory &&rh)
TempTrajectory(PropagationDirection dir)
void push(TrajectoryMeasurement &&tm, double chi2Increment)
const T & back() const
Definition: bqueue.h:161
std::vector< ConstRecHitPointer > ConstRecHitContainer
bool isValid() const
void push(const TrajectoryMeasurement &tm, double chi2Increment)
signed char theNLoops
float chiSquared() const
Value of the raw Chi2 of the trajectory, not normalised to the N.D.F.
#define dso_internal
void emplace(Args &&...args)
void popInvalidTail()
Pops out all the invalid hits on the tail.
cmsutils::bqueue< TrajectoryMeasurement > DataContainer
signed char theDirection
~TempTrajectory()
destruct a TempTrajectory
dbl *** dir
Definition: mlp_gen.cc:35
volatile std::atomic< bool > shutdown_flag false
signed char nLoops() const
void emplace(double chi2Increment, Args &&...args)
const DetLayer * lastLayer() const
Redundant method, returns the layer of lastMeasurement() .
TempTrajectory(TempTrajectory const &rh)
TempTrajectory & operator=(TempTrajectory const &rh)
void push_back(const T &val)
Definition: bqueue.h:133
void pushAux(double chi2Increment)
int lostHits() const
void push(const TrajectoryMeasurement &tm)