test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DetGroup.h
Go to the documentation of this file.
1 #ifndef DetLayers_DetGroup_h
2 #define DetLayers_DetGroup_h
3 
6 #include <vector>
7 #include <utility>
8 #include <algorithm>
9 
11  public:
12  typedef std::pair<const GeomDet*,TrajectoryStateOnSurface> DetWithState;
13  typedef GeomDet Det;
14 
15 
17  det_(dws.first), state_(dws.second) {}
18 
20  det_(d), state_(s) {}
21 
22  DetGroupElement(DetGroupElement const & rhs) : det_(rhs.det_), state_(rhs.state_){}
25  det_=rhs.det_;
26  state_ = rhs.state_;
27  return *this;
28  }
30  det_=rhs.det_;
31  state_ = std::move(rhs.state_);
32  return *this;
33  }
35  det_(d), state_(std::move(s)) {}
36 
37  const Det* det() const {return det_;}
39 
40 private:
41 
42  const Det* det_;
44 
45 };
46 
47 
48 class DetGroup : public std::vector< DetGroupElement> {
49 public:
50 
51  typedef std::vector< DetGroupElement> Base;
53 
54  DetGroup() {}
55  DetGroup(DetGroup const & rhs) : Base(rhs), index_(rhs.index_), indexSize_(rhs.indexSize_) {}
56  DetGroup(DetGroup && rhs) noexcept : Base(std::forward<Base>(rhs)), index_(rhs.index_), indexSize_(rhs.indexSize_) {}
57  DetGroup & operator=(DetGroup const & rhs) {
58  Base::operator=(rhs);
59  index_ = rhs.index_;
60  indexSize_ = rhs.indexSize_;
61  return *this;
62  }
64  Base::operator=(std::forward<Base>(rhs));
65  index_ = rhs.index_;
66  indexSize_ = rhs.indexSize_;
67  return *this;
68  }
69 
70 
71  DetGroup(int ind, int indSize) : index_(ind), indexSize_(indSize) {}
72 
73  DetGroup(const std::vector<DetWithState>& vec) {
74  reserve( vec.size());
75  for (std::vector<DetWithState>::const_iterator i=vec.begin(); i!=vec.end(); i++) {
76  push_back(DetGroupElement(*i));
77  }
78  }
79 
80  int index() const {return index_;}
81 
82  int indexSize() const {return indexSize_;}
83 
84  void setIndexSize( int newSize) {indexSize_ = newSize;}
85 
86  void incrementIndex( int incr) {
87  // for (iterator i=begin(); i!=end(); i++) i->incrementIndex(incr);
88  index_ += incr;
89  indexSize_ += incr;
90  }
91 
92 private:
93 
94  int index_;
96 
97 };
98 
99 #endif
void incrementIndex(int incr)
Definition: DetGroup.h:86
int i
Definition: DBlmapReader.cc:9
const Det * det() const
Definition: DetGroup.h:37
const Det * det_
Definition: DetGroup.h:42
DetGroup(DetGroup const &rhs)
Definition: DetGroup.h:55
DetGroup(const std::vector< DetWithState > &vec)
Definition: DetGroup.h:73
DetGroup(int ind, int indSize)
Definition: DetGroup.h:71
DetGroupElement & operator=(DetGroupElement &&rhs)
Definition: DetGroup.h:29
DetGroup & operator=(DetGroup &&rhs)
Definition: DetGroup.h:63
DetGroupElement::DetWithState DetWithState
Definition: DetGroup.h:52
#define noexcept
GeomDet Det
Definition: DetGroup.h:13
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
Definition: DetGroup.h:12
DetGroupElement(const Det *d, TrajectoryStateOnSurface &&s)
Definition: DetGroup.h:34
U second(std::pair< T, U > const &p)
tuple d
Definition: ztail.py:151
DetGroup(DetGroup &&rhs)
Definition: DetGroup.h:56
DetGroup()
Definition: DetGroup.h:54
DetGroupElement & operator=(DetGroupElement const &rhs)
Definition: DetGroup.h:24
std::vector< DetGroupElement > Base
Definition: DetGroup.h:51
def move
Definition: eostools.py:510
DetGroupElement(DetGroupElement const &rhs)
Definition: DetGroup.h:22
int index() const
Definition: DetGroup.h:80
int indexSize_
Definition: DetGroup.h:95
int indexSize() const
Definition: DetGroup.h:82
DetGroup & operator=(DetGroup const &rhs)
Definition: DetGroup.h:57
DetGroupElement(DetGroupElement &&rhs)
Definition: DetGroup.h:23
void setIndexSize(int newSize)
Definition: DetGroup.h:84
DetGroupElement(const Det *d, const TrajectoryStateOnSurface &s)
Definition: DetGroup.h:19
TrajectoryStateOnSurface state_
Definition: DetGroup.h:43
const TrajectoryStateOnSurface & trajectoryState() const
Definition: DetGroup.h:38
DetGroupElement(const DetWithState &dws)
Definition: DetGroup.h:16
int index_
Definition: DetGroup.h:94