CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/CalibFormats/CaloObjects/interface/CaloSamples.h

Go to the documentation of this file.
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 
00044   // between values
00045   CaloSamples& offsetTime(double offset);
00046 
00047   void setDetId( DetId detId ) { id_ = detId ; }
00048 
00049   void setSize( unsigned int size ) { size_ = size ; }
00050 
00051   bool isBlank() const ; // are the samples blank (zero?)
00052 
00053   void setBlank() ; // keep id, presamples, size but zero out data
00054 
00055   static const int MAXSAMPLES=10;
00056 private:
00057   DetId id_;
00058   double data_[MAXSAMPLES]; // 
00059   int size_, presamples_;
00060 };
00061 
00062 std::ostream& operator<<(std::ostream& s, const CaloSamples& samps);
00063 
00064 #endif