/
TrajectorySeed.h
97 lines (75 loc) · 2.63 KB
/
TrajectorySeed.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#ifndef DATAFORMATS_TRAJECTORYSEED_TRAJECTORYSEED_h
#define DATAFORMATS_TRAJECTORYSEED_TRAJECTORYSEED_h
#include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
#include "DataFormats/Common/interface/OwnVector.h"
#include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h"
#include "DataFormats/TrajectoryState/interface/PTrajectoryStateOnDet.h"
#include <utility>
#include <algorithm>
#include "FWCore/Utilities/interface/GCC11Compatibility.h"
/**
TrajectorySeed contains
- a TSOS
- a vector of RecHits (with Own_vector to store polimorphic)
- a propagation direction
**/
class TrajectorySeed {
public:
typedef edm::OwnVector<TrackingRecHit> recHitContainer;
typedef recHitContainer::const_iterator const_iterator;
typedef std::pair<const_iterator,const_iterator> range;
TrajectorySeed(){}
virtual ~TrajectorySeed(){}
TrajectorySeed(PTrajectoryStateOnDet const & ptsos,
recHitContainer const & rh,
PropagationDirection dir) :
hits_(rh), tsos_(ptsos), dir_(dir) {}
#if defined( __GXX_EXPERIMENTAL_CXX0X__)
TrajectorySeed(PTrajectoryStateOnDet const & ptsos,
recHitContainer && rh,
PropagationDirection dir) noexcept :
hits_(std::move(rh)), tsos_(ptsos), dir_(dir) {}
#endif
void swap(PTrajectoryStateOnDet & ptsos,
recHitContainer & rh,
PropagationDirection & dir) noexcept {
hits_.swap(rh);
std::swap(tsos_,ptsos);
std::swap(dir_,dir);
}
void swap(TrajectorySeed & rh) noexcept {
hits_.swap(rh.hits_);
std::swap(tsos_,rh.tsos_);
std::swap(dir_,rh.dir_);
}
TrajectorySeed(TrajectorySeed const & o) :
hits_(o.hits_), tsos_(o.tsos_), dir_(o.dir_) {}
TrajectorySeed & operator=(TrajectorySeed const & o) {
TrajectorySeed tmp(o); swap(tmp);
return *this;
}
#if defined( __GXX_EXPERIMENTAL_CXX0X__)
TrajectorySeed(TrajectorySeed && o) noexcept :
hits_(std::move(o.hits_)), tsos_(std::move(o.tsos_)), dir_(std::move(o.dir_)) {}
TrajectorySeed & operator=(TrajectorySeed && o) {
swap(o);
return *this;
}
#endif
range recHits() const {
return std::make_pair(hits_.begin(), hits_.end());
}
unsigned int nHits() const {return hits_.size();}
PropagationDirection direction() const {return dir_;}
PTrajectoryStateOnDet const & startingState() const {return tsos_;}
virtual TrajectorySeed * clone() const {return new TrajectorySeed( * this); }
private:
edm::OwnVector<TrackingRecHit> hits_;
PTrajectoryStateOnDet tsos_;
PropagationDirection dir_;
};
inline void swap(TrajectorySeed & rh, TrajectorySeed & lh) noexcept {
rh.swap(lh);
}
typedef TrajectorySeed BasicTrajectorySeed;
#endif