Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DIRC_hit.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/Hit/Hit_NHits_LED
6 // hnamepath: /DIRC_online/Hit/SouthLowerBox/Hit_TimeOverThresholdVsChannel_LED
7 // hnamepath: /DIRC_online/Hit/SouthLowerBox/Hit_TimeVsChannel_LED
8 // hnamepath: /DIRC_online/Hit/SouthLowerBox/Hit_Time_NonLED
9 // hnamepath: /DIRC_online/Hit/SouthLowerBox/Hit_Time_LED
10 // hnamepath: /DIRC_online/Hit/SouthLowerBox/Hit_PixelOccupancy_LED
11 // hnamepath: /DIRC_online/Hit/SouthLowerBox/Hit_PixelOccupancy_NonLED
12 
13 
14 {
15  TDirectory *dir = (TDirectory*)gDirectory->FindObjectAny("DIRC_online");
16  if(dir) dir->cd();
17 
18  TH2I* hOcc = (TH2I*)gDirectory->Get("Hit/Hit_NHits_LED");
19  //TH2I* hTotN = (TH2I*)gDirectory->Get("Hit/NorthUpperBox/Hit_TimeOverThresholdVsChannel_NorthUpperBox");
20  TH2I* hTotS = (TH2I*)gDirectory->Get("Hit/SouthLowerBox/Hit_TimeOverThresholdVsChannel_LED");
21  //TH2I* hTN = (TH2I*)gDirectory->Get("Hit/NorthUpperBox/Hit_TimeVsChannel_NorthUpperBox");
22  TH2I* hTimeVsChannelS_LED = (TH2I*)gDirectory->Get("Hit/SouthLowerBox/Hit_TimeVsChannel_LED");
23  TH1I* hTS = (TH1I*)gDirectory->Get("Hit/SouthLowerBox/Hit_Time_NonLED");
24  TH1I* hTS_LED = (TH1I*)gDirectory->Get("Hit/SouthLowerBox/Hit_Time_LED");
25 
26  //TH2I* hOccN = (TH2I*)gDirectory->Get("Hit/NorthUpperBox/Hit_PixelOccupancy_NorthUpperBox");
27  TH2I* hOccS_LED = (TH2I*)gDirectory->Get("Hit/SouthLowerBox/Hit_PixelOccupancy_LED");
28  TH2I* hOccS = (TH2I*)gDirectory->Get("Hit/SouthLowerBox/Hit_PixelOccupancy_NonLED");
29 
30  if(gPad == NULL){
31  TCanvas *c1 = new TCanvas("c1","DIRC Hit Monitor",150,10,990,660);
32  c1->cd(0);
33  c1->Draw();
34  c1->Update();
35  }
36 
37  if(!gPad) return;
38  TCanvas* c1 = gPad->GetCanvas();
39  c1->Divide(2,2);
40 
41  double tsize = 0.05;
42  gStyle->SetOptStat("emr");
43 
44 /*
45  if(hOcc){
46  c1->cd(1);
47  hOcc->SetLabelSize(0.08,"x");
48  hOcc->SetTitleSize(tsize,"xy");
49  hOcc->GetXaxis()->SetBinLabel(1, "North");
50  hOcc->GetXaxis()->SetBinLabel(2, "South");
51  hOcc->Draw("colz");
52  }
53 
54  if(hTotN){
55  c1->cd(2);
56  hTotN->SetTitleSize(tsize,"xy");
57  hTotN->Draw("colz");
58  }
59 
60  if(hOccN && hOccS){
61  c1->cd(4);
62  TPad *p1 = new TPad("p1","p1",0.0,0.5,1.0,1.0);
63  p1->Draw();
64  p1->cd();
65  gStyle->SetOptStat(0);
66  if(hOccN && hOccN->Integral() > 10) hOccN->Draw("colz");
67 
68  c1->cd(4);
69  TPad *p2 = new TPad("p2","p2",0.0,0.0,1.0,0.5);
70  p2->Draw();
71  p2->cd();
72  gStyle->SetOptStat(0);
73  if(hOccS && hOccS->Integral() > 10) hOccS->Draw("colz");
74  }
75 
76  if(hTN){
77  hTN->SetFillColor(kBlue);
78  c1->cd(5);
79  hTN->SetTitleSize(tsize,"xy");
80  hTN->Draw("colz");
81  }
82 */
83 
84  if(hOccS_LED){
85  c1->cd(1);
86  hOccS_LED->SetTitleSize(tsize,"xy");
87  hOccS_LED->Draw("colz");
88  }
89 
90  if(hTimeVsChannelS_LED){
91  c1->cd(2);
92  hTimeVsChannelS_LED->SetTitleSize(tsize,"xy");
93  hTimeVsChannelS_LED->Draw("colz");
94  }
95 
96  if(hOccS){
97  c1->cd(3);
98  hOccS->SetTitleSize(tsize,"xy");
99  hOccS->Draw("colz");
100  }
101 
102 
103  if(hTS && hTS_LED){
104  hTS->SetLineColor(kBlack);
105  hTS_LED->SetLineColor(kBlue);
106  c1->cd(4);
107  hTS_LED->SetTitleSize(tsize,"xy");
108  hTS_LED->Draw();
109  hTS->Scale(hTS_LED->GetMaximum()/hTS->GetMaximum());
110  hTS->Draw("h same");
111 
112  TLegend *leg = new TLegend(0.6, 0.6, 0.85, 0.8);
113  leg->AddEntry(hTS_LED,"LED trigger","l");
114  leg->AddEntry(hTS,"Non-LED triggers","l");
115  leg->Draw("same");
116  }
117 
118 
119 }
double tsize
Definition: DIRC_digihit.C:36
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