#include <HcalCastorDetId.h>
Public Types | |
enum | { kNumberModulesPerEnd = 14, kNumberSectorsPerEnd = 16, kNumberCellsPerEnd = kNumberModulesPerEnd*kNumberSectorsPerEnd, kSizeForDenseIndexing = kNumberCellsPerEnd } |
enum | Section { Unknown = 0, EM = 1, HAD = 2 } |
Public Member Functions | |
uint32_t | denseIndex () const |
HcalCastorDetId (const DetId &id) | |
HcalCastorDetId () | |
HcalCastorDetId (bool true_for_positive_eta, int sector, int module) | |
HcalCastorDetId (uint32_t rawid) | |
HcalCastorDetId (Section section, bool true_for_positive_eta, int sector, int module) | |
int | module () const |
get the module (1-2 for EM, 1-12 for HAD) | |
HcalCastorDetId & | operator= (const DetId &id) |
Section | section () const |
get the section | |
int | sector () const |
get the sector (1-16) | |
int | zside () const |
get the z-side of the cell (1/-1) | |
Static Public Member Functions | |
static HcalCastorDetId | detIdFromDenseIndex (uint32_t di) |
static bool | validDenseIndex (uint32_t din) |
static bool | validDetId (Section iSection, bool posEta, int iSector, int iMod) |
Static Public Attributes | |
static const int | SubdetectorId = 3 |
Private Member Functions | |
void | buildMe (Section section, bool true_for_positive_eta, int sector, int module) |
Contents of the HcalCastorDetId : [9] Z position (true for positive) [8:7] Section (EM/HAD) [6:4] sector (depth) [3:0] module
NEW: [8] z position [7:4] sector [3:0] module
Definition at line 23 of file HcalCastorDetId.h.
anonymous enum |
Definition at line 74 of file HcalCastorDetId.h.
Definition at line 27 of file HcalCastorDetId.h.
HcalCastorDetId::HcalCastorDetId | ( | ) |
Create a null cellid
Definition at line 5 of file HcalCastorDetId.cc.
Referenced by detIdFromDenseIndex().
: DetId() {}
HcalCastorDetId::HcalCastorDetId | ( | uint32_t | rawid | ) |
Create cellid from raw id (0=invalid tower id)
Definition at line 7 of file HcalCastorDetId.cc.
: DetId(rawid) {}
HcalCastorDetId::HcalCastorDetId | ( | Section | section, |
bool | true_for_positive_eta, | ||
int | sector, | ||
int | module | ||
) |
Constructor from section, z-side, sector and module
Definition at line 19 of file HcalCastorDetId.cc.
References buildMe().
: DetId(DetId::Calo, SubdetectorId) { buildMe( section, true_for_positive_eta, sector, module ) ; }
HcalCastorDetId::HcalCastorDetId | ( | bool | true_for_positive_eta, |
int | sector, | ||
int | module | ||
) |
Definition at line 29 of file HcalCastorDetId.cc.
References buildMe(), and Unknown.
: DetId( DetId::Calo, SubdetectorId ) { buildMe( Section(Unknown), true_for_positive_eta, sector, module ) ; }
HcalCastorDetId::HcalCastorDetId | ( | const DetId & | id | ) |
Constructor from a generic cell id
Definition at line 37 of file HcalCastorDetId.cc.
References DetId::Calo, DetId::det(), Exception, DetId::id_, DetId::null(), DetId::rawId(), SubdetectorId, and DetId::subdetId().
{ if( !gen.null() && ( gen.det() != DetId::Calo || gen.subdetId() != SubdetectorId ) ) { throw cms::Exception("Invalid DetId") << "Cannot initialize CASTORDetId from " << std::hex << gen.rawId() << std::dec; } id_= gen.rawId(); }
void HcalCastorDetId::buildMe | ( | Section | section, |
bool | true_for_positive_eta, | ||
int | sector, | ||
int | module | ||
) | [private] |
Definition at line 10 of file HcalCastorDetId.cc.
References DetId::id_, and module().
Referenced by HcalCastorDetId().
uint32_t HcalCastorDetId::denseIndex | ( | ) | const |
Definition at line 95 of file HcalCastorDetId.cc.
References kNumberCellsPerEnd, kNumberSectorsPerEnd, module(), sector(), and zside().
{ return ( kNumberCellsPerEnd*( zside() + 1 )/2 + kNumberSectorsPerEnd*( module() - 1 ) + sector() - 1 ) ; }
HcalCastorDetId HcalCastorDetId::detIdFromDenseIndex | ( | uint32_t | di | ) | [static] |
Definition at line 114 of file HcalCastorDetId.cc.
References HcalCastorDetId(), kNumberCellsPerEnd, and kNumberSectorsPerEnd.
Referenced by CaloGenericDetId::CaloGenericDetId().
{ return HcalCastorDetId( kNumberCellsPerEnd <= di , di%kNumberSectorsPerEnd + 1 , (di%kNumberCellsPerEnd)/kNumberSectorsPerEnd + 1) ; }
int HcalCastorDetId::module | ( | ) | const [inline] |
get the module (1-2 for EM, 1-12 for HAD)
Definition at line 65 of file HcalCastorDetId.h.
References DetId::id_.
Referenced by CastorMonitorModule::beginRun(), buildMe(), denseIndex(), HcalGenericDetId::hashedId(), CastorTopology::incModule(), CastorTopology::incSector(), CastorText2DetIdConverter::init(), CastorHardcodeGeometryLoader::makeCell(), CastorLEDMonitor::perChanHists(), CastorChannelQualityMonitor::processEvent(), CastorCellProducer::produce(), section(), CastorUnpacker::unpack(), and CaloGenericDetId::validDetId().
{ return ( id_ & 0xF ) ; }
HcalCastorDetId & HcalCastorDetId::operator= | ( | const DetId & | id | ) |
Assignment from a generic cell id
Definition at line 49 of file HcalCastorDetId.cc.
References DetId::Calo, DetId::det(), Exception, DetId::id_, DetId::null(), DetId::rawId(), SubdetectorId, and DetId::subdetId().
{ if( !gen.null() && ( gen.det() != DetId::Calo || gen.subdetId() != SubdetectorId ) ) { throw cms::Exception("Invalid DetId") << "Cannot assign Castor DetId from " << std::hex << gen.rawId() << std::dec; } id_ = gen.rawId(); return *this; }
HcalCastorDetId::Section HcalCastorDetId::section | ( | ) | const |
get the section
Definition at line 71 of file HcalCastorDetId.cc.
References EM, HAD, mod(), module(), and Unknown.
Referenced by CastorTopology::incModule(), CastorTopology::incSector(), CastorText2DetIdConverter::init(), CastorHardcodeGeometryLoader::makeCell(), and CaloGenericDetId::validDetId().
{ const int mod = module(); Section sect ; if ( mod <= 2 ) { sect = HcalCastorDetId::EM ; } else { if( mod > 2 && mod <= 14 ) { sect = HcalCastorDetId::HAD ; } else { sect = HcalCastorDetId::Unknown; } } return sect ; }
int HcalCastorDetId::sector | ( | ) | const [inline] |
get the sector (1-16)
Definition at line 69 of file HcalCastorDetId.h.
References DetId::id_.
Referenced by CastorMonitorModule::beginRun(), denseIndex(), HcalGenericDetId::hashedId(), CastorTopology::incModule(), CastorTopology::incSector(), CastorText2DetIdConverter::init(), CastorHardcodeGeometryLoader::makeCell(), CastorLEDMonitor::perChanHists(), CastorChannelQualityMonitor::processEvent(), CastorCellProducer::produce(), CastorUnpacker::unpack(), and CaloGenericDetId::validDetId().
{ return ((id_ >> 4) & 0xF) + 1 ; }
static bool HcalCastorDetId::validDenseIndex | ( | uint32_t | din | ) | [inline, static] |
Definition at line 86 of file HcalCastorDetId.h.
References kSizeForDenseIndexing.
{ return ( din < kSizeForDenseIndexing ) ; }
bool HcalCastorDetId::validDetId | ( | Section | iSection, |
bool | posEta, | ||
int | iSector, | ||
int | iMod | ||
) | [static] |
Definition at line 102 of file HcalCastorDetId.cc.
References kNumberModulesPerEnd, and kNumberSectorsPerEnd.
{ return ( 0 < iSector && kNumberSectorsPerEnd >= iSector && 0 < iModule && kNumberModulesPerEnd >= iModule ) ; }
int HcalCastorDetId::zside | ( | ) | const [inline] |
get the z-side of the cell (1/-1)
Definition at line 57 of file HcalCastorDetId.h.
References DetId::id_.
Referenced by denseIndex(), HcalGenericDetId::hashedId(), CastorTopology::incModule(), CastorTopology::incSector(), CastorText2DetIdConverter::init(), CastorHardcodeGeometryLoader::makeCell(), CastorLEDMonitor::perChanHists(), CastorCellProducer::produce(), CastorUnpacker::unpack(), and CaloGenericDetId::validDetId().
{ return 2*( ( id_ >> 8 ) & 0x1 ) - 1 ; }
const int HcalCastorDetId::SubdetectorId = 3 [static] |
Definition at line 30 of file HcalCastorDetId.h.
Referenced by CastorHitFilter::accepts(), ValidateGeometry::analyze(), CastorSimpleReconstructor::CastorSimpleReconstructor(), CastorDigiProducer::checkGeometry(), CastorHitCorrection::delay(), HcalGenericDetId::genericSubdet(), HcalCastorDetId(), CaloGenericDetId::isCastor(), CastorHardcodeGeometryLoader::load(), operator=(), CastorSimpleReconstructor::produce(), CaloGeometryBuilder::produceAligned(), CastorDigiProducer::sortHits(), and CastorHitCorrection::timeOfFlight().