CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
EcalPnDiodeDetId.cc
Go to the documentation of this file.
3 
5 
6 EcalPnDiodeDetId::EcalPnDiodeDetId(uint32_t rawid) : DetId(rawid) {}
7 
8 EcalPnDiodeDetId::EcalPnDiodeDetId(int EcalSubDetectorId, int DCCId, int PnId) : DetId(Ecal, EcalLaserPnDiode) {
9  if ((DCCId < MIN_DCCID) || (DCCId > MAX_DCCID) || (PnId < MIN_PNID) || (PnId > MAX_PNID) ||
10  (EcalSubDetectorId != EcalBarrel && EcalSubDetectorId != EcalEndcap))
11  throw cms::Exception("InvalidDetId") << "EcalPnDiodeDetId: Cannot create object. Indexes out of bounds.";
12  id_ |= ((((EcalSubDetectorId == EcalBarrel) ? (0) : (1)) << 11) | ((DCCId & 0x7F) << 4) | (PnId & 0xF));
13 }
14 
16  if (!gen.null() && (gen.det() != Ecal || gen.subdetId() != EcalLaserPnDiode)) {
17  throw cms::Exception("InvalidDetId");
18  }
19  id_ = gen.rawId();
20 }
21 
23  if (!gen.null() && (gen.det() != Ecal || gen.subdetId() != EcalLaserPnDiode)) {
24  throw cms::Exception("InvalidDetId");
25  }
26  id_ = gen.rawId();
27  return *this;
28 }
29 
30 int EcalPnDiodeDetId::hashedIndex() const { throw cms::Exception("MethodNotImplemented"); }
31 
32 std::ostream& operator<<(std::ostream& s, const EcalPnDiodeDetId& id) {
33  return s << "(EcalPnDiode " << id.iEcalSubDetectorId() << ',' << id.iDCCId() << ',' << id.iPnId() << ')';
34 }
constexpr bool null() const
is this a null id ?
Definition: DetId.h:59
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
EcalPnDiodeDetId & operator=(const DetId &id)
static const int MIN_DCCID
static const int MAX_PNID
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static const int MAX_DCCID
Definition: DetId.h:17
int hashedIndex() const
get a compact index for arrays [TODO: NEEDS WORK]
uint32_t id_
Definition: DetId.h:69
static const int MIN_PNID
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46