9 #include <framework/database/DBImportObjPtr.h>
10 #include <framework/database/DBObjPtr.h>
11 #include <framework/database/DBStore.h>
12 #include <framework/datastore/StoreObjPtr.h>
13 #include <framework/datastore/DataStore.h>
14 #include <framework/dataobjects/EventMetaData.h>
15 #include <framework/logging/LogSystem.h>
16 #include <ecl/dbobjects/ECLCrystalCalib.h>
23 void setupDatabase(
int exp,
int run,
int eventNr = 1)
56 std::vector<float> tempCalib;
57 std::vector<float> tempCalibUnc;
107 logging->setDebugLevel(10);
113 int experiment = 1002;
115 setupDatabase(experiment, run);
121 std::vector<float> calibIn;
122 std::vector<float> calibInUnc;
123 calibIn = InputCalib->getCalibVector();
124 calibInUnc = InputCalib->getCalibUncVector();
128 tempCalibUnc = calibInUnc;
131 for (
int ic = 0; ic < 9000; ic += 1000) {
132 std::cout <<
"crysID " << ic <<
" calib = " << tempCalib[ic] <<
" +/- " << tempCalibUnc[ic] << std::endl;
136 std::cout <<
"Creating importer" << std::endl;
138 importer.construct();
139 importer->setCalibVector(tempCalib, tempCalibUnc);
141 std::cout <<
"Successfully wrote payload ECLCrystalEnergyGammaGamma" << std::endl;
Class for importing a single object to the database.
Singleton class to cache database objects.
static DataStore & Instance()
Instance of singleton Store.
void setInitializeActive(bool active)
Setter for m_initializeActive.
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.
bool registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.
Type-safe access to single objects in the data store.
bool construct(Args &&... params)
Construct an object of type T in this StoreObjPtr, using the provided constructor arguments.
static DBStore & Instance()
Instance of a singleton DBStore.
void updateEvent()
Updates all intra-run dependent objects.
void update()
Updates all objects that are outside their interval of validity.
Abstract base class for different kinds of events.
int main(int argc, char **argv)
Run all tests.