Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef CALOTSAMPLESBASE_H
0002 #define CALOTSAMPLESBASE_H 1
0003 
0004 #include "DataFormats/DetId/interface/DetId.h"
0005 #include <cassert>
0006 #include <ostream>
0007 
0008 template <class Ttype>
0009 class CaloTSamplesBase {
0010 public:
0011   CaloTSamplesBase(Ttype *mydata, uint32_t size);
0012 
0013   CaloTSamplesBase(const CaloTSamplesBase<Ttype> &cs);
0014 
0015   CaloTSamplesBase(Ttype *mydata, uint32_t length, const DetId &id, uint32_t size, uint32_t pre);
0016 
0017   virtual ~CaloTSamplesBase();
0018 
0019   void setZero();
0020 
0021   DetId id() const;
0022   uint32_t size() const;
0023   uint32_t pre() const;
0024   bool zero() const;
0025 
0026   Ttype &operator[](uint32_t i);
0027 
0028   const Ttype &operator[](uint32_t i) const;
0029 
0030   CaloTSamplesBase<Ttype> &operator=(const CaloTSamplesBase<Ttype> &cs);
0031 
0032   CaloTSamplesBase<Ttype> &operator*=(Ttype value);
0033 
0034   CaloTSamplesBase<Ttype> &operator+=(Ttype value);
0035 
0036   CaloTSamplesBase<Ttype> &operator+=(const CaloTSamplesBase<Ttype> &cs);
0037 
0038   virtual uint32_t capacity() const = 0;
0039 
0040 private:
0041   virtual Ttype *data(uint32_t i) = 0;
0042   virtual const Ttype *cdata(uint32_t i) const = 0;
0043 
0044   DetId m_id;
0045   uint32_t m_size;
0046   uint32_t m_pre;
0047 };
0048 
0049 template <class Ttype>
0050 std::ostream &operator<<(std::ostream &s, const CaloTSamplesBase<Ttype> &sam);
0051 
0052 #endif