Belle II Software  release-05-01-25
EKLMDatabaseImporter.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2016 Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Kirill Chilikin *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 /* Own header. */
12 #include <klm/eklm/calibration/EKLMDatabaseImporter.h>
13 
14 /* KLM headers. */
15 #include <klm/dbobjects/eklm/EKLMReconstructionParameters.h>
16 #include <klm/dbobjects/eklm/EKLMSimulationParameters.h>
17 
18 /* Belle 2 headers. */
19 #include <framework/database/IntervalOfValidity.h>
20 #include <framework/database/DBImportObjPtr.h>
21 #include <framework/gearbox/GearDir.h>
22 #include <framework/gearbox/Unit.h>
23 
24 using namespace Belle2;
25 
27 {
28 }
29 
31 {
32 }
33 
34 void EKLMDatabaseImporter::setIOV(int experimentLow, int runLow,
35  int experimentHigh, int runHigh)
36 {
37  m_ExperimentLow = experimentLow;
38  m_RunLow = runLow;
39  m_ExperimentHigh = experimentHigh;
40  m_RunHigh = runHigh;
41 }
42 
44 {
46  recPar.construct();
47  GearDir gd("/Detector/DetectorComponent[@name=\"EKLM\"]/"
48  "Content/DigitizationParams");
49  recPar->setTimeResolution(gd.getDouble("TimeResolution"));
52  recPar.import(iov);
53 }
54 
56 {
58  simPar.construct();
59  GearDir gd(Gearbox::getInstance().getDetectorComponent("KLM"));
60  gd.append("/EKLM/SensitiveDetector");
61  simPar->setHitTimeThreshold(
62  Unit::convertValue(gd.getDouble("HitTimeThreshold") , "ns"));
65  simPar.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::EKLMDatabaseImporter::EKLMDatabaseImporter
EKLMDatabaseImporter()
Constructor.
Definition: EKLMDatabaseImporter.cc:26
Belle2::EKLMSimulationParameters::setHitTimeThreshold
void setHitTimeThreshold(float threshold)
Set hit time threshold.
Definition: EKLMSimulationParameters.h:58
Belle2::EKLMDatabaseImporter::~EKLMDatabaseImporter
~EKLMDatabaseImporter()
Destructor.
Definition: EKLMDatabaseImporter.cc:30
Belle2::Gearbox::getInstance
static Gearbox & getInstance()
Return reference to the Gearbox instance.
Definition: Gearbox.cc:74
Belle2::EKLMDatabaseImporter::m_ExperimentLow
int m_ExperimentLow
Low experiment.
Definition: EKLMDatabaseImporter.h:62
Belle2::EKLMDatabaseImporter::m_RunLow
int m_RunLow
Low run.
Definition: EKLMDatabaseImporter.h:65
Belle2::EKLMDatabaseImporter::importReconstructionParameters
void importReconstructionParameters()
Import reconstruction parameters.
Definition: EKLMDatabaseImporter.cc:43
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::EKLMDatabaseImporter::m_ExperimentHigh
int m_ExperimentHigh
High experiment.
Definition: EKLMDatabaseImporter.h:68
Belle2::gearbox::Interface::getDouble
double getDouble(const std::string &path="") const noexcept(false)
Get the parameter path as a double.
Definition: Interface.cc:51
Belle2::Unit::convertValue
static double convertValue(double value, const std::string &unitString)
Converts a floating point value to the standard framework unit.
Definition: UnitConst.cc:136
Belle2::EKLMReconstructionParameters::setTimeResolution
void setTimeResolution(float resolution)
Set time resolution (of reconstructed time, not ADC).
Definition: EKLMReconstructionParameters.h:58
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::GearDir
GearDir is the basic class used for accessing the parameter store.
Definition: GearDir.h:41
Belle2::GearDir::append
void append(const std::string &path)
Append something to the current path, modifying the GearDir in place.
Definition: GearDir.h:62
Belle2::DBImportObjPtr
Class for importing a single object to the database.
Definition: DBImportObjPtr.h:33
Belle2::EKLMDatabaseImporter::importSimulationParameters
void importSimulationParameters()
Import simulation parameters.
Definition: EKLMDatabaseImporter.cc:55
Belle2::EKLMDatabaseImporter::m_RunHigh
int m_RunHigh
High run.
Definition: EKLMDatabaseImporter.h:71
Belle2::EKLMDatabaseImporter::setIOV
void setIOV(int experimentLow, int runLow, int experimentHigh, int runHigh)
Set interval of validity.
Definition: EKLMDatabaseImporter.cc:34