CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/DataFormats/HcalDetId/interface/HcalDetId.h

Go to the documentation of this file.
00001 #ifndef DATAFORMATS_HCALDETID_HCALDETID_H
00002 #define DATAFORMATS_HCALDETID_HCALDETID_H 1
00003 
00004 #include <iosfwd>
00005 #include "DataFormats/DetId/interface/DetId.h"
00006 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
00007 
00008 
00018 class HcalDetId : public DetId {
00019 public:
00021   HcalDetId();
00023   HcalDetId(uint32_t rawid);
00025   HcalDetId(HcalSubdetector subdet, int tower_ieta, int tower_iphi, int depth);
00027   HcalDetId(const DetId& id);
00029   HcalDetId& operator=(const DetId& id);
00030 
00032   HcalSubdetector subdet() const { return (HcalSubdetector)(subdetId()); }
00034   int zside() const { return (id_&0x2000)?(1):(-1); }
00036   int ietaAbs() const { return (id_>>7)&0x3f; }
00038   int ieta() const { return zside()*ietaAbs(); }
00040   int iphi() const { return id_&0x7F; }
00042   int depth() const { return (id_>>14)&0x1F; }
00044   int crystal_ieta_low() const { return ((ieta()-zside())*5)+zside(); }
00046   int crystal_ieta_high() const { return ((ieta()-zside())*5)+5*zside(); }
00048   int crystal_iphi_low() const; 
00050   int crystal_iphi_high() const;
00051 
00052   static const HcalDetId Undefined;
00053 
00054 };
00055 
00056 std::ostream& operator<<(std::ostream&,const HcalDetId& id);
00057 
00058 #endif