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 {
13  namespace quantity
14  {
16  {
17  fiphi = 0,
18  fieta = 1,
19  fdepth = 2,
20  fSubdet = 3,
21  fSubdetPM = 4,
23  };
24  int getValue_iphi(HcalDetId const&);
25  int getValue_ieta(HcalDetId const&);
26  int getValue_depth(HcalDetId const&);
27  int getValue_Subdet(HcalDetId const&);
28  int getValue_SubdetPM(HcalDetId const&);
29  uint32_t getBin_iphi(HcalDetId const&);
30  uint32_t getBin_ieta(HcalDetId const&);
31  uint32_t getBin_depth(HcalDetId const&);
32  uint32_t getBin_Subdet(HcalDetId const&);
33  uint32_t getBin_SubdetPM(HcalDetId const&);
39  std::vector<std::string> getLabels_iphi();
40  std::vector<std::string> getLabels_ieta();
41  std::vector<std::string> getLabels_depth();
42  std::vector<std::string> getLabels_Subdet();
43  std::vector<std::string> getLabels_SubdetPM();
44 
45  typedef int (*getValueType_did)(HcalDetId const&);
46  typedef uint32_t (*getBinType_did)(HcalDetId const&);
47  typedef HcalDetId (*getDid_did)(int);
48  typedef std::vector<std::string> (*getLabels_did)();
52  };
56  };
60  };
64  };
66  "iphi", "ieta", "depth", "Subdet", "SubdetPM"
67  };
68  double const min_did[nDetectorQuantityType] = {
69  0.5, 0, 0.5, 0, 0
70  };
71  double const max_did[nDetectorQuantityType] = {
72  72.5, 84, 4.5, 4, 8
73  };
75  72, 84, 4, 4, 8
76  };
77 
78  class DetectorQuantity : public Quantity
79  {
80  public:
83  Quantity(name_did[type], isLog), _type(type)
84  {}
85  ~DetectorQuantity() override {}
87  {return new DetectorQuantity(_type, _isLog);}
88 
89  int getValue(HcalDetId const& did) override
90  {return getValue_functions_did[_type](did);}
91  uint32_t getBin(HcalDetId const& did) override
92  {return getBin_functions_did[_type](did);}
93 
94  QuantityType type() override {return fDetectorQuantity;}
95  int nbins() override {return nbins_did[_type];}
96  double min() override {return min_did[_type];}
97  double max() override {return max_did[_type];}
98  bool isCoordinate() override {return true;}
99  std::vector<std::string> getLabels() override
100  {return getLabels_functions_did[_type]();}
101 
102  protected:
104  };
105  }
106 }
107 
108 #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:48
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]