10#include <klm/calibration/KLMDatabaseImporter.h>
13#include <framework/database/DBImportObjPtr.h>
14#include <framework/database/IntervalOfValidity.h>
15#include <framework/logging/Logger.h>
35 int experimentHigh,
int runHigh)
47 channelStatusImport.
construct(*channelStatus);
50 channelStatusImport.
import(iov);
57 digPar.construct(*digitizationParameters);
67 digPar.construct(*digitizationParameters);
77 timeConversionImport.
construct(*timeConversion);
80 timeConversionImport.
import(iov);
89 timeWindowImport.
import(iov);
95 TFile* file = TFile::Open(fileName.c_str(),
"r");
97 B2ERROR(
"KLMDatabaseImporter: calibration file " << fileName <<
" *** failed to open");
99 TTree* tree = (TTree*)file->Get(
"tree");
101 B2ERROR(
"KLMDatabaseImporter: calibration file " << fileName <<
" *** no tree named 'tree' found");
105 tree->SetBranchAddress(
"isBarrel", &isBarrel);
107 tree->SetBranchAddress(
"isForward", §ion);
109 tree->SetBranchAddress(
"sector", §or);
111 tree->SetBranchAddress(
"layer", &layer);
113 tree->SetBranchAddress(
"plane", &plane);
115 tree->SetBranchAddress(
"strip", &strip);
116 float efficiency = 1.;
117 tree->SetBranchAddress(
"efficiency", &efficiency);
118 float efficiencyError = 0.;
119 tree->SetBranchAddress(
"efficiencyError", &efficiencyError);
121 for (
int i = 0; i < tree->GetEntries(); i++) {
124 stripEfficiency->setBarrelEfficiency(section, sector, layer, plane, strip, efficiency, efficiencyError);
126 stripEfficiency->setEndcapEfficiency(section, sector, layer, plane, strip, efficiency, efficiencyError);
137 stripEfficiencyImport.
construct(*stripEfficiency);
140 stripEfficiencyImport.
import(iov);
146 std::string payloadName;
148 payloadName =
"BKLMDisplacement";
150 payloadName =
"BKLMAlignment";
152 bklmAlignmentImport.
construct(*bklmAlignment);
155 bklmAlignmentImport.
import(iov);
161 std::string payloadName;
163 payloadName =
"EKLMDisplacement";
165 payloadName =
"EKLMAlignment";
167 eklmAlignmentImport.
construct(*eklmAlignment);
170 eklmAlignmentImport.
import(iov);
176 std::string payloadName;
178 payloadName =
"EKLMSegmentDisplacement";
180 payloadName =
"EKLMSegmentAlignment";
182 eklmSegmentAlignmentImport.
construct(*eklmSegmentAlignment);
185 eklmSegmentAlignmentImport.
import(iov);
Class to store BKLM alignment data in the database.
bool import(const IntervalOfValidity &iov)
Import the object to database.
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.
Class to store EKLM alignment data in the database.
Class to store EKLM alignment data in the database.
A class that describes the interval of experiments/runs for which an object in the database is valid.
~KLMDatabaseImporter()
Destructor.
void importTimeWindow(KLMTimeWindow *timeWindow)
Import KLM time window parameters.
int m_ExperimentHigh
High experiment.
KLMDatabaseImporter()
Constructor.
void importEKLMSegmentAlignment(const EKLMSegmentAlignment *eklmSegmentAlignment, bool displacement=false)
Import EKLM segment alignment.
void importReconstructionParameters(const KLMReconstructionParameters *digitizationParameters)
Import reconstruction parameters.
void importScintillatorDigitizationParameters(const KLMScintillatorDigitizationParameters *digitizationParameters)
Import scintillator simulation parameters.
int m_ExperimentLow
Low experiment.
void importChannelStatus(const KLMChannelStatus *channelStatus)
Import channel status.
void setIOV(int experimentLow, int runLow, int experimentHigh, int runHigh)
Set interval of validity.
void importTimeConversion(const KLMTimeConversion *timeConversion)
Import time conversion parameters.
void importStripEfficiency(const KLMStripEfficiency *stripEfficiency)
Import strip efficiencies.
void importEKLMAlignment(const EKLMAlignment *eklmAlignment, bool displacement=false)
Import EKLM alignment.
void importAlignment(const BKLMAlignment *bklmAlignment, const EKLMAlignment *eklmAlignment, const EKLMSegmentAlignment *eklmSegmentAlignment, bool displacement=false)
Import alignment.
void loadStripEfficiency(KLMStripEfficiency *stripEfficiency, std::string fileName)
Load strip efficiencies.
void importBKLMAlignment(const BKLMAlignment *bklmAlignment, bool displacement=false)
Import BKLM alignment.
Class to store KLM reconstruction parameters in the database.
Class to store KLM scintillator simulation parameters in the database.
DBObject used to store the efficiencies of KLM strips.
DBObject containing KLM time window parameters used in KLMReconstructor module.
Abstract base class for different kinds of events.