Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
StdHist.h
1/*
2 * Hal::StdHist.h
3 *
4 * Created on: 30-04-2022
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#ifndef HALSTDHIST_H_
10#define HALSTDHIST_H_
11
12#include <TString.h>
13#include <TVector3.h>
14
15class TH1;
16class TH1D;
17class TH2;
18class TH2D;
19class TH3;
20class TH3D;
21class TAxis;
22class TVirtualPad;
23
24namespace Hal {
25 namespace Std {
26 namespace {
27 int anonymCounter = {0};
28 }
35 void RemoveNan(TH1* h, Double_t fill = 0, Double_t fill_e = 1);
42 void CopyAxisProp(const TAxis* from, TAxis* to, TString opt = "");
49 void CopyHistProp(const TH1& from, TH1& to, TString opt = "");
61 TH1D* GetDiagonalProjection1D(TH3* h, TString dir, Double_t start, Double_t start2 = 0.);
77 TH1D* GetProjection1D(const TH2* histo, Double_t min, Double_t max, Option_t* opt);
93 TH1D* GetProjection1D(const TH3* histo, Double_t min1, Double_t max1, Double_t min2, Double_t max2, Option_t* opt);
108 TH1D* SmearHistogram(TH1D* input_histogram, TH2D* smear_matrix, Option_t* opt = "");
121 TH2D* GetProjection2D(const TH3* histo, Double_t min, Double_t max, Option_t* opt);
132 void HistogramEdges(TH1* h, TString option = "x+uv", Double_t value = 0);
139 void HistogramExtend(TH1* h, Char_t axis = 'x', Double_t factor = 1);
147 Bool_t AreSimilar(const TH1* x, const TH1* y, Bool_t classes = kTRUE);
156 void GetAxisPar(const TH1& obj, Int_t& nbins, Double_t& min, Double_t& xmax, Option_t* opt = "x");
163 std::vector<double> GetAxisCenters(const TH1& obj, Option_t* opt = "x");
172 TH1* MakeHisto1D(TString name, TString title, TVector3 Xaxis, Char_t type = 'D');
182 TH2* MakeHisto2D(TString name, TString title, TVector3 Xaxis, TVector3 Yaxis, Char_t type = 'D');
193 TH3* MakeHisto3D(TString name, TString title, TVector3 Xaxis, TVector3 Yaxis, TVector3 Zaxis, Char_t type = 'D');
197 void MakeBeautiful();
207 void Fold1D(Double_t val, TH1& h);
214 void Fold2D(Double_t val, TH2& h, TString opt = "x");
221 void Fold3D(Double_t val, TH3& h, TString opt = "x");
227 void SetColor(TH1& h, Color_t color);
235 void SetColorAndMarker(TH1& h, Color_t color, Marker_t m, Size_t s = 1);
244 void SetRainbow(TH2& h, Double_t x1, Double_t y1, Double_t x2, Double_t y2);
250 Int_t GetAntiColor(Int_t col);
256 Int_t GetListOfSubPads(TVirtualPad* pad);
265 TH1D* Crop1D(const TH1& h, Double_t min, Double_t max, TString opt = "vals");
276 TH2D* Crop2D(const TH2& h, Double_t minX, Double_t maxX, Double_t minY, Double_t maxY, TString opt = "vals");
289 TH3D* Crop3D(const TH3& h,
290 Double_t minX,
291 Double_t maxX,
292 Double_t minY,
293 Double_t maxY,
294 Double_t minZ,
295 Double_t maxZ,
296 TString opt = "vals");
297 std::vector<TObject*> GetPadChildren(TString objName, TString className = "", TVirtualPad* pad = nullptr);
309 Bool_t CheckHistogramData(const TH1& h1, const TH1& h2, Double_t thres = 0, Option_t* opt = "");
310 } // namespace Std
311} // namespace Hal
312#endif /* HALSTDHIST_H_ */