Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:06:58

0001 /*
0002  * =====================================================================================
0003  *
0004  *       Filename:  MonitorObject.h
0005  *
0006  *    Description:  Monitor Object envelope
0007  *
0008  *        Version:  1.0
0009  *        Created:  10/06/2008 01:49:51 PM
0010  *       Revision:  none
0011  *       Compiler:  gcc
0012  *
0013  *         Author:  Valdas Rapsevicius, valdas.rapsevicius@cern.ch
0014  *        Company:  CERN, CH
0015  *
0016  * =====================================================================================
0017  */
0018 
0019 #ifndef CSCMonitorObject_H
0020 #define CSCMonitorObject_H
0021 
0022 #include "DQMServices/Core/interface/DQMStore.h"
0023 #include "CSCDQM_MonitorObject.h"
0024 
0025 /**
0026  * @class CSCMonitorObject
0027  * @brief cscdqm::MonitorObject implementation used in CSCMonitorModuleCmn
0028  */
0029 class CSCMonitorObject : public cscdqm::MonitorObject {
0030 protected:
0031   typedef dqm::legacy::DQMStore DQMStore;
0032   typedef dqm::legacy::MonitorElement MonitorElement;
0033 
0034 private:
0035   MonitorElement *me;
0036 
0037 public:
0038   CSCMonitorObject(MonitorElement *p_me) { me = p_me; }
0039   ~CSCMonitorObject() override {}
0040 
0041   void Fill(float x) override {
0042     cscdqm::LockType lock(mutex);
0043     me->Fill(x);
0044   }
0045 
0046   void Fill(float x, float yw) override {
0047     cscdqm::LockType lock(mutex);
0048     me->Fill(x, yw);
0049   }
0050 
0051   void Fill(float x, float y, float zw) override {
0052     cscdqm::LockType lock(mutex);
0053     me->Fill(x, y, zw);
0054   }
0055 
0056   void Fill(float x, float y, float z, float w) override {
0057     cscdqm::LockType lock(mutex);
0058     me->Fill(x, y, z, w);
0059   }
0060 
0061   void SetEntries(const double value) override {
0062     cscdqm::LockType lock(mutex);
0063     me->setEntries(value);
0064   }
0065 
0066   void SetBinContent(const int binX, const double value) override {
0067     cscdqm::LockType lock(mutex);
0068     me->setBinContent(binX, value);
0069   }
0070 
0071   void SetBinContent(const int binX, const int binY, const double value) override {
0072     cscdqm::LockType lock(mutex);
0073     me->setBinContent(binX, binY, value);
0074   }
0075 
0076   double GetBinContent(const int binX) override {
0077     cscdqm::LockType lock(mutex);
0078     double d = me->getBinContent(binX);
0079     return d;
0080   }
0081 
0082   double GetBinContent(const int binX, int binY) override {
0083     cscdqm::LockType lock(mutex);
0084     double d = me->getBinContent(binX, binY);
0085     return d;
0086   }
0087 
0088   void SetAxisRange(const double from, const double to, const std::string &axis) override {
0089     cscdqm::LockType lock(mutex);
0090     me->getTH1()->SetAxisRange(from, to, axis.c_str());
0091   }
0092 
0093   void setAxisTitle(const std::string title, const int axisN) override {
0094     cscdqm::LockType lock(mutex);
0095     me->setAxisTitle(title, axisN);
0096   }
0097 
0098   const int GetMaximumBin() override {
0099     cscdqm::LockType lock(mutex);
0100     int i = me->getTH1()->GetMaximumBin();
0101     return i;
0102   }
0103 
0104   void SetNormFactor(const double factor) override {
0105     cscdqm::LockType lock(mutex);
0106     me->getTH1()->SetNormFactor(factor);
0107   }
0108 
0109   const double GetEntries() override {
0110     cscdqm::LockType lock(mutex);
0111     double d = me->getTH1()->GetEntries();
0112     return d;
0113   }
0114 
0115   void SetMaximum(const double d) override {
0116     cscdqm::LockType lock(mutex);
0117     me->getTH1()->SetMaximum(d);
0118   }
0119 
0120   const TObject *getRefRootObject(void) const override { return nullptr; }
0121 
0122   const double GetBinError(const int bin) override {
0123     cscdqm::LockType lock(mutex);
0124     double d = me->getTH1()->GetBinError(bin);
0125     return d;
0126   }
0127 
0128   void SetBinError(const int bin, const double error) override {
0129     cscdqm::LockType lock(mutex);
0130     me->getTH1()->SetBinError(bin, error);
0131   }
0132 
0133   const TH1 *getTH1(void) const override { return me->getTH1(); }
0134 
0135   TH1 *getTH1Lock(void) override { return me->getTH1(); }
0136 };
0137 
0138 #endif