9#include "CorrFitMapGroupConfig.h"
14 CorrFitMapGroupConfig::CorrFitMapGroupConfig() : fBins(100), fMin(0), fMax(100) {
15 fStep = (fMax - fMin) / Double_t(fBins);
17 SetName(
"CorrFitMapGroup");
20 void CorrFitMapGroupConfig::SetAxis(Int_t bins, Double_t min, Double_t max) {
24 if (fBins % 2 == 1) { Cout::PrintInfo(
"CorrFitMapGroupConfig::SetAxis odd number of CF bins detected!", EInfo::kError); }
29 fStep = (fMax - fMin) / Double_t(fBins);
33 Bool_t CorrFitMapGroupConfig::GroupByLong()
const {
34 if (fMode == 1)
return kTRUE;
38 Bool_t CorrFitMapGroupConfig::GroupByKStar()
const {
return !GroupByLong(); }
40 Int_t CorrFitMapGroupConfig::GetBin(
const FemtoPair* pair)
const {
41 Double_t val = TMath::Abs(pair->GetT());
43 val = TMath::Abs(pair->GetZ());
45 Int_t bin = (val - fMin) * fStep;
46 if (bin >= fBins)
return -1;
50 void CorrFitMapGroupConfig::Add(
const Object* pack) {
56 auto printError = []() {
Hal::Cout::PrintInfo(
"Cannot add CorrFitMapGroupConfig", EInfo::kError); };
58 if (fMode != data->fMode) { printError(); }
59 if (fBins != data->fBins) { printError(); };
60 if (fMin != data->fMin) { printError(); }
63 std::vector<TString> CorrFitMapGroupConfig::GetBranchesByValue(Double_t min, Double_t max, Bool_t signal)
const {
64 if (min == max && fMin != fMax) {
return GetBranchesByValue(fMin, fMax, signal); }
65 Int_t lowBin = (fMin - min) * fStep;
66 Int_t highBin = (fMax - min) * fStep;
67 std::vector<TString> result;
68 TString pattern =
"FemtoBackground_%i";
69 if (signal) { pattern =
"FemtoSignal_%i"; }
70 for (
int i = lowBin; i < highBin; i++) {
71 TString name = Form(pattern, i);
72 result.push_back(name);
77 std::vector<TString> CorrFitMapGroupConfig::GetBranchesByIndex(Int_t min, Int_t max, Bool_t signal)
const {
78 std::vector<TString> result;
79 TString pattern =
"FemtoBackground_%i";
80 if (signal) { pattern =
"FemtoSignal_%i"; }
81 for (
int i = min; i < max; i++) {
82 TString name = Form(pattern, i);
83 result.push_back(name);
static void PrintInfo(TString text, Hal::EInfo status)