Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ST_Monitoring_Waveform_ch4.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  if(gPad == NULL)
35  {
36  TCanvas *c1 = new TCanvas("c1","Start Counter Expert Waveform Histograms( 100 < Pulse height <= 150)", 200, 10, 600, 480);
37  c1->cd(0);
38  c1->Draw();
39  c1->Update();
40  }
41 
42  if(!gPad) return;
43  TCanvas *c1 = gPad->GetCanvas();
44  c1->Divide(3,2);
45 
46  // f1ADC250 multiplicity histograms
47  c1->cd(1);
48  gPad->SetTicks();
49  gStyle->SetOptStat(10);
50 
51  //set margins
52  gPad->SetLeftMargin(0.12);
53  gPad->SetRightMargin(0.03);
54  gPad->SetBottomMargin(0.14);
55  gPad->SetTopMargin(0.1);
56  //set axis label size
57  h_amp_vs_sampl_chan150[3]->SetLabelSize(0.04,"X");
58  h_amp_vs_sampl_chan150[3]->SetLabelSize(0.04,"Y");
59  h_amp_vs_sampl_chan150[3]->GetXaxis()->CenterTitle();
60  h_amp_vs_sampl_chan150[3]->GetYaxis()->CenterTitle();
61  h_amp_vs_sampl_chan150[3]->SetTitleSize(0.06,"X");
62  h_amp_vs_sampl_chan150[3]->SetTitleSize(0.06,"Y");
63 
64  //set marker,& marker size and color
65  h_amp_vs_sampl_chan150[3]->SetMarkerStyle(8);
66  h_amp_vs_sampl_chan150[3]->SetMarkerColor(4);
67  h_amp_vs_sampl_chan150[3]->SetMarkerSize(0.5);
68 
69  if(h_amp_vs_sampl_chan150[3]) h_amp_vs_sampl_chan150[3]->Draw("PC");
70  h_amp_vs_sampl_chan150[3]->SetMinimum(50);
71  h_amp_vs_sampl_chan150[3]->SetMaximum(150);
72 
73  // f1ADC250 multiplicity histograms
74  c1->cd(2);
75  gPad->SetTicks();
76  gStyle->SetOptStat(10);
77 
78  //set margins
79  gPad->SetLeftMargin(0.12);
80  gPad->SetRightMargin(0.03);
81  gPad->SetBottomMargin(0.14);
82  gPad->SetTopMargin(0.1);
83  //set axis label size
84  h_amp_vs_sampl_chan[3]->SetLabelSize(0.04,"X");
85  h_amp_vs_sampl_chan[3]->SetLabelSize(0.04,"Y");
86  h_amp_vs_sampl_chan[3]->GetXaxis()->CenterTitle();
87  h_amp_vs_sampl_chan[3]->GetYaxis()->CenterTitle();
88  h_amp_vs_sampl_chan[3]->SetTitleSize(0.06,"X");
89  h_amp_vs_sampl_chan[3]->SetTitleSize(0.06,"Y");
90 
91  //set marker,& marker size and color
92  h_amp_vs_sampl_chan[3]->SetMarkerStyle(8);
93  h_amp_vs_sampl_chan[3]->SetMarkerColor(4);
94  h_amp_vs_sampl_chan[3]->SetMarkerSize(0.5);
95 
96  if(h_amp_vs_sampl_chan[3]) h_amp_vs_sampl_chan[3]->Draw("PC");
97  h_amp_vs_sampl_chan[3]->SetMinimum(50);
98  h_amp_vs_sampl_chan[3]->SetMaximum(1000);
99 
100 
101  c1->cd(3);
102  gPad->SetTicks();
103  gStyle->SetOptStat(10);
104  //set margins
105  gPad->SetLeftMargin(0.12);
106  gPad->SetRightMargin(0.03);
107  gPad->SetBottomMargin(0.14);
108  gPad->SetTopMargin(0.1);
109  //set axis label size
110  h_amp_vs_sampl_chan1000[3]->SetLabelSize(0.04,"X");
111  h_amp_vs_sampl_chan1000[3]->SetLabelSize(0.04,"Y");
112  h_amp_vs_sampl_chan1000[3]->GetXaxis()->CenterTitle();
113  h_amp_vs_sampl_chan1000[3]->GetYaxis()->CenterTitle();
114  h_amp_vs_sampl_chan1000[3]->SetTitleSize(0.06,"X");
115  h_amp_vs_sampl_chan1000[3]->SetTitleSize(0.06,"Y");
116  //set marker,& marker size and color
117  h_amp_vs_sampl_chan1000[3]->SetMarkerStyle(8);
118  h_amp_vs_sampl_chan1000[3]->SetMarkerColor(4);
119  h_amp_vs_sampl_chan1000[3]->SetMarkerSize(0.5);
120  if(h_amp_vs_sampl_chan1000[3]) h_amp_vs_sampl_chan1000[3]->Draw("PC");
121  h_amp_vs_sampl_chan1000[3]->SetMinimum(50);
122  h_amp_vs_sampl_chan1000[3]->SetMaximum(2000);
123 
124 
125  c1->cd(4);
126  gPad->SetTicks();
127  gStyle->SetOptStat(10);
128  //set margins
129  gPad->SetLeftMargin(0.12);
130  gPad->SetRightMargin(0.03);
131  gPad->SetBottomMargin(0.14);
132  gPad->SetTopMargin(0.1);
133  //set axis label size
134  h_amp_vs_sampl_chan2000[3]->SetLabelSize(0.04,"X");
135  h_amp_vs_sampl_chan2000[3]->SetLabelSize(0.04,"Y");
136  h_amp_vs_sampl_chan2000[3]->GetXaxis()->CenterTitle();
137  h_amp_vs_sampl_chan2000[3]->GetYaxis()->CenterTitle();
138  h_amp_vs_sampl_chan2000[3]->SetTitleSize(0.06,"X");
139  h_amp_vs_sampl_chan2000[3]->SetTitleSize(0.06,"Y");
140  //set marker,& marker size and color
141  h_amp_vs_sampl_chan2000[3]->SetMarkerStyle(8);
142  h_amp_vs_sampl_chan2000[3]->SetMarkerColor(4);
143  h_amp_vs_sampl_chan2000[3]->SetMarkerSize(0.5);
144  if(h_amp_vs_sampl_chan2000[3]) h_amp_vs_sampl_chan2000[3]->Draw("PC");
145  h_amp_vs_sampl_chan2000[3]->SetMinimum(50);
146  h_amp_vs_sampl_chan2000[3]->SetMaximum(3000);
147 
148 
149  c1->cd(5);
150  gPad->SetTicks();
151  gStyle->SetOptStat(10);
152  //set margins
153  gPad->SetLeftMargin(0.12);
154  gPad->SetRightMargin(0.03);
155  gPad->SetBottomMargin(0.14);
156  gPad->SetTopMargin(0.1);
157  //set axis label size
158  h_amp_vs_sampl_chan3000[3]->SetLabelSize(0.04,"X");
159  h_amp_vs_sampl_chan3000[3]->SetLabelSize(0.04,"Y");
160  h_amp_vs_sampl_chan3000[3]->GetXaxis()->CenterTitle();
161  h_amp_vs_sampl_chan3000[3]->GetYaxis()->CenterTitle();
162  h_amp_vs_sampl_chan3000[3]->SetTitleSize(0.06,"X");
163  h_amp_vs_sampl_chan3000[3]->SetTitleSize(0.06,"Y");
164  //set marker,& marker size and color
165  h_amp_vs_sampl_chan3000[3]->SetMarkerStyle(8);
166  h_amp_vs_sampl_chan3000[3]->SetMarkerColor(4);
167  h_amp_vs_sampl_chan3000[3]->SetMarkerSize(0.5);
168  if(h_amp_vs_sampl_chan3000[3]) h_amp_vs_sampl_chan3000[3]->Draw("PC");
169  h_amp_vs_sampl_chan3000[3]->SetMinimum(50);
170  h_amp_vs_sampl_chan3000[3]->SetMaximum(4000);
171 
172 
173  c1->cd(6);
174  gPad->SetTicks();
175  gStyle->SetOptStat(10);
176  //set margins
177  gPad->SetLeftMargin(0.12);
178  gPad->SetRightMargin(0.03);
179  gPad->SetBottomMargin(0.14);
180  gPad->SetTopMargin(0.1);
181  //set axis label size
182  h_amp_vs_sampl_chan4000[3]->SetLabelSize(0.04,"X");
183  h_amp_vs_sampl_chan4000[3]->SetLabelSize(0.04,"Y");
184  h_amp_vs_sampl_chan4000[3]->GetXaxis()->CenterTitle();
185  h_amp_vs_sampl_chan4000[3]->GetYaxis()->CenterTitle();
186  h_amp_vs_sampl_chan4000[3]->SetTitleSize(0.06,"X");
187  h_amp_vs_sampl_chan4000[3]->SetTitleSize(0.06,"Y");
188  //set marker,& marker size and color
189  h_amp_vs_sampl_chan4000[3]->SetMarkerStyle(8);
190  h_amp_vs_sampl_chan4000[3]->SetMarkerColor(4);
191  h_amp_vs_sampl_chan4000[3]->SetMarkerSize(0.5);
192  if(h_amp_vs_sampl_chan4000[3]) h_amp_vs_sampl_chan4000[3]->Draw("PC");
193  h_amp_vs_sampl_chan4000[3]->SetMinimum(50);
194  h_amp_vs_sampl_chan4000[3]->SetMaximum(9000);
195 
196 
197 
198 }
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
TH1I ** h_amp_vs_sampl_chan3000
TH1I ** h_amp_vs_sampl_chan150
TH1I ** h_amp_vs_sampl_chan4000
TDirectory * dir
Definition: bcal_hist_eff.C:31