Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TAGH_doubles_E.C
Go to the documentation of this file.
1 // Plot fraction of TAGH hits that are double hits vs. Energy
2 
4 {
5  TDirectory *dir = (TDirectory*)gDirectory->FindObjectAny("TAGH_doubles");
6  if(dir) dir->cd();
7 
8  TH1F *doubles =(TH1F*)gDirectory->Get("BeforeMergingDoubles/BM2_Energy");
9  TH1F *total =(TH1F*)gDirectory->Get("BeforeMergingDoubles/BM1_Energy");
10 
11  TH1F *f_doubles = (TH1F*)doubles->Clone();
12  f_doubles->Sumw2();
13  f_doubles->Divide(doubles, total);
14 
15  if(gPad == NULL) {
16  TCanvas *c1 = new TCanvas("c1","TAGH double-hit fraction",150,10,990,660);
17  c1->cd(0);
18  c1->Draw();
19  c1->Update();
20  }
21 
22  if(!gPad) return;
23  TCanvas* c1 = gPad->GetCanvas();
24 
25  gStyle->SetOptStat("");
26  f_doubles->SetTitle("TAGH double-hit fraction vs. energy");
27  f_doubles->SetTitleSize(0.045, "XY");
28  f_doubles->GetXaxis()->SetTitle("TAGH energy [GeV]");
29  f_doubles->GetYaxis()->SetTitle("double-hit fraction");
30  f_doubles->SetAxisRange(0.0,1.0,"Y");
31  f_doubles->Draw();
32 }
double total
Definition: FitGains.C:151
Double_t c1[2][NMODULES]
Definition: tw_corr.C:68
void TAGH_doubles_E()
Definition: TAGH_doubles_E.C:3
TDirectory * dir
Definition: bcal_hist_eff.C:31