27void CalibdEdxCorrection::clear()
29 for (
auto&
row : mParams) {
34 for (
auto&
x : mChi2) {
42 std::unique_ptr<TFile>
file(TFile::Open(fileName.data(),
"recreate"));
44 LOGP(error,
"Failed to open file {} for writing", fileName.data());
48 file->WriteObject(
this, objName.data());
53 std::unique_ptr<TFile>
file(TFile::Open(fileName.data()));
55 LOGP(error,
"Failed to open file {}", fileName.data());
63 LOGP(error,
"Failed to load object with name {} from file {}", objName.data(), fileName.data());
78 std::vector<float> qMaxCorrOut;
79 std::vector<float> qTotCorrOut;
80 std::vector<float> tglOut;
81 std::vector<float> snpOut;
83 for (
float tgl = 0;
tgl < 2;
tgl += 0.01) {
84 for (
float snp = 0;
snp < 1;
snp += 0.1) {
87 tglOut.emplace_back(
tgl);
88 snpOut.emplace_back(
snp);
93 <<
"qMaxCorr=" << qMaxCorrOut
94 <<
"qTotCorr=" << qTotCorrOut
98 <<
"sector=" << sector
106 std::array<float, ParamSize>
params{};
111 std::for_each(
params.begin(),
params.end(), [](
auto&
val) { val /= (0.5f * FitSize); });
117 std::array<float, ParamSize>
params{};
122 std::for_each(
params.begin(),
params.end(), [](
auto&
val) { val /= (SECTORSPERSIDE * SIDES); });
136 return mean / (0.5f *
FitSize);
159 return mean / (0.5f *
FitSize);
void dumpToTree(const char *outFileName="calib_dedx.root") const
static constexpr int ParamSize
Number of params per fit.
const std::array< float, ParamSize > getMeanParams(ChargeType charge) const
Parameters averaged over all stacks.
void writeToFile(std::string_view fileName, std::string_view objName="ccdb_object") const
void loadFromFile(std::string_view fileName, std::string_view objName="ccdb_object")
float getMeanParam(ChargeType charge, uint32_t param) const
Single fit parameters averaged over all sectors for a stack type.
ChargeType float float snp
float getMeanEntries(ChargeType charge) const
Single fit parameters averaged over all sectors for a stack type.
static constexpr int FitSize
Number of fitted corrections.
GLenum const GLfloat * params
Global TPC definitions and constants.
GEMstack
TPC GEM stack types.
constexpr unsigned char SECTORSPERSIDE
constexpr unsigned char SIDES
constexpr unsigned short GEMSTACKSPERSECTOR
GEM stack identification.