ATLAS Offline Software
Loading...
Searching...
No Matches
NHitStack Class Reference
Inheritance diagram for NHitStack:
Collaboration diagram for NHitStack:

Public Member Functions

 NHitStack (TNtuple *, TLegend *, bool, int, int)

Detailed Description

Definition at line 101 of file TRTCalib_makeplots.cxx.

Constructor & Destructor Documentation

◆ NHitStack()

NHitStack::NHitStack ( TNtuple * tuple,
TLegend * leg,
bool doleg,
int mint0,
int minrt )

Definition at line 107 of file TRTCalib_makeplots.cxx.

108{
109
110 int min = (int)tuple->GetMinimum("nt0");
111 int max = (int)tuple->GetMaximum("nt0");
112 float bsize = ceil(((float)(max - min) / 50));
113 int hmax = min + (int)(50 * bsize);
114 // cout << min << " " << max << " " << bsize << " " << hmax << endl;
115 TH1F *hits1 = new TH1F(Form("%s_hits1", tuple->GetName()), "test1", 50, min, hmax);
116 TH1F *hits2 = new TH1F(Form("%s_hits2", tuple->GetName()), "test2", 50, min, hmax);
117 TH1F *hits3 = new TH1F(Form("%s_hits3", tuple->GetName()), "test3", 50, min, hmax);
118 // TH1F* hits2 = new TH1F("hits2","test2",50,min,hmax);
119 // TH1F* hits3 = new TH1F("hits3","test3",50,min,hmax);
120 tuple->Draw(Form("nt0>>%s_hits1", tuple->GetName()), Form("nt0<=%i", mint0));
121 tuple->Draw(Form("nt0>>%s_hits2", tuple->GetName()), Form("nt0>%i && nt0<=%i", mint0, minrt));
122 tuple->Draw(Form("nt0>>%s_hits3", tuple->GetName()), Form("nt0>%i", minrt));
123 hits1->SetFillColor(46);
124 hits2->SetFillColor(8);
125 hits3->SetFillColor(38);
126
127 // gStyle->SetOptStat("e");
128
129 this->Add(hits1);
130 this->Add(hits2);
131 this->Add(hits3);
132
133 if (doleg)
134 {
135 leg->AddEntry(hits1, "no calibration");
136 leg->AddEntry(hits2, "enough for T0 calib");
137 leg->AddEntry(hits3, "enough for T0+RT calib");
138 leg->SetTextSize(0.04);
139 }
140}
#define min(a, b)
Definition cfImp.cxx:40
#define max(a, b)
Definition cfImp.cxx:41
double hmax(TH1 *&h)
Definition listroot.cxx:115
TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)

The documentation for this class was generated from the following file: