8#include "FemtoCFPainter.h"
18 const int FemtoCFPainter::kNumBit = 8;
19 const int FemtoCFPainter::kDenBit = 9;
20 const int FemtoCFPainter::kCFBit = 10;
21 const int FemtoCFPainter::kHideTitles = 11;
23 void FemtoCFPainter::DeleteHistograms() {
24 for (
auto& x : fHistograms) {
32 void FemtoCFPainter::ScaleHistograms() {
33 for (
auto& x : fHistograms) {
35 if (y) y->Scale(fScale);
37 fDrawScale = fScale * fDrawScale;
40 void FemtoCFPainter::Rescale(Double_t newScale) {
41 if (newScale == 0)
return;
42 fScale = newScale / fDrawScale;
45 void FemtoCFPainter::DrawHistograms() {
48 for (
auto i : fHistograms) {
52 if (
CheckOpt(kHideTitles)) j->SetTitle(
"");
54 j->Draw(fDefDrawFlag);
61 FemtoCFPainter::~FemtoCFPainter() { DeleteHistograms(); }
80 }
else if (fScale != 1)
87 TH1* FemtoCFPainter::CloneHist(TH1* h)
const {
88 TH1* copy = (TH1*) h->Clone();
89 h->SetName(Form(
"%i", Hal::Std::anonymCounter++));
90 copy->SetDirectory(
nullptr);
92 copy->SetObjectStat(kFALSE);
96 ULong64_t FemtoCFPainter::PrepBitTemplate(std::initializer_list<int> temps)
const {
98 auto vec = Hal::Std::GetVector(temps);
107 if (Hal::Std::FindParam(opt,
"num", kTRUE)) { SETBIT(newOpts, kNumBit); }
108 if (Hal::Std::FindParam(opt,
"den", kTRUE)) { SETBIT(newOpts, kDenBit); }
109 if (Hal::Std::FindParam(opt,
"tit", kTRUE)) { SETBIT(newOpts, kHideTitles); }
110 if (Hal::Std::FindParam(opt,
"fit", kTRUE)) {
111 CLRBIT(newOpts, kDenBit);
112 CLRBIT(newOpts, kNumBit);
114 auto ranges = Hal::Std::FindBrackets(opt, kTRUE, kTRUE);
115 for (
auto range : ranges) {
116 std::vector<double> res;
119 if (res.size() == 2 && foundx) {
123 if (res.size() == 2 && foundy) {
128 if (!TESTBIT(newOpts, kNumBit) && !TESTBIT(newOpts, kDenBit)) { SETBIT(newOpts, kCFBit); }
133 std::pair<Double_t, Double_t> res;
134 if (fHistograms.size() < x + 1)
return res;
135 if (fHistograms[x].size() < y + 1)
return res;
136 auto h = fHistograms[x][y];
138 res.first = h->GetMinimum();
139 res.second = h->GetMaximum();
std::pair< Double_t, Double_t > GetMinMax(Int_t x=0, Int_t y=0) const
virtual void InnerRepaint()
virtual void InnerPaint()
Bool_t AreSimiliar(ULong64_t current, ULong64_t pattern) const
virtual ULong64_t SetOptionInternal(TString opt, ULong64_t prev=0)
virtual void InnerPaint()
Bool_t CheckOpt(Int_t opt) const
virtual void OptionsApplied()
virtual void InnerRepaint()
void GotoPad(Int_t no, Int_t canvasNo=0)
Bool_t GetPatterns(TString opt, TString flag, std::vector< double > &vals) const