10#include <reconstruction/dbobjects/CDCDedxDatabaseImporter.h>
11#include <reconstruction/dbobjects/CDCDedxScaleFactor.h>
12#include <reconstruction/dbobjects/CDCDedxHadronCor.h>
13#include <reconstruction/dbobjects/CDCDedxMeanPars.h>
14#include <reconstruction/dbobjects/CDCDedxSigmaPars.h>
15#include <reconstruction/dbobjects/DedxPDFs.h>
18#include <framework/logging/Logger.h>
19#include <framework/database/IntervalOfValidity.h>
20#include <framework/database/Database.h>
28#include <TClonesArray.h>
41 TClonesArray dedxPDFs(
"Belle2::DedxPDFs");
52 TClonesArray scaleFactor(
"Belle2::CDCDedxScaleFactor");
62 TClonesArray hadronCorrection(
"Belle2::CDCDedxHadronCor");
69 TFile* f = TFile::Open(inputFile.c_str(),
"READ");
71 TIter next(f->GetListOfKeys());
73 while ((key = (TKey*) next())) {
75 std::string histconstants = key->GetName();
77 if (histconstants.compare(
"CDCDedxHadronCor") == 0) {
78 parhist = (TH1F*)f->Get(histconstants.c_str());
79 B2INFO(
"Key name matches: " << histconstants);
83 B2WARNING(
"Key name does not match: " << histconstants);
91 if (nFiles != 1) { B2FATAL(
"Sorry, you must only import one file at a time for now!"); }
94 if (!parhist) B2FATAL(
"None of the input files contains the histogram called 'CDCDedxHadronCor'!");
95 short version = parhist->GetBinContent(1);
96 std::vector<double> hadroncor;
97 for (
int bin = 2; bin <= parhist->GetNbinsX(); ++bin) {
98 hadroncor.push_back(parhist->GetBinContent(bin));
109 TClonesArray meanParameters(
"Belle2::CDCDedxMeanPars");
116 TFile* f = TFile::Open(inputFile.c_str(),
"READ");
118 TIter next(f->GetListOfKeys());
120 while ((key = (TKey*) next())) {
122 std::string histconstants = key->GetName();
124 if (histconstants.compare(
"CDCDedxMeanPars") == 0) {
125 parhist = (TH1F*)f->Get(histconstants.c_str());
126 B2INFO(
"Key name matches: " << histconstants);
130 B2WARNING(
"Key name does not match: " << histconstants);
138 if (nFiles != 1) { B2FATAL(
"Sorry, you must only import one file at a time for now!"); }
141 if (!parhist) B2FATAL(
"None of the input files contains the histogram called 'CDCDedxMeanPars'!");
142 short version = parhist->GetBinContent(1);
143 std::vector<double> meanpars;
144 for (
int bin = 2; bin <= parhist->GetNbinsX(); ++bin) {
145 meanpars.push_back(parhist->GetBinContent(bin));
156 TClonesArray sigmaParameters(
"Belle2::CDCDedxSigmaPars");
163 TFile* f = TFile::Open(inputFile.c_str(),
"READ");
165 TIter next(f->GetListOfKeys());
167 while ((key = (TKey*) next())) {
169 std::string histconstants = key->GetName();
171 if (histconstants.compare(
"CDCDedxSigmaPars") == 0) {
172 parhist = (TH1F*)f->Get(histconstants.c_str());
173 B2INFO(
"Key name matches: " << histconstants);
177 B2WARNING(
"Key name does not match: " << histconstants);
185 if (nFiles != 1) { B2FATAL(
"Sorry, you must only import one file at a time for now!"); }
188 if (!parhist) B2FATAL(
"None of the input files contains the histogram called 'CDCDedxSigmaPars'!");
189 short version = parhist->GetBinContent(1);
190 std::vector<double> sigmapars;
191 for (
int bin = 2; bin <= parhist->GetNbinsX(); ++bin) {
192 sigmapars.push_back(parhist->GetBinContent(bin));
void importScaleFactor(double scale)
Import a scale factor to make electron dE/dx ~ 1.
void importHadronCorrection()
Import parameters for the hadron correction.
void importSigmaParameters()
Import predicted resolution parameters to the database.
std::vector< std::string > m_inputFileNames
Name of input ROOT files.
CDCDedxDatabaseImporter(std::string inputFileName, const std::string &m_name)
Constructor.
void importMeanParameters()
Import predicted mean parameters to the database.
std::string m_name
Name of database ROOT file.
void importPDFs()
Import a set of dedx:momentum pdfs.
dE/dx hadron saturation parameterization constants
dE/dx mean (curve versus beta-gamma) parameterization constants
dE/dx run gain calibration constants
dE/dx sigma (versus beta-gamma) parameterization constants
dE/dx wire gain calibration constants
A class that describes the interval of experiments/runs for which an object in the database is valid.
static Database & Instance()
Instance of a singleton Database.
bool storeData(const std::string &name, TObject *object, const IntervalOfValidity &iov)
Store an object in the database.
Abstract base class for different kinds of events.