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