CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
jsoncollector::DataPointMonitor Class Reference

#include <DataPointMonitor.h>

Public Member Functions

 DataPointMonitor (const std::vector< JsonMonitorable * > &monitorableVariables, string defPath)
 
void snap (DataPoint &outputDataPoint)
 
virtual ~DataPointMonitor ()
 

Private Member Functions

JsonMonitorablegetVarForName (string name) const
 
bool isStringMonitorable (string key) const
 

Private Attributes

string defPath_
 
DataPointDefinition dpd_
 
vector< JsonMonitorable * > monitorableVars_
 
vector< JsonMonitorable * > monitoredVars_
 
vector< string > toBeMonitored_
 

Detailed Description

Definition at line 23 of file DataPointMonitor.h.

Constructor & Destructor Documentation

DataPointMonitor::DataPointMonitor ( const std::vector< JsonMonitorable * > &  monitorableVariables,
string  defPath 
)

Definition at line 13 of file DataPointMonitor.cc.

References defPath_, dpd_, jsoncollector::ObjectMerger::getDataPointDefinitionFor(), jsoncollector::DataPointDefinition::getLegend(), getVarForName(), i, jsoncollector::DataPointDefinition::isPopulated(), and monitoredVars_.

14  :
15  monitorableVars_(monitorableVariables) {
16  defPath_ = defPath;
18  if (dpd_.isPopulated()) {
19  for (unsigned int i = 0; i < dpd_.getLegend().size(); i++) {
20  string toBeMonitored = dpd_.getLegend()[i].getName();
21  monitoredVars_.push_back(getVarForName(toBeMonitored));
22  }
23  }
24 }
int i
Definition: DBlmapReader.cc:9
JsonMonitorable * getVarForName(string name) const
vector< JsonMonitorable * > monitorableVars_
static bool getDataPointDefinitionFor(std::string defFilePath, DataPointDefinition &def)
vector< JsonMonitorable * > monitoredVars_
std::vector< LegendItem > getLegend() const
DataPointMonitor::~DataPointMonitor ( )
virtual

Definition at line 26 of file DataPointMonitor.cc.

26  {
27 }

Member Function Documentation

JsonMonitorable * DataPointMonitor::getVarForName ( string  name) const
private

Definition at line 44 of file DataPointMonitor.cc.

References i, and monitorableVars_.

Referenced by DataPointMonitor().

44  {
45  for (unsigned int i = 0; i < monitorableVars_.size(); i++)
46  if (name.compare(monitorableVars_[i]->getName()) == 0)
47  return monitorableVars_[i];
48  return 0;
49 }
int i
Definition: DBlmapReader.cc:9
vector< JsonMonitorable * > monitorableVars_
bool DataPointMonitor::isStringMonitorable ( string  key) const
private

Definition at line 37 of file DataPointMonitor.cc.

References i, and toBeMonitored_.

37  {
38  for (unsigned int i = 0; i < toBeMonitored_.size(); i++)
39  if (key.compare(toBeMonitored_[i]) == 0)
40  return true;
41  return false;
42 }
int i
Definition: DBlmapReader.cc:9
list key
Definition: combine.py:13
void DataPointMonitor::snap ( DataPoint outputDataPoint)

Definition at line 29 of file DataPointMonitor.cc.

References jsoncollector::DataPoint::addToData(), defPath_, i, monitoredVars_, jsoncollector::DataPoint::resetData(), jsoncollector::DataPoint::setDefinition(), and jsoncollector::DataPoint::setSource().

Referenced by RawEventFileWriterForBU::endOfLS(), MTRawEventFileWriterForBU::endOfLS(), and RawEventFileWriterForBU::initialize().

29  {
30  outputDataPoint.resetData();
31  for (unsigned int i = 0; i < monitoredVars_.size(); i++)
32  outputDataPoint.addToData(monitoredVars_[i]->toString());
33  outputDataPoint.setSource("");
34  outputDataPoint.setDefinition(defPath_);
35 }
int i
Definition: DBlmapReader.cc:9
void addToData(std::string data)
Definition: DataPoint.h:50
void setDefinition(std::string definition)
Definition: DataPoint.h:47
void setSource(std::string source)
Definition: DataPoint.h:44
vector< JsonMonitorable * > monitoredVars_

Member Data Documentation

string jsoncollector::DataPointMonitor::defPath_
private

Definition at line 41 of file DataPointMonitor.h.

Referenced by DataPointMonitor(), and snap().

DataPointDefinition jsoncollector::DataPointMonitor::dpd_
private

Definition at line 40 of file DataPointMonitor.h.

Referenced by DataPointMonitor().

vector<JsonMonitorable*> jsoncollector::DataPointMonitor::monitorableVars_
private

Definition at line 37 of file DataPointMonitor.h.

Referenced by getVarForName().

vector<JsonMonitorable*> jsoncollector::DataPointMonitor::monitoredVars_
private

Definition at line 39 of file DataPointMonitor.h.

Referenced by DataPointMonitor(), and snap().

vector<string> jsoncollector::DataPointMonitor::toBeMonitored_
private

Definition at line 38 of file DataPointMonitor.h.

Referenced by isStringMonitorable().