#include <DataFormats/HcalDetId/interface/HcalZDCDetId.h>
Public Types | |
enum | { kSizeForDenseIndexing = 2*kDepTot } |
enum | Section { Unknown = 0, EM = 1, HAD = 2, LUM = 3 } |
Public Member Functions | |
int | channel () const |
get the channel (equivalent to depth) | |
uint32_t | denseIndex () const |
int | depth () const |
get the depth | |
HcalZDCDetId (const DetId &id) | |
Constructor from a generic cell id. | |
HcalZDCDetId (Section section, bool true_for_positive_eta, int depth) | |
Constructor from section, eta sign, and depth/channel. | |
HcalZDCDetId (uint32_t rawid) | |
Create cellid from raw id (0=invalid tower id). | |
HcalZDCDetId () | |
Create a null cellid. | |
HcalZDCDetId & | operator= (const DetId &id) |
Assignment from a generic cell id. | |
Section | section () const |
get the section | |
int | zside () const |
get the z-side of the cell (1/-1) | |
Static Public Member Functions | |
static HcalZDCDetId | detIdFromDenseIndex (uint32_t di) |
static bool | validDenseIndex (uint32_t di) |
static bool | validDetId (Section se, int dp) |
Static Public Attributes | |
static const int | SubdetectorId = 2 |
Private Types | |
enum | { kDepEM = 5, kDepHAD = 4, kDepLUM = 2, kDepTot = kDepEM + kDepHAD + kDepLUM } |
Definition at line 18 of file HcalZDCDetId.h.
anonymous enum [private] |
anonymous enum |
HcalZDCDetId::HcalZDCDetId | ( | ) |
Create a null cellid.
Definition at line 4 of file HcalZDCDetId.cc.
Referenced by detIdFromDenseIndex().
00004 : DetId() { 00005 }
HcalZDCDetId::HcalZDCDetId | ( | uint32_t | rawid | ) |
Constructor from section, eta sign, and depth/channel.
Definition at line 11 of file HcalZDCDetId.cc.
References DetId::id_.
00011 : DetId(DetId::Calo,SubdetectorId) { 00012 id_|=(section&0x3)<<4; 00013 if (true_for_positive_eta) id_|=0x40; 00014 id_|=depth&0xF; 00015 }
HcalZDCDetId::HcalZDCDetId | ( | const DetId & | id | ) |
Constructor from a generic cell id.
Definition at line 17 of file HcalZDCDetId.cc.
References DetId::Calo, DetId::det(), Exception, DetId::id_, DetId::null(), DetId::rawId(), SubdetectorId, and DetId::subdetId().
00017 { 00018 if (!gen.null() && (gen.det()!=Calo || gen.subdetId()!=SubdetectorId)) { 00019 throw cms::Exception("Invalid DetId") << "Cannot initialize ZDCDetId from " << std::hex << gen.rawId() << std::dec; 00020 } 00021 id_=gen.rawId(); 00022 }
int HcalZDCDetId::channel | ( | ) | const [inline] |
get the channel (equivalent to depth)
Definition at line 42 of file HcalZDCDetId.h.
References DetId::id_.
Referenced by ZdcTBAnalysis::analyze(), and HcalText2DetIdConverter::init().
00042 { return id_&0xF; }
uint32_t HcalZDCDetId::denseIndex | ( | ) | const |
Definition at line 33 of file HcalZDCDetId.cc.
References depth(), HAD, kDepEM, kDepHAD, kDepTot, LUM, section(), and zside().
00034 { 00035 const int se ( section() ) ; 00036 return ( ( zside()<0 ? 0 : kDepTot ) + depth() - 1 + 00037 ( se == HAD ? kDepEM : 00038 ( se == LUM ? kDepEM + kDepHAD : 0 ) ) ) ; 00039 }
int HcalZDCDetId::depth | ( | ) | const [inline] |
get the depth
Definition at line 40 of file HcalZDCDetId.h.
References DetId::id_.
Referenced by ZdcTBAnalysis::analyze(), denseIndex(), HcalGenericDetId::hashedId(), ZdcTopology::longitudinal(), and ZdcTopology::transverse().
00040 { return id_&0xF; }
HcalZDCDetId HcalZDCDetId::detIdFromDenseIndex | ( | uint32_t | di | ) | [static] |
Definition at line 42 of file HcalZDCDetId.cc.
References EM, HAD, HcalZDCDetId(), in, kDepEM, kDepHAD, kDepTot, LUM, and validDenseIndex().
00043 { 00044 if( validDenseIndex( di ) ) 00045 { 00046 const bool lz ( di >= kDepTot ) ; 00047 const uint32_t in ( di%kDepTot ) ; 00048 const Section se ( in<kDepEM ? EM : 00049 ( in<kDepEM+kDepHAD ? HAD : LUM ) ) ; 00050 const uint32_t dp ( EM == se ? in+1 : 00051 ( HAD == se ? in - kDepEM + 1 : in - kDepEM - kDepHAD + 1 ) ) ; 00052 return HcalZDCDetId( se, lz, dp ) ; 00053 } 00054 else 00055 { 00056 return HcalZDCDetId() ; 00057 } 00058 }
HcalZDCDetId & HcalZDCDetId::operator= | ( | const DetId & | id | ) |
Assignment from a generic cell id.
Definition at line 24 of file HcalZDCDetId.cc.
References DetId::Calo, DetId::det(), Exception, DetId::id_, DetId::null(), DetId::rawId(), SubdetectorId, and DetId::subdetId().
00024 { 00025 if (!gen.null() && (gen.det()!=Calo || gen.subdetId()!=SubdetectorId)) { 00026 throw cms::Exception("Invalid DetId") << "Cannot assign ZDCDetId from " << std::hex << gen.rawId() << std::dec; 00027 } 00028 id_=gen.rawId(); 00029 return *this; 00030 }
Section HcalZDCDetId::section | ( | ) | const [inline] |
get the section
Definition at line 38 of file HcalZDCDetId.h.
References DetId::id_.
Referenced by ZdcTBAnalysis::analyze(), denseIndex(), HcalGenericDetId::hashedId(), HcalText2DetIdConverter::init(), ZdcTopology::longitudinal(), operator<<(), and ZdcTopology::transverse().
static bool HcalZDCDetId::validDenseIndex | ( | uint32_t | di | ) | [inline, static] |
Definition at line 46 of file HcalZDCDetId.h.
References kSizeForDenseIndexing.
Referenced by detIdFromDenseIndex().
00046 { return ( di < kSizeForDenseIndexing ) ; }
Definition at line 61 of file HcalZDCDetId.cc.
References EM, HAD, kDepEM, kDepHAD, kDepLUM, and LUM.
00063 { 00064 return ( dp >= 1 && 00065 ( ( se == EM ) && 00066 ( dp <= kDepEM ) ) || 00067 ( ( se == HAD ) && 00068 ( dp <= kDepHAD ) ) || 00069 ( ( se == LUM ) && 00070 ( dp <= kDepLUM ) ) ) ; 00071 }
int HcalZDCDetId::zside | ( | ) | const [inline] |
get the z-side of the cell (1/-1)
Definition at line 36 of file HcalZDCDetId.h.
References DetId::id_.
Referenced by ZdcTBAnalysis::analyze(), denseIndex(), HcalGenericDetId::hashedId(), HcalText2DetIdConverter::init(), ZdcTopology::longitudinal(), and ZdcTopology::transverse().
00036 { return (id_&0x40)?(1):(-1); }
const int HcalZDCDetId::SubdetectorId = 2 [static] |
Definition at line 22 of file HcalZDCDetId.h.
Referenced by ZDCHitFilter::accepts(), HcalDigiProducer::checkGeometry(), HcalHitCorrection::delay(), HcalGenericDetId::genericSubdet(), HcalSimpleReconstructor::HcalSimpleReconstructor(), HcalZDCDetId(), ZdcHardcodeGeometryLoader::load(), operator=(), HcalSimpleReconstructor::produce(), CaloGeometryBuilder::produceAligned(), CaloGeometryBuilder::produceIdeal(), HcalHitCorrection::timeOfFlight(), and HcalUnpacker::unpack().