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() const { return varNames_; }
45  std::vector<std::string> const& getOperations() const { 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) const;
59 
61  std::string const& getDefFilePath() const { return defFilePath_; }
62  //void populateMonConfig(std::vector<JsonMonConfig>& monConfig);
63 
64  //known JSON operation names
65  static const std::string SUM;
66  static const std::string AVG;
67  static const std::string SAME;
68  static const std::string HISTO;
69  static const std::string CAT;
70  static const std::string MERGE;
71  static const std::string BINARYOR;
72  static const std::string ADLER32;
73 
74  // JSON field names
75  static const std::string LEGEND;
76  static const std::string DATA;
77  static const std::string PARAM_NAME;
78  static const std::string OPERATION;
79  static const std::string TYPE;
80 
81  private:
82  std::vector<std::string> varNames_;
83  std::vector<std::string> typeNames_;
84  std::vector<std::string> opNames_;
87 
88  // std::string namePrefix_;
89  };
90 } // namespace jsoncollector
91 
92 #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:86
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::AVG
static const std::string AVG
Definition: DataPointDefinition.h:66
jsoncollector::DataPointDefinition::typeNames_
std::vector< std::string > typeNames_
Definition: DataPointDefinition.h:83
jsoncollector::DataPointDefinition::defFilePath_
std::string defFilePath_
Definition: DataPointDefinition.h:85
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:79
jsoncollector::DataPointDefinition::PARAM_NAME
static const std::string PARAM_NAME
Definition: DataPointDefinition.h:77
jsoncollector::DataPointDefinition::MERGE
static const std::string MERGE
Definition: DataPointDefinition.h:70
jsoncollector::DataPointDefinition::SUM
static const std::string SUM
Definition: DataPointDefinition.h:65
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::serialize
void serialize(Json::Value &root) const override
Definition: DataPointDefinition.cc:50
jsoncollector::DataPointDefinition::getOperations
std::vector< std::string > const & getOperations() const
Definition: DataPointDefinition.h:45
jsoncollector::DataPointDefinition::CAT
static const std::string CAT
Definition: DataPointDefinition.h:69
jsoncollector::DataPointDefinition::getNames
std::vector< std::string > const & getNames() const
Definition: DataPointDefinition.h:44
jsoncollector::DataPointDefinition::BINARYOR
static const std::string BINARYOR
Definition: DataPointDefinition.h:71
jsoncollector::DataPointDefinition::opNames_
std::vector< std::string > opNames_
Definition: DataPointDefinition.h:84
JsonSerializable.h
jsoncollector::DataPointDefinition::HISTO
static const std::string HISTO
Definition: DataPointDefinition.h:68
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
jsoncollector::DataPointDefinition::OPERATION
static const std::string OPERATION
Definition: DataPointDefinition.h:78
jsoncollector::DataPointDefinition::getOperationFor
OperationType getOperationFor(unsigned int index) const
Definition: DataPointDefinition.cc:78
jsoncollector::DataPointDefinition::getDefFilePath
std::string const & getDefFilePath() const
Definition: DataPointDefinition.h:61
jsoncollector::DataPointDefinition::SAME
static const std::string SAME
Definition: DataPointDefinition.h:67
jsoncollector::DataPointDefinition::varNames_
std::vector< std::string > varNames_
Definition: DataPointDefinition.h:82
root
Definition: RooFitFunction.h:10
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
jsoncollector
Definition: DataPoint.h:26
jsoncollector::DataPointDefinition
Definition: DataPointDefinition.h:20
jsoncollector::DataPointDefinition::getDefFilePath
std::string & getDefFilePath()
Definition: DataPointDefinition.h:60
jsoncollector::DataPointDefinition::ADLER32
static const std::string ADLER32
Definition: DataPointDefinition.h:72
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
jsoncollector::DataPointDefinition::LEGEND
static const std::string LEGEND
Definition: DataPointDefinition.h:75
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:76
Json::Value
Represents a JSON value.
Definition: value.h:99
watchdog.group
group
Definition: watchdog.py:82