00001 #ifndef CALOSAMPLES_H 00002 #define CALOSAMPLES_H 1 00003 00004 #include <ostream> 00005 #include "DataFormats/DetId/interface/DetId.h" 00006 00015 class CaloSamples { 00016 public: 00017 CaloSamples(); 00018 explicit CaloSamples(const DetId& id, int size); 00019 00021 DetId id() const { return id_; } 00022 00024 int size() const { return size_; } 00026 double& operator[](int i) { return data_[i]; } 00028 double operator[](int i) const { return data_[i]; } 00029 00031 int presamples() const { return presamples_; } 00033 void setPresamples(int pre); 00034 00036 CaloSamples& scale(double value); 00038 CaloSamples& operator*=(double value) { return scale(value); } 00039 00041 CaloSamples& operator+=(double value); 00042 00043 void setDetId( DetId detId ) { id_ = detId ; } 00044 00045 void setSize( unsigned int size ) { size_ = size ; } 00046 00047 bool isBlank() const ; // are the samples blank (zero?) 00048 00049 void setBlank() ; // keep id, presamples, size but zero out data 00050 00051 static const int MAXSAMPLES=10; 00052 private: 00053 DetId id_; 00054 double data_[MAXSAMPLES]; // 00055 int size_, presamples_; 00056 }; 00057 00058 std::ostream& operator<<(std::ostream& s, const CaloSamples& samps); 00059 00060 #endif