Centrality Framework
Loading...
Searching...
No Matches
BordersFinder.hpp
1
7
8#ifndef CENTRALITY_BORDERSFINDER_H
9#define CENTRALITY_BORDERSFINDER_H
10
11#include "TH1.h"
12
13namespace Centrality {
14
15class BordersFinder {
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 // Set ranges of centrality estimator by vector, e.g. {0., 25., 50., 75., 100.} centrality [%]
27 void SetRanges(const std::vector<double>& ranges) { ranges_ = ranges; }
28
29 // Set ranges of centrality estimator, i.e. min, max centrality [%] + number of equal sized bins
30 void SetRanges(int n, double min, double max);
31
35 void SetBorders(const std::vector<double>& borders) { borders_ = borders; }
36
37 void SetLimits(double xLo, double xHi) {
38 xLo_ = xLo;
39 xHi_ = xHi;
40 applyLimits_ = true;
41 }
42
43 void IsSpectator(bool is = true) { isSpectator_ = is; }
44
45 [[nodiscard]] const std::vector<double>& GetRanges() const { return ranges_; }
46 [[nodiscard]] const std::vector<double>& GetBorders() const { return borders_; }
47 [[nodiscard]] bool GetIsSpectator() const { return isSpectator_; }
48
49 private:
50 TH1F histo_;
51
52 std::vector<double> ranges_{};
53 std::vector<double> borders_{};
54
55 bool isSpectator_{false};
56
57 bool applyLimits_{false};
58 double xLo_{-1};
59 double xHi_{-1};
60};
61}// namespace Centrality
62
63#endif//CENTRALITY_BORDERSFINDER_H
void SetBorders(const std::vector< double > &borders)
Definition BordersFinder.hpp:35