CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ESDetId.h
Go to the documentation of this file.
1 #ifndef ECALDETID_ESDETID_H
2 #define ECALDETID_ESDETID_H
3 
4 #include <ostream>
7 
15 class ESDetId : public DetId {
16  public:
17 
18  enum { Subdet = EcalPreshower } ;
20  ESDetId();
22  ESDetId(uint32_t rawid);
24  ESDetId(int strip, int ixs, int iys, int plane, int iz);
26  ESDetId(const DetId& id);
28  ESDetId& operator=(const DetId& id);
29 
33  int zside() const { return (id_&0x80000)?(1):(-1); }
35  int plane() const { return ((id_>>18)&0x1)+1; }
37  int six() const { return (id_>>6)&0x3F; }
39  int siy() const { return (id_>>12)&0x3F; }
41  int strip() const { return (id_&0x3F); }
43  int hashedIndex() const ;
44 
45  uint32_t denseIndex() const { return hashedIndex() ; }
46 
47  static bool validDenseIndex( uint32_t din ) { return validHashIndex( din ) ; }
48 
49  static ESDetId detIdFromDenseIndex( uint32_t din ) { return unhashIndex( din ) ; }
50 
52  static ESDetId unhashIndex( int hi ) ;
53  static bool validHashIndex( int hi ) { return ( hi < kSizeForDenseIndexing ) ; }
55  static bool validDetId(int istrip, int ixs, int iys, int iplane, int iz) ;
56 
57  static const int IX_MIN=1;
58  static const int IY_MIN=1;
59  static const int IX_MAX=40;
60  static const int IY_MAX=40;
61  static const int ISTRIP_MIN=1;
62  static const int ISTRIP_MAX=32;
63  static const int PLANE_MIN=1;
64  static const int PLANE_MAX=2;
65  static const int IZ_NUM=2;
66 
67  private :
68 
69  enum { kXYMAX=1072,
70  kXYMIN= 1,
71  kXMAX = 40,
72  kYMAX = 40,
73  kXMIN = 1,
74  kYMIN = 1,
75  // now normalize to A-D notation for ease of use
78  kNc =kXYMAX - kXYMIN + 1,
80  kLd =kNd,
83  kLa =kLb*kNa } ;
84 
85  static const unsigned short hxy1[ kXMAX ][ kYMAX ] ;
86  static const unsigned short hx1[ kXYMAX ] ;
87  static const unsigned short hy1[ kXYMAX ] ;
88 
89  static const unsigned short hxy2[ kXMAX ][ kYMAX ] ;
90  static const unsigned short hx2[ kXYMAX ] ;
91  static const unsigned short hy2[ kXYMAX ] ;
92 
93  public:
94 
96 
97 };
98 
99 std::ostream& operator<<(std::ostream&,const ESDetId& id);
100 
101 
102 #endif
static bool validDenseIndex(uint32_t din)
Definition: ESDetId.h:47
int strip() const
Definition: ESDetId.h:41
static const unsigned short hy2[kXYMAX]
Definition: ESDetId.h:91
static const unsigned short hxy2[kXMAX][kYMAX]
Definition: ESDetId.h:89
static const unsigned short hy1[kXYMAX]
Definition: ESDetId.h:87
static const int IY_MAX
Definition: ESDetId.h:60
int six() const
Definition: ESDetId.h:37
static const int ISTRIP_MAX
Definition: ESDetId.h:62
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
ESDetId & operator=(const DetId &id)
Definition: ESDetId.cc:72
static const int PLANE_MIN
Definition: ESDetId.h:63
int siy() const
Definition: ESDetId.h:39
static const int PLANE_MAX
Definition: ESDetId.h:64
ESDetId()
Definition: ESDetId.cc:6
int zside() const
Definition: ESDetId.h:33
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
static ESDetId detIdFromDenseIndex(uint32_t din)
Definition: ESDetId.h:49
uint32_t denseIndex() const
Definition: ESDetId.h:45
static const unsigned short hxy1[kXMAX][kYMAX]
Definition: ESDetId.h:85
Definition: DetId.h:20
static const int IY_MIN
Definition: ESDetId.h:58
static const int IZ_NUM
Definition: ESDetId.h:65
static const unsigned short hx2[kXYMAX]
Definition: ESDetId.h:90
uint32_t id_
Definition: DetId.h:57
static bool validDetId(int istrip, int ixs, int iys, int iplane, int iz)
check if a valid index combination
Definition: ESDetId.cc:50
static const int IX_MAX
Definition: ESDetId.h:59
int plane() const
Definition: ESDetId.h:35
static ESDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: ESDetId.cc:103
EcalSubdetector
EcalSubdetector subdet() const
get the subdetector
Definition: ESDetId.h:31
static const unsigned short hx1[kXYMAX]
Definition: ESDetId.h:86
static const int ISTRIP_MIN
Definition: ESDetId.h:61
static bool validHashIndex(int hi)
Definition: ESDetId.h:53
static const int IX_MIN
Definition: ESDetId.h:57
int hashedIndex() const
get a compact index for arrays [TODO: NEEDS WORK]
Definition: ESDetId.cc:85