10#include <analysis/modules/ParticleWeightingLookUpCreator/ParticleWeightingLookUpCreatorModule.h>
13#include <framework/core/ModuleParam.templateDetails.h>
14#include <framework/database/DBImportObjPtr.h>
15#include <framework/logging/Logger.h>
36 addParam(
"tableIDNotSpec",
m_tableIDNotSpec,
"Bin:weight info map without specific bin-numbering scheme", empty_noid_list);
38 addParam(
"tableIDSpec",
m_tableIDSpec,
"Bin:weight info map with specific bin-numbering scheme", empty_specificid_list);
53 for (
auto bin_1d : bin_tuple) {
54 std::string axis_name = bin_1d.first;
55 double min_val = std::get<0>(bin_1d.second);
56 double max_val = std::get<1>(bin_1d.second);
58 binning.insert(std::make_pair(axis_name,
lims));
75 table.addEntry(info, bin);
80 double bin_id = std::get<1>(entry);
83 table.addEntry(info, bin, bin_id);
86 B2ERROR(
"Please define one table: with OR without specific bin IDs");
92 B2INFO(
"Printing LookUp table");
93 table.printParticleWeightingLookUpTable();
96 importer.construct(table);
103 if (
lims !=
nullptr) {
Class for importing a single object to the database.
A class that describes the interval of experiments/runs for which an object in the database is valid.
void setDescription(const std::string &description)
Sets the description of the module.
Just pair of numbers - min and max values of bin border.
listOfNoIdEntries m_tableIDNotSpec
List of entries for table to be created from without specified ID.
virtual void initialize() override
Initialize the Module.
NDBin NDBinTupleToNDBin(const NDBinTuple &bin_tuple)
Currently, std::pair can not be retrieved from python list We will get ParticleWeightingLookUpTable e...
virtual void terminate() override
Clean up anything created in initialize().
ParticleWeightingBinLimits * lims
object holding bin limits
int m_runLow
Lowest valid run #.
ParticleWeightingLookUpCreatorModule()
Constructor.
std::string m_tableName
Name of the table.
int m_experimentLow
Lowest valid experiment #.
int m_experimentHigh
Highest valid experiment #.
listOfSpecificIDEntries m_tableIDSpec
List of entries for table to be created from with specified ID.
int m_runHigh
Highest valid run #.
WeightInfo m_outOfRangeWeight
Weight info for out-of-range bin.
Class for handling LookUp tables.
std::tuple< WeightInfo, NDBinTuple > noIdEntry
the ID
std::vector< specificIDEntry > listOfSpecificIDEntries
List of entries for table to be created from with specified ID.
std::map< std::string, BinLimitsTuple > NDBinTuple
the NDimensional tuple of bin limits
std::vector< noIdEntry > listOfNoIdEntries
List of entries for table to be created from without specified ID.
std::map< std::string, ParticleWeightingBinLimits * > NDBin
N-dim bin: pairs of bin limits with name of the axis variable.
std::map< std::string, double > WeightInfo
Weight information: a line from the weight lookup table.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.