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 short version = parhist->GetBinContent(1);
95 std::vector<double> hadroncor;
96 for (
int bin = 2; bin <= parhist->GetNbinsX(); ++bin) {
97 hadroncor.push_back(parhist->GetBinContent(bin));
108 TClonesArray meanParameters(
"Belle2::CDCDedxMeanPars");
115 TFile* f = TFile::Open(inputFile.c_str(),
"READ");
117 TIter next(f->GetListOfKeys());
119 while ((key = (TKey*) next())) {
121 std::string histconstants = key->GetName();
123 if (histconstants.compare(
"CDCDedxMeanPars") == 0) {
124 parhist = (TH1F*)f->Get(histconstants.c_str());
125 B2INFO(
"Key name matches: " << histconstants);
129 B2WARNING(
"Key name does not match: " << histconstants);
137 if (nFiles != 1) { B2FATAL(
"Sorry, you must only import one file at a time for now!"); }
140 short version = parhist->GetBinContent(1);
141 std::vector<double> meanpars;
142 for (
int bin = 2; bin <= parhist->GetNbinsX(); ++bin) {
143 meanpars.push_back(parhist->GetBinContent(bin));
154 TClonesArray sigmaParameters(
"Belle2::CDCDedxSigmaPars");
161 TFile* f = TFile::Open(inputFile.c_str(),
"READ");
163 TIter next(f->GetListOfKeys());
165 while ((key = (TKey*) next())) {
167 std::string histconstants = key->GetName();
169 if (histconstants.compare(
"CDCDedxSigmaPars") == 0) {
170 parhist = (TH1F*)f->Get(histconstants.c_str());
171 B2INFO(
"Key name matches: " << histconstants);
175 B2WARNING(
"Key name does not match: " << histconstants);
183 if (nFiles != 1) { B2FATAL(
"Sorry, you must only import one file at a time for now!"); }
186 short version = parhist->GetBinContent(1);
187 std::vector<double> sigmapars;
188 for (
int bin = 2; bin <= parhist->GetNbinsX(); ++bin) {
189 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.