Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
Femto1DCFPainter.cxx
1/*
2 * Femto1DCFPainter.cxx
3 *
4 * Created on: 22 lip 2024
5 * Author: daniel
6 */
7
8#include "Femto1DCFPainter.h"
9
10#include <RtypesCore.h>
11#include <TH1.h>
12#include <TString.h>
13
14#include "Femto1DCF.h"
15#include "StdHist.h"
16#include "StdString.h"
17
18namespace Hal {
19
20 Femto1DCFPainter::Femto1DCFPainter(Hal::Femto1DCF* cf) { fCF = cf; }
21
22 void Femto1DCFPainter::MakeHistograms() {
23 std::vector<TH1*> hist;
24 if (CheckOpt(kDenBit)) { hist.push_back(CloneHist(fCF->GetDen())); }
25 if (CheckOpt(kNumBit)) { hist.push_back(CloneHist(fCF->GetNum())); }
26 if (CheckOpt(kCFBit)) { hist.push_back(fCF->GetHist(false)); }
27 if (hist.size() == 2) {
28 Hal::Std::SetColor(*hist[0], kGreen);
29 Hal::Std::SetColor(*hist[1], kRed);
30 }
31 if (fRangeX[0] != fRangeX[1]) {
32 for (auto h : hist) {
33 h->GetXaxis()->SetRangeUser(fRangeX[0], fRangeX[1]);
34 }
35 }
36 if (fRangeY[0] != fRangeY[1]) {
37 for (auto h : hist) {
38 h->SetMaximum(fRangeY[1]);
39 h->SetMinimum(fRangeY[0]);
40 }
41 }
42 fHistograms.push_back(hist);
43 }
44
45 void Femto1DCFPainter::ScaleHistograms() {
46 FemtoCFPainter::ScaleHistograms();
47 if (fRangeY[0] != fRangeY[1])
48 for (auto& x : fHistograms) {
49 for (auto y : x) {
50 y->SetMinimum(fRangeY[0]);
51 y->SetMaximum(fRangeY[1]);
52 }
53 }
54 }
55
56 Femto1DCFPainter::~Femto1DCFPainter() {}
57
59
60} // namespace Hal
TH1 * GetHist(Bool_t normalized=kTRUE) const
virtual void MakePadsAndCanvases()
Bool_t CheckOpt(Int_t opt) const
Definition Painter.h:79
void MakeCanvasPads(Int_t x=1, Int_t y=1, Int_t canvasNo=0)
Definition Painter.cxx:70