CMS 3D CMS Logo

DetectorQuantity.h
Go to the documentation of this file.
1 #ifndef DetectorQuantity_h
2 #define DetectorQuantity_h
3 
10 
11 namespace hcaldqm {
12  namespace quantity {
14  fiphi = 0,
15  fieta = 1,
16  fdepth = 2,
17  fSubdet = 3,
18  fSubdetPM = 4,
20  };
21  int getValue_iphi(HcalDetId const &);
22  int getValue_ieta(HcalDetId const &);
23  int getValue_depth(HcalDetId const &);
24  int getValue_Subdet(HcalDetId const &);
25  int getValue_SubdetPM(HcalDetId const &);
26  uint32_t getBin_iphi(HcalDetId const &);
27  uint32_t getBin_ieta(HcalDetId const &);
28  uint32_t getBin_depth(HcalDetId const &);
29  uint32_t getBin_Subdet(HcalDetId const &);
30  uint32_t getBin_SubdetPM(HcalDetId const &);
36  std::vector<std::string> getLabels_iphi();
37  std::vector<std::string> getLabels_ieta();
38  std::vector<std::string> getLabels_depth();
39  std::vector<std::string> getLabels_Subdet();
40  std::vector<std::string> getLabels_SubdetPM();
41 
42  typedef int (*getValueType_did)(HcalDetId const &);
43  typedef uint32_t (*getBinType_did)(HcalDetId const &);
44  typedef HcalDetId (*getDid_did)(int);
45  typedef std::vector<std::string> (*getLabels_did)();
54  std::string const name_did[nDetectorQuantityType] = {"iphi", "ieta", "depth", "Subdet", "SubdetPM"};
55  double const min_did[nDetectorQuantityType] = {0.5, 0, 0.5, 0, 0};
56  double const max_did[nDetectorQuantityType] = {72.5, 84, 4.5, 4, 8};
57  int const nbins_did[nDetectorQuantityType] = {72, 84, 4, 4, 8};
58 
59  class DetectorQuantity : public Quantity {
60  public:
63  ~DetectorQuantity() override {}
64  DetectorQuantity *makeCopy() override { return new DetectorQuantity(_type, _isLog); }
65 
66  int getValue(HcalDetId const &did) override { return getValue_functions_did[_type](did); }
67  uint32_t getBin(HcalDetId const &did) override { return getBin_functions_did[_type](did); }
68 
69  QuantityType type() override { return fDetectorQuantity; }
70  int nbins() override { return nbins_did[_type]; }
71  double min() override { return min_did[_type]; }
72  double max() override { return max_did[_type]; }
73  bool isCoordinate() override { return true; }
74  std::vector<std::string> getLabels() override { return getLabels_functions_did[_type](); }
75 
76  protected:
78  };
79  } // namespace quantity
80 } // namespace hcaldqm
81 
82 #endif
hcaldqm::quantity::getValue_SubdetPM
int getValue_SubdetPM(HcalDetId const &)
Definition: DetectorQuantity.cc:21
hcaldqm::quantity::fSubdetPM
Definition: DetectorQuantity.h:18
hcaldqm::quantity::getValue_Subdet
int getValue_Subdet(HcalDetId const &)
Definition: DetectorQuantity.cc:19
hcaldqm::quantity::DetectorQuantity::getBin
uint32_t getBin(HcalDetId const &did) override
Definition: DetectorQuantity.h:67
hcaldqm::quantity::DetectorQuantity::max
double max() override
Definition: DetectorQuantity.h:72
hcaldqm
Definition: Constants.h:8
hcaldqm::quantity::getLabels_ieta
std::vector< std::string > getLabels_ieta()
Definition: DetectorQuantity.cc:51
hcaldqm::quantity::max_did
const double max_did[nDetectorQuantityType]
Definition: DetectorQuantity.h:56
hcaldqm::quantity::fdepth
Definition: DetectorQuantity.h:16
hcaldqm::quantity::getBin_ieta
uint32_t getBin_ieta(HcalDetId const &)
Definition: DetectorQuantity.cc:27
hcaldqm::quantity::getBin_SubdetPM
uint32_t getBin_SubdetPM(HcalDetId const &)
Definition: DetectorQuantity.cc:35
hcaldqm::quantity::getLabels_Subdet
std::vector< std::string > getLabels_Subdet()
Definition: DetectorQuantity.cc:63
hcaldqm::quantity::getLabels_SubdetPM
std::vector< std::string > getLabels_SubdetPM()
Definition: DetectorQuantity.cc:70
hcaldqm::quantity::DetectorQuantity::min
double min() override
Definition: DetectorQuantity.h:71
hcaldqm::quantity::getBinType_did
uint32_t(* getBinType_did)(HcalDetId const &)
Definition: DetectorQuantity.h:43
hcaldqm::quantity::getDid_ieta
HcalDetId getDid_ieta(int)
Definition: DetectorQuantity.cc:39
hcaldqm::quantity::getLabels_did
std::vector< std::string >(* getLabels_did)()
Definition: DetectorQuantity.h:45
hcaldqm::quantity::DetectorQuantity::nbins
int nbins() override
Definition: DetectorQuantity.h:70
hcaldqm::quantity::DetectorQuantity::getValue
int getValue(HcalDetId const &did) override
Definition: DetectorQuantity.h:66
hcaldqm::quantity::min_did
const double min_did[nDetectorQuantityType]
Definition: DetectorQuantity.h:55
hcaldqm::quantity::Quantity::isLog
virtual bool isLog()
Definition: Quantity.h:35
hcaldqm::quantity::fDetectorQuantity
Definition: Quantity.h:16
hcaldqm::quantity::fieta
Definition: DetectorQuantity.h:15
hcaldqm::quantity::fiphi
Definition: DetectorQuantity.h:14
hcaldqm::quantity::getDid_depth
HcalDetId getDid_depth(int)
Definition: DetectorQuantity.cc:43
hcaldqm::quantity::DetectorQuantity::_type
DetectorQuantityType _type
Definition: DetectorQuantity.h:77
hcaldqm::quantity::getValue_ieta
int getValue_ieta(HcalDetId const &)
Definition: DetectorQuantity.cc:8
hcaldqm::quantity::DetectorQuantity::makeCopy
DetectorQuantity * makeCopy() override
Definition: DetectorQuantity.h:64
hcaldqm::quantity::DetectorQuantity
Definition: DetectorQuantity.h:59
hcaldqm::quantity::getBin_Subdet
uint32_t getBin_Subdet(HcalDetId const &)
Definition: DetectorQuantity.cc:33
hcaldqm::quantity::getDid_did
HcalDetId(* getDid_did)(int)
Definition: DetectorQuantity.h:44
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
hcaldqm::quantity::getValueType_did
int(* getValueType_did)(HcalDetId const &)
Definition: DetectorQuantity.h:42
hcaldqm::quantity::fSubdet
Definition: DetectorQuantity.h:17
MjjMonitor_cfi.quantity
quantity
Definition: MjjMonitor_cfi.py:10
hcaldqm::quantity::nbins_did
const int nbins_did[nDetectorQuantityType]
Definition: DetectorQuantity.h:57
hcaldqm::quantity::DetectorQuantity::DetectorQuantity
DetectorQuantity()
Definition: DetectorQuantity.h:61
hcaldqm::quantity::QuantityType
QuantityType
Definition: Quantity.h:15
hcaldqm::quantity::getBin_functions_did
const getBinType_did getBin_functions_did[nDetectorQuantityType]
Definition: DetectorQuantity.h:48
HcalDetId
Definition: HcalDetId.h:12
createfilelist.int
int
Definition: createfilelist.py:10
hcaldqm::quantity::getDid_iphi
HcalDetId getDid_iphi(int)
Definition: DetectorQuantity.cc:37
hcaldqm::quantity::Quantity
Definition: Quantity.h:27
hcaldqm::quantity::getLabels_functions_did
const getLabels_did getLabels_functions_did[nDetectorQuantityType]
Definition: DetectorQuantity.h:52
hcaldqm::quantity::DetectorQuantity::~DetectorQuantity
~DetectorQuantity() override
Definition: DetectorQuantity.h:63
hcaldqm::quantity::nDetectorQuantityType
Definition: DetectorQuantity.h:19
hcaldqm::quantity::getValue_iphi
int getValue_iphi(HcalDetId const &)
Definition: DetectorQuantity.cc:6
hcaldqm::quantity::name_did
const std::string name_did[nDetectorQuantityType]
Definition: DetectorQuantity.h:54
hcaldqm::quantity::Quantity::_isLog
bool _isLog
Definition: Quantity.h:72
Quantity.h
hcaldqm::quantity::getLabels_depth
std::vector< std::string > getLabels_depth()
Definition: DetectorQuantity.cc:61
type
type
Definition: HCALResponse.h:21
hcaldqm::quantity::getBin_depth
uint32_t getBin_depth(HcalDetId const &)
Definition: DetectorQuantity.cc:29
hcaldqm::quantity::DetectorQuantityType
DetectorQuantityType
Definition: DetectorQuantity.h:13
hcaldqm::quantity::DetectorQuantity::getLabels
std::vector< std::string > getLabels() override
Definition: DetectorQuantity.h:74
hcaldqm::quantity::getDid_SubdetPM
HcalDetId getDid_SubdetPM(int)
Definition: DetectorQuantity.cc:47
hcaldqm::quantity::getDid_Subdet
HcalDetId getDid_Subdet(int)
Definition: DetectorQuantity.cc:45
hcaldqm::quantity::getDid_functions_did
const getDid_did getDid_functions_did[nDetectorQuantityType]
Definition: DetectorQuantity.h:50
hcaldqm::quantity::getLabels_iphi
std::vector< std::string > getLabels_iphi()
Definition: DetectorQuantity.cc:49
hcaldqm::quantity::getValue_functions_did
const getValueType_did getValue_functions_did[nDetectorQuantityType]
Definition: DetectorQuantity.h:46
hcaldqm::quantity::getBin_iphi
uint32_t getBin_iphi(HcalDetId const &)
Definition: DetectorQuantity.cc:25
hcaldqm::quantity::getValue_depth
int getValue_depth(HcalDetId const &)
Definition: DetectorQuantity.cc:17
hcaldqm::quantity::DetectorQuantity::DetectorQuantity
DetectorQuantity(DetectorQuantityType type, bool isLog=false)
Definition: DetectorQuantity.h:62
hcaldqm::quantity::DetectorQuantity::type
QuantityType type() override
Definition: DetectorQuantity.h:69
hcaldqm::quantity::DetectorQuantity::isCoordinate
bool isCoordinate() override
Definition: DetectorQuantity.h:73