Belle II Software  release-08-01-10
DQMHistAnalysisEpicsOutput.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 // Own header.
10 #include <dqm/analysis/modules/DQMHistAnalysisEpicsOutput.h>
11 
12 #include <TH1F.h>
13 
14 using namespace std;
15 using namespace Belle2;
16 
17 //-----------------------------------------------------------------
18 // Register module
19 //-----------------------------------------------------------------
20 
21 REG_MODULE(DQMHistAnalysisEpicsOutput);
22 
23 DQMHistAnalysisEpicsOutputModule::DQMHistAnalysisEpicsOutputModule()
25 {
26  // set module description (e.g. insert text)
27  setDescription("EPICS output enabler/flusher module");
29 }
30 
32 {
33  // Crosscheck
34  if (!getUseEpics()) {
35  B2ERROR("EPICS is not enabled, most likely DQMHistAnalysisEpicsEnableModule is missing in the beginning of the process chain.");
36  }
37 }
38 
40 {
41  checkPVStatus();
42 }
43 
45 {
46  checkPVStatus();
47 }
48 
50 {
51  // -> now trigger flush to network
52  // this is the reason we want to have this modul after all other Analysis modules
53  auto state = updateEpicsPVs(5.0); // 5 seconds
54  // be aware that any "error" arising from a PV in an analysis module, may only show up here (timeout etc)
55  if (state != ECA_NORMAL) checkPVStatus();
56 }
void initialize(void) override final
Initialize the Module.
void endRun(void) override final
End run action.
void beginRun(void) override final
End run action.
void event(void) override final
Event action.
The base class for the histogram analysis module.
void checkPVStatus(void)
Check the status of all PVs and report if disconnected or not found.
bool getUseEpics(void)
Getter for EPICS usage.
int updateEpicsPVs(float timeout)
Update all EPICS PV (flush to network)
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:214
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Definition: Module.cc:208
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Definition: Module.h:80
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
Abstract base class for different kinds of events.