12 #include <reconstruction/dbobjects/CDCDedxDatabaseImporter.h>
13 #include <reconstruction/dbobjects/CDCDedxScaleFactor.h>
14 #include <reconstruction/dbobjects/CDCDedxHadronCor.h>
15 #include <reconstruction/dbobjects/CDCDedxMeanPars.h>
16 #include <reconstruction/dbobjects/CDCDedxSigmaPars.h>
17 #include <reconstruction/dbobjects/DedxPDFs.h>
20 #include <framework/logging/Logger.h>
21 #include <framework/database/IntervalOfValidity.h>
22 #include <framework/database/Database.h>
30 #include <TClonesArray.h>
43 TClonesArray dedxPDFs(
"Belle2::DedxPDFs");
54 TClonesArray scaleFactor(
"Belle2::CDCDedxScaleFactor");
64 TClonesArray hadronCorrection(
"Belle2::CDCDedxHadronCor");
71 TFile* f = TFile::Open(inputFile.c_str(),
"READ");
73 TIter next(f->GetListOfKeys());
75 while ((key = (TKey*) next())) {
77 std::string histconstants = key->GetName();
79 if (histconstants.compare(
"CDCDedxHadronCor") == 0) {
80 parhist = (TH1F*)f->Get(histconstants.c_str());
81 B2INFO(
"Key name matches: " << histconstants);
85 B2WARNING(
"Key name does not match: " << histconstants);
93 if (nFiles != 1) { B2FATAL(
"Sorry, you must only import one file at a time for now!"); }
96 short version = parhist->GetBinContent(1);
97 std::vector<double> hadroncor;
98 for (
int bin = 2; bin <= parhist->GetNbinsX(); ++bin) {
99 hadroncor.push_back(parhist->GetBinContent(bin));
110 TClonesArray meanParameters(
"Belle2::CDCDedxMeanPars");
117 TFile* f = TFile::Open(inputFile.c_str(),
"READ");
119 TIter next(f->GetListOfKeys());
121 while ((key = (TKey*) next())) {
123 std::string histconstants = key->GetName();
125 if (histconstants.compare(
"CDCDedxMeanPars") == 0) {
126 parhist = (TH1F*)f->Get(histconstants.c_str());
127 B2INFO(
"Key name matches: " << histconstants);
131 B2WARNING(
"Key name does not match: " << histconstants);
139 if (nFiles != 1) { B2FATAL(
"Sorry, you must only import one file at a time for now!"); }
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 short version = parhist->GetBinContent(1);
189 std::vector<double> sigmapars;
190 for (
int bin = 2; bin <= parhist->GetNbinsX(); ++bin) {
191 sigmapars.push_back(parhist->GetBinContent(bin));