CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/DQM/EcalCommon/src/MESetDet0D.cc

Go to the documentation of this file.
00001 #include "DQM/EcalCommon/interface/MESetDet0D.h"
00002 
00003 #include "FWCore/Utilities/interface/Exception.h"
00004 
00005 namespace ecaldqm
00006 {
00007 
00008   MESetDet0D::MESetDet0D(std::string const& _fullpath, MEData const& _data, bool _readOnly/* = false*/) :
00009     MESetEcal(_fullpath, _data, 0, _readOnly)
00010   {
00011   }
00012 
00013   MESetDet0D::~MESetDet0D()
00014   {
00015   }
00016 
00017   void
00018   MESetDet0D::fill(DetId const& _id, double _value, double, double)
00019   {
00020     unsigned offset(binService_->findOffset(data_->otype, _id));
00021     if(offset >= mes_.size() || !mes_[offset])
00022       throw cms::Exception("InvalidCall") << "ME array index overflow" << std::endl;
00023 
00024     mes_[offset]->Fill(_value);
00025   }
00026 
00027   void
00028   MESetDet0D::fill(unsigned _dcctccid, double _value, double, double)
00029   {
00030     unsigned offset(binService_->findOffset(data_->otype, data_->btype, _dcctccid));
00031     if(offset >= mes_.size() || !mes_[offset])
00032       throw cms::Exception("InvalidCall") << "ME array index overflow" << offset << std::endl;
00033 
00034     mes_[offset]->Fill(_value);
00035   }
00036 
00037   void
00038   MESetDet0D::fill(double _value, double, double)
00039   {
00040     if(!(data_->otype == BinService::kEcal && mes_.size() == 1))
00041       throw cms::Exception("InvalidCall") << "ME type incompatible";
00042 
00043     mes_[0]->Fill(_value);
00044   }
00045 
00046 }