CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalCastorDetId.h
Go to the documentation of this file.
1 #ifndef HcalCastorDetId_h_included
2 #define HcalCastorDetId_h_included 1
3 
4 #include <ostream>
6 
23 class HcalCastorDetId : public DetId
24 {
25  public:
26 
27  enum Section { Unknown=0, EM=1, HAD=2 };
28 
29  // 1 => CaloTower, 2 => ZDC, 3 => Castor
30  static const int SubdetectorId = 3;
31 
34 
36  HcalCastorDetId(uint32_t rawid);
37 
40  bool true_for_positive_eta,
41  int sector,
42  int module);
43 
44  // constructor without section
45  HcalCastorDetId( bool true_for_positive_eta,
46  int sector,
47  int module );
48 
50  HcalCastorDetId(const DetId& id);
51 
53  HcalCastorDetId& operator=(const DetId& id);
54 
56  //int zside() const { return (id_&0x40)?(1):(-1); }
57  int zside() const { return 2*( ( id_ >> 8 ) & 0x1 ) - 1 ; }
58 
60  //Section section() const { return (Section)((id_>>7)&0x3); }
61  Section section() const ;
62 
64  //int module() const { return id_&0xF; }
65  int module() const { return ( id_ & 0xF ) ; }
66 
68  //int sector() const { return (id_>>6)&0x3; }
69  int sector() const { return ((id_ >> 4) & 0xF) + 1 ; }
70 
71  // get the individual cell id
72  // int channel() const;
73 
74  enum { kNumberModulesPerEnd = 14 ,
78 
79  uint32_t denseIndex() const ;
80 
81  static bool validDetId( Section iSection,
82  bool posEta,
83  int iSector,
84  int iMod ) ;
85 
86  static bool validDenseIndex( uint32_t din )
87  { return ( din < kSizeForDenseIndexing ) ; }
88 
89  static HcalCastorDetId detIdFromDenseIndex( uint32_t di ) ;
90 
91  private:
92 
93  void buildMe( Section section,
94  bool true_for_positive_eta,
95  int sector,
96  int module ) ;
97 };
98 
99 std::ostream& operator<<(std::ostream&,const HcalCastorDetId& id);
100 
101 
102 #endif // HcalCastorDetId_h_included
103 
static bool validDetId(Section iSection, bool posEta, int iSector, int iMod)
int sector() const
get the sector (1-16)
void buildMe(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)
uint32_t denseIndex() const
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
Section section() const
get the section
static HcalCastorDetId detIdFromDenseIndex(uint32_t di)
int zside() const
get the z-side of the cell (1/-1)
static bool validDenseIndex(uint32_t din)
static const int SubdetectorId
HcalCastorDetId & operator=(const DetId &id)
Definition: DetId.h:20
uint32_t id_
Definition: DetId.h:57
Definition: vlib.h:209