Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-03-17 23:26:18

0001 #include "DQM/EcalCommon/interface/MESetDet0D.h"
0002 
0003 namespace ecaldqm {
0004   MESetDet0D::MESetDet0D(std::string const &_fullPath,
0005                          binning::ObjectType _otype,
0006                          binning::BinningType _btype,
0007                          MonitorElement::Kind _kind)
0008       : MESetEcal(_fullPath, _otype, _btype, _kind, 0, nullptr, nullptr) {
0009     switch (kind_) {
0010       case MonitorElement::Kind::REAL:
0011         break;
0012       default:
0013         throw_("Unsupported MonitorElement kind");
0014     }
0015   }
0016 
0017   MESetDet0D::MESetDet0D(MESetDet0D const &_orig) : MESetEcal(_orig) {}
0018 
0019   MESetDet0D::~MESetDet0D() {}
0020 
0021   MESet *MESetDet0D::clone(std::string const &_path /* = ""*/) const {
0022     std::string path(path_);
0023     if (!_path.empty())
0024       path_ = _path;
0025     MESet *copy(new MESetDet0D(*this));
0026     path_ = path;
0027     return copy;
0028   }
0029 
0030   void MESetDet0D::fill(EcalDQMSetupObjects const edso, DetId const &_id, double _value, double, double) {
0031     if (!active_)
0032       return;
0033 
0034     unsigned iME(binning::findPlotIndex(edso.electronicsMap, otype_, _id));
0035     checkME_(iME);
0036 
0037     mes_[iME]->Fill(_value);
0038   }
0039 
0040   void MESetDet0D::fill(EcalDQMSetupObjects const edso, EcalElectronicsId const &_id, double _value, double, double) {
0041     if (!active_)
0042       return;
0043 
0044     unsigned iME(binning::findPlotIndex(edso.electronicsMap, otype_, _id));
0045     checkME_(iME);
0046 
0047     mes_[iME]->Fill(_value);
0048   }
0049 
0050   void MESetDet0D::fill(EcalDQMSetupObjects const edso, int _dcctccid, double _value, double, double) {
0051     if (!active_)
0052       return;
0053 
0054     unsigned iME(binning::findPlotIndex(edso.electronicsMap, otype_, _dcctccid, btype_));
0055     checkME_(iME);
0056 
0057     mes_[iME]->Fill(_value);
0058   }
0059 
0060   double MESetDet0D::getBinContent(EcalDQMSetupObjects const edso, DetId const &_id, int) const {
0061     if (!active_)
0062       return 0.;
0063 
0064     unsigned iME(binning::findPlotIndex(edso.electronicsMap, otype_, _id));
0065     checkME_(iME);
0066 
0067     return mes_[iME]->getFloatValue();
0068   }
0069 
0070   double MESetDet0D::getBinContent(EcalDQMSetupObjects const edso, EcalElectronicsId const &_id, int) const {
0071     if (!active_)
0072       return 0.;
0073 
0074     unsigned iME(binning::findPlotIndex(edso.electronicsMap, otype_, _id));
0075     checkME_(iME);
0076 
0077     return mes_[iME]->getFloatValue();
0078   }
0079 
0080   double MESetDet0D::getBinContent(EcalDQMSetupObjects const edso, int _dcctccid, int) const {
0081     if (!active_)
0082       return 0.;
0083 
0084     unsigned iME(binning::findPlotIndex(edso.electronicsMap, otype_, _dcctccid, btype_));
0085     checkME_(iME);
0086 
0087     return mes_[iME]->getFloatValue();
0088   }
0089 
0090   void MESetDet0D::reset(EcalElectronicsMapping const *electronicsMap, double _value /* = 0.*/, double, double) {
0091     unsigned nME(mes_.size());
0092     for (unsigned iME(0); iME < nME; iME++)
0093       mes_[iME]->Fill(_value);
0094   }
0095 }  // namespace ecaldqm