9 #include <framework/database/DBImportObjPtr.h>
10 #include <framework/database/IntervalOfValidity.h>
11 #include <framework/database/Configuration.h>
12 #include <framework/logging/LogSystem.h>
13 #include <framework/utilities/FileSystem.h>
15 #include <simulation/dbobjects/ROIParameters.h>
20 int main(
int argc,
char** argv)
22 if (argc < 4 or !(std::stoi(argv[1]) == 0 or std::stoi(argv[1]) == 1)) {
24 "Please specify IOV: 0/1 {=off/on} N {=off for every Nth event; -1 if not used} experiment run [experimentEnd] [runEnd]" <<
29 bool enableROI = std::stoi(argv[1]) == 1;
30 int disableROIforEveryNth = std::stoi(argv[2]);
33 disableROIforEveryNth = -1;
34 std::cout <<
"Parameter \"N\" does not have any function if ROI finding turned off. Neglecting." << std::endl;
35 }
else if (disableROIforEveryNth == 0 or disableROIforEveryNth == 1) {
36 disableROIforEveryNth = -1;
38 "Parameter \"N\" does not make any sense. Please use positive integer greater than 1 (or negative integer for disabling this feature)."
40 }
else if (disableROIforEveryNth < -1) {
41 disableROIforEveryNth = -1;
44 int experiment = std::stoi(argv[3]);
45 int run = std::stoi(argv[4]);
48 if (argc > 5) exp_end = std::stoi(argv[5]);
49 if (argc > 6) run_end = std::stoi(argv[6]);
54 conf.prependTestingPayloadLocation(
"localdb/database.txt");
59 logging->setDebugLevel(10);
69 roiParametersDBPtr.
construct(roiParameters);
71 std::cout <<
"Successfully wrote payload ROIParameters with iov "
72 << experiment <<
"," << run <<
"," << exp_end <<
"," << run_end << std::endl;
static Configuration & getInstance()
Get a reference to the instance which will be used when the Database is initialized.
bool import(const IntervalOfValidity &iov)
Import the object to database.
Class for importing a single object to the database.
void construct(Args &&... params)
Construct an object of type T in this DBImportObjPtr using the provided constructor arguments.
A class that describes the interval of experiments/runs for which an object in the database is valid.
@ c_Debug
Debug: for code development.
LogConfig * getLogConfig()
Returns global log system configuration.
static LogSystem & Instance()
Static method to get a reference to the LogSystem instance.
The payload containing all PXD ROI parameters.
void setDisableROIforEveryNth(int disableROIforEveryNth)
Set if ROI finding was disabled for every Nth event (-1 if not used)
void setROIfinding(bool useROIfinding)
Set whether ROI finding was used.
int main(int argc, char **argv)
Run all tests.