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 Types | Static Private Attributes
ESDetId Class Reference

#include <ESDetId.h>

Inheritance diagram for ESDetId:
DetId

Public Types

enum  { Subdet = EcalPreshower }
 
enum  { kSizeForDenseIndexing = kLa }
 
- 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
 
 ESDetId ()
 
 ESDetId (uint32_t rawid)
 
 ESDetId (int strip, int ixs, int iys, int plane, int iz, bool doverify=false)
 constructor from strip, ix, iy, plane, and iz More...
 
 ESDetId (const DetId &id)
 
int hashedIndex () const
 get a compact index for arrays [TODO: NEEDS WORK] More...
 
ESDetIdoperator= (const DetId &id)
 
int plane () const
 
int six () const
 
int siy () const
 
int strip () const
 
EcalSubdetector subdet () const
 get the subdetector More...
 
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 ESDetId detIdFromDenseIndex (uint32_t din)
 
static ESDetId unhashIndex (int hi)
 get a DetId from a compact index for arrays More...
 
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 More...
 
static bool validHashIndex (int hi)
 
static void verify (int istrip, int ixs, int iys, int iplane, int iz)
 

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
 
- Static Public Attributes inherited from DetId
static const int kDetOffset = 28
 
static const int kSubdetOffset = 25
 

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]
 

Additional Inherited Members

- Protected Attributes inherited from DetId
uint32_t id_
 

Detailed Description

Det id for a preshower (endcap) strip

Definition at line 14 of file ESDetId.h.

Member Enumeration Documentation

anonymous enum
Enumerator
Subdet 

Definition at line 17 of file ESDetId.h.

anonymous enum
private
Enumerator
kXYMAX 
kXYMIN 
kXMAX 
kYMAX 
kXMIN 
kYMIN 
kNa 
kNb 
kNc 
kNd 
kLd 
kLc 
kLb 
kLa 

Definition at line 82 of file ESDetId.h.

82  { kXYMAX=1072,
83  kXYMIN= 1,
84  kXMAX = 40,
85  kYMAX = 40,
86  kXMIN = 1,
87  kYMIN = 1,
88  // now normalize to A-D notation for ease of use
89  kNa =IZ_NUM,
90  kNb =PLANE_MAX - PLANE_MIN + 1,
91  kNc =kXYMAX - kXYMIN + 1,
92  kNd =ISTRIP_MAX - ISTRIP_MIN + 1,
93  kLd =kNd,
94  kLc =kLd*kNc,
95  kLb =kLc*kNb,
96  kLa =kLb*kNa } ;
static const int ISTRIP_MAX
Definition: ESDetId.h:75
static const int PLANE_MIN
Definition: ESDetId.h:76
static const int PLANE_MAX
Definition: ESDetId.h:77
static const int IZ_NUM
Definition: ESDetId.h:78
static const int ISTRIP_MIN
Definition: ESDetId.h:74
anonymous enum
Enumerator
kSizeForDenseIndexing 

Definition at line 108 of file ESDetId.h.

Constructor & Destructor Documentation

ESDetId::ESDetId ( )
inline

Constructor of a null id

Definition at line 19 of file ESDetId.h.

19 {}
ESDetId::ESDetId ( uint32_t  rawid)
inline

Constructor from a raw value

Definition at line 21 of file ESDetId.h.

21 : DetId( rawid ) {}
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
ESDetId::ESDetId ( int  strip,
int  ixs,
int  iys,
int  plane,
int  iz,
bool  doverify = false 
)
inline

constructor from strip, ix, iy, plane, and iz

Definition at line 25 of file ESDetId.h.

References DetId::id_, and verify().

25  :
27  id_ |= (strip&0x3F) |
28  ((ixs&0x3F)<<6) |
29  ((iys&0x3F)<<12) |
30  (((plane-1)&0x1)<<18) |
31  ((iz>0)?(1<<19):(0))
32  ;
33  if (doverify) verify(strip, ixs, iys, plane, iz);
34  }
int strip() const
Definition: ESDetId.h:52
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
static void verify(int istrip, int ixs, int iys, int iplane, int iz)
Definition: ESDetId.cc:6
uint32_t id_
Definition: DetId.h:55
int plane() const
Definition: ESDetId.h:46
ESDetId::ESDetId ( const DetId id)
inline

constructor from a generic DetId

Definition at line 115 of file ESDetId.h.

References DetId::det(), DetId::Ecal, EcalPreshower, Exception, DetId::null(), and DetId::subdetId().

115  : DetId(gen)
116 {
117 #ifdef EDM_ML_DEBUG
118  if( !gen.null() &&
119  ( gen.det() != Ecal ||
120  gen.subdetId() != EcalPreshower ) )
121  {
122  throw cms::Exception("InvalidDetId");
123  }
124 #endif
125 }
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
def gen
run2 Cosmic #### Run 256259 @ 0T 2015C### Run 272133 @ 3.8T 2016B###

Member Function Documentation

uint32_t ESDetId::denseIndex ( ) const
inline

Definition at line 56 of file ESDetId.h.

References hashedIndex().

56 { return hashedIndex() ; }
int hashedIndex() const
get a compact index for arrays [TODO: NEEDS WORK]
Definition: ESDetId.cc:44
static ESDetId ESDetId::detIdFromDenseIndex ( uint32_t  din)
inlinestatic

Definition at line 60 of file ESDetId.h.

References unhashIndex().

Referenced by CaloGenericDetId::CaloGenericDetId(), and ESHitResponse::ESHitResponse().

60 { return unhashIndex( din ) ; }
static ESDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: ESDetId.cc:62
int ESDetId::hashedIndex ( ) const

get a compact index for arrays [TODO: NEEDS WORK]

Definition at line 44 of file ESDetId.cc.

Referenced by denseIndex().

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

assignment from a generic DetId

Definition at line 129 of file ESDetId.h.

References DetId::det(), DetId::Ecal, EcalPreshower, Exception, DetId::id_, DetId::null(), DetId::rawId(), and DetId::subdetId().

130 {
131 #ifdef EDM_ML_DEBUG
132  if (!gen.null() &&
133  ( gen.det() != Ecal ||
134  gen.subdetId() != EcalPreshower ) )
135  {
136  throw cms::Exception("InvalidDetId");
137  }
138 #endif
139  id_=gen.rawId();
140  return *this;
141 }
def gen
run2 Cosmic #### Run 256259 @ 0T 2015C### Run 272133 @ 3.8T 2016B###
uint32_t id_
Definition: DetId.h:55
int ESDetId::plane ( ) const
inline

get the plane

Definition at line 46 of file ESDetId.h.

References DetId::id_.

Referenced by EcalPreshowerDigisValidation::analyze(), PreshowerPhiClusterAlgo::makeOneCluster(), ESDigiToRaw::produce(), and CaloGenericDetId::validDetId().

46 { return ((id_>>18)&0x1)+1; }
uint32_t id_
Definition: DetId.h:55
int ESDetId::six ( ) const
inline

get the sensor ix

Definition at line 48 of file ESDetId.h.

References DetId::id_.

Referenced by EcalPreshowerDigisValidation::analyze(), ESDigiToRaw::produce(), and CaloGenericDetId::validDetId().

48 { return (id_>>6)&0x3F; }
uint32_t id_
Definition: DetId.h:55
int ESDetId::siy ( ) const
inline

get the sensor iy

Definition at line 50 of file ESDetId.h.

References DetId::id_.

Referenced by EcalPreshowerDigisValidation::analyze(), ESDigiToRaw::produce(), and CaloGenericDetId::validDetId().

50 { return (id_>>12)&0x3F; }
uint32_t id_
Definition: DetId.h:55
int ESDetId::strip ( ) const
inline

get the strip

Definition at line 52 of file ESDetId.h.

References DetId::id_.

Referenced by EcalPreshowerDigisValidation::analyze(), and CaloGenericDetId::validDetId().

52 { return (id_&0x3F); }
uint32_t id_
Definition: DetId.h:55
EcalSubdetector ESDetId::subdet ( ) const
inline

get the subdetector

Definition at line 42 of file ESDetId.h.

References DetId::subdetId().

42 { return EcalSubdetector(subdetId()); }
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
EcalSubdetector
ESDetId ESDetId::unhashIndex ( int  hi)
static

get a DetId from a compact index for arrays

Definition at line 62 of file ESDetId.cc.

Referenced by detIdFromDenseIndex().

static bool ESDetId::validDenseIndex ( uint32_t  din)
inlinestatic

Definition at line 58 of file ESDetId.h.

References validHashIndex().

58 { return validHashIndex( din ) ; }
static bool validHashIndex(int hi)
Definition: ESDetId.h:64
bool ESDetId::validDetId ( int  istrip,
int  ixs,
int  iys,
int  iplane,
int  iz 
)
static
static bool ESDetId::validHashIndex ( int  hi)
inlinestatic

Definition at line 64 of file ESDetId.h.

References kSizeForDenseIndexing.

Referenced by validDenseIndex().

void ESDetId::verify ( int  istrip,
int  ixs,
int  iys,
int  iplane,
int  iz 
)
static

Definition at line 6 of file ESDetId.cc.

Referenced by ESDetId().

int ESDetId::zside ( ) const
inline

get the zside

Definition at line 44 of file ESDetId.h.

References DetId::id_.

Referenced by ESPedestalTask::analyze(), ESTimingTask::analyze(), EcalPreshowerDigisValidation::analyze(), ESDigiToRaw::produce(), and CaloGenericDetId::validDetId().

44 { return (id_&0x80000)?(1):(-1); }
uint32_t id_
Definition: DetId.h:55

Member Data Documentation

const unsigned short ESDetId::hx1
staticprivate

Definition at line 99 of file ESDetId.h.

const unsigned short ESDetId::hx2
staticprivate

Definition at line 103 of file ESDetId.h.

const unsigned short ESDetId::hxy1
staticprivate

Definition at line 98 of file ESDetId.h.

const unsigned short ESDetId::hxy2
staticprivate

Definition at line 102 of file ESDetId.h.

const unsigned short ESDetId::hy1
staticprivate

Definition at line 100 of file ESDetId.h.

const unsigned short ESDetId::hy2
staticprivate

Definition at line 104 of file ESDetId.h.

const int ESDetId::ISTRIP_MAX =32
static

Definition at line 75 of file ESDetId.h.

const int ESDetId::ISTRIP_MIN =1
static

Definition at line 74 of file ESDetId.h.

const int ESDetId::IX_MAX =40
static

Definition at line 72 of file ESDetId.h.

const int ESDetId::IX_MIN =1
static

Definition at line 70 of file ESDetId.h.

const int ESDetId::IY_MAX =40
static

Definition at line 73 of file ESDetId.h.

const int ESDetId::IY_MIN =1
static

Definition at line 71 of file ESDetId.h.

const int ESDetId::IZ_NUM =2
static

Definition at line 78 of file ESDetId.h.

const int ESDetId::PLANE_MAX =2
static

Definition at line 77 of file ESDetId.h.

const int ESDetId::PLANE_MIN =1
static

Definition at line 76 of file ESDetId.h.