CMS 3D CMS Logo

Quantity.h
Go to the documentation of this file.
1 #ifndef Quantity_h
2 #define Quantity_h
3 
12 
13 namespace hcaldqm {
14  namespace quantity {
15  enum QuantityType {
21  fNone = 5,
23  };
24 
25  enum AxisType { fXAxis = 0, fYAxis = 1, fZAxis = 2, nAxisType = 3 };
26 
27  class Quantity {
28  public:
29  Quantity() : _name("Quantity"), _isLog(false), _showOverflow(false) {}
31  virtual ~Quantity() {}
32 
33  virtual QuantityType type() { return fNone; }
34  virtual std::string name() { return _name; }
35  virtual bool isLog() { return _isLog; }
36  virtual void setAxisType(AxisType at) { _axistype = at; }
37  virtual Quantity *makeCopy() { return new Quantity(_name, _isLog); }
38 
39  virtual uint32_t getBin(HcalDetId const &) { return 1; }
40  virtual uint32_t getBin(HcalElectronicsId const &) { return 1; }
41  virtual uint32_t getBin(HcalTrigTowerDetId const &) { return 1; }
42  virtual uint32_t getBin(int) { return 1; }
43  virtual uint32_t getBin(double) { return 1; }
44 
45  virtual int getValue(HcalDetId const &) { return 0; }
46  virtual int getValue(HcalElectronicsId const &) { return 0; }
47  virtual int getValue(HcalTrigTowerDetId const &) { return 0; }
48  virtual int getValue(int x) { return x; }
49  virtual double getValue(double x) { return x; }
50 
51  virtual void setBits(TH1 *o) { setLog(o); }
52  virtual void setLog(TH1 *o) {
53  if (_isLog)
54  o->SetBit(BIT(constants::BIT_OFFSET + _axistype));
55  }
56 
57  virtual int nbins() { return 1; }
58  virtual int wofnbins() { return nbins() + 2; }
59  virtual double min() { return 0; }
60  virtual double max() { return 1; }
61  virtual bool isCoordinate() { return false; }
62  virtual std::vector<std::string> getLabels() { return std::vector<std::string>(); }
63 
64  virtual void setMax(double) {}
65  virtual void setMin(double) {}
66  virtual void setNbins(int) {}
67 
69 
70  protected:
72  bool _isLog;
75  };
76  } // namespace quantity
77 } // namespace hcaldqm
78 
79 #endif
hcaldqm::quantity::Quantity::showOverflow
virtual void showOverflow(bool showOverflow)
Definition: Quantity.h:68
hcaldqm::quantity::Quantity::getBin
virtual uint32_t getBin(HcalTrigTowerDetId const &)
Definition: Quantity.h:41
funct::false
false
Definition: Factorize.h:29
hcaldqm::quantity::Quantity::getValue
virtual int getValue(int x)
Definition: Quantity.h:48
hcaldqm::quantity::fElectronicsQuantity
Definition: Quantity.h:17
hcaldqm::quantity::Quantity::setAxisType
virtual void setAxisType(AxisType at)
Definition: Quantity.h:36
hcaldqm
Definition: Constants.h:8
hcaldqm::quantity::Quantity::setBits
virtual void setBits(TH1 *o)
Definition: Quantity.h:51
hcaldqm::quantity::Quantity::~Quantity
virtual ~Quantity()
Definition: Quantity.h:31
hcaldqm::quantity::Quantity::getValue
virtual int getValue(HcalElectronicsId const &)
Definition: Quantity.h:46
hcaldqm::quantity::Quantity::getValue
virtual int getValue(HcalTrigTowerDetId const &)
Definition: Quantity.h:47
hcaldqm::quantity::Quantity::setMin
virtual void setMin(double)
Definition: Quantity.h:65
hcaldqm::quantity::Quantity::type
virtual QuantityType type()
Definition: Quantity.h:33
hcaldqm::quantity::Quantity::Quantity
Quantity(std::string const &name, bool isLog)
Definition: Quantity.h:30
Utilities.h
hcaldqm::constants::BIT_OFFSET
const int BIT_OFFSET
Definition: Constants.h:279
hcaldqm::quantity::fZAxis
Definition: Quantity.h:25
hcaldqm::quantity::Quantity::min
virtual double min()
Definition: Quantity.h:59
hcaldqm::quantity::Quantity::setNbins
virtual void setNbins(int)
Definition: Quantity.h:66
hcaldqm::quantity::AxisType
AxisType
Definition: Quantity.h:25
HcalCommonHeaders.h
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
hcaldqm::quantity::Quantity::getBin
virtual uint32_t getBin(HcalDetId const &)
Definition: Quantity.h:39
hcaldqm::quantity::Quantity::isLog
virtual bool isLog()
Definition: Quantity.h:35
hcaldqm::quantity::Quantity::nbins
virtual int nbins()
Definition: Quantity.h:57
hcaldqm::quantity::fDetectorQuantity
Definition: Quantity.h:16
hcaldqm::quantity::fNone
Definition: Quantity.h:21
hcaldqm::quantity::Quantity::getValue
virtual int getValue(HcalDetId const &)
Definition: Quantity.h:45
hcaldqm::quantity::Quantity::_showOverflow
bool _showOverflow
Definition: Quantity.h:74
HcalElectronicsId
Readout chain identification for Hcal.
Definition: HcalElectronicsId.h:32
hcaldqm::quantity::fValueQuantity
Definition: Quantity.h:19
hcaldqm::quantity::Quantity::wofnbins
virtual int wofnbins()
Definition: Quantity.h:58
hcaldqm::quantity::Quantity::setLog
virtual void setLog(TH1 *o)
Definition: Quantity.h:52
hcaldqm::quantity::Quantity::max
virtual double max()
Definition: Quantity.h:60
hcaldqm::quantity::fYAxis
Definition: Quantity.h:25
Constants.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
MjjMonitor_cfi.quantity
quantity
Definition: MjjMonitor_cfi.py:10
hcaldqm::quantity::Quantity::getLabels
virtual std::vector< std::string > getLabels()
Definition: Quantity.h:62
hcaldqm::quantity::nQuantityType
Definition: Quantity.h:22
hcaldqm::quantity::Quantity::name
virtual std::string name()
Definition: Quantity.h:34
hcaldqm::quantity::Quantity::getBin
virtual uint32_t getBin(double)
Definition: Quantity.h:43
hcaldqm::quantity::QuantityType
QuantityType
Definition: Quantity.h:15
hcaldqm::quantity::Quantity::Quantity
Quantity()
Definition: Quantity.h:29
hcaldqm::quantity::Quantity::getBin
virtual uint32_t getBin(HcalElectronicsId const &)
Definition: Quantity.h:40
HcalDetId
Definition: HcalDetId.h:12
hcaldqm::quantity::Quantity::getValue
virtual double getValue(double x)
Definition: Quantity.h:49
hcaldqm::quantity::nAxisType
Definition: Quantity.h:25
hcaldqm::quantity::Quantity
Definition: Quantity.h:27
hcaldqm::quantity::fTrigTowerQuantity
Definition: Quantity.h:18
hcaldqm::quantity::Quantity::setMax
virtual void setMax(double)
Definition: Quantity.h:64
hcaldqm::quantity::Quantity::_isLog
bool _isLog
Definition: Quantity.h:72
hcaldqm::quantity::fFlagQuantity
Definition: Quantity.h:20
hcaldqm::quantity::Quantity::makeCopy
virtual Quantity * makeCopy()
Definition: Quantity.h:37
hcaldqm::quantity::Quantity::isCoordinate
virtual bool isCoordinate()
Definition: Quantity.h:61
hcaldqm::quantity::fXAxis
Definition: Quantity.h:25
hcaldqm::quantity::Quantity::_axistype
AxisType _axistype
Definition: Quantity.h:73
hcaldqm::quantity::Quantity::_name
std::string _name
Definition: Quantity.h:71
hcaldqm::quantity::Quantity::getBin
virtual uint32_t getBin(int)
Definition: Quantity.h:42
HcalTrigTowerDetId
Definition: HcalTrigTowerDetId.h:14