CMS 3D CMS Logo

TempTrajectory.h
Go to the documentation of this file.
1 #ifndef CkfPattern_TempTrajectory_H
2 #define CkfPattern_TempTrajectory_H
3 
10 
11 #include <vector>
12 #include <algorithm>
13 #include <limits>
15 
17 
41 public:
45 
52 
57  TempTrajectory(PropagationDirection dir, unsigned char nhseed)
58  : theDirection(dir), theValid(true), theNHseed(nhseed) {}
59 
60  TempTrajectory(TempTrajectory const& rh) = default;
61  TempTrajectory& operator=(TempTrajectory const& rh) = default;
62 
64  : theData(std::move(rh.theData)),
65  theChiSquared(rh.theChiSquared),
66  theNumberOfFoundHits(rh.theNumberOfFoundHits),
67  theNumberOfFoundPixelHits(rh.theNumberOfFoundPixelHits),
68  theNumberOfLostHits(rh.theNumberOfLostHits),
69  theNumberOfTrailingFoundHits(rh.theNumberOfTrailingFoundHits),
70  theNumberOfCCCBadHits_(rh.theNumberOfCCCBadHits_),
71  theDirection(rh.theDirection),
72  theValid(rh.theValid),
73  theNHseed(rh.theNHseed),
74  theNLoops(rh.theNLoops),
75  theDPhiCache(rh.theDPhiCache),
76  theCCCThreshold_(rh.theCCCThreshold_),
77  stopReason_(rh.stopReason_) {}
78 
80  using std::swap;
81  swap(theData, rh.theData);
82  theChiSquared = rh.theChiSquared;
83  theNumberOfFoundHits = rh.theNumberOfFoundHits;
84  theNumberOfFoundPixelHits = rh.theNumberOfFoundPixelHits;
85  theNumberOfLostHits = rh.theNumberOfLostHits;
86  theNumberOfTrailingFoundHits = rh.theNumberOfTrailingFoundHits;
87  theNumberOfCCCBadHits_ = rh.theNumberOfCCCBadHits_;
88  theDirection = rh.theDirection;
89  theValid = rh.theValid;
90  theNHseed = rh.theNHseed;
91  theNLoops = rh.theNLoops;
92  theDPhiCache = rh.theDPhiCache;
93  theCCCThreshold_ = rh.theCCCThreshold_;
94  stopReason_ = rh.stopReason_;
95  return *this;
96  }
97 
99  explicit TempTrajectory(Trajectory&& traj);
100 
103 
108  void push(const TrajectoryMeasurement& tm) { push(tm, tm.estimate()); }
109 
110  void push(TrajectoryMeasurement&& tm) { push(std::forward<TrajectoryMeasurement>(tm), tm.estimate()); }
111 
112  template <typename... Args>
113  void emplace(Args&&... args) {
114  theData.emplace_back(std::forward<Args>(args)...);
116  }
117 
123  void push(TempTrajectory const& segment);
124 
129  void join(TempTrajectory& segment);
130 
134  void push(const TrajectoryMeasurement& tm, double chi2Increment) {
135  theData.push_back(tm);
136  pushAux(chi2Increment);
137  }
138 
139  void push(TrajectoryMeasurement&& tm, double chi2Increment) {
141  pushAux(chi2Increment);
142  }
143 
144  template <typename... Args>
145  void emplace(double chi2Increment, Args&&... args) { // works only because the first Arg is never a double!
146  theData.emplace_back(std::forward<Args>(args)...);
147  pushAux(chi2Increment);
148  }
149 
152  void pop();
153 
160  check();
161  return theData.back();
162  }
163 
171  check();
172  return theData.front();
173  }
174 
177  const DataContainer& measurements() const { return theData; }
178 
184  int foundHits() const { return theNumberOfFoundHits; }
185 
189 
194  int lostHits() const { return theNumberOfLostHits; }
195 
199 
204  int cccBadHits() const { return theNumberOfCCCBadHits_; }
205 
206  //number of hits in seed
207  unsigned int seedNHits() const { return theNHseed; }
208 
210  bool empty() const { return theData.empty(); }
211 
213  float chiSquared() const { return theChiSquared; }
214 
220 
224  bool isValid() const { return theValid; }
225 
227  void invalidate() { theValid = false; }
228 
231  static bool inactive( //const Det& det
232  ) {
233  return false;
234  } //FIXME
235 
237  const DetLayer* lastLayer() const {
238  check();
239  return theData.back().layer();
240  }
241 
243  Trajectory toTrajectory() const;
244 
246  void popInvalidTail();
247 
251 
255 
256  bool isLooper() const { return (theNLoops > 0); }
257  signed char nLoops() const { return theNLoops; }
258 
259  void setNLoops(signed char value) { theNLoops = value; }
260  void incrementLoops() { theNLoops++; }
261 
262  StopReason stopReason() const { return stopReason_; }
264 
265  int numberOfCCCBadHits(float ccc_threshold);
266 
267  static bool lost(const TrackingRecHit& hit) dso_internal;
268 
269 private:
274  void updateBadForCCC(float ccc_threshold) dso_internal;
275 
276  void pushAux(double chi2Increment);
277 
278 private:
280 
281  float theChiSquared = 0;
282 
283  signed short theNumberOfFoundHits = 0;
284  signed short theNumberOfFoundPixelHits = 0;
285  signed short theNumberOfLostHits = 0;
287  signed short theNumberOfCCCBadHits_ = 0;
288 
289  // PropagationDirection
290  signed char theDirection = anyDirection;
291  bool theValid = false;
292 
293  unsigned char theNHseed = 0;
294 
295  signed char theNLoops = 0;
296  float theDPhiCache = 0;
299 
300  void check() const;
301 };
302 
303 #endif
writedatasetfile.args
args
Definition: writedatasetfile.py:18
Visibility.h
anyDirection
Definition: PropagationDirection.h:4
TempTrajectory::direction
PropagationDirection direction() const
Definition: TempTrajectory.cc:118
TempTrajectory::theCCCThreshold_
float theCCCThreshold_
Definition: TempTrajectory.h:297
TempTrajectory::cccBadHits
int cccBadHits() const
Definition: TempTrajectory.h:204
TempTrajectory::push
void push(const TrajectoryMeasurement &tm)
Definition: TempTrajectory.h:108
DetLayer
Definition: DetLayer.h:21
TempTrajectory::join
void join(TempTrajectory &segment)
Definition: TempTrajectory.cc:99
TempTrajectory
Definition: TempTrajectory.h:40
edm::swap
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:117
TempTrajectory::RecHitContainer
ConstRecHitContainer RecHitContainer
Definition: TempTrajectory.h:44
TrajectoryMeasurement.h
TempTrajectory::push
void push(TrajectoryMeasurement &&tm)
Definition: TempTrajectory.h:110
TempTrajectory::trailingFoundHits
int trailingFoundHits() const
Definition: TempTrajectory.h:198
TempTrajectory::TempTrajectory
TempTrajectory()
Definition: TempTrajectory.h:51
TempTrajectory::theChiSquared
float theChiSquared
Definition: TempTrajectory.h:281
TempTrajectory::theNumberOfCCCBadHits_
signed short theNumberOfCCCBadHits_
Definition: TempTrajectory.h:287
cmsutils::bqueue::back
const T & back() const
Definition: bqueue.h:195
TempTrajectory::setNLoops
void setNLoops(signed char value)
Definition: TempTrajectory.h:259
TempTrajectory::invalidate
void invalidate()
Method to invalidate a trajectory. Useful during ambiguity resolution.
Definition: TempTrajectory.h:227
alignCSCRings.s
s
Definition: alignCSCRings.py:92
TrackingRecHit.h
TempTrajectory::theData
DataContainer theData
Definition: TempTrajectory.h:279
TempTrajectory::isValid
bool isValid() const
Definition: TempTrajectory.h:224
TempTrajectory::inactive
static bool inactive()
Definition: TempTrajectory.h:231
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
TempTrajectory::lost
static bool lost(const TrackingRecHit &hit)
Definition: TempTrajectory.cc:126
TempTrajectory::seedNHits
unsigned int seedNHits() const
Definition: TempTrajectory.h:207
TrajectoryStopReasons.h
TempTrajectory::lastMeasurement
const TrajectoryMeasurement & lastMeasurement() const
Definition: TempTrajectory.h:159
TempTrajectory::TempTrajectory
TempTrajectory(TempTrajectory &&rh) noexcept
Definition: TempTrajectory.h:63
TempTrajectory::measurements
const DataContainer & measurements() const
Definition: TempTrajectory.h:177
TempTrajectory::foundHits
int foundHits() const
Definition: TempTrajectory.h:184
TempTrajectory::theNumberOfLostHits
signed short theNumberOfLostHits
Definition: TempTrajectory.h:285
cmsutils::bqueue< TrajectoryMeasurement >
TempTrajectory::updateBadForCCC
void updateBadForCCC(float ccc_threshold)
Definition: TempTrajectory.cc:156
cmsutils::bqueue::front
const T & front() const
Definition: bqueue.h:193
TempTrajectory::theDPhiCache
float theDPhiCache
Definition: TempTrajectory.h:296
TempTrajectory::isLooper
bool isLooper() const
Definition: TempTrajectory.h:256
TempTrajectory::setDPhiCacheForLoopersReconstruction
void setDPhiCacheForLoopersReconstruction(float dphi)
Definition: TempTrajectory.h:254
TempTrajectory::stopReason_
StopReason stopReason_
Definition: TempTrajectory.h:298
funct::true
true
Definition: Factorize.h:173
TempTrajectory::chiSquared
float chiSquared() const
Value of the raw Chi2 of the trajectory, not normalised to the N.D.F.
Definition: TempTrajectory.h:213
cmsutils::bqueue::empty
bool empty() const
Definition: bqueue.h:202
TempTrajectory::operator=
TempTrajectory & operator=(TempTrajectory &&rh) noexcept
Definition: TempTrajectory.h:79
TempTrajectory::lostHits
int lostHits() const
Definition: TempTrajectory.h:194
TempTrajectory::toTrajectory
Trajectory toTrajectory() const
Convert to a standard Trajectory.
Definition: TempTrajectory.cc:176
TrackingRecHit::ConstRecHitContainer
std::vector< ConstRecHitPointer > ConstRecHitContainer
Definition: TrackingRecHit.h:32
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
TempTrajectory::push
void push(TrajectoryMeasurement &&tm, double chi2Increment)
Definition: TempTrajectory.h:139
cmsutils::bqueue::push_back
void push_back(const T &val)
Definition: bqueue.h:160
dso_internal
#define dso_internal
Definition: Visibility.h:13
TempTrajectory::theNLoops
signed char theNLoops
Definition: TempTrajectory.h:295
TempTrajectory::check
void check() const
Definition: TempTrajectory.cc:120
TempTrajectory::stopReason
StopReason stopReason() const
Definition: TempTrajectory.h:262
value
Definition: value.py:1
TempTrajectory::emplace
void emplace(double chi2Increment, Args &&... args)
Definition: TempTrajectory.h:145
TempTrajectory::operator=
TempTrajectory & operator=(TempTrajectory const &rh)=default
TempTrajectory::firstMeasurement
const TrajectoryMeasurement & firstMeasurement() const
Definition: TempTrajectory.h:170
TempTrajectory::theValid
bool theValid
Definition: TempTrajectory.h:291
bqueue.h
TempTrajectory::theNumberOfTrailingFoundHits
signed short theNumberOfTrailingFoundHits
Definition: TempTrajectory.h:286
cmsutils::bqueue::emplace_back
void emplace_back(Args &&...args)
Definition: bqueue.h:177
PropagationDirection.h
TempTrajectory::incrementLoops
void incrementLoops()
Definition: TempTrajectory.h:260
TrackingRecHit
Definition: TrackingRecHit.h:21
Trajectory.h
TempTrajectory::dPhiCacheForLoopersReconstruction
float dPhiCacheForLoopersReconstruction() const
Definition: TempTrajectory.h:250
eostools.move
def move(src, dest)
Definition: eostools.py:511
TempTrajectory::badForCCC
bool badForCCC(const TrajectoryMeasurement &tm)
Definition: TempTrajectory.cc:141
TrajectoryMeasurement::estimate
float estimate() const
Definition: TrajectoryMeasurement.h:192
Trajectory
Definition: Trajectory.h:38
StopReason::UNINITIALIZED
relativeConstraints.value
value
Definition: relativeConstraints.py:53
TempTrajectory::setStopReason
void setStopReason(StopReason s)
Definition: TempTrajectory.h:263
PropagationDirection
PropagationDirection
Definition: PropagationDirection.h:4
TempTrajectory::DataContainer
cmsutils::bqueue< TrajectoryMeasurement > DataContainer
Definition: TempTrajectory.h:42
TempTrajectory::push
void push(const TrajectoryMeasurement &tm, double chi2Increment)
Definition: TempTrajectory.h:134
TempTrajectory::numberOfCCCBadHits
int numberOfCCCBadHits(float ccc_threshold)
Definition: TempTrajectory.cc:171
TempTrajectory::lastLayer
const DetLayer * lastLayer() const
Redundant method, returns the layer of lastMeasurement() .
Definition: TempTrajectory.h:237
TempTrajectory::theNHseed
unsigned char theNHseed
Definition: TempTrajectory.h:293
TempTrajectory::theDirection
signed char theDirection
Definition: TempTrajectory.h:290
TempTrajectory::nLoops
signed char nLoops() const
Definition: TempTrajectory.h:257
TempTrajectory::theNumberOfFoundPixelHits
signed short theNumberOfFoundPixelHits
Definition: TempTrajectory.h:284
TempTrajectory::TempTrajectory
TempTrajectory(PropagationDirection dir, unsigned char nhseed)
Definition: TempTrajectory.h:57
TempTrajectory::theNumberOfFoundHits
signed short theNumberOfFoundHits
Definition: TempTrajectory.h:283
TempTrajectory::emplace
void emplace(Args &&... args)
Definition: TempTrajectory.h:113
TrajectoryMeasurement::layer
const DetLayer * layer() const
Definition: TrajectoryMeasurement.h:194
OwnVector.h
TempTrajectory::foundPixelHits
int foundPixelHits() const
Definition: TempTrajectory.h:188
TempTrajectory::popInvalidTail
void popInvalidTail()
Pops out all the invalid hits on the tail.
StopReason
StopReason
Definition: TrajectoryStopReasons.h:6
TrajectoryMeasurement
Definition: TrajectoryMeasurement.h:25
TempTrajectory::pop
void pop()
Definition: TempTrajectory.cc:44
hit
Definition: SiStripHitEffFromCalibTree.cc:88
TempTrajectory::~TempTrajectory
~TempTrajectory()
destruct a TempTrajectory
Definition: TempTrajectory.h:102
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
TempTrajectory::pushAux
void pushAux(double chi2Increment)
Definition: TempTrajectory.cc:60
TempTrajectory::empty
bool empty() const
True if trajectory has no measurements.
Definition: TempTrajectory.h:210
TempTrajectory::ConstRecHitContainer
TrackingRecHit::ConstRecHitContainer ConstRecHitContainer
Definition: TempTrajectory.h:43