Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:03:48

0001 #ifndef DATAFORMATS_CALOTOWERS_CALOTOWERDETID_H
0002 #define DATAFORMATS_CALOTOWERS_CALOTOWERDETID_H 1
0003 
0004 #include "DataFormats/DetId/interface/DetId.h"
0005 
0006 /** \class CaloTowerDetId
0007  *   
0008  * CaloTowerDetId uses DetId::Det of Calo and subdetId() of 1.
0009  *
0010  * \author J. Mans - Minnesota
0011  */
0012 class CaloTowerDetId : public DetId {
0013 public:
0014   /** Create a null cellid*/
0015   CaloTowerDetId();
0016   /** Create cellid from raw id (0=invalid tower id) */
0017   explicit CaloTowerDetId(uint32_t rawid);
0018   /** Constructor from signed tower ieta and iphi  */
0019   CaloTowerDetId(int tower_ieta, int tower_iphi);
0020   /** Constructor from a generic cell id */
0021   CaloTowerDetId(const DetId& id);
0022   /** Assignment from a generic cell id */
0023   CaloTowerDetId& operator=(const DetId& id);
0024 
0025   /// get the z-side of the tower (1/-1)
0026   int zside() const { return (id_ & 0x2000) ? (1) : (-1); }
0027   /// get the absolute value of the tower ieta
0028   int ietaAbs() const { return (id_ >> 7) & 0x3f; }
0029   /// get the tower ieta
0030   int ieta() const { return zside() * ietaAbs(); }
0031   /// get the tower iphi
0032   int iphi() const;
0033 
0034   static const int SubdetId = 1;
0035 };
0036 
0037 std::ostream& operator<<(std::ostream&, const CaloTowerDetId& id);
0038 
0039 #endif