CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalDetId.h
Go to the documentation of this file.
1 #ifndef DATAFORMATS_HCALDETID_HCALDETID_H
2 #define DATAFORMATS_HCALDETID_HCALDETID_H 1
3 
4 #include <iosfwd>
7 
8 
18 class HcalDetId : public DetId {
19 public:
21  HcalDetId();
23  HcalDetId(uint32_t rawid);
25  HcalDetId(HcalSubdetector subdet, int tower_ieta, int tower_iphi, int depth);
27  HcalDetId(const DetId& id);
29  HcalDetId& operator=(const DetId& id);
30 
34  int zside() const { return (id_&0x2000)?(1):(-1); }
36  int ietaAbs() const { return (id_>>7)&0x3f; }
38  int ieta() const { return zside()*ietaAbs(); }
40  int iphi() const { return id_&0x7F; }
42  int depth() const { return (id_>>14)&0x1F; }
44  int crystal_ieta_low() const { return ((ieta()-zside())*5)+zside(); }
46  int crystal_ieta_high() const { return ((ieta()-zside())*5)+5*zside(); }
48  int crystal_iphi_low() const;
50  int crystal_iphi_high() const;
51 
52  static bool validDetId( HcalSubdetector subdet,
53  int tower_ieta,
54  int tower_iphi,
55  int depth ) ;
56 
57  // get the hashed index
58  int hashed_index() const;
59 
60  uint32_t denseIndex() const { return hashed_index() ; }
61 
62  static bool validDenseIndex( uint32_t din ) { return ( din < kSizeForDenseIndexing ) ; }
63 
64  static HcalDetId detIdFromDenseIndex( uint32_t di ) ;
65 
66  static const HcalDetId Undefined;
67 
68  private:
69 
70  enum { kHBhalf = 1296 ,
71  kHEhalf = 1296 ,
72  kHOhalf = 1080 ,
73  kHFhalf = 864 ,
75 
76  public:
77 
79 
80 };
81 
82 std::ostream& operator<<(std::ostream&,const HcalDetId& id);
83 
84 #endif
static const HcalDetId Undefined
Definition: HcalDetId.h:66
HcalDetId & operator=(const DetId &id)
Definition: HcalDetId.cc:33
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:32
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalDetId.h:34
int crystal_iphi_low() const
get the smallest crystal_iphi of the crystal in front of this tower (HB and HE tower 17 only) ...
Definition: HcalDetId.cc:47
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
static bool validDetId(HcalSubdetector subdet, int tower_ieta, int tower_iphi, int depth)
Definition: HcalDetId.cc:70
HcalDetId()
Definition: HcalDetId.cc:7
int depth() const
get the tower depth
Definition: HcalDetId.h:42
static HcalDetId detIdFromDenseIndex(uint32_t di)
Definition: HcalDetId.cc:155
int crystal_ieta_low() const
get the smallest crystal_ieta of the crystal in front of this tower (HB and HE tower 17 only) ...
Definition: HcalDetId.h:44
int ieta() const
get the cell ieta
Definition: HcalDetId.h:38
HcalSubdetector
Definition: HcalAssistant.h:32
static bool validDenseIndex(uint32_t din)
Definition: HcalDetId.h:62
uint32_t denseIndex() const
Definition: HcalDetId.h:60
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.h:36
int iphi() const
get the cell iphi
Definition: HcalDetId.h:40
Definition: DetId.h:20
uint32_t id_
Definition: DetId.h:57
int crystal_ieta_high() const
get the largest crystal_ieta of the crystal in front of this tower (HB and HE tower 17 only) ...
Definition: HcalDetId.h:46
int crystal_iphi_high() const
get the largest crystal_iphi of the crystal in front of this tower (HB and HE tower 17 only) ...
Definition: HcalDetId.cc:53
int hashed_index() const
Definition: HcalDetId.cc:119