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 <boost/shared_ptr.hpp>
14 
17 
42 {
43 public:
44 
48 
49 
56  theChiSquared(0),
60  {}
61 
62 
70  theSeed( new TrajectorySeed(seed) ),
71  theChiSquared(0),
75  {}
76 
82  theSeed( new TrajectorySeed(seed) ),
83  theChiSquared(0),
87  {}
88 
93  TempTrajectory( const boost::shared_ptr<const TrajectorySeed> & seed, PropagationDirection dir) :
94  theSeed( seed ),
95  theChiSquared(0),
99  {}
100 
101 
107  theChiSquared(0),
111  {}
112 
113 
114 
115 #if defined( __GXX_EXPERIMENTAL_CXX0X__)
116 
117  TempTrajectory(TempTrajectory const & rh) :
118  theSeed(rh.theSeed),
119  theData(rh.theData),
124  {}
125 
126 
127  TempTrajectory & operator=(TempTrajectory const & rh) {
128  DataContainer aData(rh.theData);
129  using std::swap;
130  swap(theData,aData);
131  theSeed = rh.theSeed;
137  theValid=rh.theValid;
139  theNLoops=rh.theNLoops;
140 
141  return *this;
142 
143  }
144 
145 
147  theSeed(std::move(rh.theSeed)),
148  theData(std::move(rh.theData)),
152  theValid(rh.theValid),
154  theNLoops(rh.theNLoops)
155  {}
156 
158  using std::swap;
159  swap(theSeed,rh.theSeed);
160  swap(theData,rh.theData);
161  theChiSquared=rh.theChiSquared;
162  theNumberOfFoundHits=rh.theNumberOfFoundHits;
163  theNumberOfLostHits=rh.theNumberOfLostHits;
164  theDirection=rh.theDirection;
165  theDirectionValidity=rh.theDirectionValidity;
166  theValid=rh.theValid;
167  theDPhiCache=rh.theDPhiCache;
168  theNLoops=rh.theNLoops;
169  return *this;
170 
171  }
172 
173 
174 #endif
175 
176 
177 
179  TempTrajectory( const Trajectory& traj);
180 
182  // trivial destructor, but must be out-of-line for code size issues
183  // https://hypernews.cern.ch/HyperNews/CMS/get/code-perf/247.html
184  ~TempTrajectory() ;
185 
190  void push( const TrajectoryMeasurement& tm);
191 #if defined( __GXX_EXPERIMENTAL_CXX0X__)
192  void push(TrajectoryMeasurement&& tm);
193 #endif
194 
198  void push( const TempTrajectory & segment);
199 
204  void join( TempTrajectory & segment);
205 
206 
207 
211  void push( const TrajectoryMeasurement& tm, double chi2Increment);
212 #if defined( __GXX_EXPERIMENTAL_CXX0X__)
213  void push( TrajectoryMeasurement&& tm, double chi2Increment);
214 #endif
215 
217  void pop();
218 
225  check(); return theData.back();
226  }
227 
235  check(); return theData.front();
236  }
237 
240  const DataContainer & measurements() const { return theData; }
242  //DataContainer data() const { return measurements();}
243 
246  //ConstRecHitContainer recHits() const;
247 
254  int foundHits() const { return theNumberOfFoundHits;}
255 
261  int lostHits() const { return theNumberOfLostHits;}
262 
264  bool empty() const { return theData.empty();}
265 
267  double chiSquared() const { return theChiSquared;}
268 
274 
278  bool isValid() const { return theValid;}
279 
281  void invalidate() { theValid = false;}
282 
284  const TrajectorySeed & seed() const { return *theSeed;}
285 
286 
289  static bool inactive(//const Det& det
290  ){return false;}//FIXME
291 
295  static bool lost( const TransientTrackingRecHit& hit);
296 
298  const DetLayer* lastLayer() const {
299  check(); return theData.back().layer();
300  }
301 
303  Trajectory toTrajectory() const ;
304 
306  void popInvalidTail() ;
307 
308 
312 
316 
317  bool isLooper() const { return (theNLoops>0);}
318  signed char nLoops() const {return theNLoops;}
319 
320  void setNLoops(signed char value) { theNLoops=value;}
322 
323 
324 private:
325 
326  void pushAux( const TrajectoryMeasurement& tm, double chi2Increment);
327 
328 private:
329 
330 
331  boost::shared_ptr<const TrajectorySeed> theSeed;
333 
335 
336  signed short theNumberOfFoundHits;
337  signed short theNumberOfLostHits;
338 
341  bool theValid;
342 
344  signed char theNLoops;
345 
346 
347  void check() const;
348 };
349 
350 #endif
const TrajectoryMeasurement & firstMeasurement() const
signed short theNumberOfFoundHits
nocap nocap const skelname & operator=(const skelname &)
void swap(ora::Record &rh, ora::Record &lh)
Definition: Record.h:70
const TrajectorySeed & seed() const
Access to the seed used to reconstruct the Trajectory.
void join(TempTrajectory &segment)
bool empty() const
True if trajectory has no measurements.
ConstRecHitContainer RecHitContainer
bool empty() const
Definition: bqueue.h:147
const DataContainer & measurements() const
void setNLoops(signed char value)
int foundHits() const
obsolete name, use measurements() instead.
PropagationDirection theDirection
PropagationDirection
static bool lost(const TransientTrackingRecHit &hit)
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()
TempTrajectory(const TrajectorySeed &seed, PropagationDirection dir)
const DetLayer * layer() const
TempTrajectory(PropagationDirection dir)
double chiSquared() const
Value of the raw Chi2 of the trajectory, not normalised to the N.D.F.
bool isValid() const
std::vector< ConstRecHitPointer > ConstRecHitContainer
#define noexcept
boost::shared_ptr< const TrajectorySeed > theSeed
TempTrajectory(const TrajectorySeed &seed)
signed char theNLoops
void popInvalidTail()
Pops out all the invalid hits on the tail.
cmsutils::bqueue< TrajectoryMeasurement > DataContainer
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
~TempTrajectory()
destruct a TempTrajectory
TempTrajectory(const boost::shared_ptr< const TrajectorySeed > &seed, PropagationDirection dir)
dbl *** dir
Definition: mlp_gen.cc:35
signed char nLoops() const
const DetLayer * lastLayer() const
Redundant method, returns the layer of lastMeasurement() .
void pushAux(const TrajectoryMeasurement &tm, double chi2Increment)
int lostHits() const
void push(const TrajectoryMeasurement &tm)