Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "DQM/HcalCommon/interface/ContainerSingleProf2D.h"
0002 
0003 namespace hcaldqm {
0004   using namespace quantity;
0005   using namespace constants;
0006   ContainerSingleProf2D::ContainerSingleProf2D() {
0007     _qx = nullptr;
0008     _qy = nullptr;
0009     _qz = nullptr;
0010   }
0011 
0012   ContainerSingleProf2D::ContainerSingleProf2D(std::string const &folder, Quantity *qx, Quantity *qy, Quantity *qz)
0013       : ContainerSingle2D(folder, qx, qy, qz) {
0014     _qx->setAxisType(quantity::fXAxis);
0015     _qy->setAxisType(quantity::fYAxis);
0016     _qz->setAxisType(quantity::fZAxis);
0017   }
0018 
0019   /* virtual */ void ContainerSingleProf2D::initialize(
0020       std::string const &folder, Quantity *qx, Quantity *qy, Quantity *qz, int debug /*=0*/) {
0021     ContainerSingle2D::initialize(folder, qx, qy, qz, debug);
0022     _qx->setAxisType(quantity::fXAxis);
0023     _qy->setAxisType(quantity::fYAxis);
0024     _qz->setAxisType(quantity::fZAxis);
0025   }
0026 
0027   /* virtual */ void ContainerSingleProf2D::initialize(
0028       std::string const &folder, std::string const &qname, Quantity *qx, Quantity *qy, Quantity *qz, int debug /*=0*/) {
0029     ContainerSingle2D::initialize(folder, qname, qx, qy, qz, debug);
0030     _qx->setAxisType(quantity::fXAxis);
0031     _qy->setAxisType(quantity::fYAxis);
0032     _qz->setAxisType(quantity::fZAxis);
0033   }
0034 
0035   /* virtual */ void ContainerSingleProf2D::book(DQMStore::IBooker &ib, std::string subsystem, std::string aux) {
0036     ib.setCurrentFolder(subsystem + "/" + _folder + "/" + _qname);
0037     _me = ib.bookProfile2D(_qname + (aux.empty() ? aux : "_" + aux),
0038                            _qname + (aux.empty() ? aux : " " + aux),
0039                            _qx->nbins(),
0040                            _qx->min(),
0041                            _qx->max(),
0042                            _qy->nbins(),
0043                            _qy->min(),
0044                            _qy->max(),
0045                            _qz->min(),
0046                            _qz->max());
0047     customize();
0048   }
0049 
0050   /* virtual */ void ContainerSingleProf2D::fill(int x, int y) { _me->Fill(_qx->getValue(x), _qy->getValue(y)); }
0051 
0052   /* virtual */ void ContainerSingleProf2D::fill(int x, double y) { _me->Fill(_qx->getValue(x), _qy->getValue(y)); }
0053 
0054   /* virtual */ void ContainerSingleProf2D::fill(int x, double y, double z) {
0055     _me->Fill(_qx->getValue(x), _qy->getValue(y), _qz->getValue(z));
0056   }
0057 
0058   /* virtual */ void ContainerSingleProf2D::fill(double x, int y) { _me->Fill(_qx->getValue(x), _qy->getValue(y)); }
0059 
0060   /* virtual */ void ContainerSingleProf2D::fill(double x, double y) { _me->Fill(_qx->getValue(x), _qy->getValue(y)); }
0061 
0062   /* virtual */ void ContainerSingleProf2D::fill(double x, double y, double z) {
0063     _me->Fill(_qx->getValue(x), _qy->getValue(y), _qz->getValue(z));
0064   }
0065 
0066   /* virtual */ void ContainerSingleProf2D::fill(int x, int y, double z) {
0067     _me->Fill(_qx->getValue(x), _qy->getValue(y), _qz->getValue(z));
0068   }
0069 
0070   /* virtual */ void ContainerSingleProf2D::fill(int x, int y, int z) {
0071     _me->Fill(_qx->getValue(x), _qy->getValue(y), _qz->getValue(z));
0072   }
0073 
0074   /* virtual */ void ContainerSingleProf2D::fill(HcalDetId const &id) {
0075     _me->Fill(_qx->getValue(id), _qy->getValue(id));
0076   }
0077 
0078   /* virtual */ void ContainerSingleProf2D::fill(HcalDetId const &id, double x) {
0079     if (_qx->isCoordinate() && _qy->isCoordinate())
0080       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0081     else if (_qx->isCoordinate())
0082       _me->Fill(_qx->getValue(id), _qy->getValue(x));
0083     else if (_qy->isCoordinate())
0084       _me->Fill(_qx->getValue(x), _qy->getValue(id));
0085   }
0086 
0087   /* virtual */ void ContainerSingleProf2D::fill(HcalDetId const &id, int x) {
0088     if (_qx->isCoordinate() && _qy->isCoordinate())
0089       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0090     else if (_qx->isCoordinate())
0091       _me->Fill(_qx->getValue(id), _qy->getValue(x));
0092     else if (_qy->isCoordinate())
0093       _me->Fill(_qx->getValue(x), _qy->getValue(id));
0094   }
0095 
0096   /* virtual */ void ContainerSingleProf2D::fill(HcalDetId const &id, double x, double y) {
0097     if (_qx->isCoordinate() && _qy->isCoordinate())
0098       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0099     else if (_qx->isCoordinate() && !_qy->isCoordinate())
0100       _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
0101     else if (!_qx->isCoordinate() && _qy->isCoordinate())
0102       _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
0103   }
0104 
0105   /* virtual */ void ContainerSingleProf2D::fill(HcalDetId const &id, int x, int y) {
0106     if (_qx->isCoordinate() && _qy->isCoordinate())
0107       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0108     else if (_qx->isCoordinate() && !_qy->isCoordinate())
0109       _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
0110     else if (!_qx->isCoordinate() && _qy->isCoordinate())
0111       _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
0112   }
0113 
0114   /* virtual */ void ContainerSingleProf2D::fill(HcalDetId const &id, int x, double y) {
0115     if (_qx->isCoordinate() && _qy->isCoordinate())
0116       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0117     else if (_qx->isCoordinate() && !_qy->isCoordinate())
0118       _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
0119     else if (!_qx->isCoordinate() && _qy->isCoordinate())
0120       _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
0121   }
0122 
0123   /* virtual */ void ContainerSingleProf2D::fill(HcalElectronicsId const &id) {
0124     _me->Fill(_qx->getValue(id), _qy->getValue(id));
0125   }
0126 
0127   /* virtual */ void ContainerSingleProf2D::fill(HcalElectronicsId const &id, double x) {
0128     if (_qx->isCoordinate() && _qy->isCoordinate())
0129       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0130     else if (_qx->isCoordinate())
0131       _me->Fill(_qx->getValue(id), _qy->getValue(x));
0132     else if (_qy->isCoordinate())
0133       _me->Fill(_qx->getValue(x), _qy->getValue(id));
0134   }
0135 
0136   /* virtual */ void ContainerSingleProf2D::fill(HcalElectronicsId const &id, int x) {
0137     if (_qx->isCoordinate() && _qy->isCoordinate())
0138       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0139     else if (_qx->isCoordinate())
0140       _me->Fill(_qx->getValue(id), _qy->getValue(x));
0141     else if (_qy->isCoordinate())
0142       _me->Fill(_qx->getValue(x), _qy->getValue(id));
0143   }
0144 
0145   /* virtual */ void ContainerSingleProf2D::fill(HcalElectronicsId const &id, double x, double y) {
0146     if (_qx->isCoordinate() && _qy->isCoordinate())
0147       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0148     else if (_qx->isCoordinate() && !_qy->isCoordinate())
0149       _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
0150     else if (!_qx->isCoordinate() && _qy->isCoordinate())
0151       _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
0152   }
0153 
0154   /* virtual */ void ContainerSingleProf2D::fill(HcalElectronicsId const &id, int x, int y) {
0155     if (_qx->isCoordinate() && _qy->isCoordinate())
0156       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0157     else if (_qx->isCoordinate() && !_qy->isCoordinate())
0158       _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
0159     else if (!_qx->isCoordinate() && _qy->isCoordinate())
0160       _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
0161   }
0162 
0163   /* virtual */ void ContainerSingleProf2D::fill(HcalElectronicsId const &id, int x, double y) {
0164     if (_qx->isCoordinate() && _qy->isCoordinate())
0165       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0166     else if (_qx->isCoordinate() && !_qy->isCoordinate())
0167       _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
0168     else if (!_qx->isCoordinate() && _qy->isCoordinate())
0169       _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
0170   }
0171 
0172   /* virtual */ void ContainerSingleProf2D::fill(HcalTrigTowerDetId const &id) {
0173     _me->Fill(_qx->getValue(id), _qy->getValue(id));
0174   }
0175 
0176   /* virtual */ void ContainerSingleProf2D::fill(HcalTrigTowerDetId const &id, double x) {
0177     if (_qx->isCoordinate() && _qy->isCoordinate())
0178       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0179     else if (_qx->isCoordinate())
0180       _me->Fill(_qx->getValue(id), _qy->getValue(x));
0181     else if (_qy->isCoordinate())
0182       _me->Fill(_qx->getValue(x), _qy->getValue(id));
0183   }
0184 
0185   /* virtual */ void ContainerSingleProf2D::fill(HcalTrigTowerDetId const &id, int x) {
0186     if (_qx->isCoordinate() && _qy->isCoordinate())
0187       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0188     else if (_qx->isCoordinate())
0189       _me->Fill(_qx->getValue(id), _qy->getValue(x));
0190     else if (_qy->isCoordinate())
0191       _me->Fill(_qx->getValue(x), _qy->getValue(id));
0192   }
0193 
0194   /* virtual */ void ContainerSingleProf2D::fill(HcalTrigTowerDetId const &id, double x, double y) {
0195     if (_qx->isCoordinate() && _qy->isCoordinate())
0196       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0197     else if (_qx->isCoordinate() && !_qy->isCoordinate())
0198       _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
0199     else if (!_qx->isCoordinate() && _qy->isCoordinate())
0200       _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
0201   }
0202 
0203   /* virtual */ void ContainerSingleProf2D::fill(HcalTrigTowerDetId const &id, int x, int y) {
0204     if (_qx->isCoordinate() && _qy->isCoordinate())
0205       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0206     else if (_qx->isCoordinate() && !_qy->isCoordinate())
0207       _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
0208     else if (!_qx->isCoordinate() && _qy->isCoordinate())
0209       _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
0210   }
0211 
0212   /* virtual */ void ContainerSingleProf2D::fill(HcalTrigTowerDetId const &id, int x, double y) {
0213     if (_qx->isCoordinate() && _qy->isCoordinate())
0214       _me->Fill(_qx->getValue(id), _qy->getValue(id), x);
0215     else if (_qx->isCoordinate() && !_qy->isCoordinate())
0216       _me->Fill(_qx->getValue(id), _qy->getValue(x), y);
0217     else if (!_qx->isCoordinate() && _qy->isCoordinate())
0218       _me->Fill(_qx->getValue(x), _qy->getValue(id), y);
0219   }
0220 
0221   /* virtual */ void ContainerSingleProf2D::fill(HcalDetId const &did, HcalElectronicsId const &eid) {
0222     if (_qx->type() == fDetectorQuantity)
0223       _me->Fill(_qx->getValue(did), _qy->getValue(eid));
0224     else
0225       _me->Fill(_qx->getValue(eid), _qy->getValue(did));
0226   }
0227 
0228   /* virtual */ void ContainerSingleProf2D::fill(HcalDetId const &did, HcalElectronicsId const &eid, double x) {
0229     if (_qx->type() == fDetectorQuantity)
0230       _me->Fill(_qx->getValue(did), _qy->getValue(eid), x);
0231     else
0232       _me->Fill(_qx->getValue(eid), _qy->getValue(did), x);
0233   }
0234 
0235 }  // namespace hcaldqm