Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PSC_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: /PSC/Hit/LeftArm/Hit_Occupancy_LeftArm
6 // hnamepath: /PSC/Hit/RightArm/Hit_Occupancy_RightArm
7 // hnamepath: /PSC/Hit/LeftArm/Hit_TimeVsModule_LeftArm
8 // hnamepath: /PSC/Hit/RightArm/Hit_TimeVsModule_RightArm
9 
10 {
11  TDirectory *dir = (TDirectory*)gDirectory->FindObjectAny("PSC");
12  if(dir) dir->cd();
13 
14  TH1I* hOcc_l = (TH1I*)gDirectory->Get("Hit/LeftArm/Hit_Occupancy_LeftArm");
15  TH1I* hOcc_r = (TH1I*)gDirectory->Get("Hit/RightArm/Hit_Occupancy_RightArm");
16  TH2I* hTl = (TH2I*)gDirectory->Get("Hit/LeftArm/Hit_TimeVsModule_LeftArm");
17  TH2I* hTr = (TH2I*)gDirectory->Get("Hit/RightArm/Hit_TimeVsModule_RightArm");
18 
19  if(gPad == NULL){
20  TCanvas *c1 = new TCanvas("c1","Coarse PS Hit Monitor I",150,10,990,660);
21  c1->cd(0);
22  c1->Draw();
23  c1->Update();
24  }
25 
26  if(!gPad) return;
27  TCanvas* c1 = gPad->GetCanvas();
28  c1->Divide(2,2);
29 
30  double tsize = 0.0475;
31  gStyle->SetOptStat("emr");
32  if(hOcc_l){
33  hOcc_l->SetFillColor(kBlue);
34  c1->cd(1);
35  hOcc_l->SetTitleSize(tsize,"xy");
36  hOcc_l->Draw();
37  }
38 
39  if(hOcc_r){
40  hOcc_r->SetFillColor(kBlue);
41  c1->cd(2);
42  hOcc_r->SetTitleSize(tsize,"xy");
43  hOcc_r->Draw();
44  }
45 
46  if(hTl){
47  hTl->SetFillColor(kBlue);
48  c1->cd(3);
49  hTl->SetTitleSize(tsize,"xy");
50  hTl->GetYaxis()->SetRange(hTl->FindFirstBinAbove(10.0,2),hTl->FindLastBinAbove(10.0,2));
51  hTl->Draw("colz");
52  }
53 
54  if(hTr){
55  hTr->SetFillColor(kBlue);
56  c1->cd(4);
57  hTr->SetTitleSize(tsize,"xy");
58  hTr->GetYaxis()->SetRange(hTr->FindFirstBinAbove(10.0,2),hTr->FindLastBinAbove(10.0,2));
59  hTr->Draw("colz");
60  }
61 
62 }
double tsize
Definition: DIRC_digihit.C:36
Double_t c1[2][NMODULES]
Definition: tw_corr.C:68
TDirectory * dir
Definition: bcal_hist_eff.C:31