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  theChiSquared(0),
61  theValid(false),
62  theNHseed(0),
63  theNLoops(0),
64  theDPhiCache(0),
65  theCCCThreshold_(std::numeric_limits<float>::max()),
67  {}
68 
69 
70 
75  TempTrajectory(PropagationDirection dir, unsigned char nhseed) :
76  theChiSquared(0),
80  theDirection(dir),
81  theValid(true),
82  theNHseed(nhseed),
83  theNLoops(0),
84  theDPhiCache(0),
85  theCCCThreshold_(std::numeric_limits<float>::max()),
87  {}
88 
89 
90 
91  TempTrajectory(TempTrajectory const & rh) = default;
92  TempTrajectory & operator=(TempTrajectory const & rh) = default;
93 
94 
96  theData(std::move(rh.theData)),
102  theValid(rh.theValid),
103  theNHseed(rh.theNHseed),
104  theNLoops(rh.theNLoops),
108 
110  using std::swap;
111  swap(theData,rh.theData);
112  theChiSquared=rh.theChiSquared;
113  theNumberOfFoundHits=rh.theNumberOfFoundHits;
114  theNumberOfLostHits=rh.theNumberOfLostHits;
115  theNumberOfCCCBadHits_=rh.theNumberOfCCCBadHits_;
116  theDirection=rh.theDirection;
117  theValid=rh.theValid;
118  theNHseed=rh.theNHseed;
119  theNLoops=rh.theNLoops;
120  theDPhiCache=rh.theDPhiCache;
121  theCCCThreshold_=rh.theCCCThreshold_;
122  stopReason_=rh.stopReason_;
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 
236  int cccBadHits() const { return theNumberOfCCCBadHits_;}
237 
238  //number of hits in seed
239  unsigned int seedNHits() const { return theNHseed;}
240 
242  bool empty() const { return theData.empty();}
243 
245  float chiSquared() const { return theChiSquared;}
246 
252 
256  bool isValid() const { return theValid;}
257 
259  void invalidate() { theValid = false;}
260 
261 
264  static bool inactive(//const Det& det
265  ){return false;}//FIXME
266 
267 
269  const DetLayer* lastLayer() const {
270  check(); return theData.back().layer();
271  }
272 
274  Trajectory toTrajectory() const;
275 
277  void popInvalidTail() ;
278 
279 
283 
287 
288  bool isLooper() const { return (theNLoops>0);}
289  signed char nLoops() const {return theNLoops;}
290 
291  void setNLoops(signed char value) { theNLoops=value;}
293 
296 
297  int numberOfCCCBadHits(float ccc_threshold);
298 
299 private:
303  static bool lost( const TrackingRecHit& hit) dso_internal;
304 
305  bool badForCCC(const TrajectoryMeasurement &tm);
306  void updateBadForCCC(float ccc_threshold);
307 
308 
309 
310  void pushAux(double chi2Increment);
311 
312 private:
313 
315 
317 
318  signed short theNumberOfFoundHits;
319  signed short theNumberOfLostHits;
321 
322  // PropagationDirection
323  signed char theDirection;
324  bool theValid;
325 
326  unsigned char theNHseed;
327 
328  signed char theNLoops;
332 
333  void check() const;
334 };
335 
336 #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
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
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
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.
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
unsigned char theNHseed
void setStopReason(StopReason s)
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() .
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)