#include <ESDetId.h>
Public Types | |
enum | { Subdet = EcalPreshower } |
enum | { kSizeForDenseIndexing = kLa } |
Public Member Functions | |
uint32_t | denseIndex () const |
ESDetId (uint32_t rawid) | |
ESDetId (const DetId &id) | |
ESDetId () | |
ESDetId (int strip, int ixs, int iys, int plane, int iz) | |
constructor from strip, ix, iy, plane, and iz | |
int | hashedIndex () const |
get a compact index for arrays [TODO: NEEDS WORK] | |
ESDetId & | operator= (const DetId &id) |
int | plane () const |
int | six () const |
int | siy () const |
int | strip () const |
EcalSubdetector | subdet () const |
get the subdetector | |
int | zside () const |
Static Public Member Functions | |
static ESDetId | detIdFromDenseIndex (uint32_t din) |
static ESDetId | unhashIndex (int hi) |
get a DetId from a compact index for arrays | |
static bool | validDenseIndex (uint32_t din) |
static bool | validDetId (int istrip, int ixs, int iys, int iplane, int iz) |
check if a valid index combination | |
static bool | validHashIndex (int hi) |
Static Public Attributes | |
static const int | ISTRIP_MAX = 32 |
static const int | ISTRIP_MIN = 1 |
static const int | IX_MAX = 40 |
static const int | IX_MIN = 1 |
static const int | IY_MAX = 40 |
static const int | IY_MIN = 1 |
static const int | IZ_NUM = 2 |
static const int | PLANE_MAX = 2 |
static const int | PLANE_MIN = 1 |
Private Types | |
enum | { kXYMAX = 1072, kXYMIN = 1, kXMAX = 40, kYMAX = 40, kXMIN = 1, kYMIN = 1, kNa = IZ_NUM, kNb = PLANE_MAX - PLANE_MIN + 1, kNc = kXYMAX - kXYMIN + 1, kNd = ISTRIP_MAX - ISTRIP_MIN + 1, kLd = kNd, kLc = kLd*kNc, kLb = kLc*kNb, kLa = kLb*kNa } |
Static Private Attributes | |
static const unsigned short | hx1 [kXYMAX] |
static const unsigned short | hx2 [kXYMAX] |
static const unsigned short | hxy1 [kXMAX][kYMAX] |
static const unsigned short | hxy2 [kXMAX][kYMAX] |
static const unsigned short | hy1 [kXYMAX] |
static const unsigned short | hy2 [kXYMAX] |
Det id for a preshower (endcap) strip
anonymous enum |
anonymous enum [private] |
anonymous enum |
Definition at line 95 of file ESDetId.h.
{ kSizeForDenseIndexing = kLa } ;
ESDetId::ESDetId | ( | ) |
Constructor of a null id
Definition at line 6 of file ESDetId.cc.
Referenced by unhashIndex().
: DetId() { }
ESDetId::ESDetId | ( | uint32_t | rawid | ) |
ESDetId::ESDetId | ( | int | strip, |
int | ixs, | ||
int | iys, | ||
int | plane, | ||
int | iz | ||
) |
constructor from strip, ix, iy, plane, and iz
Definition at line 15 of file ESDetId.cc.
References Exception, hxy1, hxy2, DetId::id_, and validDetId().
: DetId( Ecal, EcalPreshower ) { if( !validDetId( strip, ixs, iys, plane, iz) ) throw cms::Exception("InvalidDetId") << "ESDetId: Cannot create object. Indexes out of bounds \n" << " strip = " << strip << " x = " << ixs << " y = " << iys << "\n" << " plane = " << plane << " z = " << iz << " hxy = " << (1==plane?hxy1[ixs-1][iys-1]:hxy2[ixs-1][iys-1]) << "\n"; id_ |= (strip&0x3F) | ((ixs&0x3F)<<6) | ((iys&0x3F)<<12) | (((plane-1)&0x1)<<18) | ((iz>0)?(1<<19):(0)); }
ESDetId::ESDetId | ( | const DetId & | id | ) |
constructor from a generic DetId
Definition at line 38 of file ESDetId.cc.
References DetId::det(), DetId::Ecal, EcalPreshower, Exception, DetId::id_, DetId::null(), DetId::rawId(), and DetId::subdetId().
{ if( !gen.null() && ( gen.det() != Ecal || gen.subdetId() != EcalPreshower ) ) { throw cms::Exception("InvalidDetId"); } id_ = gen.rawId() ; }
uint32_t ESDetId::denseIndex | ( | ) | const [inline] |
static ESDetId ESDetId::detIdFromDenseIndex | ( | uint32_t | din | ) | [inline, static] |
Definition at line 49 of file ESDetId.h.
References unhashIndex().
Referenced by CaloGenericDetId::CaloGenericDetId(), and ESHitResponse::ESHitResponse().
{ return unhashIndex( din ) ; }
int ESDetId::hashedIndex | ( | ) | const |
assignment from a generic DetId
Definition at line 72 of file ESDetId.cc.
References DetId::det(), DetId::Ecal, EcalPreshower, Exception, DetId::id_, DetId::null(), DetId::rawId(), and DetId::subdetId().
{ if (!gen.null() && ( gen.det() != Ecal || gen.subdetId() != EcalPreshower ) ) { throw cms::Exception("InvalidDetId"); } id_=gen.rawId(); return *this; }
int ESDetId::plane | ( | ) | const [inline] |
get the plane
Definition at line 35 of file ESDetId.h.
References DetId::id_.
Referenced by EcalPreshowerDigisValidation::analyze(), EcalDigisValidation::analyze(), EcalPreshowerRecHitsValidation::analyze(), EcalMixingModuleValidation::analyze(), ESDataFormatterV4::DigiToRaw(), ESDataFormatterV1_1::DigiToRaw(), EndcapPiZeroDiscriminatorAlgo::findPreshVector(), hashedIndex(), EcalPreshowerGeometry::initializeParms(), PreshowerClusterAlgo::makeOneCluster(), PreshowerPhiClusterAlgo::makeOneCluster(), ESDigiToRaw::produce(), EcalSimHitsValidProducer::update(), CaloGenericDetId::validDetId(), and ESUnpacker::word2digi().
{ return ((id_>>18)&0x1)+1; }
int ESDetId::six | ( | ) | const [inline] |
get the sensor ix
Definition at line 37 of file ESDetId.h.
References DetId::id_.
Referenced by EcalPreshowerDigisValidation::analyze(), EcalRecHitsValidation::analyze(), EcalDigisValidation::analyze(), EcalPreshowerRecHitsValidation::analyze(), EcalMixingModuleValidation::analyze(), ESDataFormatterV4::DigiToRaw(), ESDataFormatterV1_1::DigiToRaw(), hashedIndex(), ESDigiToRaw::produce(), CaloGenericDetId::validDetId(), and ESUnpacker::word2digi().
{ return (id_>>6)&0x3F; }
int ESDetId::siy | ( | ) | const [inline] |
get the sensor iy
Definition at line 39 of file ESDetId.h.
References DetId::id_.
Referenced by EcalPreshowerDigisValidation::analyze(), EcalRecHitsValidation::analyze(), EcalDigisValidation::analyze(), EcalPreshowerRecHitsValidation::analyze(), EcalMixingModuleValidation::analyze(), ESDataFormatterV4::DigiToRaw(), ESDataFormatterV1_1::DigiToRaw(), hashedIndex(), ESDigiToRaw::produce(), CaloGenericDetId::validDetId(), and ESUnpacker::word2digi().
{ return (id_>>12)&0x3F; }
int ESDetId::strip | ( | ) | const [inline] |
get the strip
Definition at line 41 of file ESDetId.h.
References DetId::id_.
Referenced by EcalPreshowerDigisValidation::analyze(), EcalRecHitsValidation::analyze(), EcalDigisValidation::analyze(), EcalPreshowerRecHitsValidation::analyze(), EcalMixingModuleValidation::analyze(), ESDataFormatterV4::DigiToRaw(), ESDataFormatterV1_1::DigiToRaw(), EndcapPiZeroDiscriminatorAlgo::findPreshVector(), hashedIndex(), PreshowerClusterAlgo::makeOneCluster(), CaloGenericDetId::validDetId(), and ESUnpacker::word2digi().
{ return (id_&0x3F); }
EcalSubdetector ESDetId::subdet | ( | ) | const [inline] |
get the subdetector
Definition at line 31 of file ESDetId.h.
References DetId::subdetId().
{ return EcalSubdetector(subdetId()); }
ESDetId ESDetId::unhashIndex | ( | int | hi | ) | [static] |
get a DetId from a compact index for arrays
Definition at line 103 of file ESDetId.cc.
References ESDetId(), hx1, hx2, hy1, hy2, kLb, kLc, kLd, and validHashIndex().
Referenced by detIdFromDenseIndex(), and ESTrivialConditionRetriever::getChannelStatusFromConfiguration().
{ if( validHashIndex( hi ) ) { const int id ( hi%kLd + 1 ) ; const int nd ( hi - id + 1 ) ; const int ic ( ( nd%kLc )/kLd + 1 ) ; const int nc ( nd - ( ic - 1 )*kLd ) ; const int ib ( ( nc%kLb )/kLc + 1 ) ; const int nb ( nc - ( ib - 1 )*kLc ) ; const int ia ( nb/kLb + 1 );// + 1 ) ; const int st ( id ) ; const int pl ( ib ) ; int ix ; int iy ; const int ic1 ( ic - 1 ) ; if( 1 == pl ) { ix = hx1[ ic1 ] ; iy = hy1[ ic1 ] ; } else { ix = hx2[ ic1 ] ; iy = hy2[ ic1 ] ; } const int iz ( 1 == ia ? -1 : 1 ) ; return ESDetId( st, ix, iy, pl, iz ) ; } else { return ESDetId() ; } }
static bool ESDetId::validDenseIndex | ( | uint32_t | din | ) | [inline, static] |
Definition at line 47 of file ESDetId.h.
References validHashIndex().
{ return validHashIndex( din ) ; }
bool ESDetId::validDetId | ( | int | istrip, |
int | ixs, | ||
int | iys, | ||
int | iplane, | ||
int | iz | ||
) | [static] |
check if a valid index combination
Definition at line 50 of file ESDetId.cc.
References abs, hxy1, hxy2, ISTRIP_MAX, ISTRIP_MIN, IX_MAX, IX_MIN, IY_MAX, IY_MIN, PLANE_MAX, and PLANE_MIN.
Referenced by ESDetId(), EcalPreshowerGeometry::getClosestCellInPlane(), and ESUnpacker::word2digi().
{ return ( !( ( istrip < ISTRIP_MIN ) || ( istrip > ISTRIP_MAX ) || ( ixs < IX_MIN ) || ( ixs > IX_MAX ) || ( iys < IY_MIN ) || ( iys > IY_MAX ) || ( abs( iz ) != 1 ) || ( iplane < PLANE_MIN ) || ( iplane > PLANE_MAX ) || ( ( 1 == iplane ) && 0 == hxy1[ixs-1][iys-1] ) || ( ( 2 == iplane ) && 0 == hxy2[ixs-1][iys-1] ) ) ) ; }
static bool ESDetId::validHashIndex | ( | int | hi | ) | [inline, static] |
Definition at line 53 of file ESDetId.h.
References kSizeForDenseIndexing.
Referenced by unhashIndex(), and validDenseIndex().
{ return ( hi < kSizeForDenseIndexing ) ; }
int ESDetId::zside | ( | ) | const [inline] |
get the zside
Definition at line 33 of file ESDetId.h.
References DetId::id_.
Referenced by EcalPreshowerDigisValidation::analyze(), ESTimingTask::analyze(), EcalDigisValidation::analyze(), ESOccupancyTask::analyze(), EcalPreshowerRecHitsValidation::analyze(), ESTrendTask::analyze(), EcalMixingModuleValidation::analyze(), ESPedestalTask::analyze(), ESDataFormatterV4::DigiToRaw(), ESDataFormatterV1_1::DigiToRaw(), hashedIndex(), EcalPreshowerGeometry::initializeParms(), ESDigiToRaw::produce(), EcalSimHitsValidProducer::update(), CaloGenericDetId::validDetId(), and ESUnpacker::word2digi().
{ return (id_&0x80000)?(1):(-1); }
const unsigned short ESDetId::hx1 [static, private] |
Definition at line 86 of file ESDetId.h.
Referenced by unhashIndex().
const unsigned short ESDetId::hx2 [static, private] |
Definition at line 90 of file ESDetId.h.
Referenced by unhashIndex().
const unsigned short ESDetId::hxy1 [static, private] |
Definition at line 85 of file ESDetId.h.
Referenced by ESDetId(), hashedIndex(), and validDetId().
const unsigned short ESDetId::hxy2 [static, private] |
Definition at line 89 of file ESDetId.h.
Referenced by ESDetId(), hashedIndex(), and validDetId().
const unsigned short ESDetId::hy1 [static, private] |
Definition at line 87 of file ESDetId.h.
Referenced by unhashIndex().
const unsigned short ESDetId::hy2 [static, private] |
Definition at line 91 of file ESDetId.h.
Referenced by unhashIndex().
const int ESDetId::ISTRIP_MAX = 32 [static] |
Definition at line 62 of file ESDetId.h.
Referenced by ESTrivialConditionRetriever::getChannelStatusFromConfiguration(), EcalPreshowerGeometry::getClosestCellInPlane(), ESTrivialConditionRetriever::produceESChannelStatus(), ESTrivialConditionRetriever::produceESIntercalibConstants(), ESTrivialConditionRetriever::produceESPedestals(), ESTrivialConditionRetriever::produceESWeightStripGroups(), and validDetId().
const int ESDetId::ISTRIP_MIN = 1 [static] |
Definition at line 61 of file ESDetId.h.
Referenced by ESTrivialConditionRetriever::getChannelStatusFromConfiguration(), EcalPreshowerGeometry::getClosestCellInPlane(), ESTrivialConditionRetriever::produceESChannelStatus(), ESTrivialConditionRetriever::produceESIntercalibConstants(), ESTrivialConditionRetriever::produceESPedestals(), ESTrivialConditionRetriever::produceESWeightStripGroups(), and validDetId().
const int ESDetId::IX_MAX = 40 [static] |
Definition at line 59 of file ESDetId.h.
Referenced by ESTrivialConditionRetriever::getChannelStatusFromConfiguration(), ESTrivialConditionRetriever::produceESChannelStatus(), ESTrivialConditionRetriever::produceESIntercalibConstants(), ESTrivialConditionRetriever::produceESPedestals(), ESTrivialConditionRetriever::produceESWeightStripGroups(), and validDetId().
const int ESDetId::IX_MIN = 1 [static] |
Definition at line 57 of file ESDetId.h.
Referenced by ESTrivialConditionRetriever::getChannelStatusFromConfiguration(), ESTrivialConditionRetriever::produceESChannelStatus(), ESTrivialConditionRetriever::produceESIntercalibConstants(), ESTrivialConditionRetriever::produceESPedestals(), ESTrivialConditionRetriever::produceESWeightStripGroups(), and validDetId().
const int ESDetId::IY_MAX = 40 [static] |
Definition at line 60 of file ESDetId.h.
Referenced by ESTrivialConditionRetriever::getChannelStatusFromConfiguration(), ESTrivialConditionRetriever::produceESChannelStatus(), ESTrivialConditionRetriever::produceESIntercalibConstants(), ESTrivialConditionRetriever::produceESPedestals(), ESTrivialConditionRetriever::produceESWeightStripGroups(), and validDetId().
const int ESDetId::IY_MIN = 1 [static] |
Definition at line 58 of file ESDetId.h.
Referenced by ESTrivialConditionRetriever::getChannelStatusFromConfiguration(), ESTrivialConditionRetriever::produceESChannelStatus(), ESTrivialConditionRetriever::produceESIntercalibConstants(), ESTrivialConditionRetriever::produceESPedestals(), ESTrivialConditionRetriever::produceESWeightStripGroups(), and validDetId().
const int ESDetId::IZ_NUM = 2 [static] |
const int ESDetId::PLANE_MAX = 2 [static] |
Definition at line 64 of file ESDetId.h.
Referenced by validDetId().
const int ESDetId::PLANE_MIN = 1 [static] |
Definition at line 63 of file ESDetId.h.
Referenced by validDetId().