17#ifndef GPUCA_STANDALONE
29void CalibdEdxCorrection::clear()
31 for (
auto&
row : mParams) {
36 for (
auto&
x : mChi2) {
42#ifndef GPUCA_STANDALONE
46 std::unique_ptr<TFile> file(TFile::Open(fileName.data(),
"recreate"));
48 LOGP(error,
"Failed to open file {} for writing", fileName.data());
52 file->WriteObject(
this, objName.data());
57 std::unique_ptr<TFile> file(TFile::Open(fileName.data()));
58 if (!file || file->IsZombie()) {
59 LOGP(error,
"Failed to open file {}", fileName.data());
67 LOGP(error,
"Failed to load object with name {} from file {}", objName.data(), fileName.data());
76 for (
int sector = 0; sector < 2 * SECTORSPERSIDE; ++sector) {
77 for (
int roc = 0;
roc < GEMSTACKSPERSECTOR; ++
roc) {
82 std::vector<float> qMaxCorrOut;
83 std::vector<float> qTotCorrOut;
84 std::vector<float> tglOut;
85 std::vector<float> snpOut;
87 for (
float tgl = 0;
tgl < 2;
tgl += 0.01) {
88 for (
float snp = 0;
snp < 1;
snp += 0.1) {
91 tglOut.emplace_back(
tgl);
92 snpOut.emplace_back(
snp);
97 <<
"qMaxCorr=" << qMaxCorrOut
98 <<
"qTotCorr=" << qTotCorrOut
102 <<
"sector=" << sector
110 std::array<float, ParamSize>
params{};
115 std::for_each(
params.begin(),
params.end(), [](
auto&
val) { val /= (0.5f * FitSize); });
121 std::array<float, ParamSize>
params{};
126 std::for_each(
params.begin(),
params.end(), [](
auto&
val) { val /= (SECTORSPERSIDE * SIDES); });
132 if (
param >= ParamSize) {
140 return mean / (0.5f * FitSize);
145 if (
param >= ParamSize) {
153 return mean / (SECTORSPERSIDE * SIDES);
163 return mean / (0.5f * FitSize);
173 return mean / (SECTORSPERSIDE * SIDES);
178 for (
int i = 0;
i < FitSize; ++
i) {
179 for (
int j = 0;
j < ParamSize; ++
j) {
void dumpToTree(const char *outFileName="calib_dedx.root") const
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.
void setUnity()
set all corrections to 1, used for default initialization and to reset corrections
ChargeType float float snp
float getMeanEntries(ChargeType charge) const
Single fit parameters averaged over all sectors for a stack type.
GLenum const GLfloat * params
Global TPC definitions and constants.
GEMstack
TPC GEM stack types.
GEM stack identification.