test
CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ME0Chamber.cc
Go to the documentation of this file.
4 #include <iostream>
5 
7  GeomDet(plane), detId_(id)
8 {
9  setDetId(id);
10 }
11 
13 
15  return detId_;
16 }
17 
18 bool ME0Chamber::operator==(const ME0Chamber& ch) const {
19  return this->id()==ch.id();
20 }
21 
23  layers_.push_back(rl);
24 }
25 
26 std::vector<const GeomDet*> ME0Chamber::components() const {
27  return std::vector<const GeomDet*>(layers_.begin(), layers_.end());
28 }
29 
31  return layer(ME0DetId(id.rawId()));
32 }
33 
34 const std::vector<const ME0Layer*>& ME0Chamber::layers() const {
35  return layers_;
36 }
37 
38 int ME0Chamber::nLayers() const {
39  return layers_.size();
40 }
41 
43  if (id.chamberId()!=detId_) return 0; // not in this layer!
44  return layer(id.roll());
45 }
46 
47 const ME0Layer* ME0Chamber::layer(int isl) const {
48  for (auto roll : layers_){
49  if (roll->id().roll()==isl)
50  return roll;
51  }
52  return 0;
53 }
54 
55 // For the old ME0 Geometry (with one eta partition)
56 // we need to maintain this for a while
58  etaPartitions_.push_back(rl);
59 }
60 
61 const std::vector<const ME0EtaPartition*>& ME0Chamber::etaPartitions() const {
62  return etaPartitions_;
63 }
64 
66  return etaPartitions_.size();
67 }
68 
70  if (id.chamberId()!=detId_) return 0; // not in this eta partition!
71  return etaPartition(id.roll());
72 }
73 
75  for (auto roll : etaPartitions_){
76  if (roll->id().roll()==isl)
77  return roll;
78  }
79  return 0;
80 }
int nLayers() const
Retunr numbers of layers.
Definition: ME0Chamber.cc:38
const std::vector< const ME0EtaPartition * > & etaPartitions() const
Definition: ME0Chamber.cc:61
int nEtaPartitions() const
Definition: ME0Chamber.cc:65
virtual std::vector< const GeomDet * > components() const
Return the rolls in the chamber.
Definition: ME0Chamber.cc:26
const ME0Layer * layer(ME0DetId id) const
Return the layer corresponding to the given id.
Definition: ME0Chamber.cc:42
std::vector< const ME0EtaPartition * > etaPartitions_
Definition: ME0Chamber.h:74
void setDetId(DetId id)
Definition: GeomDet.h:120
virtual ~ME0Chamber()
Destructor.
Definition: ME0Chamber.cc:12
ME0DetId id() const
Return the ME0DetId of this chamber.
Definition: ME0Chamber.cc:14
void add(ME0Layer *layer)
Add Layer to the chamber which takes ownership.
Definition: ME0Chamber.cc:22
std::vector< const ME0Layer * > layers_
Definition: ME0Chamber.h:72
ME0Chamber(ME0DetId id, const ReferenceCountingPointer< BoundPlane > &plane)
Constructor.
Definition: ME0Chamber.cc:6
const ME0EtaPartition * etaPartition(ME0DetId id) const
Definition: ME0Chamber.cc:69
Definition: DetId.h:18
ME0DetId detId_
Definition: ME0Chamber.h:69
bool operator==(const ME0Chamber &ch) const
equal if the id is the same
Definition: ME0Chamber.cc:18
virtual const GeomDet * component(DetId id) const
Return the sub-component (roll) with a given id in this chamber.
Definition: ME0Chamber.cc:30
const std::vector< const ME0Layer * > & layers() const
Return the layers.
Definition: ME0Chamber.cc:34