Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
FastAxisCalc.cxx
1/*
2 * FastAxisCalc.cxx
3 *
4 * Created on: 11 paź 2024
5 * Author: daniel
6 */
7
8#include "FastAxisCalc.h"
9
10#include <iostream>
11
12#include <TAxis.h>
13
14namespace Hal {
15 FastAxisCalc::FastAxisCalc(const TAxis& x) {
16 const int steps = x.GetNbins();
17 fMin = x.GetBinLowEdge(1);
18 fMax = x.GetBinUpEdge(x.GetNbins());
19 fStep = (fMax - fMin) / ((Double_t) steps);
20 fStep = 1.0 / fStep;
21 fMinBin = 0;
22 fMaxBin = steps + 1;
23 }
24
25 void FastAxisCalc::Recalc(const TAxis& x) {
26 const int steps = x.GetNbins();
27 fMin = x.GetBinLowEdge(1);
28 fMax = x.GetBinUpEdge(x.GetNbins());
29 fStep = (fMax - fMin) / ((Double_t) steps);
30 fStep = 1.0 / fStep;
31 fMinBin = 0;
32 fMaxBin = steps + 1;
33 }
34
35 void FastAxisCalc::RoundToMinusOne() { fMinBin = fMaxBin = -1; }
36
37 void FastAxisCalc::Print(Option_t* option) const {
38 std::cout << ClassName() << std::endl;
39 std::cout << Form("1/step %4.4f min = %4.4f max = %4.4f", fStep, fMin, fMax) << std::endl;
40 }
41
42} // namespace Hal