CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TrajectorySeed.h
Go to the documentation of this file.
1 #ifndef DATAFORMATS_TRAJECTORYSEED_TRAJECTORYSEED_h
2 #define DATAFORMATS_TRAJECTORYSEED_TRAJECTORYSEED_h
3 
9 #include <utility>
10 #include <algorithm>
11 
19 public:
22 
24  virtual ~TrajectorySeed() {}
25 
27  : hits_(rh), tsos_(ptsos), dir_(dir) {}
28 
30  : hits_(std::move(rh)), tsos_(ptsos), dir_(dir) {}
31 
33  hits_.swap(rh);
34  std::swap(tsos_, ptsos);
35  std::swap(dir_, dir);
36  }
37 
38  void swap(TrajectorySeed& rh) noexcept {
39  hits_.swap(rh.hits_);
40  std::swap(tsos_, rh.tsos_);
41  std::swap(dir_, rh.dir_);
42  }
43 
44  TrajectorySeed(TrajectorySeed const& o) = default;
45 
46  TrajectorySeed& operator=(TrajectorySeed const& o) = default;
47 
48  TrajectorySeed(TrajectorySeed&& o) noexcept = default;
49 
50  TrajectorySeed& operator=(TrajectorySeed&& o) noexcept = default;
51 
52  RecHitRange recHits() const { return {hits_.begin(), hits_.end()}; }
53  unsigned int nHits() const { return hits_.size(); }
54  PropagationDirection direction() const { return dir_; }
55  PTrajectoryStateOnDet const& startingState() const { return tsos_; }
56 
57  virtual TrajectorySeed* clone() const { return new TrajectorySeed(*this); }
58 
59 private:
63 };
64 
65 inline void swap(TrajectorySeed& rh, TrajectorySeed& lh) noexcept { rh.swap(lh); }
66 
68 
69 #endif
PropagationDirection direction() const
edm::OwnVector< TrackingRecHit > RecHitContainer
virtual TrajectorySeed * clone() const
void swap(TrajectorySeed &rh) noexcept
size_type size() const
Definition: OwnVector.h:300
RecHitContainer hits_
TrajectorySeed & operator=(TrajectorySeed const &o)=default
PropagationDirection dir_
PropagationDirection
bool int lh
Definition: SIMDVec.h:20
void swap(OwnVector< T, P > &other) noexcept
Definition: OwnVector.h:512
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:117
iterator begin()
Definition: OwnVector.h:280
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
def move
Definition: eostools.py:511
TrajectorySeed(PTrajectoryStateOnDet const &ptsos, RecHitContainer &&rh, PropagationDirection dir) noexcept
virtual ~TrajectorySeed()
RecHitRange recHits() const
iterator end()
Definition: OwnVector.h:285
PTrajectoryStateOnDet const & startingState() const
TrajectorySeed BasicTrajectorySeed
TrajectorySeed(PTrajectoryStateOnDet const &ptsos, RecHitContainer const &rh, PropagationDirection dir)
unsigned int nHits() const
void swap(PTrajectoryStateOnDet &ptsos, RecHitContainer &rh, PropagationDirection &dir) noexcept
PTrajectoryStateOnDet tsos_
edm::Range< RecHitContainer::const_iterator > RecHitRange