Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
QAHistoSettings.cxx
1/*
2 * QAHistoSettings.cxx
3 *
4 * Created on: 25 lis 2020
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#include "QAHistoSettings.h"
10
11#include "StdHist.h"
12
13#include <iostream>
14
15namespace Hal {
16 TH1* QAHistoSettings::MakeHisto() const {
17 switch (fSize) {
18 case 1: return Hal::Std::MakeHisto1D(GetName(), GetFullTitle(), fBinsX); break;
19 case 2: return (TH1*) Hal::Std::MakeHisto2D(GetName(), GetFullTitle(), fBinsX, fBinsY); break;
20 case 3: return (TH1*) Hal::Std::MakeHisto3D(GetName(), GetFullTitle(), fBinsX, fBinsY, fBinsZ); break;
21 }
22 return nullptr;
23 }
24
26 switch (fSize) {
27 case 1: return Form("%s;%s", GetTitle(), fAxisNameX.Data()); break;
28 case 2: return Form("%s;%s;%s", GetTitle(), fAxisNameX.Data(), fAxisNameY.Data()); break;
29 case 3: return Form("%s;%s;%s;%s", GetTitle(), fAxisNameX.Data(), fAxisNameY.Data(), fAxisNameZ.Data()); break;
30 }
31 return GetName();
32 }
33
34 void QAHistoSettings::Print(Option_t* /*option*/) const {
35 std::cout << "== QAHistoSettings ==" << std::endl;
36 std::cout << "Ndim: " << fSize << std::endl;
37 std::cout << "Custom: " << fCustom << std::endl;
38 std::cout << "Flag: " << fFlag << std::endl;
39 if (fSize > 0) {
40 std::cout << "\tConf X " << std::endl;
41 std::cout << "\t\tFill flag id: " << fFillFlagIdX << std::endl;
42 std::cout << "\t\tFill flag name: " << fAxisNameX << std::endl;
43 std::cout << "\t\t Axis conf " << Form("%4.0f %4.4f %4.4f", fBinsX.X(), fBinsX.Y(), fBinsX.Z()) << std::endl;
44 }
45 if (fSize > 1) {
46 std::cout << "\tConf Y " << std::endl;
47 std::cout << "\t\tFill flag id: " << fFillFlagIdY << std::endl;
48 std::cout << "\t\tFill flag name: " << fAxisNameY << std::endl;
49 std::cout << "\t\t Axis conf " << Form("%4.0f %4.4f %4.4f", fBinsY.X(), fBinsY.Y(), fBinsY.Z()) << std::endl;
50 }
51 if (fSize > 2) {
52 std::cout << "\tConf X " << std::endl;
53 std::cout << "\t\tFill flag id: " << fFillFlagIdZ << std::endl;
54 std::cout << "\t\tFill flag name: " << fAxisNameZ << std::endl;
55 std::cout << "\t\t Axis conf " << Form("%4.0f %4.4f %4.4f", fBinsZ.X(), fBinsZ.Y(), fBinsZ.Z()) << std::endl;
56 }
57 }
58} // namespace Hal
TString GetFullTitle() const