Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ST_Monitoring_Hit.C
Go to the documentation of this file.
1 // File: ST_Monitoring_1.C
2 // Created: 05/17/2015
3 // Creator: Mahmoud Kamel, mkame006@fiu.edu
4 // Purpose: Displaying histograms for online monitoring purposes
5 {
6  // Define the directory that contains the histograms
7  TDirectory *dir = (TDirectory*)gDirectory->FindObjectAny("st_lowlevel");
8  if(dir) dir->cd();
9  // Grab Hit object histograms
10  TH2I *h2_t_sec = (TH2I*)gDirectory->FindObjectAny("h2_t_sec");
11  TH2I *h2_tTDC_sec = (TH2I*)gDirectory->FindObjectAny("h2_tTDC_sec");
12  TH2I *h2_tfADC_sec = (TH2I*)gDirectory->FindObjectAny("h2_tfADC_sec");
13  TH2I *h2_dE_sec = (TH2I*)gDirectory->FindObjectAny("h2_dE_sec");
14 
15  //Grab TDC Digihitobject histograms
16  TH2I *h2_raw_tdcTime_sec = (TH2I*)gDirectory->FindObjectAny("h2_raw_tdcTime_sec");
17  //if adc_sec = tdc_sec grab the TDC vs Sector histo
18  TH2I *h2_tdcTime_sec = (TH2I*)gDirectory->FindObjectAny("h2_tdcTime_sec");
19  //Create the canvas
20  if(gPad == NULL)
21  {
22  TCanvas *c1 = new TCanvas("c1","Start Counter Raw Histograms 1", 200, 10, 600, 480);
23  c1->cd(0);
24  c1->Draw();
25  c1->Update();
26  }
27  if(!gPad) return;
28  TCanvas *c1 = gPad->GetCanvas();
29  c1->Divide(3,2);
30  //TDC time when there is a hit in adc
31  c1->cd(1);
32  gStyle->SetOptStat(10);
33  gPad->SetTicks();
34  gPad->SetGrid();
35  if (h2_tdcTime_sec) h2_tdcTime_sec->Draw("colz");
36  h2_tdcTime_sec->SetLabelSize(0.025,"Y");
37  h2_tdcTime_sec->GetXaxis()->CenterTitle();
38  h2_tdcTime_sec->GetYaxis()->CenterTitle();
39  h2_tdcTime_sec->GetYaxis()->SetTitleOffset(1.5);
40  h2_tdcTime_sec->SetAxisRange(0., 800.,"Y");
41  gPad->SetLogz();
42  //t_tdc from hit object
43  c1->cd(2);
44  gPad->SetTicks();
45  gPad->SetGrid();
46  if (h2_tTDC_sec) h2_tTDC_sec->Draw("colz");
47  h2_tTDC_sec->GetXaxis()->CenterTitle();
48  h2_tTDC_sec->GetYaxis()->CenterTitle();
49  h2_tTDC_sec->SetAxisRange(-50., 50.,"Y");
50  gPad->SetLogz();
51  // t from hit object (tdc time walk corrected)
52  c1->cd(3);
53  gPad->SetTicks();
54  gPad->SetGrid();
55  if (h2_t_sec) h2_t_sec->Draw("colz");
56  h2_t_sec->GetXaxis()->CenterTitle();
57  h2_t_sec->GetYaxis()->CenterTitle();
58  h2_t_sec->SetAxisRange(-50., 50.,"Y");
59  gPad->SetLogz();
60  c1->cd(4);
61  gStyle->SetOptStat(10);
62  gPad->SetTicks();
63  gPad->SetGrid();
64  TH1D *h_tdcTime_sec = h2_tdcTime_sec->ProjectionY();
65  h_tdcTime_sec->Draw();
66  h_tdcTime_sec->GetXaxis()->CenterTitle();
67  h_tdcTime_sec->GetYaxis()->CenterTitle();
68  c1->cd(5);
69  gPad->SetTicks();
70  gPad->SetGrid();
71  TH1D *h_tTDC = h2_tTDC_sec->ProjectionY();
72  h_tTDC->Draw();
73  h_tTDC->GetXaxis()->CenterTitle();
74  h_tTDC->GetYaxis()->CenterTitle();
75  c1->cd(6);
76  gStyle->SetOptStat(10);
77  gPad->SetTicks();
78  gPad->SetGrid();
79  TH1D *h_t = h2_t_sec->ProjectionY();
80  h_t->Draw();
81  h_t->GetXaxis()->CenterTitle();
82  h_t->GetYaxis()->CenterTitle();
83 
84  //Create the canvas = 2
85  TCanvas *c2 = new TCanvas("c2","Start Counter Raw Histograms 2", 200, 10, 600, 480);
86  c2->cd(1);
87  c2->Draw();
88  c2->Update();
89  if(!gPad) return;
90  c2 = gPad->GetCanvas();
91  c2->Divide(2,2);
92  // t_adc from hit object
93  c2->cd(1);
94  gStyle->SetOptStat(10);
95  gPad->SetTicks();
96  gPad->SetGrid();
97  if (h2_tfADC_sec) h2_tfADC_sec->Draw("colz");
98  h2_tfADC_sec->GetXaxis()->CenterTitle();
99  h2_tfADC_sec->GetYaxis()->CenterTitle();
100  h2_tfADC_sec->SetAxisRange(-50., 50.,"Y");
101  gPad->SetLogz();
102  // Energy loss from hit object
103  c2->cd(2);
104  gStyle->SetOptStat(10);
105  gPad->SetTicks();
106  gPad->SetGrid();
107  if (h2_dE_sec) h2_dE_sec->Draw("colz");
108  h2_dE_sec->GetXaxis()->CenterTitle();
109  h2_dE_sec->GetYaxis()->CenterTitle();
110  h2_dE_sec->SetAxisRange(0., 0.003,"Y");
111  gPad->SetLogz();
112  c2->cd(3);
113  gStyle->SetOptStat(10);
114  gPad->SetTicks();
115  gPad->SetGrid();
116  TH1D *h_tfADC = h2_tfADC_sec->ProjectionY();
117  h_tfADC->Draw();
118  //h1_adc_sec->SetMinimum(0);
119  h_tfADC->GetXaxis()->CenterTitle();
120  h_tfADC->GetYaxis()->CenterTitle();
121  c2->cd(4);
122  gStyle->SetOptStat(10);
123  gPad->SetTicks();
124  gPad->SetGrid();
125  TH1D *h_dE = h2_dE_sec->ProjectionY();
126  h_dE->Draw();
127  h_dE->GetXaxis()->CenterTitle();
128  h_dE->GetYaxis()->CenterTitle();
129 }
static TH2I * h2_tTDC_sec
static TH2I * h2_t_sec
Double_t c1[2][NMODULES]
Definition: tw_corr.C:68
Double_t c2[2][NMODULES]
Definition: tw_corr.C:69
static TH2I * h2_dE_sec
static TH2I * h2_raw_tdcTime_sec
static TH2I * h2_tfADC_sec
TH1I * h_t[10]
static TH2I * h2_tdcTime_sec
TDirectory * dir
Definition: bcal_hist_eff.C:31