CMS 3D CMS Logo

/data/git/CMSSW_5_3_11_patch5/src/DataFormats/HcalDetId/src/HcalOtherDetId.cc

Go to the documentation of this file.
00001 #include "DataFormats/HcalDetId/interface/HcalOtherDetId.h"
00002 #include "FWCore/Utilities/interface/Exception.h"
00003 
00004 HcalOtherDetId::HcalOtherDetId() {
00005 }
00006   
00007 HcalOtherDetId::HcalOtherDetId(uint32_t rawid) : DetId(rawid) {
00008 }
00009   
00010 HcalOtherDetId::HcalOtherDetId(HcalOtherSubdetector other_type)
00011   : DetId(Hcal,HcalOther) {
00012   id_|= (int(other_type&0x1F)<<20);
00013 }
00014   
00015 HcalOtherDetId::HcalOtherDetId(const DetId& gen) {
00016   if (gen.det()!=Hcal || gen.subdetId()!=HcalOther) {
00017     throw cms::Exception("Invalid DetId") << "Cannot initialize HcalOtherDetId from " << std::hex << gen.rawId() << std::dec;
00018   }
00019   id_=gen.rawId();    
00020 }
00021   
00022 HcalOtherDetId& HcalOtherDetId::operator=(const DetId& gen) {
00023   if (gen.det()!=Hcal || gen.subdetId()!=HcalOther) {
00024     throw cms::Exception("Invalid DetId") << "Cannot assign HcalOtherDetId from " << std::hex << gen.rawId() << std::dec; 
00025   }
00026   id_=gen.rawId();
00027   return *this;
00028 }
00029   
00030 
00031