Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef DATAFORMATS_HCALDIGI_HCALHISTOGRAMDIGI_H
0002 #define DATAFORMATS_HCALDIGI_HCALHISTOGRAMDIGI_H 1
0003 
0004 #include <ostream>
0005 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
0006 #include <cstdint>
0007 
0008 /** \class HcalHistogramDigi
0009   *  
0010   * \author J. Mans - Minnesota
0011   */
0012 class HcalHistogramDigi {
0013 public:
0014   typedef HcalDetId key_type;  ///< For the sorted collection
0015 
0016   HcalHistogramDigi();  // For persistence
0017   explicit HcalHistogramDigi(const HcalDetId& id);
0018 
0019   const HcalDetId& id() const { return id_; }
0020   /// get the contents of the specified bin for the specified capid (0-3)
0021   uint16_t get(int capid, int bin) const;
0022   /// get the contents of the specified bin summed over capids
0023   int getSum(int bin) const;
0024 
0025   /// get the array for the specified capid
0026   uint16_t* getArray(int capid);
0027 
0028   static const int BINS_PER_HISTOGRAM = 32;
0029 
0030 private:
0031   HcalDetId id_;
0032   uint16_t bins_[BINS_PER_HISTOGRAM * 4];
0033 };
0034 
0035 std::ostream& operator<<(std::ostream&, const HcalHistogramDigi& digi);
0036 
0037 #endif