CbmRoot
Loading...
Searching...
No Matches
CbmQaEff.h
Go to the documentation of this file.
1/* Copyright (C) 2023 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergei Zharko [committer] */
4
9
10
11#ifndef CbmQaEff_h
12#define CbmQaEff_h 1
13
14#include "CbmQaCanvas.h"
15#include "Logger.h"
16#include "TEfficiency.h"
17#include "TFitResultPtr.h"
18#include "TGraphAsymmErrors.h"
19#include "TH2.h"
20#include "TPaveStats.h"
21#include "TPaveText.h"
22#include "TStyle.h"
23#include "TVirtualPad.h"
24
25#include <tuple>
26
29class CbmQaEff : public TEfficiency {
30 public:
31 static constexpr int kMarkerStyle = 20;
32
34 CbmQaEff();
35
37 CbmQaEff(const CbmQaEff& other);
38
41 template<typename... Args>
42 CbmQaEff(Args... args);
43
45 ~CbmQaEff() = default;
46
48 template<typename... Args>
49 TFitResultPtr Fit(Args... args)
50 {
51 return TEfficiency::Fit(args...);
52 }
53
54 void Paint(Option_t* opt)
55 {
56 TEfficiency::Paint(opt);
57 SetStats();
58 if (fpStats) {
59 fpStats->Draw();
60 }
61 }
62
63 void Draw(Option_t* opt = "")
64 {
65 if (GetDimension() == 1) {
66 this->SetMarkerStyle(kMarkerStyle);
67 }
68 TEfficiency::Draw(opt);
69 }
70
74 CbmQaEff* DrawCopy(Option_t* opt, const char* postfix = "_copy") const;
75
81 CbmQaEff* Integral(double lo, double hi);
82
88 std::tuple<double, double, double> GetTotalEfficiency() const;
89
91 void SetStats();
92
94
95 private:
96 TPaveText* fpStats = nullptr;
97
98 // Functions of the base class, using which can produce inconsistent results
99 using TEfficiency::SetBetaBinParameters;
100};
101
102// **********************************************************
103// ** Template and inline functions implementation **
104// **********************************************************
105
106// ---------------------------------------------------------------------------------------------------------------------
107//
108template<typename... Args>
109CbmQaEff::CbmQaEff(Args... args) : TEfficiency(args...)
110{
111}
112
113#endif // CbmQaEff_h
Definition of the CbmQaCanvas class.
static constexpr int kMarkerStyle
Definition CbmQaEff.h:31
~CbmQaEff()=default
Destructor.
CbmQaEff * Integral(double lo, double hi)
Definition CbmQaEff.cxx:72
void Draw(Option_t *opt="")
Definition CbmQaEff.h:63
std::tuple< double, double, double > GetTotalEfficiency() const
Definition CbmQaEff.cxx:25
void SetStats()
Sets statistics box for efficiency.
Definition CbmQaEff.cxx:133
void Paint(Option_t *opt)
Definition CbmQaEff.h:54
ClassDef(CbmQaEff, 1)
CbmQaEff * DrawCopy(Option_t *opt, const char *postfix="_copy") const
Definition CbmQaEff.cxx:112
TPaveText * fpStats
Statistics box.
Definition CbmQaEff.h:96
CbmQaEff()
Default constructor.
Definition CbmQaEff.cxx:17
TFitResultPtr Fit(Args... args)
Fit method reimplementation.
Definition CbmQaEff.h:49