Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
FastAxisCalc.h
1/*
2 * FastAxisCalc.h
3 *
4 * Created on: 11 paź 2024
5 * Author: daniel
6 */
7
8#ifndef HAL_FEATURES_PHYS_FASTAXISCALC_H_
9#define HAL_FEATURES_PHYS_FASTAXISCALC_H_
10
11#include <TObject.h>
12
13class TAxis;
14
15namespace Hal {
19 class FastAxisCalc : public TObject {
20 Double_t fMin = {0}, fMax = {1.0}, fStep = {100.0};
21 Int_t fMinBin = {0};
22 Int_t fMaxBin = {100};
23
24 public:
25 FastAxisCalc() {};
26 FastAxisCalc(const TAxis& x);
27 void Recalc(const TAxis& x);
28 void RoundToMinusOne();
29 inline Int_t GetBin(Double_t val) const {
30 if (val < fMin) return fMinBin;
31 if (val >= fMax) return fMaxBin;
32 return (val - fMin) * fStep + 1.0;
33 }
34 virtual void Print(Option_t* option = "") const;
35 virtual ~FastAxisCalc() {};
36 ClassDef(FastAxisCalc, 1)
37 };
38} // namespace Hal
39
40#endif /* HAL_FEATURES_PHYS_FASTAXISCALC_H_ */