Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:10:10

0001 #include "DQM/HcalCommon/interface/ContainerSingle2D.h"
0002 #include "DQM/HcalCommon/interface/Utilities.h"
0003 
0004 namespace hcaldqm {
0005   using namespace constants;
0006   using namespace quantity;
0007   ContainerSingle2D::ContainerSingle2D() {
0008     _qx = nullptr;
0009     _qy = nullptr;
0010     _qz = nullptr;
0011   }
0012 
0013   ContainerSingle2D::ContainerSingle2D(std::string const &folder, Quantity *qx, Quantity *qy, Quantity *qz)
0014       : Container(folder, qz->name() + "vs" + qy->name() + "vs" + qx->name()), _qx(qx), _qy(qy), _qz(qz) {
0015     _qx->setAxisType(quantity::fXAxis);
0016     _qy->setAxisType(quantity::fYAxis);
0017     _qz->setAxisType(quantity::fZAxis);
0018   }
0019 
0020   ContainerSingle2D::ContainerSingle2D(
0021       std::string const &folder, std::string const &qname, Quantity *qx, Quantity *qy, Quantity *qz, int debug /*=0*/)
0022       : Container(folder, qname), _qx(qx), _qy(qy), _qz(qz) {
0023     _qx->setAxisType(quantity::fXAxis);
0024     _qy->setAxisType(quantity::fYAxis);
0025     _qz->setAxisType(quantity::fZAxis);
0026   }
0027 
0028   ContainerSingle2D::ContainerSingle2D(ContainerSingle2D const &c) : Container(c._folder, c._qname) {
0029     _qx = c._qx->makeCopy();
0030     _qy = c._qy->makeCopy();
0031     _qz = c._qz->makeCopy();
0032   }
0033 
0034   ContainerSingle2D::~ContainerSingle2D() {
0035     if (_qx != nullptr)
0036       delete _qx;
0037     if (_qy != nullptr)
0038       delete _qy;
0039     if (_qz != nullptr)
0040       delete _qz;
0041     _qx = nullptr;
0042     _qy = nullptr;
0043     _qz = nullptr;
0044   }
0045 
0046   /* virtual */ void ContainerSingle2D::initialize(
0047       std::string const &folder, Quantity *qx, Quantity *qy, Quantity *qz, int debug /*=0*/) {
0048     Container::initialize(folder, qz->name() + "vs" + qy->name() + "vs" + qx->name(), debug);
0049     _qx = qx;
0050     _qy = qy;
0051     _qz = qz;
0052     _qx->setAxisType(quantity::fXAxis);
0053     _qy->setAxisType(quantity::fYAxis);
0054     _qz->setAxisType(quantity::fZAxis);
0055   }
0056 
0057   /* virtual */ void ContainerSingle2D::initialize(
0058       std::string const &folder, std::string const &qname, Quantity *qx, Quantity *qy, Quantity *qz, int debug /*=0*/) {
0059     Container::initialize(folder, qname, debug);
0060     _qx = qx;
0061     _qy = qy;
0062     _qz = qz;
0063     _qx->setAxisType(quantity::fXAxis);
0064     _qy->setAxisType(quantity::fYAxis);
0065     _qz->setAxisType(quantity::fZAxis);
0066   }
0067 
0068   /* virtual */ void ContainerSingle2D::book(DQMStore::IBooker &ib, std::string subsystem, std::string aux) {
0069     ib.setCurrentFolder(subsystem + "/" + _folder + "/" + _qname);
0070     _me = ib.book2D(_qname + (aux.empty() ? aux : "_" + aux),
0071                     _qname + (aux.empty() ? aux : " " + aux),
0072                     _qx->nbins(),
0073                     _qx->min(),
0074                     _qx->max(),
0075                     _qy->nbins(),
0076                     _qy->min(),
0077                     _qy->max());
0078     customize();
0079   }
0080 
0081   /* virtual */ void ContainerSingle2D::load(DQMStore::IGetter &ig, std::string subsystem, std::string aux) {
0082     _me = ig.get(subsystem + "/" + _folder + "/" + _qname + "/" + _qname + (aux.empty() ? aux : "_" + aux));
0083   }
0084 
0085   /* virtual */ void ContainerSingle2D::customize() {
0086     _me->setAxisTitle(_qx->name(), 1);
0087     _me->setAxisTitle(_qy->name(), 2);
0088     _me->setAxisTitle(_qz->name(), 3);
0089 
0090     TH1 *h = _me->getTH1();
0091     _qx->setBits(h);
0092     _qy->setBits(h);
0093     _qz->setBits(h);
0094 
0095     std::vector<std::string> xlabels = _qx->getLabels();
0096     std::vector<std::string> ylabels = _qy->getLabels();
0097     for (unsigned int i = 0; i < xlabels.size(); i++) {
0098       _me->setBinLabel(i + 1, xlabels[i], 1);
0099     }
0100     for (unsigned int i = 0; i < ylabels.size(); i++) {
0101       _me->setBinLabel(i + 1, ylabels[i], 2);
0102     }
0103   }
0104 
0105   /* virtual */ void ContainerSingle2D::fill(int x, int y) { _me->Fill(_qx->getValue(x), _qy->getValue(y)); }
0106 
0107   /* virtual */ void ContainerSingle2D::fill(int x, double y) { _me->Fill(_qx->getValue(x), _qy->getValue(y)); }
0108 
0109   /* virtual */ void ContainerSingle2D::fill(int x, double y, double z) {
0110     _me->Fill(_qx->getValue(x), _qy->getValue(y), z);
0111   }
0112 
0113   /* virtual */ void ContainerSingle2D::fill(double x, int y) { _me->Fill(_qx->getValue(x), _qy->getValue(y)); }
0114 
0115   /* virtual */ void ContainerSingle2D::fill(double x, double y) { _me->Fill(_qx->getValue(x), _qy->getValue(y)); }
0116 
0117   /* virtual */ void ContainerSingle2D::fill(double x, double y, double z) {
0118     _me->Fill(_qx->getValue(x), _qy->getValue(y), z);
0119   }
0120 
0121   /* virtual */ void ContainerSingle2D::fill(int x, int y, double z) {
0122     _me->Fill(_qx->getValue(x), _qy->getValue(y), z);
0123   }
0124 
0125   /* virtual */ void ContainerSingle2D::fill(int x, int y, int z) { _me->Fill(_qx->getValue(x), _qy->getValue(y), z); }
0126 
0127   /* virtual */ void ContainerSingle2D::fill(HcalDetId const &id) { _me->Fill(_qx->getValue(id), _qy->getValue(id)); }
0128 
0129   /* virtual */ double ContainerSingle2D::getBinContent(int x, int y) {
0130     return _me->getBinContent(_qx->getBin(x), _qy->getBin(y));
0131   }
0132   /* virtual */ double ContainerSingle2D::getBinContent(int x, double y) {
0133     return _me->getBinContent(_qx->getBin(x), _qy->getBin(y));
0134   }
0135   /* virtual */ double ContainerSingle2D::getBinContent(double x, int y) {
0136     return _me->getBinContent(_qx->getBin(x), _qy->getBin(y));
0137   }
0138   /* virtual */ double ContainerSingle2D::getBinContent(double x, double y) {
0139     return _me->getBinContent(_qx->getBin(x), _qy->getBin(y));
0140   }
0141   /* virtual */ double ContainerSingle2D::getBinEntries(int x, int y) {
0142     return _me->getBinEntries(_qx->getBin(x) + _qx->wofnbins() * _qy->getBin(y));
0143   }
0144   /* virtual */ double ContainerSingle2D::getBinEntries(int x, double y) {
0145     return _me->getBinEntries(_qx->getBin(x) + _qx->wofnbins() * _qy->getBin(y));
0146   }
0147   /* virtual */ double ContainerSingle2D::getBinEntries(double x, int y) {
0148     return _me->getBinEntries(_qx->getBin(x) + _qx->wofnbins() * _qy->getBin(y));
0149   }
0150   /* virtual */ double ContainerSingle2D::getBinEntries(double x, double y) {
0151     return _me->getBinEntries(_qx->getBin(x) + _qx->wofnbins() * _qy->getBin(y));
0152   }
0153 
0154   /* virtual */ void ContainerSingle2D::setBinContent(int x, int y, int z) {
0155     _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
0156   }
0157   /* virtual */ void ContainerSingle2D::setBinContent(int x, double y, int z) {
0158     _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
0159   }
0160   /* virtual */ void ContainerSingle2D::setBinContent(double x, int y, int z) {
0161     _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
0162   }
0163   /* virtual */ void ContainerSingle2D::setBinContent(double x, double y, int z) {
0164     _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
0165   }
0166   /* virtual */ void ContainerSingle2D::setBinContent(int x, int y, double z) {
0167     _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
0168   }
0169   /* virtual */ void ContainerSingle2D::setBinContent(int x, double y, double z) {
0170     _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
0171   }
0172   /* virtual */ void ContainerSingle2D::setBinContent(double x, int y, double z) {
0173     _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
0174   }
0175   /* virtual */ void ContainerSingle2D::setBinContent(double x, double y, double z) {
0176     _me->setBinContent(_qx->getBin(x), _qy->getBin(y), z);
0177   }
0178 
0179   /* virtual */ void ContainerSingle2D::fill(HcalDetId const &id, double x) {
0180     if (_qx->isCoordinate() && _qy->isCoordinate())
0181       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0182     else if (_qx->isCoordinate())
0183       _me->Fill(_qx->getValue(id), _qy->getValue(x));
0184     else if (_qy->isCoordinate())
0185       _me->Fill(_qx->getValue(x), _qy->getValue(id));
0186   }
0187 
0188   /* virtual */ void ContainerSingle2D::fill(HcalDetId const &id, int x) {
0189     if (_qx->isCoordinate() && _qy->isCoordinate())
0190       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0191     else if (_qx->isCoordinate())
0192       _me->Fill(_qx->getValue(id), _qy->getValue(x));
0193     else if (_qy->isCoordinate())
0194       _me->Fill(_qx->getValue(x), _qy->getValue(id));
0195   }
0196 
0197   /* virtual */ void ContainerSingle2D::fill(HcalDetId const &id, double x, double y) {
0198     if (_qx->isCoordinate() && _qy->isCoordinate())
0199       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0200     else if (_qx->isCoordinate() && !_qy->isCoordinate())
0201       _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
0202     else if (!_qx->isCoordinate() && _qy->isCoordinate())
0203       _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
0204   }
0205 
0206   /* virtual */ void ContainerSingle2D::fill(HcalDetId const &id, int x, int y) {
0207     if (_qx->isCoordinate() && _qy->isCoordinate())
0208       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0209     else if (_qx->isCoordinate() && !_qy->isCoordinate())
0210       _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
0211     else if (!_qx->isCoordinate() && _qy->isCoordinate())
0212       _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
0213   }
0214 
0215   /* virtual */ void ContainerSingle2D::fill(HcalDetId const &id, int x, double y) {
0216     if (_qx->isCoordinate() && _qy->isCoordinate())
0217       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0218     else if (_qx->isCoordinate() && !_qy->isCoordinate())
0219       _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
0220     else if (!_qx->isCoordinate() && _qy->isCoordinate())
0221       _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
0222   }
0223 
0224   /* virtula */ double ContainerSingle2D::getBinContent(HcalDetId const &id) {
0225     return _me->getBinContent(_qx->getBin(id), _qy->getBin(id));
0226   }
0227   /* virtual */ double ContainerSingle2D::getBinContent(HcalDetId const &id, int x) {
0228     if (_qx->isCoordinate())
0229       return _me->getBinContent(_qx->getBin(id), _qy->getBin(x));
0230     else
0231       return _me->getBinContent(_qx->getBin(x), _qy->getBin(id));
0232   }
0233   /* virtual */ double ContainerSingle2D::getBinContent(HcalDetId const &id, double x) {
0234     if (_qx->isCoordinate())
0235       return _me->getBinContent(_qx->getBin(id), _qy->getBin(x));
0236     else
0237       return _me->getBinContent(_qx->getBin(x), _qy->getBin(id));
0238   }
0239   /* virtula */ double ContainerSingle2D::getBinEntries(HcalDetId const &id) {
0240     return _me->getBinEntries(_qx->getBin(id) + _qx->wofnbins() * _qy->getBin(id));
0241   }
0242   /* virtual */ double ContainerSingle2D::getBinEntries(HcalDetId const &id, int x) {
0243     if (_qx->isCoordinate())
0244       return _me->getBinEntries(_qx->getBin(id) + _qx->wofnbins() * _qy->getBin(x));
0245     else
0246       return _me->getBinEntries(_qx->getBin(x) + _qx->wofnbins() * _qy->getBin(id));
0247   }
0248   /* virtual */ double ContainerSingle2D::getBinEntries(HcalDetId const &id, double x) {
0249     if (_qx->isCoordinate())
0250       return _me->getBinEntries(_qx->getBin(id) + _qx->wofnbins() * _qy->getBin(x));
0251     else
0252       return _me->getBinEntries(_qx->getBin(x) + _qx->wofnbins() * _qy->getBin(id));
0253   }
0254 
0255   /* virtual */ void ContainerSingle2D::setBinContent(HcalDetId const &id, int x) {
0256     _me->setBinContent(_qx->getBin(id), _qy->getBin(id), x);
0257   }
0258   /* virtual */ void ContainerSingle2D::setBinContent(HcalDetId const &id, double x) {
0259     _me->setBinContent(_qx->getBin(id), _qy->getBin(id), x);
0260   }
0261   /* virtual */ void ContainerSingle2D::setBinContent(HcalDetId const &id, int x, int y) {
0262     if (_qx->isCoordinate())
0263       _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
0264     else
0265       _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
0266   }
0267   /* virtual */ void ContainerSingle2D::setBinContent(HcalDetId const &id, int x, double y) {
0268     if (_qx->isCoordinate())
0269       _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
0270     else
0271       _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
0272   }
0273   /* virtual */ void ContainerSingle2D::setBinContent(HcalDetId const &id, double x, int y) {
0274     if (_qx->isCoordinate())
0275       _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
0276     else
0277       _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
0278   }
0279   /* virtual */ void ContainerSingle2D::setBinContent(HcalDetId const &id, double x, double y) {
0280     if (_qx->isCoordinate())
0281       _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
0282     else
0283       _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
0284   }
0285 
0286   //    by ElectronicsId
0287   /* virtual */ void ContainerSingle2D::fill(HcalElectronicsId const &id) {
0288     _me->Fill(_qx->getValue(id), _qy->getValue(id));
0289   }
0290 
0291   /* virtual */ void ContainerSingle2D::fill(HcalElectronicsId const &id, double x) {
0292     if (_qx->isCoordinate() && _qy->isCoordinate())
0293       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0294     else if (_qx->isCoordinate())
0295       _me->Fill(_qx->getValue(id), _qy->getValue(x));
0296     else if (_qy->isCoordinate())
0297       _me->Fill(_qx->getValue(x), _qy->getValue(id));
0298   }
0299 
0300   /* virtual */ void ContainerSingle2D::fill(HcalElectronicsId const &id, int x) {
0301     if (_qx->isCoordinate() && _qy->isCoordinate())
0302       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0303     else if (_qx->isCoordinate())
0304       _me->Fill(_qx->getValue(id), _qy->getValue(x));
0305     else if (_qy->isCoordinate())
0306       _me->Fill(_qx->getValue(x), _qy->getValue(id));
0307   }
0308 
0309   /* virtual */ void ContainerSingle2D::fill(HcalElectronicsId const &id, double x, double y) {
0310     if (_qx->isCoordinate() && _qy->isCoordinate())
0311       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0312     else if (_qx->isCoordinate() && !_qy->isCoordinate())
0313       _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
0314     else if (!_qx->isCoordinate() && _qy->isCoordinate())
0315       _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
0316   }
0317 
0318   /* virtual */ void ContainerSingle2D::fill(HcalElectronicsId const &id, int x, int y) {
0319     if (_qx->isCoordinate() && _qy->isCoordinate())
0320       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0321     else if (_qx->isCoordinate() && !_qy->isCoordinate())
0322       _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
0323     else if (!_qx->isCoordinate() && _qy->isCoordinate())
0324       _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
0325   }
0326 
0327   /* virtual */ void ContainerSingle2D::fill(HcalElectronicsId const &id, int x, double y) {
0328     if (_qx->isCoordinate() && _qy->isCoordinate())
0329       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0330     else if (_qx->isCoordinate() && !_qy->isCoordinate())
0331       _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
0332     else if (!_qx->isCoordinate() && _qy->isCoordinate())
0333       _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
0334   }
0335 
0336   /* virtula */ double ContainerSingle2D::getBinContent(HcalElectronicsId const &id) {
0337     return _me->getBinContent(_qx->getBin(id), _qy->getBin(id));
0338   }
0339   /* virtual */ double ContainerSingle2D::getBinContent(HcalElectronicsId const &id, int x) {
0340     if (_qx->isCoordinate())
0341       return _me->getBinContent(_qx->getBin(id), _qy->getBin(x));
0342     else
0343       return _me->getBinContent(_qx->getBin(x), _qy->getBin(id));
0344   }
0345   /* virtual */ double ContainerSingle2D::getBinContent(HcalElectronicsId const &id, double x) {
0346     if (_qx->isCoordinate())
0347       return _me->getBinContent(_qx->getBin(id), _qy->getBin(x));
0348     else
0349       return _me->getBinContent(_qx->getBin(x), _qy->getBin(id));
0350   }
0351   /* virtula */ double ContainerSingle2D::getBinEntries(HcalElectronicsId const &id) {
0352     return _me->getBinEntries(_qx->getBin(id) + _qx->wofnbins() * _qy->getBin(id));
0353   }
0354   /* virtual */ double ContainerSingle2D::getBinEntries(HcalElectronicsId const &id, int x) {
0355     if (_qx->isCoordinate())
0356       return _me->getBinEntries(_qx->getBin(id) + _qx->wofnbins() * _qy->getBin(x));
0357     else
0358       return _me->getBinEntries(_qx->getBin(x) + _qx->wofnbins() * _qy->getBin(id));
0359   }
0360   /* virtual */ double ContainerSingle2D::getBinEntries(HcalElectronicsId const &id, double x) {
0361     if (_qx->isCoordinate())
0362       return _me->getBinEntries(_qx->getBin(id) + _qx->wofnbins() * _qy->getBin(x));
0363     else
0364       return _me->getBinEntries(_qx->getBin(x) + _qx->wofnbins() * _qy->getBin(id));
0365   }
0366 
0367   /* virtual */ void ContainerSingle2D::setBinContent(HcalElectronicsId const &id, int x) {
0368     _me->setBinContent(_qx->getBin(id), _qy->getBin(id), x);
0369   }
0370   /* virtual */ void ContainerSingle2D::setBinContent(HcalElectronicsId const &id, double x) {
0371     _me->setBinContent(_qx->getBin(id), _qy->getBin(id), x);
0372   }
0373   /* virtual */ void ContainerSingle2D::setBinContent(HcalElectronicsId const &id, int x, int y) {
0374     if (_qx->isCoordinate())
0375       _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
0376     else
0377       _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
0378   }
0379   /* virtual */ void ContainerSingle2D::setBinContent(HcalElectronicsId const &id, int x, double y) {
0380     if (_qx->isCoordinate())
0381       _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
0382     else
0383       _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
0384   }
0385   /* virtual */ void ContainerSingle2D::setBinContent(HcalElectronicsId const &id, double x, int y) {
0386     if (_qx->isCoordinate())
0387       _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
0388     else
0389       _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
0390   }
0391   /* virtual */ void ContainerSingle2D::setBinContent(HcalElectronicsId const &id, double x, double y) {
0392     if (_qx->isCoordinate())
0393       _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
0394     else
0395       _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
0396   }
0397 
0398   //    by TrigTowerDetId
0399   /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const &id) {
0400     _me->Fill(_qx->getValue(id), _qy->getValue(id));
0401   }
0402 
0403   /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const &id, double x) {
0404     if (_qx->isCoordinate() && _qy->isCoordinate())
0405       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0406     else if (_qx->isCoordinate())
0407       _me->Fill(_qx->getValue(id), _qy->getValue(x));
0408     else if (_qy->isCoordinate())
0409       _me->Fill(_qx->getValue(x), _qy->getValue(id));
0410   }
0411 
0412   /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const &id, int x) {
0413     if (_qx->isCoordinate() && _qy->isCoordinate())
0414       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0415     else if (_qx->isCoordinate())
0416       _me->Fill(_qx->getValue(id), _qy->getValue(x));
0417     else if (_qy->isCoordinate())
0418       _me->Fill(_qx->getValue(x), _qy->getValue(id));
0419   }
0420 
0421   /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const &id, double x, double y) {
0422     if (_qx->isCoordinate() && _qy->isCoordinate())
0423       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0424     else if (_qx->isCoordinate() && !_qy->isCoordinate())
0425       _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
0426     else if (!_qx->isCoordinate() && _qy->isCoordinate())
0427       _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
0428   }
0429 
0430   /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const &id, int x, int y) {
0431     if (_qx->isCoordinate() && _qy->isCoordinate())
0432       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0433     else if (_qx->isCoordinate() && !_qy->isCoordinate())
0434       _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
0435     else if (!_qx->isCoordinate() && _qy->isCoordinate())
0436       _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
0437   }
0438 
0439   /* virtual */ void ContainerSingle2D::fill(HcalTrigTowerDetId const &id, int x, double y) {
0440     if (_qx->isCoordinate() && _qy->isCoordinate())
0441       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0442     else if (_qx->isCoordinate() && !_qy->isCoordinate())
0443       _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
0444     else if (!_qx->isCoordinate() && _qy->isCoordinate())
0445       _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
0446   }
0447 
0448   /* virtual */ void ContainerSingle2D::fill(HcalDetId const &did, HcalElectronicsId const &eid) {
0449     if (_qx->type() == fDetectorQuantity)
0450       _me->Fill(_qx->getValue(did), _qy->getValue(eid));
0451     else
0452       _me->Fill(_qx->getValue(eid), _qy->getValue(did));
0453   }
0454 
0455   /* virtual */ void ContainerSingle2D::fill(HcalDetId const &did, HcalElectronicsId const &eid, double x) {
0456     if (_qx->type() == fDetectorQuantity)
0457       _me->Fill(_qx->getValue(did), _qy->getValue(eid), x);
0458     else
0459       _me->Fill(_qx->getValue(eid), _qy->getValue(did), x);
0460   }
0461 
0462   /* virtula */ double ContainerSingle2D::getBinContent(HcalTrigTowerDetId const &id) {
0463     return _me->getBinContent(_qx->getBin(id), _qy->getBin(id));
0464   }
0465   /* virtual */ double ContainerSingle2D::getBinContent(HcalTrigTowerDetId const &id, int x) {
0466     if (_qx->isCoordinate())
0467       return _me->getBinContent(_qx->getBin(id), _qy->getBin(x));
0468     else
0469       return _me->getBinContent(_qx->getBin(x), _qy->getBin(id));
0470   }
0471   /* virtual */ double ContainerSingle2D::getBinContent(HcalTrigTowerDetId const &id, double x) {
0472     if (_qx->isCoordinate())
0473       return _me->getBinContent(_qx->getBin(id), _qy->getBin(x));
0474     else
0475       return _me->getBinContent(_qx->getBin(x), _qy->getBin(id));
0476   }
0477   /* virtula */ double ContainerSingle2D::getBinEntries(HcalTrigTowerDetId const &id) {
0478     return _me->getBinEntries(_qx->getBin(id) + _qx->wofnbins() * _qy->getBin(id));
0479   }
0480   /* virtual */ double ContainerSingle2D::getBinEntries(HcalTrigTowerDetId const &id, int x) {
0481     if (_qx->isCoordinate())
0482       return _me->getBinEntries(_qx->getBin(id) + _qx->wofnbins() * _qy->getBin(x));
0483     else
0484       return _me->getBinEntries(_qx->getBin(x) + _qx->wofnbins() * _qy->getBin(id));
0485   }
0486   /* virtual */ double ContainerSingle2D::getBinEntries(HcalTrigTowerDetId const &id, double x) {
0487     if (_qx->isCoordinate())
0488       return _me->getBinEntries(_qx->getBin(id) + _qx->wofnbins() * _qy->getBin(x));
0489     else
0490       return _me->getBinEntries(_qx->getBin(x) + _qx->wofnbins() * _qy->getBin(id));
0491   }
0492 
0493   /* virtual */ void ContainerSingle2D::setBinContent(HcalTrigTowerDetId const &id, int x) {
0494     _me->setBinContent(_qx->getBin(id), _qy->getBin(id), x);
0495   }
0496   /* virtual */ void ContainerSingle2D::setBinContent(HcalTrigTowerDetId const &id, double x) {
0497     _me->setBinContent(_qx->getBin(id), _qy->getBin(id), x);
0498   }
0499   /* virtual */ void ContainerSingle2D::setBinContent(HcalTrigTowerDetId const &id, int x, int y) {
0500     if (_qx->isCoordinate())
0501       _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
0502     else
0503       _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
0504   }
0505   /* virtual */ void ContainerSingle2D::setBinContent(HcalTrigTowerDetId const &id, int x, double y) {
0506     if (_qx->isCoordinate())
0507       _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
0508     else
0509       _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
0510   }
0511   /* virtual */ void ContainerSingle2D::setBinContent(HcalTrigTowerDetId const &id, double x, int y) {
0512     if (_qx->isCoordinate())
0513       _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
0514     else
0515       _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
0516   }
0517   /* virtual */ void ContainerSingle2D::setBinContent(HcalTrigTowerDetId const &id, double x, double y) {
0518     if (_qx->isCoordinate())
0519       _me->setBinContent(_qx->getBin(id), _qy->getBin(x), y);
0520     else
0521       _me->setBinContent(_qx->getBin(x), _qy->getBin(id), y);
0522   }
0523 
0524   /* virtual */ void ContainerSingle2D::extendAxisRange(int l) {
0525     if (l < _qx->nbins())
0526       return;
0527 
0528     int x = _qx->nbins();
0529     while (l >= x) {
0530       _me->getTH1()->LabelsInflate();
0531       x *= 2;
0532       _qx->setMax(x);
0533     }
0534   }
0535 
0536   void ContainerSingle2D::showOverflowZ(bool showOverflow) { _qz->showOverflow(showOverflow); }
0537 }  // namespace hcaldqm