CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  virtual ~DetectorQuantity() {}
87  {return new DetectorQuantity(_type, _isLog);}
88 
89  virtual int getValue(HcalDetId const& did)
90  {return getValue_functions_did[_type](did);}
91  virtual uint32_t getBin(HcalDetId const& did)
92  {return getBin_functions_did[_type](did);}
93 
94  virtual QuantityType type() {return fDetectorQuantity;}
95  virtual int nbins() {return nbins_did[_type];}
96  virtual double min() {return min_did[_type];}
97  virtual double max() {return max_did[_type];}
98  virtual bool isCoordinate() {return true;}
99  virtual std::vector<std::string> getLabels()
100  {return getLabels_functions_did[_type]();}
101 
102  protected:
104  };
105  }
106 }
107 
108 #endif
type
Definition: HCALResponse.h:21
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 &)
int getValue_ieta(HcalDetId const &)
uint32_t getBin_ieta(HcalDetId const &)
uint32_t getBin_Subdet(HcalDetId const &)
std::vector< std::string > getLabels_Subdet()
int(* getValueType_did)(HcalDetId const &)
uint32_t(* getBinType_did)(HcalDetId const &)
virtual uint32_t getBin(HcalDetId const &did)
virtual std::vector< std::string > getLabels()
getValueType_did const getValue_functions_did[nDetectorQuantityType]
std::string const name_did[nDetectorQuantityType]
std::vector< std::string >(* getLabels_did)()
double const min_did[nDetectorQuantityType]
HcalDetId getDid_iphi(int)
HcalDetId getDid_SubdetPM(int)
uint32_t getBin_depth(HcalDetId const &)
HcalDetId(* getDid_did)(int)
std::vector< std::string > getLabels_depth()
int getValue_iphi(HcalDetId const &)
virtual DetectorQuantity * makeCopy()
getLabels_did const getLabels_functions_did[nDetectorQuantityType]
virtual bool isLog()
Definition: Quantity.h:48
virtual int getValue(HcalDetId const &did)
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]