10#include <ecl/dataobjects/ECLElementNumbers.h>
11#include <ecl/dbobjects/ECLCrystalCalib.h>
14#include <framework/database/DBImportObjPtr.h>
15#include <framework/database/DBObjPtr.h>
16#include <framework/database/DBStore.h>
17#include <framework/dataobjects/EventMetaData.h>
18#include <framework/datastore/DataStore.h>
19#include <framework/datastore/StoreObjPtr.h>
20#include <framework/logging/LogSystem.h>
29 void setupDatabase(
int exp,
int run,
int eventNr = 1)
62 std::vector<float> tempCalib;
63 std::vector<float> tempCalibUnc;
119 int experiment = 1002;
121 setupDatabase(experiment, run);
127 std::vector<float> calibIn;
128 std::vector<float> calibInUnc;
129 calibIn = InputCalib->getCalibVector();
130 calibInUnc = InputCalib->getCalibUncVector();
134 tempCalibUnc = calibInUnc;
137 for (
int ic = 0; ic < 9000; ic += 1000) {
138 std::cout <<
"crysID " << ic <<
" calib = " << tempCalib[ic] <<
" +/- " << tempCalibUnc[ic] << std::endl;
142 std::cout <<
"Creating importer" << std::endl;
144 importer.construct();
145 importer->setCalibVector(tempCalib, tempCalibUnc);
147 std::cout <<
"Successfully wrote payload ECLCrystalEnergyGammaGamma" << std::endl;
Class for importing a single object to the database.
Class for accessing objects in 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.
void setDebugLevel(int debugLevel)
Configure the debug messaging level.
@ c_Debug
Debug: for code development.
void setLogLevel(ELogLevel logLevel)
Configure the log level.
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.