CMS 3D CMS Logo

HGCScintillatorDetId.cc
Go to the documentation of this file.
2 #include <ostream>
3 #include <iostream>
4 
6 
7 std::vector<HGCScintillatorDetId> HGCScintillatorDetId::detectorCells() const {
8  std::vector<HGCScintillatorDetId> cells;
9  int irad = ring();
10  int ifi = iphi();
11  int iz = zside();
12  if (trigger()) {
13  cells.emplace_back(HGCScintillatorDetId(type(), layer(), (2 * irad - 1) * iz, 2 * ifi - 1, false));
14  cells.emplace_back(HGCScintillatorDetId(type(), layer(), 2 * irad * iz, 2 * ifi - 1, false));
15  cells.emplace_back(HGCScintillatorDetId(type(), layer(), (2 * irad - 1) * iz, 2 * ifi, false));
16  cells.emplace_back(HGCScintillatorDetId(type(), layer(), 2 * irad * iz, 2 * ifi, false));
17  } else {
18  cells.emplace_back(HGCScintillatorDetId(type(), layer(), irad * iz, ifi, false));
19  }
20  return cells;
21 }
22 
23 std::ostream& operator<<(std::ostream& s, const HGCScintillatorDetId& id) {
24  return s << " HGCScintillatorDetId::EE:HE= " << id.isEE() << ":" << id.isHE() << " trigger= " << id.trigger()
25  << " type= " << id.type() << " SiPM= " << id.sipm() << " layer= " << id.layer() << " ring= " << id.iradius()
26  << ":" << id.iradiusTrigger() << " phi= " << id.iphi() << ":" << id.iphiTrigger();
27 }
constexpr int iphi() const
get the phi index
constexpr int zside() const
get the z-side of the cell (1/-1)
std::ostream & operator<<(std::ostream &s, const HGCScintillatorDetId &id)
constexpr bool trigger() const
constexpr int type() const
get/set the type
static const HGCScintillatorDetId Undefined
std::vector< HGCScintillatorDetId > detectorCells() const
trigger or detector cell
constexpr int layer() const
get the layer #
constexpr int ring() const
get the eta index