Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DIRC_digihit.C
Go to the documentation of this file.
1 // The following are special comments used by RootSpy to know
2 // which histograms to fetch for the macro.
3 //
4 
5 // hnamepath: /DIRC_online/DigiHit/DigiHit_NHits_LED
6 // hnamepath: /DIRC_online/DigiHit/DigiHit_NHits_NonLED
7 // hnamepath: /DIRC_online/DigiHit/SouthLowerBox/TDCDigiHit_Time_LED
8 // hnamepath: /DIRC_online/DigiHit/SouthLowerBox/TDCDigiHit_Time_NonLED
9 // hnamepath: /DIRC_online/DigiHit/SouthLowerBox/TDCDigiHit_TimeVsChannel_LED
10 // hnamepath: /DIRC_online/DigiHit/SouthLowerBox/TDCDigiHit_TimeVsChannel_NonLED
11 
12 {
13  TDirectory *dir = (TDirectory*)gDirectory->FindObjectAny("DIRC_online");
14  if(dir) dir->cd();
15 
16  //TH2I* hOcc = (TH2I*)gDirectory->Get("DigiHit/DigiHit_NHitsVsBox");
17  //TH2I* hTN = (TH2I*)gDirectory->Get("DigiHit/NorthUpperBox/TDCDigiHit_TimeVsChannel_NorthUpperBox");
18  TH1I* hDigiHit_Nhits_LED = (TH1I*)gDirectory->Get("DigiHit/DigiHit_NHits_LED");
19  TH1I* hDigiHit_Nhits = (TH1I*)gDirectory->Get("DigiHit/DigiHit_NHits_NonLED");
20  TH1I* hDigiHit_Time_LED = (TH1I*)gDirectory->Get("DigiHit/SouthLowerBox/TDCDigiHit_Time_LED");
21  TH1I* hDigiHit_Time = (TH1I*)gDirectory->Get("DigiHit/SouthLowerBox/TDCDigiHit_Time_NonLED");
22  TH2I* hTS_LED = (TH2I*)gDirectory->Get("DigiHit/SouthLowerBox/TDCDigiHit_TimeVsChannel_LED");
23  TH2I* hTS = (TH2I*)gDirectory->Get("DigiHit/SouthLowerBox/TDCDigiHit_TimeVsChannel_NonLED");
24 
25  if(gPad == NULL){
26  TCanvas *c1 = new TCanvas("c1","DIRC Hit Monitor",150,10,990,660);
27  c1->cd(0);
28  c1->Draw();
29  c1->Update();
30  }
31 
32  if(!gPad) return;
33  TCanvas* c1 = gPad->GetCanvas();
34  c1->Divide(2,2);
35 
36  double tsize = 0.05;
37  gStyle->SetOptStat("emr");
38 
39 /*
40  if(hOcc){
41  hOcc->SetFillColor(kBlue);
42  c1->cd(1);
43  hOcc->SetLabelSize(0.08,"x");
44  hOcc->SetTitleSize(tsize,"xy");
45  hOcc->GetXaxis()->SetBinLabel(1, "North");
46  hOcc->GetXaxis()->SetBinLabel(2, "South");
47  hOcc->Draw("colz");
48  }
49 
50  if(hTN){
51  hTN->SetFillColor(kBlue);
52  c1->cd(3);
53  hTN->SetTitleSize(tsize,"xy");
54  hTN->Draw("colz");
55  }
56 */
57 
58  TLegend *leg = new TLegend(0.6, 0.6, 0.85, 0.8);
59  leg->AddEntry(hTS_LED,"LED trigger","l");
60  leg->AddEntry(hTS,"Non-LED triggers","l");
61  leg->Draw("same");
62 
63 
64  if(hDigiHit_Nhits && hDigiHit_Nhits_LED) {
65  hDigiHit_Nhits->SetLineColor(kBlack);
66  hDigiHit_Nhits_LED->SetLineColor(kBlue);
67  c1->cd(1);
68  hDigiHit_Nhits_LED->SetTitleSize(tsize,"xy");
69  hDigiHit_Nhits_LED->Draw();
70  double scale = hDigiHit_Nhits_LED->GetMaximum()/hDigiHit_Nhits->GetMaximum();
71  if(hDigiHit_Nhits->GetMaximum() == 0) scale = 1.;
72  hDigiHit_Nhits->Scale(scale);
73  hDigiHit_Nhits->Draw("h same");
74 
75  TLegend *leg = new TLegend(0.6, 0.6, 0.85, 0.8);
76  leg->AddEntry(hDigiHit_Nhits_LED,"LED trigger","l");
77  leg->AddEntry(hDigiHit_Nhits,"Non-LED triggers","l");
78  leg->Draw("same");
79  }
80 
81  if(hDigiHit_Time && hDigiHit_Time_LED) {
82  hDigiHit_Time->SetLineColor(kBlack);
83  hDigiHit_Time_LED->SetLineColor(kBlue);
84  c1->cd(3);
85  hDigiHit_Time->SetTitleSize(tsize,"xy");
86  hDigiHit_Time_LED->Draw();
87  double scale = hDigiHit_Time_LED->GetMaximum()/hDigiHit_Time->GetMaximum();
88  if(hDigiHit_Time->GetMaximum() == 0) scale = 1.;
89  hDigiHit_Time->Scale(scale);
90  hDigiHit_Time->Draw("h same");
91 
92  TLegend *leg = new TLegend(0.6, 0.6, 0.85, 0.8);
93  leg->AddEntry(hDigiHit_Time_LED,"LED trigger","l");
94  leg->AddEntry(hDigiHit_Time,"Non-LED triggers","l");
95  leg->Draw("same");
96 
97  }
98 
99  if(hTS){
100  c1->cd(4);
101  hTS->SetTitleSize(tsize,"xy");
102  hTS->Draw("colz");
103  }
104 
105  if(hTS_LED){
106  c1->cd(2);
107  hTS_LED->SetTitleSize(tsize,"xy");
108  hTS_LED->Draw("colz");
109  }
110 
111 
112 
113 }
double tsize
Definition: DIRC_digihit.C:36
static TH1I * hDigiHit_Time[Narms]
Double_t c1[2][NMODULES]
Definition: tw_corr.C:68
TLegend * leg
Definition: DIRC_digihit.C:58
TDirectory * dir
Definition: bcal_hist_eff.C:31