Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:06

0001 #ifndef SimG4CMS_HGCalTestBeam_AHCALDETID_H
0002 #define SimG4CMS_HGCalTestBeam_AHCALDETID_H 1
0003 
0004 #include <iosfwd>
0005 #include "DataFormats/DetId/interface/DetId.h"
0006 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
0007 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
0008 
0009 /** \class AHCalDetId
0010  *  Cell identifier class for the HCAL subdetectors, precision readout cells
0011  * only
0012  */
0013 class AHCalDetId : public DetId {
0014 public:
0015   /** Create a null cellid*/
0016   AHCalDetId();
0017   /** Create cellid from raw id (0=invalid tower id) */
0018   AHCalDetId(uint32_t rawid);
0019   /** Constructor from subdetector, signed tower ieta,iphi,and depth */
0020   AHCalDetId(int row, int col, int depth);
0021   /** Constructor from a generic cell id */
0022   AHCalDetId(const DetId& id);
0023   /** Assignment from a generic cell id */
0024   AHCalDetId& operator=(const DetId& id) {
0025     id_ = id.rawId();
0026     return *this;
0027   }
0028 
0029   /// get the subdetector
0030   HcalSubdetector subdet() const { return HcalOther; }
0031   /// get the z-side of the cell (1/-1)
0032   int zside() const { return 1; }
0033   /// get the row number
0034   int irow() const;
0035   int irowAbs() const { return ((id_ >> HcalDetId::kHcalEtaOffset1) & HcalDetId::kHcalEtaMask1); }
0036   /// get the column number
0037   int icol() const;
0038   int icolAbs() const { return (id_ & HcalDetId::kHcalPhiMask1); }
0039   /// get the layer number
0040   int depth() const;
0041 
0042   static const AHCalDetId Undefined;
0043 
0044 private:
0045   static constexpr int kMaxRowCol = 16;
0046   static constexpr uint32_t kHcalDepthMask = 0x3F;
0047 };
0048 
0049 std::ostream& operator<<(std::ostream&, const AHCalDetId& id);
0050 
0051 #endif