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:
62  DetectorQuantity(DetectorQuantityType type, bool isLog = false) : Quantity(name_did[type], isLog), _type(type) {}
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
type
Definition: HCALResponse.h:21
uint32_t getBin(HcalDetId const &did) override
HcalDetId getDid_ieta(int)
int const nbins_did[nDetectorQuantityType]
uint32_t getBin_iphi(HcalDetId const &)
std::vector< std::string > getLabels_SubdetPM()
DetectorQuantity(DetectorQuantityType type, bool isLog=false)
std::vector< std::string > getLabels_ieta()
getDid_did const getDid_functions_did[nDetectorQuantityType]
HcalDetId getDid_depth(int)
uint32_t getBin_SubdetPM(HcalDetId const &)
std::vector< std::string > getLabels() override
uint32_t(* getBinType_did)(HcalDetId const &)
int getValue_ieta(HcalDetId const &)
uint32_t getBin_ieta(HcalDetId const &)
uint32_t getBin_Subdet(HcalDetId const &)
int(* getValueType_did)(HcalDetId const &)
std::vector< std::string > getLabels_Subdet()
std::vector< std::string >(* getLabels_did)()
HcalDetId(* getDid_did)(int)
getValueType_did const getValue_functions_did[nDetectorQuantityType]
std::string const name_did[nDetectorQuantityType]
int getValue(HcalDetId const &did) override
DetectorQuantity * makeCopy() override
double const min_did[nDetectorQuantityType]
HcalDetId getDid_iphi(int)
HcalDetId getDid_SubdetPM(int)
uint32_t getBin_depth(HcalDetId const &)
std::vector< std::string > getLabels_depth()
int getValue_iphi(HcalDetId const &)
getLabels_did const getLabels_functions_did[nDetectorQuantityType]
virtual bool isLog()
Definition: Quantity.h:35
HcalDetId getDid_Subdet(int)
std::vector< std::string > getLabels_iphi()
int getValue_SubdetPM(HcalDetId const &)
int getValue_depth(HcalDetId const &)
double const max_did[nDetectorQuantityType]
int getValue_Subdet(HcalDetId const &)
getBinType_did const getBin_functions_did[nDetectorQuantityType]