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 
9 
10 #include <vector>
11 #include <algorithm>
12 #include <limits>
14 
17 
42 {
43 public:
44 
48 
49 
56 
57 
58 
63  TempTrajectory(PropagationDirection dir, unsigned char nhseed) :
64  theDirection(dir),
65  theValid(true),
66  theNHseed(nhseed)
67  {}
68 
69 
70 
71  TempTrajectory(TempTrajectory const & rh) = default;
72  TempTrajectory & operator=(TempTrajectory const & rh) = default;
73 
74 
76  theData(std::move(rh.theData)),
84  theValid(rh.theValid),
85  theNHseed(rh.theNHseed),
86  theNLoops(rh.theNLoops),
90 
92  using std::swap;
93  swap(theData,rh.theData);
94  theChiSquared=rh.theChiSquared;
95  theNumberOfFoundHits=rh.theNumberOfFoundHits;
96  theNumberOfFoundPixelHits=rh.theNumberOfFoundPixelHits;
97  theNumberOfLostHits=rh.theNumberOfLostHits;
98  theNumberOfTrailingFoundHits=rh.theNumberOfTrailingFoundHits;
99  theNumberOfCCCBadHits_=rh.theNumberOfCCCBadHits_;
100  theDirection=rh.theDirection;
101  theValid=rh.theValid;
102  theNHseed=rh.theNHseed;
103  theNLoops=rh.theNLoops;
104  theDPhiCache=rh.theDPhiCache;
105  theCCCThreshold_=rh.theCCCThreshold_;
106  stopReason_=rh.stopReason_;
107  return *this;
108 
109  }
110 
111 
113  explicit TempTrajectory(Trajectory && traj);
114 
115 
118 
123  void push( const TrajectoryMeasurement& tm){
124  push( tm, tm.estimate());
125  }
126 
128  push( std::forward<TrajectoryMeasurement>(tm), tm.estimate());
129  }
130 
131  template<typename... Args>
132  void emplace(Args && ...args) {
133  theData.emplace_back(std::forward<Args>(args)...);
135  }
136 
142  void push(TempTrajectory const & segment);
143 
144 
145 
150  void join( TempTrajectory & segment);
151 
152 
153 
157  void push( const TrajectoryMeasurement& tm, double chi2Increment) {
158  theData.push_back(tm);
159  pushAux(chi2Increment);
160  }
161 
162  void push( TrajectoryMeasurement&& tm, double chi2Increment) {
164  pushAux(chi2Increment);
165  }
166 
167 
168  template<typename... Args>
169  void emplace(double chi2Increment, Args && ...args) { // works only because the first Arg is never a double!
170  theData.emplace_back(std::forward<Args>(args)...);
171  pushAux(chi2Increment);
172  }
173 
174 
177  void pop();
178 
185  check(); return theData.back();
186  }
187 
195  check(); return theData.front();
196  }
197 
200  const DataContainer & measurements() const { return theData; }
201 
202 
208  int foundHits() const { return theNumberOfFoundHits;}
209 
213 
218  int lostHits() const { return theNumberOfLostHits;}
219 
223 
228  int cccBadHits() const { return theNumberOfCCCBadHits_;}
229 
230  //number of hits in seed
231  unsigned int seedNHits() const { return theNHseed;}
232 
234  bool empty() const { return theData.empty();}
235 
237  float chiSquared() const { return theChiSquared;}
238 
244 
248  bool isValid() const { return theValid;}
249 
251  void invalidate() { theValid = false;}
252 
253 
256  static bool inactive(//const Det& det
257  ){return false;}//FIXME
258 
259 
261  const DetLayer* lastLayer() const {
262  check(); return theData.back().layer();
263  }
264 
266  Trajectory toTrajectory() const;
267 
269  void popInvalidTail() ;
270 
271 
275 
279 
280  bool isLooper() const { return (theNLoops>0);}
281  signed char nLoops() const {return theNLoops;}
282 
283  void setNLoops(signed char value) { theNLoops=value;}
285 
288 
289  int numberOfCCCBadHits(float ccc_threshold);
290 
291  static bool lost( const TrackingRecHit& hit) dso_internal;
292 
293 private:
298  void updateBadForCCC(float ccc_threshold) dso_internal;
299 
300 
301 
302  void pushAux(double chi2Increment);
303 
304 private:
305 
307 
308  float theChiSquared=0;
309 
310  signed short theNumberOfFoundHits=0;
312  signed short theNumberOfLostHits=0;
314  signed short theNumberOfCCCBadHits_=0;
315 
316  // PropagationDirection
318  bool theValid=false;
319 
320  unsigned char theNHseed=0;
321 
322  signed char theNLoops=0;
323  float theDPhiCache=0;
326 
327  void check() const;
328 };
329 
330 #endif
const TrajectoryMeasurement & firstMeasurement() const
signed short theNumberOfFoundHits
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
signed short theNumberOfCCCBadHits_
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
int cccBadHits() const
StopReason stopReason() const
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:116
int foundPixelHits() const
const T & front() const
Definition: bqueue.h:159
const TrajectoryMeasurement & lastMeasurement() const
PropagationDirection direction() const
void setDPhiCacheForLoopersReconstruction(float dphi)
DataContainer theData
StopReason stopReason_
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()
void updateBadForCCC(float ccc_threshold)
def move
Definition: eostools.py:510
unsigned int seedNHits() const
TempTrajectory & operator=(TempTrajectory const &rh)=default
const DetLayer * layer() const
TempTrajectory & operator=(TempTrajectory &&rh)
void push(TrajectoryMeasurement &&tm, double chi2Increment)
const T & back() const
Definition: bqueue.h:161
std::vector< ConstRecHitPointer > ConstRecHitContainer
bool isValid() const
int trailingFoundHits() const
void push(const TrajectoryMeasurement &tm, double chi2Increment)
int numberOfCCCBadHits(float ccc_threshold)
signed char theNLoops
float chiSquared() const
Value of the raw Chi2 of the trajectory, not normalised to the N.D.F.
signed short theNumberOfFoundPixelHits
bool badForCCC(const TrajectoryMeasurement &tm)
#define dso_internal
void emplace(Args &&...args)
void popInvalidTail()
Pops out all the invalid hits on the tail.
cmsutils::bqueue< TrajectoryMeasurement > DataContainer
signed short theNumberOfTrailingFoundHits
unsigned char theNHseed
void setStopReason(StopReason s)
signed char theDirection
~TempTrajectory()
destruct a TempTrajectory
dbl *** dir
Definition: mlp_gen.cc:35
signed char nLoops() const
void emplace(double chi2Increment, Args &&...args)
const DetLayer * lastLayer() const
Redundant method, returns the layer of lastMeasurement() .
void push_back(const T &val)
Definition: bqueue.h:133
void pushAux(double chi2Increment)
int lostHits() const
void push(const TrajectoryMeasurement &tm)
TempTrajectory(PropagationDirection dir, unsigned char nhseed)