CMS 3D CMS Logo

DataPointDefinition.h
Go to the documentation of this file.
1 /*
2  * DataPointDefinition.h
3  *
4  * Created on: Sep 24, 2012
5  * Author: aspataru
6  */
7 
8 #ifndef DATAPOINTDEFINITION_H_
9 #define DATAPOINTDEFINITION_H_
10 
13 #include <string>
14 #include <vector>
15 
16 namespace jsoncollector {
17 
18  class JsonMonConfig;
19 
21  public:
23 
24  //DataPointDefinition(std::string const& prefix) : namePrefix_(prefix) {}
25  //DataPointDefinition(const std::vector<std::string>& names, const std::vector<std::string>& operations);
26 
27  ~DataPointDefinition() override {}
28 
32  void serialize(Json::Value& root) const override;
36  void deserialize(Json::Value& root) override;
40  bool isPopulated() const;
44  std::vector<std::string> const& getNames() { return varNames_; }
45  std::vector<std::string> const& getOperations() { return opNames_; }
46 
50  static bool getDataPointDefinitionFor(std::string& defFilePath,
52  const std::string* defaultGroup = nullptr);
53 
55 
56  void addLegendItem(std::string const& name, std::string const& type, std::string const& operation);
57 
58  OperationType getOperationFor(unsigned int index);
59 
61  //void populateMonConfig(std::vector<JsonMonConfig>& monConfig);
62 
63  //known JSON operation names
64  static const std::string SUM;
65  static const std::string AVG;
66  static const std::string SAME;
67  static const std::string HISTO;
68  static const std::string CAT;
69  static const std::string MERGE;
70  static const std::string BINARYOR;
71  static const std::string ADLER32;
72 
73  // JSON field names
74  static const std::string LEGEND;
75  static const std::string DATA;
76  static const std::string PARAM_NAME;
77  static const std::string OPERATION;
78  static const std::string TYPE;
79 
80  private:
81  std::vector<std::string> varNames_;
82  std::vector<std::string> typeNames_;
83  std::vector<std::string> opNames_;
86 
87  // std::string namePrefix_;
88  };
89 } // namespace jsoncollector
90 
91 #endif /* DATAPOINTDEFINITION_H_ */
jsoncollector::DataPointDefinition::addLegendItem
void addLegendItem(std::string const &name, std::string const &type, std::string const &operation)
Definition: DataPointDefinition.cc:93
jsoncollector::DataPointDefinition::defaultGroup_
std::string defaultGroup_
Definition: DataPointDefinition.h:85
jsoncollector::DataPointDefinition::setDefaultGroup
void setDefaultGroup(std::string const &group)
Definition: DataPointDefinition.h:54
jsoncollector::DataPointDefinition::deserialize
void deserialize(Json::Value &root) override
Definition: DataPointDefinition.cc:61
jsoncollector::DataPointDefinition::getNames
std::vector< std::string > const & getNames()
Definition: DataPointDefinition.h:44
jsoncollector::DataPointDefinition::AVG
static const std::string AVG
Definition: DataPointDefinition.h:65
jsoncollector::DataPointDefinition::typeNames_
std::vector< std::string > typeNames_
Definition: DataPointDefinition.h:82
jsoncollector::DataPointDefinition::defFilePath_
std::string defFilePath_
Definition: DataPointDefinition.h:84
jsoncollector::DataPointDefinition::getOperations
std::vector< std::string > const & getOperations()
Definition: DataPointDefinition.h:45
jsoncollector::DataPointDefinition::isPopulated
bool isPopulated() const
Definition: DataPointDefinition.cc:72
jsoncollector::OperationType
OperationType
Definition: JsonMonitorable.h:22
JsonMonitorable.h
jsoncollector::DataPointDefinition::TYPE
static const std::string TYPE
Definition: DataPointDefinition.h:78
jsoncollector::DataPointDefinition::PARAM_NAME
static const std::string PARAM_NAME
Definition: DataPointDefinition.h:76
jsoncollector::DataPointDefinition::MERGE
static const std::string MERGE
Definition: DataPointDefinition.h:69
jsoncollector::DataPointDefinition::SUM
static const std::string SUM
Definition: DataPointDefinition.h:64
jsoncollector::JsonSerializable
Definition: JsonSerializable.h:14
jsoncollector::DataPointDefinition::getDataPointDefinitionFor
static bool getDataPointDefinitionFor(std::string &defFilePath, DataPointDefinition *dpd, const std::string *defaultGroup=nullptr)
Definition: DataPointDefinition.cc:32
jsoncollector::DataPointDefinition::getOperationFor
OperationType getOperationFor(unsigned int index)
Definition: DataPointDefinition.cc:78
jsoncollector::DataPointDefinition::serialize
void serialize(Json::Value &root) const override
Definition: DataPointDefinition.cc:50
jsoncollector::DataPointDefinition::CAT
static const std::string CAT
Definition: DataPointDefinition.h:68
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
jsoncollector::DataPointDefinition::BINARYOR
static const std::string BINARYOR
Definition: DataPointDefinition.h:70
jsoncollector::DataPointDefinition::opNames_
std::vector< std::string > opNames_
Definition: DataPointDefinition.h:83
JsonSerializable.h
jsoncollector::DataPointDefinition::HISTO
static const std::string HISTO
Definition: DataPointDefinition.h:67
jsoncollector::DataPointDefinition::OPERATION
static const std::string OPERATION
Definition: DataPointDefinition.h:77
jsoncollector::DataPointDefinition::SAME
static const std::string SAME
Definition: DataPointDefinition.h:66
jsoncollector::DataPointDefinition::varNames_
std::vector< std::string > varNames_
Definition: DataPointDefinition.h:81
root
Definition: RooFitFunction.h:10
jsoncollector
Definition: DataPoint.h:26
jsoncollector::DataPointDefinition
Definition: DataPointDefinition.h:20
type
type
Definition: HCALResponse.h:21
jsoncollector::DataPointDefinition::getDefFilePath
std::string & getDefFilePath()
Definition: DataPointDefinition.h:60
jsoncollector::DataPointDefinition::ADLER32
static const std::string ADLER32
Definition: DataPointDefinition.h:71
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
jsoncollector::DataPointDefinition::LEGEND
static const std::string LEGEND
Definition: DataPointDefinition.h:74
jsoncollector::DataPointDefinition::~DataPointDefinition
~DataPointDefinition() override
Definition: DataPointDefinition.h:27
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
jsoncollector::DataPointDefinition::DataPointDefinition
DataPointDefinition()
Definition: DataPointDefinition.h:22
jsoncollector::DataPointDefinition::DATA
static const std::string DATA
Definition: DataPointDefinition.h:75
Json::Value
Represents a JSON value.
Definition: value.h:99
watchdog.group
group
Definition: watchdog.py:82