Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ST_Monitoring_Expert_Waveform.C
Go to the documentation of this file.
1 // File: ST_Monitoring_Expert_waveform.C
2 // Created: 05/18/2015
3 // Creator: Mahmoud Kamel, mkame006@fiu.edu
4 // Purpose: Displaying waveforms histograms for online monitoring purposes. Designed for ST Experts.
5 
6 {
7  // Define the directory that contains the histograms
8  TDirectory *dir = (TDirectory*)gDirectory->FindObjectAny("st_lowlevel/waveforms");
9  if(dir) dir->cd();
10 
11  // Declare the number of channels
12  const int NCHANNELS = 30;
13 
14  // Define arrays of dynamic pointers to 1D histograms
15  TH1I** h_amp_vs_sampl_chan = new TH1I*[NCHANNELS];
16  TH1I** h_amp_vs_sampl_chan150 = new TH1I*[NCHANNELS];
17  TH1I** h_amp_vs_sampl_chan1000 = new TH1I*[NCHANNELS];
18  TH1I** h_amp_vs_sampl_chan2000 = new TH1I*[NCHANNELS];
19  TH1I** h_amp_vs_sampl_chan3000 = new TH1I*[NCHANNELS];
20  TH1I** h_amp_vs_sampl_chan4000 = new TH1I*[NCHANNELS];
21  for(unsigned int i = 0; i < NCHANNELS; i++)
22  {
23  // Grab 1D histograms for root file
24  h_amp_vs_sampl_chan[i] = (TH1I*)gDirectory->FindObjectAny(Form("amp_vs_sampl_chan_%i", i+1));
25  h_amp_vs_sampl_chan150[i] = (TH1I*)gDirectory->FindObjectAny(Form("amp_vs_sampl_chan150_%i", i+1));
26  h_amp_vs_sampl_chan1000[i] = (TH1I*)gDirectory->FindObjectAny(Form("amp_vs_sampl_chan1000_%i", i+1));
27  h_amp_vs_sampl_chan2000[i] = (TH1I*)gDirectory->FindObjectAny(Form("amp_vs_sampl_chan2000_%i", i+1));
28  h_amp_vs_sampl_chan3000[i] = (TH1I*)gDirectory->FindObjectAny(Form("amp_vs_sampl_chan3000_%i", i+1));
29  h_amp_vs_sampl_chan4000[i] = (TH1I*)gDirectory->FindObjectAny(Form("amp_vs_sampl_chan4000_%i", i+1));
30  }
31 
32 
33  // Create the canvas c1
34  TCanvas *c1 = NULL;
35  if(gPad == NULL)
36  {
37  c1 = new TCanvas("c1","Start Counter Expert Waveform Histograms( 100 < Pulse height <= 150)", 200, 10, 600, 480);
38  c1->cd(0);
39  c1->Draw();
40  c1->Update();
41  }
42 
43  if(!gPad) return;
44  c1 = gPad->GetCanvas();
45  c1->Divide(5,6);
46 
47  for(unsigned int i = 0; i < NCHANNELS; i++)
48  {
49  // f1ADC250 multiplicity histograms
50  c1->cd(i+1);
51  gPad->SetTicks();
52  gStyle->SetOptStat(10);
53 
54  //set margins
55  gPad->SetLeftMargin(0.12);
56  gPad->SetRightMargin(0.02);
57  gPad->SetBottomMargin(0.14);
58  gPad->SetTopMargin(0.1);
59  //set axis label size
60  h_amp_vs_sampl_chan150[i]->SetLabelSize(0.06,"X");
61  h_amp_vs_sampl_chan150[i]->SetLabelSize(0.06,"Y");
62  h_amp_vs_sampl_chan150[i]->GetXaxis()->CenterTitle();
63  h_amp_vs_sampl_chan150[i]->GetYaxis()->CenterTitle();
64  h_amp_vs_sampl_chan150[i]->SetTitleSize(0.06,"X");
65  h_amp_vs_sampl_chan150[i]->SetTitleSize(0.06,"Y");
66 
67  //set marker,& marker size and color
68  h_amp_vs_sampl_chan150[i]->SetMarkerStyle(8);
69  h_amp_vs_sampl_chan150[i]->SetMarkerColor(4);
70  h_amp_vs_sampl_chan150[i]->SetMarkerSize(0.5);
71 
72  if(h_amp_vs_sampl_chan150[i]) h_amp_vs_sampl_chan150[i]->Draw("PC");
73  h_amp_vs_sampl_chan150[i]->SetMinimum(50);
74  h_amp_vs_sampl_chan150[i]->SetMaximum(150);
75  }
76  // Create the canvas c2
77  TCanvas *c2 = new TCanvas("c2","Start Counter Expert Waveform Histograms( 150 < Pulse height <= 1000)", 200, 10, 600, 480);
78  c2->cd(0);
79  c2->Draw();
80  c2->Update();
81  if(!gPad) return;
82  c2 = gPad->GetCanvas();
83  c2->Divide(5,6);
84 
85  for(unsigned int i = 0; i < NCHANNELS; i++)
86  {
87  // f1ADC250 multiplicity histograms
88  c2->cd(i+1);
89  gPad->SetTicks();
90  gStyle->SetOptStat(10);
91 
92  //set margins
93  gPad->SetLeftMargin(0.12);
94  gPad->SetRightMargin(0.02);
95  gPad->SetBottomMargin(0.14);
96  gPad->SetTopMargin(0.1);
97  //set axis label size
98  h_amp_vs_sampl_chan[i]->SetLabelSize(0.06,"X");
99  h_amp_vs_sampl_chan[i]->SetLabelSize(0.06,"Y");
100  h_amp_vs_sampl_chan[i]->GetXaxis()->CenterTitle();
101  h_amp_vs_sampl_chan[i]->GetYaxis()->CenterTitle();
102  h_amp_vs_sampl_chan[i]->SetTitleSize(0.06,"X");
103  h_amp_vs_sampl_chan[i]->SetTitleSize(0.06,"Y");
104 
105  //set marker,& marker size and color
106  h_amp_vs_sampl_chan[i]->SetMarkerStyle(8);
107  h_amp_vs_sampl_chan[i]->SetMarkerColor(4);
108  h_amp_vs_sampl_chan[i]->SetMarkerSize(0.5);
109 
110  if(h_amp_vs_sampl_chan[i]) h_amp_vs_sampl_chan[i]->Draw("PC");
111  h_amp_vs_sampl_chan[i]->SetMinimum(50);
112  h_amp_vs_sampl_chan[i]->SetMaximum(1000);
113  }
114  // Create the canvas c3
115  TCanvas *c3 = new TCanvas("c3","Start Counter Expert Waveform Histograms(1000 < Pulse height <= 2000)", 200, 10, 600, 480);
116  c3->cd(0);
117  c3->Draw();
118  c3->Update();
119  if(!gPad) return;
120  c3 = gPad->GetCanvas();
121  c3->Divide(5,6);
122 
123  for(unsigned int i = 0; i < NCHANNELS; i++)
124  {
125  // f1ADC250 multiplicity histograms
126  c3->cd(i+1);
127  gPad->SetTicks();
128  gStyle->SetOptStat(10);
129  //set margins
130  gPad->SetLeftMargin(0.12);
131  gPad->SetRightMargin(0.02);
132  gPad->SetBottomMargin(0.14);
133  gPad->SetTopMargin(0.1);
134  //set axis label size
135  h_amp_vs_sampl_chan1000[i]->SetLabelSize(0.06,"X");
136  h_amp_vs_sampl_chan1000[i]->SetLabelSize(0.06,"Y");
137  h_amp_vs_sampl_chan1000[i]->GetXaxis()->CenterTitle();
138  h_amp_vs_sampl_chan1000[i]->GetYaxis()->CenterTitle();
139  h_amp_vs_sampl_chan1000[i]->SetTitleSize(0.06,"X");
140  h_amp_vs_sampl_chan1000[i]->SetTitleSize(0.06,"Y");
141  //set marker,& marker size and color
142  h_amp_vs_sampl_chan1000[i]->SetMarkerStyle(8);
143  h_amp_vs_sampl_chan1000[i]->SetMarkerColor(4);
144  h_amp_vs_sampl_chan1000[i]->SetMarkerSize(0.5);
145  if(h_amp_vs_sampl_chan1000[i]) h_amp_vs_sampl_chan1000[i]->Draw("PC");
146  h_amp_vs_sampl_chan1000[i]->SetMinimum(50);
147  h_amp_vs_sampl_chan1000[i]->SetMaximum(2000);
148  }
149 // Create the canvas c4
150  TCanvas *c4 = new TCanvas("c4","Start Counter Expert Waveform Histograms (2000 < Pulse height <= 3000)", 200, 10, 600, 480);
151  c4->cd(0);
152  c4->Draw();
153  c4->Update();
154  if(!gPad) return;
155  c4 = gPad->GetCanvas();
156  c4->Divide(5,6);
157 
158  for(unsigned int i = 0; i < NCHANNELS; i++)
159  {
160  // f1ADC250 multiplicity histograms
161  c4->cd(i+1);
162  gPad->SetTicks();
163  gStyle->SetOptStat(10);
164  //set margins
165  gPad->SetLeftMargin(0.12);
166  gPad->SetRightMargin(0.02);
167  gPad->SetBottomMargin(0.14);
168  gPad->SetTopMargin(0.1);
169  //set axis label size
170  h_amp_vs_sampl_chan2000[i]->SetLabelSize(0.06,"X");
171  h_amp_vs_sampl_chan2000[i]->SetLabelSize(0.06,"Y");
172  h_amp_vs_sampl_chan2000[i]->GetXaxis()->CenterTitle();
173  h_amp_vs_sampl_chan2000[i]->GetYaxis()->CenterTitle();
174  h_amp_vs_sampl_chan2000[i]->SetTitleSize(0.06,"X");
175  h_amp_vs_sampl_chan2000[i]->SetTitleSize(0.06,"Y");
176  //set marker,& marker size and color
177  h_amp_vs_sampl_chan2000[i]->SetMarkerStyle(8);
178  h_amp_vs_sampl_chan2000[i]->SetMarkerColor(4);
179  h_amp_vs_sampl_chan2000[i]->SetMarkerSize(0.5);
180  if(h_amp_vs_sampl_chan2000[i]) h_amp_vs_sampl_chan2000[i]->Draw("PC");
181  h_amp_vs_sampl_chan2000[i]->SetMinimum(50);
182  h_amp_vs_sampl_chan2000[i]->SetMaximum(3000);
183  }
184 // Create the canvas c5
185  TCanvas *c5 = new TCanvas("c5","Start Counter Expert Waveform Histograms(3000 < Pulse height <= 4000)", 200, 10, 600, 480);
186  c5->cd(0);
187  c5->Draw();
188  c5->Update();
189  if(!gPad) return;
190  c5 = gPad->GetCanvas();
191  c5->Divide(5,6);
192 
193  for(unsigned int i = 0; i < NCHANNELS; i++)
194  {
195  // f1ADC250 multiplicity histograms
196  c5->cd(i+1);
197  gPad->SetTicks();
198  gStyle->SetOptStat(10);
199  //set margins
200  gPad->SetLeftMargin(0.12);
201  gPad->SetRightMargin(0.02);
202  gPad->SetBottomMargin(0.14);
203  gPad->SetTopMargin(0.1);
204  //set axis label size
205  h_amp_vs_sampl_chan3000[i]->SetLabelSize(0.06,"X");
206  h_amp_vs_sampl_chan3000[i]->SetLabelSize(0.06,"Y");
207  h_amp_vs_sampl_chan3000[i]->GetXaxis()->CenterTitle();
208  h_amp_vs_sampl_chan3000[i]->GetYaxis()->CenterTitle();
209  h_amp_vs_sampl_chan3000[i]->SetTitleSize(0.06,"X");
210  h_amp_vs_sampl_chan3000[i]->SetTitleSize(0.06,"Y");
211  //set marker,& marker size and color
212  h_amp_vs_sampl_chan3000[i]->SetMarkerStyle(8);
213  h_amp_vs_sampl_chan3000[i]->SetMarkerColor(4);
214  h_amp_vs_sampl_chan3000[i]->SetMarkerSize(0.5);
215  if(h_amp_vs_sampl_chan3000[i]) h_amp_vs_sampl_chan3000[i]->Draw("PC");
216  h_amp_vs_sampl_chan3000[i]->SetMinimum(50);
217  h_amp_vs_sampl_chan3000[i]->SetMaximum(4000);
218  }
219 // Create the canvas c6
220  TCanvas *c6 = new TCanvas("c6","Start Counter Expert Waveform Histograms(4000 < Pulse height)", 200, 10, 600, 480);
221  c6->cd(0);
222  c6->Draw();
223  c6->Update();
224  if(!gPad) return;
225  c6 = gPad->GetCanvas();
226  c6->Divide(5,6);
227 
228  for(unsigned int i = 0; i < NCHANNELS; i++)
229  {
230  // f1ADC250 multiplicity histograms
231  c6->cd(i+1);
232  gPad->SetTicks();
233  gStyle->SetOptStat(10);
234  //set margins
235  gPad->SetLeftMargin(0.12);
236  gPad->SetRightMargin(0.02);
237  gPad->SetBottomMargin(0.14);
238  gPad->SetTopMargin(0.1);
239  //set axis label size
240  h_amp_vs_sampl_chan4000[i]->SetLabelSize(0.06,"X");
241  h_amp_vs_sampl_chan4000[i]->SetLabelSize(0.06,"Y");
242  h_amp_vs_sampl_chan4000[i]->GetXaxis()->CenterTitle();
243  h_amp_vs_sampl_chan4000[i]->GetYaxis()->CenterTitle();
244  h_amp_vs_sampl_chan4000[i]->SetTitleSize(0.06,"X");
245  h_amp_vs_sampl_chan4000[i]->SetTitleSize(0.06,"Y");
246  //set marker,& marker size and color
247  h_amp_vs_sampl_chan4000[i]->SetMarkerStyle(8);
248  h_amp_vs_sampl_chan4000[i]->SetMarkerColor(4);
249  h_amp_vs_sampl_chan4000[i]->SetMarkerSize(0.5);
250  if(h_amp_vs_sampl_chan4000[i]) h_amp_vs_sampl_chan4000[i]->Draw("PC");
251  h_amp_vs_sampl_chan4000[i]->SetMinimum(50);
252  h_amp_vs_sampl_chan4000[i]->SetMaximum(9000);
253  }
254 
255 
256 }
TH1I ** h_amp_vs_sampl_chan1000
const Int_t NCHANNELS
TH1I ** h_amp_vs_sampl_chan2000
TH1I ** h_amp_vs_sampl_chan
Double_t c1[2][NMODULES]
Definition: tw_corr.C:68
Double_t c2[2][NMODULES]
Definition: tw_corr.C:69
TH1I ** h_amp_vs_sampl_chan3000
TH1I ** h_amp_vs_sampl_chan150
TCanvas * c4
TH1I ** h_amp_vs_sampl_chan4000
TDirectory * dir
Definition: bcal_hist_eff.C:31
TCanvas * c3