34 StepTHn(
const Char_t*
name,
const Char_t* title,
const Int_t nSteps,
const Int_t nAxes);
37 template <
typename... Ts>
38 void Fill(
int iStep,
const Ts&... valuesAndWeight);
39 void Fill(
int iStep,
int nParams,
double positionAndWeight[]);
41 THnBase*
getTHn(Int_t step, Bool_t sparse = kFALSE)
58 virtual Long64_t
Merge(TCollection* list) = 0;
102template <
class TemplateArray>
107 StepTHnT(
const Char_t*
name,
const Char_t* title,
const Int_t nSteps,
const Int_t nAxes, Int_t* nBins, std::vector<Double_t> binEdges[],
const char** axisTitles);
108 StepTHnT(
const char*
name,
const char* title,
const int nSteps,
const int nAxes,
const int* nBins,
const double* xmin,
const double* xmax);
111 Long64_t
Merge(TCollection* list)
override;
116 if (
src ==
nullptr) {
117 return new TemplateArray(
mNBins);
119 return new TemplateArray(*((TemplateArray*)
src));
127 LOGF(info,
"Created values container for step %d", iStep);
133 LOGF(info,
"Created sumw2 container for step %d", iStep);
137 auto* arr =
static_cast<TemplateArray*
>(
mValues[iStep])->GetArray();
140 auto* sw2 =
static_cast<TemplateArray*
>(
mSumw2[iStep])->GetArray();
151template <
typename... Ts>
154 constexpr int nArgs =
sizeof...(Ts);
155 double tempArray[] = {
static_cast<double>(valuesAndWeight)...};
156 Fill(iStep, nArgs, tempArray);
StepTHnT< TArrayF > StepTHnF
StepTHnT< TArrayD > StepTHnD
void updateBin(int iStep, Long64_t bin, double weight) override
TArray * createArray(const TArray *src=nullptr) const override
~StepTHnT() override=default
Long64_t Merge(TCollection *list) override
Double_t * mLastVars
cache Nbins per axis
Int_t * mLastBins
caching of last used bins (in many loops some vars are the same for a while)
void Fill(int iStep, const Ts &... valuesAndWeight)
TAxis ** mAxisCache
target histogram
Long64_t getGlobalBinIndex(const Int_t *binIdx)
StepTHn & operator=(const StepTHn &corr)
virtual TArray * createArray(const TArray *src=nullptr) const =0
Int_t * mNbinsCache
cache axis pointers (about 50% of the time in Fill is spent in GetAxis otherwise)
virtual void updateBin(int iStep, Long64_t bin, double weight)=0
virtual Long64_t Merge(TCollection *list)=0
void createTarget(Int_t step, Bool_t sparse)
TArray * getValues(Int_t step)
THnBase * getTHn(Int_t step, Bool_t sparse=kFALSE)
THnSparse * mPrototype
per-axis lookup tables
TArray * getSumw2(Int_t step)
static constexpr Int_t kLookupSize
caching of last used bins (in many loops some vars are the same for a while)
GLuint const GLchar * name
GLuint GLuint GLfloat weight