Belle II Software  release-06-01-15
BKLMDatabaseImporter.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 
9 /* Own header. */
10 #include <klm/bklm/calibration/BKLMDatabaseImporter.h>
11 
12 /* KLM headers. */
13 #include <klm/dbobjects/bklm/BKLMGeometryPar.h>
14 #include <klm/dbobjects/bklm/BKLMSimulationPar.h>
15 
16 /* Belle 2 headers. */
17 #include <framework/database/Database.h>
18 #include <framework/database/DBImportObjPtr.h>
19 #include <framework/database/IntervalOfValidity.h>
20 #include <framework/gearbox/GearDir.h>
21 
22 using namespace Belle2;
23 
25 {
26 }
27 
28 void BKLMDatabaseImporter::setIOV(int experimentLow, int runLow,
29  int experimentHigh, int runHigh)
30 {
31  m_ExperimentLow = experimentLow;
32  m_RunLow = runLow;
33  m_ExperimentHigh = experimentHigh;
34  m_RunHigh = runHigh;
35 }
36 
38 {
39  GearDir content(Gearbox::getInstance().getDetectorComponent("KLM"));
40  BKLMGeometryPar bklmGeometryPar(content);
43  Database::Instance().storeData("BKLMGeometryPar", &bklmGeometryPar, iov);
44 
45 }
46 
48 {
49  GearDir content(Gearbox::getInstance().getDetectorComponent("KLM"), "BKLM/SimulationParameters");
50  BKLMSimulationPar bklmSimulationPar(content);
53  Database::Instance().storeData("BKLMSimulationPar", &bklmSimulationPar, iov);
54 }
55 
57 {
59  adcThreshold.construct(*inputThreshold);
62  adcThreshold.import(iov);
63 }
The Class for BKLM scintillator ADC related parameters.
void importGeometryPar()
Import BKLM geometry parameters into the database.
void importSimulationPar()
Import BKLM simulation parameters into the database.
int m_ExperimentHigh
High experiment.
void setIOV(int experimentLow, int runLow, int experimentHigh, int runHigh)
Set interval of validity.
void importADCThreshold(BKLMADCThreshold *inputThreshold)
Import BKLM scintillator ADC parameters into the database.
The Class for BKLM geometry.
Provides BKLM simulation parameters.
bool import(const IntervalOfValidity &iov)
Import the object to database.
Definition: DBImportBase.cc:36
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.
GearDir is the basic class used for accessing the parameter store.
Definition: GearDir.h:31
A class that describes the interval of experiments/runs for which an object in the database is valid.
static Gearbox & getInstance()
Return reference to the Gearbox instance.
Definition: Gearbox.cc:81
static Database & Instance()
Instance of a singleton Database.
Definition: Database.cc:41
bool storeData(const std::string &name, TObject *object, const IntervalOfValidity &iov)
Store an object in the database.
Definition: Database.cc:140
Abstract base class for different kinds of events.