Belle II Software  release-05-01-25
BKLMDatabaseImporter.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015-2019 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Yinghui Guan, Vipin Gaur, *
7  * Zachary S. Stottler, Giacomo De Pietro *
8  * *
9  * This software is provided "as is" without any warranty. *
10  **************************************************************************/
11 
12 /* Own header. */
13 #include <klm/bklm/calibration/BKLMDatabaseImporter.h>
14 
15 /* KLM headers. */
16 #include <klm/dbobjects/bklm/BKLMGeometryPar.h>
17 #include <klm/dbobjects/bklm/BKLMSimulationPar.h>
18 
19 /* Belle 2 headers. */
20 #include <framework/database/Database.h>
21 #include <framework/database/DBImportObjPtr.h>
22 #include <framework/database/IntervalOfValidity.h>
23 #include <framework/gearbox/GearDir.h>
24 
25 using namespace Belle2;
26 
28 {
29 }
30 
31 void BKLMDatabaseImporter::setIOV(int experimentLow, int runLow,
32  int experimentHigh, int runHigh)
33 {
34  m_ExperimentLow = experimentLow;
35  m_RunLow = runLow;
36  m_ExperimentHigh = experimentHigh;
37  m_RunHigh = runHigh;
38 }
39 
41 {
42  GearDir content(Gearbox::getInstance().getDetectorComponent("KLM"));
43  BKLMGeometryPar bklmGeometryPar(content);
46  Database::Instance().storeData("BKLMGeometryPar", &bklmGeometryPar, iov);
47 
48 }
49 
51 {
52  GearDir content(Gearbox::getInstance().getDetectorComponent("KLM"), "BKLM/SimulationParameters");
53  BKLMSimulationPar bklmSimulationPar(content);
56  Database::Instance().storeData("BKLMSimulationPar", &bklmSimulationPar, iov);
57 }
58 
60 {
62  adcThreshold.construct(*inputThreshold);
65  adcThreshold.import(iov);
66 }
Belle2::IntervalOfValidity
A class that describes the interval of experiments/runs for which an object in the database is valid.
Definition: IntervalOfValidity.h:35
Belle2::BKLMDatabaseImporter::setIOV
void setIOV(int experimentLow, int runLow, int experimentHigh, int runHigh)
Set interval of validity.
Definition: BKLMDatabaseImporter.cc:31
Belle2::BKLMDatabaseImporter::importADCThreshold
void importADCThreshold(BKLMADCThreshold *inputThreshold)
Import BKLM scintillator ADC parameters into the database.
Definition: BKLMDatabaseImporter.cc:59
Belle2::Gearbox::getInstance
static Gearbox & getInstance()
Return reference to the Gearbox instance.
Definition: Gearbox.cc:74
Belle2::BKLMDatabaseImporter::importGeometryPar
void importGeometryPar()
Import BKLM geometry parameters into the database.
Definition: BKLMDatabaseImporter.cc:40
Belle2::BKLMDatabaseImporter::m_RunHigh
int m_RunHigh
High run.
Definition: BKLMDatabaseImporter.h:82
Belle2::Database::storeData
bool storeData(const std::string &name, TObject *object, const IntervalOfValidity &iov)
Store an object in the database.
Definition: Database.cc:152
Belle2::BKLMADCThreshold
The Class for BKLM scintillator ADC related parameters.
Definition: BKLMADCThreshold.h:36
Belle2::DBImportObjPtr::construct
void construct(Args &&... params)
Construct an object of type T in this DBImportObjPtr using the provided constructor arguments.
Definition: DBImportObjPtr.h:57
Belle2::DBImportBase::import
bool import(const IntervalOfValidity &iov)
Import the object to database.
Definition: DBImportBase.cc:38
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::BKLMSimulationPar
Provides BKLM simulation parameters.
Definition: BKLMSimulationPar.h:34
Belle2::GearDir
GearDir is the basic class used for accessing the parameter store.
Definition: GearDir.h:41
Belle2::DBImportObjPtr
Class for importing a single object to the database.
Definition: DBImportObjPtr.h:33
Belle2::BKLMDatabaseImporter::m_ExperimentLow
int m_ExperimentLow
Low experiment.
Definition: BKLMDatabaseImporter.h:73
Belle2::BKLMGeometryPar
The Class for BKLM geometry.
Definition: BKLMGeometryPar.h:42
Belle2::BKLMDatabaseImporter::m_ExperimentHigh
int m_ExperimentHigh
High experiment.
Definition: BKLMDatabaseImporter.h:79
Belle2::BKLMDatabaseImporter::BKLMDatabaseImporter
BKLMDatabaseImporter()
Constructor.
Definition: BKLMDatabaseImporter.cc:27
Belle2::Database::Instance
static Database & Instance()
Instance of a singleton Database.
Definition: Database.cc:54
Belle2::BKLMDatabaseImporter::importSimulationPar
void importSimulationPar()
Import BKLM simulation parameters into the database.
Definition: BKLMDatabaseImporter.cc:50
Belle2::BKLMDatabaseImporter::m_RunLow
int m_RunLow
Low run.
Definition: BKLMDatabaseImporter.h:76