CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Static Private Attributes
EEDetId Class Reference

#include <EEDetId.h>

Inheritance diagram for EEDetId:
DetId

Public Types

enum  { Subdet =EcalEndcap }
 
enum  { kEEhalf = 7324, kSizeForDenseIndexing = 2*kEEhalf }
 
- Public Types inherited from DetId
enum  Detector {
  Tracker =1, Muon =2, Ecal =3, Hcal =4,
  Calo =5, Forward =6, VeryForward =7
}
 

Public Member Functions

uint32_t denseIndex () const
 
 EEDetId ()
 
 EEDetId (uint32_t rawid)
 
 EEDetId (int crystal_ix, int crystal_iy, int iz)
 
 EEDetId (int i, int j, int iz, int mode)
 
 EEDetId (const DetId &id)
 
int hashedIndex () const
 
int ic () const
 
int iPhiOuterRing () const
 
int iquadrant () const
 
int isc () const
 
int ix () const
 
int iy () const
 
EEDetId offsetBy (int nrStepsX, int nrStepsY) const
 
EEDetIdoperator= (const DetId &id)
 
bool positiveZ () const
 
EcalScDetId sc () const
 
EEDetId switchZSide () const
 
int zside () const
 
- Public Member Functions inherited from DetId
Detector det () const
 get the detector field from this detid More...
 
 DetId ()
 Create an empty or null id (also for persistence) More...
 
 DetId (uint32_t id)
 Create an id from a raw number. More...
 
 DetId (Detector det, int subdet)
 Create an id, filling the detector and subdetector fields as specified. More...
 
bool null () const
 is this a null id ? More...
 
 operator uint32_t () const
 
bool operator!= (DetId id) const
 inequality More...
 
uint32_t operator() () const
 
bool operator< (DetId id) const
 comparison More...
 
bool operator== (DetId id) const
 equality More...
 
uint32_t rawId () const
 get the raw id More...
 
int subdetId () const
 get the contents of the subdetector field (not cast into any detector's numbering enum) More...
 

Static Public Member Functions

static EEDetId detIdFromDenseIndex (uint32_t din)
 
static int distanceX (const EEDetId &a, const EEDetId &b)
 
static int distanceY (const EEDetId &a, const EEDetId &b)
 
static bool fastValidDetId (int crystal_ix, int crystal_iy)
 
static EEDetId idOuterRing (int iPhi, int zEnd)
 
static int isc (int iscCol, int iscRow)
 
static bool isNextToBoundary (EEDetId id)
 
static bool isNextToDBoundary (EEDetId id)
 
static bool isNextToRingBoundary (EEDetId id)
 
static DetId offsetBy (const DetId startId, int nrStepsX, int nrStepsY)
 
static bool slowValidDetId (int crystal_ix, int crystal_iy)
 
static EcalSubdetector subdet ()
 
static DetId switchZSide (const DetId startId)
 
static EEDetId unhashIndex (int hi)
 
static bool validDenseIndex (uint32_t din)
 
static bool validDetId (int crystal_ix, int crystal_iy, int iz)
 
static bool validHashIndex (int i)
 

Static Public Attributes

static const int ICR_MAX =25
 
static const int ICR_MIN =1
 
static const int ISC_MAX =316
 
static const int ISC_MIN =1
 
static const int IX_MAX =100
 
static const int IX_MIN =1
 
static const int IY_MAX =100
 
static const int IY_MIN =1
 
static const int XYMODE = 0
 
static const int SCCRYSTALMODE = 1
 
- Static Public Attributes inherited from DetId
static const int kDetOffset = 28
 
static const int kSubdetOffset = 25
 

Private Member Functions

bool isOuterRing () const
 
int ix (int iSC, int iCrys) const
 
int ixQuadrantOne () const
 
int iy (int iSC, int iCrys) const
 
int iyQuadrantOne () const
 

Static Private Member Functions

static bool isOuterRingXY (int ax, int ay)
 

Static Private Attributes

static const int iYoffset [nCols+1] = { 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 }
 
static const unsigned short kdi [2 *IY_MAX]
 
static const unsigned short kxf [2 *IY_MAX]
 
static const int nCols = 10
 
static const int nCrys = 5
 
static const int QuadColLimits [nCols+1] = { 0, 8,17,27,36,45,54,62,70,76,79 }
 

Additional Inherited Members

- Protected Attributes inherited from DetId
uint32_t id_
 

Detailed Description

Crystal/cell identifier class for the ECAL endcap

Definition at line 15 of file EEDetId.h.

Member Enumeration Documentation

anonymous enum
Enumerator
Subdet 

Sudetector type. Here it is ECAL endcap.

Definition at line 17 of file EEDetId.h.

anonymous enum
Enumerator
kEEhalf 

Number of crystals per Dee

kSizeForDenseIndexing 

Number of dense crystal indices, that is number of crystals per endcap.

Definition at line 326 of file EEDetId.h.

Constructor & Destructor Documentation

EEDetId::EEDetId ( )
inline

Constructor of a null id

Definition at line 25 of file EEDetId.h.

EEDetId::EEDetId ( uint32_t  rawid)
inline

Constructor from a raw value

Parameters
rawiddet ID number

Definition at line 30 of file EEDetId.h.

EEDetId::EEDetId ( int  crystal_ix,
int  crystal_iy,
int  iz 
)
inline

Constructor from crystal ix,iy,iz (iz=+1/-1) (mode = XYMODE) or from sc,cr,iz (mode = SCCRYSTALMODE).

ix runs from 1 to 100 along x-axis of standard CMS coordinates
iy runs from 1 to 100 along y-axis of standard CMS coordinates
iz is -1 for EE- and +1 for EE+

For isc see isc(), for ic see ic()

See Also
isc(), ic()
Parameters
iix or isc index
jiy or isc index
iziz/zside index: -1 for EE-, +1 for EE+
modepass XYMODE if i j refer to ix, iy, SCCRYSTALMODE if thery refer to isc, ic

Definition at line 45 of file EEDetId.h.

EEDetId::EEDetId ( int  i,
int  j,
int  iz,
int  mode 
)

Definition at line 56 of file EEDetId.cc.

EEDetId::EEDetId ( const DetId id)
inline

Constructor from a generic cell id

Parameters
idsource detid

Definition at line 55 of file EEDetId.h.

Member Function Documentation

uint32_t EEDetId::denseIndex ( ) const
inline

Same as hashedIndex()

Returns
compact index from 0 to kSizeForDenseIndexing-1

Definition at line 192 of file EEDetId.h.

static EEDetId EEDetId::detIdFromDenseIndex ( uint32_t  din)
inlinestatic

Converts a hashed/dense index as defined in hashedIndex() and denseIndex() methods to a det id.

Parameters
dinhashed/dense index
Returns
det id

Definition at line 220 of file EEDetId.h.

Referenced by CaloGenericDetId::CaloGenericDetId(), EEHitResponse::EEHitResponse(), and EcalTPSkimmer::produce().

int EEDetId::distanceX ( const EEDetId a,
const EEDetId b 
)
static

Returns the distance along x-axis in crystal units between two EEDetId

Parameters
adet id of first crystal
bdet id of second crystal
Returns
distance

Definition at line 577 of file EEDetId.cc.

int EEDetId::distanceY ( const EEDetId a,
const EEDetId b 
)
static

Returns the distance along y-axis in crystal units between two EEDetId

Parameters
adet id of first crystal
bdet id of second crystal
Returns
distance

Definition at line 582 of file EEDetId.cc.

static bool EEDetId::fastValidDetId ( int  crystal_ix,
int  crystal_iy 
)
inlinestatic

check if ix and iy is in a "ring" inscribed in EE if is inside is valid for sure if not the slow version shall be called

Definition at line 262 of file EEDetId.h.

int EEDetId::hashedIndex ( ) const
inline

Gets a compact index for arrays

Returns
compact index from 0 to kSizeForDenseIndexing-1

Definition at line 182 of file EEDetId.h.

Referenced by ecalpyutils::hashedIndexEE(), EcalUncalibRecHitWorkerWeights::run(), and EcalGeomPhiSymHelper::setup().

int EEDetId::ic ( ) const

Gets crystal number inside SuperCrystal. Crystal numbering withing a supercrystal in each quadrant:

*                       A y
*  (Q2)                 |                    (Q1)
*       25 20 15 10 5   |     5 10 15 20 25
*       24 19 14  9 4   |     4  9 14 19 24
*       23 18 13  8 3   |     3  8 13 18 23
*       22 17 12  7 2   |     2  7 12 17 22
*       21 16 11  6 1   |     1  6 11 16 21
*                       |
* ----------------------o---------------------------> x
*                       |
*       21 16 11  6 1   |     1  6 11 16 21
*       22 17 12  7 2   |     2  7 12 17 22
*       23 18 13  8 3   |     3  8 13 18 23
*       24 19 14  9 4   |     4  9 14 19 24
*       25 20 15 10 5   |     5 10 15 20 25
*  (Q3)                                       (Q4)
* 
Returns
crystal number from 1 to 25

Definition at line 324 of file EEDetId.cc.

EEDetId EEDetId::idOuterRing ( int  iPhi,
int  zEnd 
)
static

Definition at line 435 of file EEDetId.cc.

int EEDetId::iPhiOuterRing ( ) const

Definition at line 388 of file EEDetId.cc.

int EEDetId::iquadrant ( ) const

Gets the quadrant of the DetId. Quadrant number definition, x and y in std CMS coordinates, for EE+:

*                 A y
*                 |
*          Q2     |    Q1
*                 |
*       ----------o---------> x
*                 |
*          Q3     |    Q4
*                 |
* 
Returns
quadrant number

Definition at line 264 of file EEDetId.cc.

int EEDetId::isc ( ) const

Gets the SuperCrystal number within the endcap. This number runs from 1 to 316, numbers 70 149 228 307 are not used.

BEWARE: This number is not consistent with indices used in constructor: see details below.

Numbering in quadrant 1 of EE+ is the following

*  08 17 27        
*  07 16 26 36 45 54     
*  06 15 25 35 44 53 62    
*  05 14 24 34 43 52 61 69   
*  04 13 23 33 42 51 60 68 76  
*  03 12 22 32 41 50 59 67 75  
*  02 11 21 31 40 49 58 66 74  
*  01 10 20 30 39 48 57 65 73 79 
*     09 19 29 38 47 56 64 72 78 
*        18 28 37 46 55 63 71 77
*  
*        == THERE IS NO INDEX 70! ==
* 

Quadrant 2 indices are deduced by a symetry about y-axis and by adding an offset of 79.
Quadrant 3 and 4 indices are deduced from quadrant 1 and 2 by a symetry about x-axis and adding an offset. Quadrant N starts with index 1 + (N-1)*79.

EE- indices are deduced from EE+ by a symetry about (x,y)-plane (mirrored view). It is inconsistent with indices used in constructor EEDetId(int, int,int) in SCCRYSTALMODE. Indices of constructor uses a symetry along y-axis: in principal it considers the isc as a local index. The discrepancy is most probably due to a bug in the implementation of this isc() method.

Definition at line 285 of file EEDetId.cc.

int EEDetId::isc ( int  iscCol,
int  iscRow 
)
static

Gives supercrystal index from endcap supercrystal x and y indexes.

See Also
isc() for the index definition
Parameters
iscColsupercrystal column number: supecrystal x-index for EE+
iscRow,:supecrystal y-index
Returns
supercystal index

Definition at line 292 of file EEDetId.cc.

bool EEDetId::isNextToBoundary ( EEDetId  id)
static

Definition at line 361 of file EEDetId.cc.

Referenced by isNextToBoundary().

bool EEDetId::isNextToDBoundary ( EEDetId  id)
static

Definition at line 367 of file EEDetId.cc.

bool EEDetId::isNextToRingBoundary ( EEDetId  id)
static

Definition at line 375 of file EEDetId.cc.

Referenced by InterestingDetIdFromSuperClusterProducer::produce().

bool EEDetId::isOuterRing ( ) const
private

Definition at line 520 of file EEDetId.cc.

bool EEDetId::isOuterRingXY ( int  ax,
int  ay 
)
staticprivate

Definition at line 531 of file EEDetId.cc.

int EEDetId::ix ( ) const
inline
int EEDetId::ix ( int  iSC,
int  iCrys 
) const
private

Definition at line 117 of file EEDetId.cc.

int EEDetId::ixQuadrantOne ( ) const
private

Definition at line 241 of file EEDetId.cc.

int EEDetId::iy ( ) const
inline
int EEDetId::iy ( int  iSC,
int  iCrys 
) const
private

Definition at line 181 of file EEDetId.cc.

int EEDetId::iyQuadrantOne ( ) const
private

Definition at line 252 of file EEDetId.cc.

EEDetId EEDetId::offsetBy ( int  nrStepsX,
int  nrStepsY 
) const

returns a new EEDetId offset by nrStepsX and nrStepsY (can be negative), returns EEDetId(0) if invalid

Definition at line 474 of file EEDetId.cc.

Referenced by EcalTools::deadNeighbour(), and EcalTools::recHitE().

DetId EEDetId::offsetBy ( const DetId  startId,
int  nrStepsX,
int  nrStepsY 
)
static

following are static member functions of the above two functions which take and return a DetId, returns DetId(0) if invalid

Definition at line 498 of file EEDetId.cc.

EEDetId& EEDetId::operator= ( const DetId id)
inline

Assignment operator

Parameters
idsource det id

Definition at line 60 of file EEDetId.h.

bool EEDetId::positiveZ ( ) const
inline

Checks if crystal is in EE+

Returns
true for EE+, false for EE-

Definition at line 173 of file EEDetId.h.

Referenced by ecaldqm::crystalID().

EcalScDetId EEDetId::sc ( ) const
inline

Gets the DetId of the supercrystal the crystal belong to.

Returns
the supercrystal det id
Exceptions
cms::Exceptionif the crystal det id is invalid

Definition at line 88 of file EEDetId.h.

bool EEDetId::slowValidDetId ( int  crystal_ix,
int  crystal_iy 
)
static

Definition at line 546 of file EEDetId.cc.

static EcalSubdetector EEDetId::subdet ( )
inlinestatic

Gets the subdetector

Returns
subdetectot ID, that is EcalEndcap

Definition at line 65 of file EEDetId.h.

EEDetId EEDetId::switchZSide ( ) const

returns a new EEDetId swapped (same iX, iY) to the other endcap, returns EEDetId(0) if invalid (shouldnt happen)

Definition at line 487 of file EEDetId.cc.

DetId EEDetId::switchZSide ( const DetId  startId)
static

Definition at line 509 of file EEDetId.cc.

EEDetId EEDetId::unhashIndex ( int  hi)
static
static bool EEDetId::validDenseIndex ( uint32_t  din)
inlinestatic

Checks validity of a dense/hashed index

Parameters
dindense/hashed index as returned by hashedIndex() or denseIndex() method
Returns
true if index is valid, false otherwise

Definition at line 213 of file EEDetId.h.

Referenced by EcalTPSkimmer::produce().

static bool EEDetId::validDetId ( int  crystal_ix,
int  crystal_iy,
int  iz 
)
inlinestatic
static bool EEDetId::validHashIndex ( int  i)
inlinestatic

Checks if a hashed/dense index is valid

See Also
hashedIndex(), denseIndex()
Parameters
ihashed/dense index
Returns
true if the index is valid, false otherwise

Definition at line 239 of file EEDetId.h.

Referenced by EcalChannelStatusXMLTranslator::dumpXML(), EcalPulseSymmCovariancesXMLTranslator::dumpXML(), EcalTPGLinearizationConstXMLTranslator::dumpXML(), EcalGainRatiosXMLTranslator::dumpXML(), EcalWeightGroupXMLTranslator::dumpXML(), and main().

int EEDetId::zside ( ) const
inline

Member Data Documentation

const int EEDetId::ICR_MAX =25
static

Upper bound of crystal index within a supercrystal

Definition at line 324 of file EEDetId.h.

const int EEDetId::ICR_MIN =1
static

Lower bound of crystal index within a supercrystal

Definition at line 314 of file EEDetId.h.

const int EEDetId::ISC_MAX =316
static

Upper bound of supercystal index defined in isc()

Beware it differs from the number of supercrystals in one endcap, which is 312, because the numbering is not dense.

Definition at line 320 of file EEDetId.h.

const int EEDetId::ISC_MIN =1
static

Lower bound of supercystal index as defined in isc()

Definition at line 310 of file EEDetId.h.

const int EEDetId::IX_MAX =100
static
const int EEDetId::IX_MIN =1
static
const int EEDetId::IY_MAX =100
static
const int EEDetId::IY_MIN =1
static
const int EEDetId::iYoffset = { 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 }
staticprivate

Definition at line 354 of file EEDetId.h.

const unsigned short EEDetId::kdi
staticprivate
Initial value:
= {
0, 10, 20, 30, 40, 50, 60, 75, 90, 105,
120, 145, 170, 195, 220, 245, 270, 300, 330, 360,
390, 420, 450, 480, 510, 540, 570, 605, 640, 675,
710, 747, 784, 821, 858, 895, 932, 969, 1006, 1043,
1080, 1122, 1164, 1206, 1248, 1290, 1332, 1374, 1416, 1458,
1500, 1545, 1590, 1635, 1680, 1725, 1770, 1815, 1860, 1905,
1950, 1995, 2040, 2085, 2130, 2175, 2220, 2265, 2310, 2355,
2400, 2447, 2494, 2541, 2588, 2635, 2682, 2729, 2776, 2818,
2860, 2903, 2946, 2988, 3030, 3071, 3112, 3152, 3192, 3232,
3272, 3311, 3350, 3389, 3428, 3467, 3506, 3545, 3584, 3623,
3662, 3701, 3740, 3779, 3818, 3857, 3896, 3935, 3974, 4013,
4052, 4092, 4132, 4172, 4212, 4253, 4294, 4336, 4378, 4421,
4464, 4506, 4548, 4595, 4642, 4689, 4736, 4783, 4830, 4877,
4924, 4969, 5014, 5059, 5104, 5149, 5194, 5239, 5284, 5329,
5374, 5419, 5464, 5509, 5554, 5599, 5644, 5689, 5734, 5779,
5824, 5866, 5908, 5950, 5992, 6034, 6076, 6118, 6160, 6202,
6244, 6281, 6318, 6355, 6392, 6429, 6466, 6503, 6540, 6577,
6614, 6649, 6684, 6719, 6754, 6784, 6814, 6844, 6874, 6904,
6934, 6964, 6994, 7024, 7054, 7079, 7104, 7129, 7154, 7179,
7204, 7219, 7234, 7249, 7264, 7274, 7284, 7294, 7304, 7314
}

Definition at line 357 of file EEDetId.h.

const unsigned short EEDetId::kxf
staticprivate
Initial value:
= {
41, 51, 41, 51, 41, 51, 36, 51, 36, 51,
26, 51, 26, 51, 26, 51, 21, 51, 21, 51,
21, 51, 21, 51, 21, 51, 16, 51, 16, 51,
14, 51, 14, 51, 14, 51, 14, 51, 14, 51,
9, 51, 9, 51, 9, 51, 9, 51, 9, 51,
6, 51, 6, 51, 6, 51, 6, 51, 6, 51,
6, 51, 6, 51, 6, 51, 6, 51, 6, 51,
4, 51, 4, 51, 4, 51, 4, 51, 4, 56,
1, 58, 1, 59, 1, 60, 1, 61, 1, 61,
1, 62, 1, 62, 1, 62, 1, 62, 1, 62,
1, 62, 1, 62, 1, 62, 1, 62, 1, 62,
1, 61, 1, 61, 1, 60, 1, 59, 1, 58,
4, 56, 4, 51, 4, 51, 4, 51, 4, 51,
6, 51, 6, 51, 6, 51, 6, 51, 6, 51,
6, 51, 6, 51, 6, 51, 6, 51, 6, 51,
9, 51, 9, 51, 9, 51, 9, 51, 9, 51,
14, 51, 14, 51, 14, 51, 14, 51, 14, 51,
16, 51, 16, 51, 21, 51, 21, 51, 21, 51,
21, 51, 21, 51, 26, 51, 26, 51, 26, 51,
36, 51, 36, 51, 41, 51, 41, 51, 41, 51
}

Definition at line 356 of file EEDetId.h.

const int EEDetId::nCols = 10
staticprivate

Definition at line 351 of file EEDetId.h.

const int EEDetId::nCrys = 5
staticprivate

Definition at line 352 of file EEDetId.h.

const int EEDetId::QuadColLimits = { 0, 8,17,27,36,45,54,62,70,76,79 }
staticprivate

Definition at line 353 of file EEDetId.h.

const int EEDetId::SCCRYSTALMODE = 1
static

Definition at line 340 of file EEDetId.h.

Referenced by EcalEndcapNumberingScheme::getUnitID().

const int EEDetId::XYMODE = 0
static

function modes for EEDetId(int, int, int, int) constructor

Definition at line 339 of file EEDetId.h.

Referenced by MatrixFillMap::fillEEMap(), and EcalMappingElectronicsHandler::getNewObjects().