Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:38:53

0001 #ifndef ECALPNDIODEDIGI_H
0002 #define ECALPNDIODEDIGI_H 1
0003 
0004 #include <ostream>
0005 #include <vector>
0006 #include "DataFormats/EcalDetId/interface/EcalPnDiodeDetId.h"
0007 #include "DataFormats/EcalDigi/interface/EcalFEMSample.h"
0008 
0009 /** \class EcalPnDiodeDigi
0010       
0011 */
0012 
0013 class EcalPnDiodeDigi {
0014 public:
0015   typedef EcalPnDiodeDetId key_type;  ///< For the sorted collection
0016 
0017   EcalPnDiodeDigi();  // for persistence
0018   explicit EcalPnDiodeDigi(const EcalPnDiodeDetId& id);
0019 
0020   const EcalPnDiodeDetId& id() const { return id_; }
0021   int size() const { return size_; }
0022 
0023   const EcalFEMSample& operator[](int i) const { return data_[i]; }
0024   const EcalFEMSample& sample(int i) const { return data_[i]; }
0025 
0026   void setSize(int size);
0027   void setSample(int i, const EcalFEMSample& sam) { data_[i] = sam; }
0028 
0029   static const int MAXSAMPLES = 50;
0030 
0031 private:
0032   EcalPnDiodeDetId id_;
0033   int size_;
0034   std::vector<EcalFEMSample> data_;
0035 };
0036 
0037 std::ostream& operator<<(std::ostream& s, const EcalPnDiodeDigi& digi);
0038 
0039 #endif