Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:35

0001 #ifndef DataFormats_HcalDetId_HcalZDCDetId_h_included
0002 #define DataFormats_HcalDetId_HcalZDCDetId_h_included 1
0003 
0004 #include <ostream>
0005 #include "DataFormats/DetId/interface/DetId.h"
0006 
0007 /** \class HcalZDCDetId
0008   *  
0009   *  Contents of the HcalZDCDetId :
0010   *     [7]   Set for RPD
0011   *     [6]   Z position (true for positive)
0012   *     [5:4] Section (EM/HAD/Lumi)
0013   *     [3:0] Channel
0014   *
0015   */
0016 class HcalZDCDetId : public DetId {
0017 public:
0018   static const int kZDCChannelMask = 0xF;
0019   static const int kZDCSectionMask = 0x3;
0020   static const int kZDCSectionOffset = 4;
0021   static const int kZDCZsideMask = 0x40;
0022   static const int kZDCRPDMask = 0x80;
0023   enum Section { Unknown = 0, EM = 1, HAD = 2, LUM = 3, RPD = 4 };
0024 
0025   static const int SubdetectorId = 2;
0026 
0027   /** Create a null cellid*/
0028   HcalZDCDetId();
0029   /** Create cellid from raw id (0=invalid tower id) */
0030   HcalZDCDetId(uint32_t rawid);
0031   /** Constructor from section, eta sign, and channel */
0032   HcalZDCDetId(Section section, bool true_for_positive_eta, int channel);
0033   /** Constructor from a generic cell id */
0034   HcalZDCDetId(const DetId& id);
0035   /** Assignment from a generic cell id */
0036   HcalZDCDetId& operator=(const DetId& id);
0037 
0038   /// get the z-side of the cell (1/-1)
0039   int zside() const { return ((id_ & kZDCZsideMask) ? (1) : (-1)); }
0040   /// get the section
0041   Section section() const;
0042   /// get the depth (1 for EM, channel + 1 for HAD, 2 for RPD, not sure yet for LUM, leave as default)
0043   int depth() const;
0044   /// get the channel
0045   int channel() const;
0046 
0047   uint32_t denseIndex() const;
0048 
0049   static bool validDenseIndex(uint32_t di) { return (di < kSizeForDenseIndexing); }
0050 
0051   static HcalZDCDetId detIdFromDenseIndex(uint32_t di);
0052 
0053   static bool validDetId(Section se, int dp);
0054 
0055 private:
0056   enum {
0057     kDepEM = 5,
0058     kDepHAD = 4,
0059     kDepLUM = 2,
0060     kDepRPD = 16,
0061     kDepRun1 = kDepEM + kDepHAD + kDepLUM,
0062     kDepTot = kDepRun1 + kDepRPD
0063   };
0064 
0065 public:
0066   enum { kSizeForDenseIndexing = 2 * kDepRun1 };
0067 };
0068 
0069 std::ostream& operator<<(std::ostream&, const HcalZDCDetId& id);
0070 
0071 #endif  // DataFormats_HcalDetId_HcalZDCDetId_h_included