Belle II Software development
ROIfindingConditionFromDBModule.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#include <simulation/modules/dbtools/ROIfindingConditionFromDBModule.h>
9#include <simulation/dbobjects/ROISimulationParameters.h>
10#include <framework/core/ModuleParam.templateDetails.h>
11
12using namespace Belle2;
13
14REG_MODULE(ROIfindingConditionFromDB);
15
17{
18 setDescription("Module which sets its return value based on the payload whether ROI-finding was enabled for the given run/exp interval or not.");
20}
21
23{
24 if (m_ROISimulationParameters.hasChanged()) {
26 m_roiEnabled = m_ROISimulationParameters->getROIfinding();
27 } else {
28 B2ERROR("No configuration for the current run found");
29 }
30 }
32}
33
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
Module()
Constructor.
Definition Module.cc:30
void setReturnValue(int value)
Sets the return value for this module as integer.
Definition Module.cc:220
@ 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
void event() override
Returns true, if ROI-finding is enabled.
bool m_roiEnabled
Internal condition: true if run/exp is in IoV.
DBObjPtr< ROISimulationParameters > m_ROISimulationParameters
Configuration parameters for ROIs.
ROIfindingConditionFromDBModule()
Add the module parameters and the description.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition Module.h:649
Abstract base class for different kinds of events.