1 #include "otsdaq-demo/DataProcessorPlugins/DemoDQMHistosConsumer.h"
2 #include "otsdaq-demo/DemoRootUtilities/DemoDQMHistos.h"
3 #include "otsdaq/Macros/CoutMacros.h"
4 #include "otsdaq/Macros/ProcessorPluginMacros.h"
5 #include "otsdaq/MessageFacility/MessageFacility.h"
10 DemoDQMHistosConsumer::DemoDQMHistosConsumer(
11 std::string supervisorApplicationUID,
12 std::string bufferUID,
13 std::string processorUID,
14 const ConfigurationTree& theXDAQContextConfigTree,
15 const std::string& configurationPath)
16 : WorkLoop(processorUID)
17 , DQMHistosConsumerBase(
18 supervisorApplicationUID, bufferUID, processorUID, LowConsumerPriority)
19 , Configurable(theXDAQContextConfigTree, configurationPath)
20 , saveDQMFile_(theXDAQContextConfigTree.getNode(configurationPath)
21 .getNode(
"SaveDQMFile")
23 , DQMFilePath_(theXDAQContextConfigTree.getNode(configurationPath)
24 .getNode(
"DQMFilePath")
25 .getValue<std::string>())
26 , DQMFilePrefix_(theXDAQContextConfigTree.getNode(configurationPath)
27 .getNode(
"DQMFileNamePrefix")
28 .getValue<std::string>())
35 DemoDQMHistosConsumer::~DemoDQMHistosConsumer(
void) { closeFile(); }
38 void DemoDQMHistosConsumer::startProcessingData(std::string runNumber)
42 DQMHistosBase::openFile(DQMFilePath_ +
"/" + DQMFilePrefix_ +
"_Run" + runNumber +
45 dqmHistos_->book(DQMHistosBase::theFile_);
46 DataConsumer::startProcessingData(runNumber);
50 void DemoDQMHistosConsumer::stopProcessingData(
void)
52 DataConsumer::stopProcessingData();
61 bool DemoDQMHistosConsumer::workLoopThread(toolbox::task::WorkLoop* )
66 return WorkLoop::continueWorkLoop_;
70 void DemoDQMHistosConsumer::fastRead(
void)
74 if(DataConsumer::read(dataP_, headerP_) < 0)
85 dqmHistos_->fill(*dataP_, *headerP_);
87 DataConsumer::setReadSubBuffer<std::string, std::map<std::string, std::string>>();
91 void DemoDQMHistosConsumer::slowRead(
void)
95 if(DataConsumer::read(data_, header_) < 0)