Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:58:11

0001 #ifndef INTEGERCALOSAMPLES_H
0002 #define INTEGERCALOSAMPLES_H 1
0003 
0004 #include "DataFormats/DetId/interface/DetId.h"
0005 #include <ostream>
0006 
0007 /** \class IntegerCaloSamples
0008 
0009 Class which represents the linear charge/voltage measurements of an
0010 event/channel, but with defined resolution.
0011 
0012 This class uses 32-bit bins, so users should be careful if their
0013 calculation implies fewer bins.
0014 
0015 */
0016 class IntegerCaloSamples {
0017 public:
0018   IntegerCaloSamples();
0019   explicit IntegerCaloSamples(const DetId &id, int size);
0020 
0021   /// get the (generic) id
0022   DetId id() const { return id_; }
0023 
0024   /// get the size
0025   int size() const { return size_; }
0026   /// mutable operator to access samples
0027   uint32_t &operator[](int i) { return data_[i]; }
0028   /// const operator to access samples
0029   uint32_t operator[](int i) const { return data_[i]; }
0030 
0031   /// access presample information
0032   int presamples() const { return presamples_; }
0033   /// set presample information
0034   void setPresamples(int pre);
0035 
0036   static const int MAXSAMPLES = 10;
0037 
0038 private:
0039   DetId id_;
0040   uint32_t data_[MAXSAMPLES];  //
0041   int size_, presamples_;
0042 };
0043 
0044 std::ostream &operator<<(std::ostream &s, const IntegerCaloSamples &samps);
0045 
0046 #endif