CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HDQMInspectorConfigBase.h
Go to the documentation of this file.
1 #ifndef GUARD_HDQMInspectorConfigBase_h
2 #define GUARD_HDQMInspectorConfigBase_h
3 
4 #include <algorithm>
5 #include <string>
6 #include <vector>
7 #include <map>
8 #include <stdint.h>
9 
35 {
36  public:
38  virtual ~HDQMInspectorConfigBase () {};
40  virtual std::string translateDetId( const uint32_t ) const = 0;
42  virtual bool valueErrorMap(std::vector<std::pair<std::string, std::string> > & valueErrorVector) const {return false;}
44  virtual bool computeIntegralList(const std::vector<std::string> & computeIntegralVector)
45  {
46  fComputeIntegral = computeIntegralVector;
47  return true;
48  }
49  bool computeIntegral(const std::string & in) const
50  {
51  if (std::find(fComputeIntegral.begin(), fComputeIntegral.end(), in) != fComputeIntegral.end()) {
52  return true;
53  }
54  return false;
55  }
56 
57  std::string getErrorForQuantity(const std::string & QuantityName) const
58  {
59  // Return the error name for a quantity name given. This is designed to be used for the
60  // "user" input quantities
61 
62  for (std::map<std::string, std::string>::const_iterator It = fErrorMap.begin(); It != fErrorMap.end(); ++It) {
63  if (QuantityName.find( It->first ) != std::string::npos) {
64  return It->second;
65  }
66  }
67 
68  return "";
69  }
70 
71  private:
72  std::map<std::string, std::string> fErrorMap;
73  std::vector<std::string> fComputeIntegral;
74 };
75 
76 
77 /*
78  * valueErrorMap: don't I need a way to access what is input here in the HDQMI code??
79  * map should be vlist=>error right?
80  *
81  * computeIntegralList: need a way to access that as well.
82  *
83  */
84 
85 
86 
87 #endif
std::string getErrorForQuantity(const std::string &QuantityName) const
virtual bool computeIntegralList(const std::vector< std::string > &computeIntegralVector)
fills the list of names of quantities for which a summation over the runs is required ...
std::vector< std::string > fComputeIntegral
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
virtual bool valueErrorMap(std::vector< std::pair< std::string, std::string > > &valueErrorVector) const
fills a vector&lt;pair&lt;string, string&gt; &gt; associating values with the corresponding errors ...
bool computeIntegral(const std::string &in) const
virtual std::string translateDetId(const uint32_t) const =0
pure virtual method that convert a DetId to a string
std::map< std::string, std::string > fErrorMap