CMS 3D CMS Logo

HGCScintillatorDetId.cc
Go to the documentation of this file.
3 #include <ostream>
4 #include <iostream>
5 
7 
9 
11 
13  : DetId(HGCalHSc, ForwardEmpty) {
14  int zside = (ring < 0) ? 1 : 0;
15  int itrig = trigger ? 1 : 0;
16  int ringAbs = std::abs(ring);
21 }
22 
24  if (!gen.null()) {
25  if (gen.det() != HGCalHSc) {
26  throw cms::Exception("Invalid DetId")
27  << "Cannot initialize HGCScintillatorDetId from " << std::hex << gen.rawId() << std::dec;
28  }
29  }
30  id_ = gen.rawId();
31 }
32 
34  if (!gen.null()) {
35  if (gen.det() != HGCalHSc) {
36  throw cms::Exception("Invalid DetId")
37  << "Cannot assign HGCScintillatorDetId from " << std::hex << gen.rawId() << std::dec;
38  }
39  }
40  id_ = gen.rawId();
41  return (*this);
42 }
43 
45  if (trigger())
46  return (2 * ((id_ >> kHGCalRadiusOffset) & kHGCalRadiusMask));
47  else
48  return ((id_ >> kHGCalRadiusOffset) & kHGCalRadiusMask);
49 }
50 
52  if (trigger())
53  return ((ring() + 1) / 2);
54  else
55  return ring();
56 }
57 
59  if (trigger())
60  return (2 * ((id_ >> kHGCalPhiOffset) & kHGCalPhiMask));
61  else
62  return ((id_ >> kHGCalPhiOffset) & kHGCalPhiMask);
63 }
64 
66  if (trigger())
67  return ((iphi() + 1) / 2);
68  else
69  return iphi();
70 }
71 
75 }
76 
80 }
81 
82 std::vector<HGCScintillatorDetId> HGCScintillatorDetId::detectorCells() const {
83  std::vector<HGCScintillatorDetId> cells;
84  int irad = ring();
85  int ifi = iphi();
86  int iz = zside();
87  if (trigger()) {
88  cells.emplace_back(HGCScintillatorDetId(type(), layer(), (2 * irad - 1) * iz, 2 * ifi - 1, false));
89  cells.emplace_back(HGCScintillatorDetId(type(), layer(), 2 * irad * iz, 2 * ifi - 1, false));
90  cells.emplace_back(HGCScintillatorDetId(type(), layer(), (2 * irad - 1) * iz, 2 * ifi, false));
91  cells.emplace_back(HGCScintillatorDetId(type(), layer(), 2 * irad * iz, 2 * ifi, false));
92  } else {
93  cells.emplace_back(HGCScintillatorDetId(type(), layer(), irad * iz, ifi, false));
94  }
95  return cells;
96 }
97 
99  if (trigger()) {
100  return HGCScintillatorDetId(type(), layer(), iradiusTrigger(), iphiTrigger(), false);
101  } else {
102  return HGCScintillatorDetId(type(), layer(), iradius(), iphi(), false);
103  }
104 }
105 
107  if (trigger())
108  return HGCScintillatorDetId(type(), layer(), iradius(), iphi(), true);
109  else
110  return HGCScintillatorDetId(type(), layer(), iradiusTrigger(), iphiTrigger(), true);
111 }
112 
113 std::ostream& operator<<(std::ostream& s, const HGCScintillatorDetId& id) {
114  return s << " HGCScintillatorDetId::EE:HE= " << id.isEE() << ":" << id.isHE() << " trigger= " << id.trigger()
115  << " type= " << id.type() << " SiPM= " << id.sipm() << " layer= " << id.layer() << " ring= " << id.iradius()
116  << ":" << id.iradiusTrigger() << " phi= " << id.iphi() << ":" << id.iphiTrigger();
117 }
HGCScintillatorDetId::setType
void setType(int type)
Definition: HGCScintillatorDetId.cc:72
HGCScintillatorDetId::iphi
int iphi() const
get the phi index
Definition: HGCScintillatorDetId.cc:58
HGCScintillatorDetId::ring
int ring() const
get the eta index
Definition: HGCScintillatorDetId.cc:44
HGCScintillatorDetId.h
ForwardEmpty
Definition: ForwardSubdetector.h:5
HGCScintillatorDetId::kHGCalTypeOffset
static const int kHGCalTypeOffset
Definition: HGCScintillatorDetId.h:94
HGCScintillatorDetId::kHGCalTriggerOffset
static const int kHGCalTriggerOffset
Definition: HGCScintillatorDetId.h:87
operator<<
std::ostream & operator<<(std::ostream &s, const HGCScintillatorDetId &id)
Definition: HGCScintillatorDetId.cc:113
cells
const caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple cms::cuda::AtomicPairCounter const GPUCACell *__restrict__ cells
Definition: CAHitNtupletGeneratorKernelsImpl.h:43
HGCScintillatorDetId::kHGCalTriggerMask
static const int kHGCalTriggerMask
Definition: HGCScintillatorDetId.h:88
HGCScintillatorDetId::iphiTrigger
int iphiTrigger() const
Definition: HGCScintillatorDetId.cc:65
HGCScintillatorDetId::kHGCalTypeMask
static const int kHGCalTypeMask
Definition: HGCScintillatorDetId.h:95
HGCScintillatorDetId::iradiusTrigger
int iradiusTrigger() const
Definition: HGCScintillatorDetId.h:99
HGCScintillatorDetId::geometryCell
HGCScintillatorDetId geometryCell() const
Definition: HGCScintillatorDetId.cc:98
HGCScintillatorDetId::detectorCells
std::vector< HGCScintillatorDetId > detectorCells() const
trigger or detector cell
Definition: HGCScintillatorDetId.cc:82
HGCScintillatorDetId::layer
int layer() const
get the layer #
Definition: HGCScintillatorDetId.h:50
HGCScintillatorDetId::iradiusTriggerAbs
int iradiusTriggerAbs() const
Definition: HGCScintillatorDetId.cc:51
DetId
Definition: DetId.h:17
alignCSCRings.s
s
Definition: alignCSCRings.py:92
HGCScintillatorDetId::trigger
bool trigger() const
Definition: HGCScintillatorDetId.h:70
HGCScintillatorDetId::kHGCalSiPMMask0
static const int kHGCalSiPMMask0
Definition: HGCScintillatorDetId.h:91
HGCScintillatorDetId::kHGCalLayerMask
static const int kHGCalLayerMask
Definition: HGCScintillatorDetId.h:86
gen
Definition: PythiaDecays.h:13
HGCScintillatorDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCScintillatorDetId.h:47
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
HGCScintillatorDetId::triggerCell
HGCScintillatorDetId triggerCell() const
Definition: HGCScintillatorDetId.cc:106
DetId::id_
uint32_t id_
Definition: DetId.h:69
PVValHelper::phi
Definition: PVValidationHelpers.h:69
HGCScintillatorDetId::Undefined
static const HGCScintillatorDetId Undefined
Definition: HGCScintillatorDetId.h:78
HGCScintillatorDetId::kHGCalRadiusOffset
static const int kHGCalRadiusOffset
Definition: HGCScintillatorDetId.h:83
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
HGCScintillatorDetId::iradius
int iradius() const
Definition: HGCScintillatorDetId.h:55
HGCScintillatorDetId::kHGCalPhiOffset
static const int kHGCalPhiOffset
Definition: HGCScintillatorDetId.h:81
HGCScintillatorDetId::operator=
HGCScintillatorDetId & operator=(const DetId &id)
Definition: HGCScintillatorDetId.cc:33
HGCScintillatorDetId::kHGCalRadiusMask
static const int kHGCalRadiusMask
Definition: HGCScintillatorDetId.h:84
HGCScintillatorDetId::type
int type() const
get/set the type
Definition: HGCScintillatorDetId.h:43
HGCScintillatorDetId::kHGCalPhiMask
static const int kHGCalPhiMask
Definition: HGCScintillatorDetId.h:82
HGCScintillatorDetId::kHGCalSiPMOffset
static const int kHGCalSiPMOffset
Definition: HGCScintillatorDetId.h:89
HGCScintillatorDetId::HGCScintillatorDetId
HGCScintillatorDetId()
Definition: HGCScintillatorDetId.cc:8
DDAxes::phi
HGCScintillatorDetId::kHGCalZsideMask
static const int kHGCalZsideMask
Definition: HGCScintillatorDetId.h:93
HGCScintillatorDetId
Definition: HGCScintillatorDetId.h:23
DetId::HGCalHSc
Definition: DetId.h:34
HGCScintillatorDetId::kHGCalZsideOffset
static const int kHGCalZsideOffset
Definition: HGCScintillatorDetId.h:92
Exception
Definition: hltDiff.cc:245
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
HGCScintillatorDetId::setSiPM
void setSiPM(int sipm)
Definition: HGCScintillatorDetId.cc:77
Exception.h
trigger
Definition: HLTPrescaleTableCond.h:8
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HGCScintillatorDetId::kHGCalLayerOffset
static const int kHGCalLayerOffset
Definition: HGCScintillatorDetId.h:85
HGCScintillatorDetId::kHGCalTypeMask0
static const int kHGCalTypeMask0
Definition: HGCScintillatorDetId.h:96
TauDecayModes.dec
dec
Definition: TauDecayModes.py:142
HGCScintillatorDetId::sipm
int sipm() const
get/set the sipm size
Definition: HGCScintillatorDetId.h:65
HGCScintillatorDetId::kHGCalSiPMMask
static const int kHGCalSiPMMask
Definition: HGCScintillatorDetId.h:90