Centrality Framework
Loading...
Searching...
No Matches
BordersFinder.hpp
1
8#ifndef CENTRALITY_BORDERSFINDER_H
9#define CENTRALITY_BORDERSFINDER_H
10
11#include "TH1.h"
12
13namespace Centrality {
14
16
17 public:
18 BordersFinder() = default;
19
20 void FindBorders();
21 void SaveBorders(const std::string& filename, const std::string& getter_name);
22
23 void SetHisto(const TH1F& h) { histo_ = h; }
24 TH1F& GetHisto() { return histo_; }// not const to use Draw etc
25
26 void SetNormalization(long int norm) { norm_ = norm; }
27 Double_t GetNormalization() const { return norm_; }
28
29 void SetRanges(const std::vector<double>& ranges) { ranges_ = ranges; }
30 void SetRanges(int n, double min, double max) {
31 ranges_.clear();
32 for (int i = 0; i <= n; ++i) {
33 ranges_.push_back(min + i * (max - min) / n);
34 }
35 }
39 void SetBorders(const std::vector<double>& borders) { borders_ = borders; }
40
41 void SetLimits(double xLo, double xHi) {
42 xLo_ = xLo;
43 xHi_ = xHi;
44 applyLimits_ = true;
45 }
46
47 void IsSpectator(bool is = true) { isSpectator_ = is; }
48
49 [[nodiscard]] const std::vector<double>& GetRanges() const { return ranges_; }
50 [[nodiscard]] const std::vector<double>& GetBorders() const { return borders_; }
51 [[nodiscard]] bool GetIsSpectator() const { return isSpectator_; }
52
53 private:
54 TH1F histo_;
55 Double_t norm_{-1};
56
57 std::vector<double> ranges_{};
58 std::vector<double> borders_{};
59
60 bool isSpectator_{false};
61
62 bool applyLimits_{false};
63 double xLo_{-1};
64 double xHi_{-1};
65};
66}// namespace Centrality
67
68#endif//CENTRALITY_BORDERSFINDER_H
Class to determine centrality.
Definition BordersFinder.hpp:15
void SetBorders(const std::vector< double > &borders)
Definition BordersFinder.hpp:39