GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
GH2D.cxx
Go to the documentation of this file.
1#include "GH2D.h"
2
3#include <iostream>
4
5#include "TDirectory.h"
6
7#include "GH1D.h"
8
9GH2D::GH2D(const char* name, const char* title, Int_t nbinsx, const Double_t* xbins, Int_t nbinsy, const Double_t* ybins)
10 : TH2D(name, title, nbinsx, xbins, nbinsy, ybins)
11{
12}
13
14GH2D::GH2D(const char* name, const char* title, Int_t nbinsx, const Float_t* xbins, Int_t nbinsy, const Float_t* ybins)
15 : TH2D(name, title, nbinsx, xbins, nbinsy, ybins)
16{
17}
18
19GH2D::GH2D(const char* name, const char* title, Int_t nbinsx, const Double_t* xbins, Int_t nbinsy, Double_t ylow, Double_t yup)
20 : TH2D(name, title, nbinsx, xbins, nbinsy, ylow, yup)
21{
22}
23
24GH2D::GH2D(const char* name, const char* title, Int_t nbinsx, Double_t xlow, Double_t xup, Int_t nbinsy, Double_t* ybins)
25 : TH2D(name, title, nbinsx, xlow, xup, nbinsy, ybins)
26{
27}
28
29GH2D::GH2D(const char* name, const char* title, Int_t nbinsx, Double_t xlow, Double_t xup, Int_t nbinsy, Double_t ylow, Double_t yup)
30 : TH2D(name, title, nbinsx, xlow, xup, nbinsy, ylow, yup)
31{
32}
33
34GH2D::GH2D(const TObject& obj)
35{
36 if(obj.InheritsFrom(TH2::Class())) {
37 obj.Copy(*this);
38 }
39}
40
41GH2D::~GH2D() = default;
42
43void GH2D::Copy(TObject& obj) const
44{
45 TH2::Copy(obj);
46 // fProjections->Copy(*(((GH2D&)obj).fProjections));
47 // fSummaryProjections->Copy(*(((GH2D&)obj).fSummaryProjections));
48}
49
50TObject* GH2D::Clone(const char* newname) const
51{
52 std::string name = newname;
53 if(name.length() == 0u) {
54 name = Form("%s_clone", GetName());
55 }
56 return TH2::Clone(name.c_str());
57}
58
59void GH2D::Clear(Option_t* opt)
60{
61 TString sopt(opt);
62 if(!sopt.Contains("projonly")) {
63 TH2D::Clear(opt);
64 }
65 GH2Clear();
66}
67
68void GH2D::Print(Option_t*) const
69{
70}
71
72void GH2D::Draw(Option_t* opt)
73{
74 std::string option = opt;
75 if(option.empty()) {
76 option = "colz";
77 }
78 TH2D::Draw(option.c_str());
79 if(gPad != nullptr) {
80 gPad->Update();
81 gPad->GetFrame()->SetBit(TBox::kCannotMove);
82 }
83}
84
85void GH2D::Draw(TCutG* cut)
86{
87 if(cut == nullptr) {
88 return;
89 }
90 std::string option = Form("colz [%s]", cut->GetName());
91 TH2D::Draw(option.c_str());
92}
93
94TH1* GH2D::DrawCopy(Option_t* opt, const char* name_postfix) const
95{
96 TH1* hist = TH2D::DrawCopy(opt, name_postfix);
97 if(gPad != nullptr) {
98 gPad->Update();
99 gPad->GetFrame()->SetBit(TBox::kCannotMove);
100 }
101 return hist;
102}
103
104TH1* GH2D::DrawNormalized(Option_t* opt, Double_t norm) const
105{
106 TH1* hist = TH2D::DrawNormalized(opt, norm);
107 if(gPad != nullptr) {
108 gPad->Update();
109 gPad->GetFrame()->SetBit(TBox::kCannotMove);
110 }
111 return hist;
112}
113
114GH1D* GH2D::ProjectionX(const char* name, int firstbin, int lastbin, Option_t* option)
115{
116 return GH2ProjectionX(name, firstbin, lastbin, option);
117}
118
119GH1D* GH2D::ProjectionY(const char* name, int firstbin, int lastbin, Option_t* option)
120{
121 return GH2ProjectionY(name, firstbin, lastbin, option);
122}
TH1D * hist
Definition UserFillObj.h:3
Definition GH1D.h:17
virtual void GH2Clear(Option_t *opt="")
Definition GH2Base.cxx:24
GH1D * GH2ProjectionY(const char *name="_py", int firstbin=0, int lastbin=-1, Option_t *option="", bool KeepEmpty=false)
Definition GH2Base.cxx:144
GH1D * GH2ProjectionX(const char *name="_px", int firstbin=0, int lastbin=-1, Option_t *option="", bool KeepEmpty=false)
Definition GH2Base.cxx:90
GH1D * ProjectionX(const char *name="_px", int firstbin=0, int lastbin=-1, Option_t *option="")
Definition GH2D.cxx:114
void Print(Option_t *opt="") const override
Definition GH2D.cxx:68
TH1 * DrawNormalized(Option_t *opt="", Double_t norm=1) const override
Definition GH2D.cxx:104
void Draw(Option_t *opt="") override
Definition GH2D.cxx:72
TH1 * DrawCopy(Option_t *opt="", const char *name_postfix="_copy") const override
Definition GH2D.cxx:94
void Clear(Option_t *opt="") override
Definition GH2D.cxx:59
GH2D()=default
void Copy(TObject &) const override
Definition GH2D.cxx:43
TObject * Clone(const char *newname="") const override
Definition GH2D.cxx:50
GH1D * ProjectionY(const char *name="_py", int firstbin=0, int lastbin=-1, Option_t *option="")
Definition GH2D.cxx:119