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 
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  const Det* det() const {return det_;}
24 
25 private:
26 
27  const Det* det_;
29 
30 };
31 
32 
33 class DetGroup : public std::vector< DetGroupElement> {
34 public:
35 
36  typedef std::vector< DetGroupElement> Base;
38 
39  DetGroup() {}
40  DetGroup(int ind, int indSize) : index_(ind), indexSize_(indSize) {}
41 
42  DetGroup(const std::vector<DetWithState>& vec) {
43  reserve( vec.size());
44  for (std::vector<DetWithState>::const_iterator i=vec.begin(); i!=vec.end(); i++) {
45  push_back(DetGroupElement(*i));
46  }
47  }
48 
49  int index() const {return index_;}
50 
51  int indexSize() const {return indexSize_;}
52 
53  void setIndexSize( int newSize) {indexSize_ = newSize;}
54 
55  void incrementIndex( int incr) {
56  // for (iterator i=begin(); i!=end(); i++) i->incrementIndex(incr);
57  index_ += incr;
58  indexSize_ += incr;
59  }
60 
61 private:
62 
63  int index_;
65 
66 };
67 
68 #endif
void incrementIndex(int incr)
Definition: DetGroup.h:55
int i
Definition: DBlmapReader.cc:9
const Det * det() const
Definition: DetGroup.h:22
const Det * det_
Definition: DetGroup.h:27
DetGroup(const std::vector< DetWithState > &vec)
Definition: DetGroup.h:42
DetGroup(int ind, int indSize)
Definition: DetGroup.h:40
DetGroupElement::DetWithState DetWithState
Definition: DetGroup.h:37
GeomDet Det
Definition: DetGroup.h:13
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
Definition: DetGroup.h:12
U second(std::pair< T, U > const &p)
DetGroup()
Definition: DetGroup.h:39
std::vector< DetGroupElement > Base
Definition: DetGroup.h:36
bool first
Definition: L1TdeRCT.cc:79
int index() const
Definition: DetGroup.h:49
int indexSize_
Definition: DetGroup.h:64
int indexSize() const
Definition: DetGroup.h:51
void setIndexSize(int newSize)
Definition: DetGroup.h:53
DetGroupElement(const Det *d, const TrajectoryStateOnSurface &s)
Definition: DetGroup.h:19
TrajectoryStateOnSurface state_
Definition: DetGroup.h:28
string s
Definition: asciidump.py:422
const TrajectoryStateOnSurface & trajectoryState() const
Definition: DetGroup.h:23
DetGroupElement(const DetWithState &dws)
Definition: DetGroup.h:16
int index_
Definition: DetGroup.h:63