StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
drawSingleTable.C
1 TH1F *h[10];
2 h[0] = 0;
3 h[1] = 0;
4 h[2] = 0;
5 h[3] = 0;
6 h[4] = 0;
7 h[5] = 0;
8 h[6] = 0;
9 h[7] = 0;
10 h[8] = 0;
11 h[9] = 0;
12 TCanvas *CANVAS = 0;
13 void clear()
14 {
15  for(int i=0;i<10;i++)
16  {
17  if(h[i]) delete h[i];
18  h[i] = 0;
19  }
20 }
21 
22 TCanvas* canvas(int nx, int ny, int sx=600, int sy =900)
23 {
24  if(CANVAS) {delete CANVAS; CANVAS=0;}
25  CANVAS = new TCanvas();
26  //CANVAS->SetWindowSize(sx,sy);
27  //CANVAS->Update();
28  CANVAS->Divide(nx,ny);
29  return CANVAS;
30 }
31 void draw(emcCalib_st* t1)
32 {
33  clear();
34  h[0] = new TH1F("emcCalib_0","",4800,0.5,4800.5);
35  h[1] = new TH1F("emcCalib_1","",4800,0.5,4800.5);
36  h[2] = new TH1F("emcCalib_2","",4800,0.5,4800.5);
37  h[3] = new TH1F("emcCalib_3","",4800,0.5,4800.5);
38  h[4] = new TH1F("emcCalib_4","",4800,0.5,4800.5);
39  h[5] = new TH1F("emcCalib_S","",4800,0.5,4800.5);
40  for(int i = 0; i<4800;i++)
41  {
42  for(int j=0;j<5;j++) h[j]->Fill(i+1,t1->AdcToE[i][j]);
43  h[5]->Fill(i+1,(float)t1->Status[i]);
44  }
45  TCanvas* c = canvas(1,6);
46  for(int j=0;j<6;j++)
47  {
48  c->cd(j+1);
49  h[j]->Draw();
50  }
51  c->Update();
52 }
53 void draw(smdCalib_st* t1)
54 {
55  clear();
56  h[0] = new TH1F("smdCalib_0","",18000,0.5,18000.5);
57  h[1] = new TH1F("smdCalib_1","",18000,0.5,18000.5);
58  h[2] = new TH1F("smdCalib_2","",18000,0.5,18000.5);
59  h[3] = new TH1F("smdCalib_3","",18000,0.5,18000.5);
60  h[4] = new TH1F("smdCalib_4","",18000,0.5,18000.5);
61  h[5] = new TH1F("smdCalib_S","",18000,0.5,18000.5);
62  for(int i = 0; i<18000;i++)
63  {
64  for(int j=0;j<5;j++) h[j]->Fill(i+1,t1->AdcToE[i][j]);
65  h[5]->Fill(i+1,(float)t1->Status[i]);
66  }
67  TCanvas* c = canvas(1,6);
68  for(int j=0;j<6;j++)
69  {
70  c->cd(j+1);
71  h[j]->Draw();
72  }
73  c->Update();
74 }
75 void draw(emcStatus_st* t1)
76 {
77  clear();
78  h[0] = new TH1F("emcStatus_S","",4800,0.5,4800.5);
79  for(int i = 0; i<4800;i++)
80  {
81  h[0]->Fill(i+1,(float)t1->Status[i]);
82  }
83  TCanvas* c = canvas(1,1,600,300);
84  h[0]->Draw();
85  c->Update();
86  return;
87 }
88 void draw(smdStatus_st* t1)
89 {
90  clear();
91  h[0] = new TH1F("smdStatus_S","",18000,0.5,18000.5);
92  for(int i = 0; i<18000;i++)
93  {
94  h[0]->Fill(i+1,(float)t1->Status[i]);
95  }
96  TCanvas* c = canvas(1,1,600,300);
97  h[0]->Draw();
98  c->Update();
99  return;
100 }
101 void draw(emcGain_st* t1)
102 {
103  clear();
104  h[0] = new TH1F("emcGain_S","",4800,0.5,4800.5);
105  for(int i = 0; i<4800;i++)
106  {
107  h[0]->Fill(i+1,(float)t1->Gain[i]);
108  }
109  TCanvas* c = canvas(1,1,600,300);
110  h[0]->Draw();
111  c->Update();
112  return;
113 }
114 void draw(smdGain_st* t1)
115 {
116  clear();
117  h[0] = new TH1F("smdGain_S","",18000,0.5,18000.5);
118  for(int i = 0; i<18000;i++)
119  {
120  h[0]->Fill(i+1,(float)t1->Gain[i]);
121  }
122  TCanvas* c = canvas(1,1,600,300);
123  h[0]->Draw();
124  c->Update();
125  return;
126 }
127 void draw(smdPed_st* t1)
128 {
129  clear();
130  h[0] = new TH1F("smdPed_ADC0","",18000,0.5,18000.5);
131  h[1] = new TH1F("smdPed_ADC1","",18000,0.5,18000.5);
132  h[2] = new TH1F("smdPed_ADC2","",18000,0.5,18000.5);
133  h[3] = new TH1F("smdPed_RMS0","",18000,0.5,18000.5);
134  h[4] = new TH1F("smdPed_RMS1","",18000,0.5,18000.5);
135  h[5] = new TH1F("smdPed_RMS2","",18000,0.5,18000.5);
136  h[6] = new TH1F("smdPed_STATUS","",18000,0.5,18000.5);
137  for(int i = 0; i<18000;i++)
138  {
139  h[0]->Fill(i+1,(float)t1->AdcPedestal[i][0]/100);
140  h[1]->Fill(i+1,(float)t1->AdcPedestal[i][1]/100);
141  h[2]->Fill(i+1,(float)t1->AdcPedestal[i][2]/100);
142  h[3]->Fill(i+1,(float)t1->AdcPedestalRMS[i][0]/100);
143  h[4]->Fill(i+1,(float)t1->AdcPedestalRMS[i][1]/100);
144  h[5]->Fill(i+1,(float)t1->AdcPedestalRMS[i][2]/100);
145  h[6]->Fill(i+1,(float)t1->Status[i]);
146  }
147  TCanvas* c = canvas(3,3,800,500);
148  for(int j=0;j<7;j++)
149  {
150  c->cd(j+1);
151  h[j]->Draw();
152  }
153  c->Update();
154  return;
155 }
156 void draw(emcPed_st* t1)
157 {
158  clear();
159  h[0] = new TH1F("emcPed_ADC","",4800,0.5,4800.5);
160  h[1] = new TH1F("emcPed_RMS","",4800,0.5,4800.5);
161  h[2] = new TH1F("emcPed_STATUS","",4800,0.5,4800.5);
162  for(int i = 0; i<4800;i++)
163  {
164  h[0]->Fill(i+1,(float)t1->AdcPedestal[i]/100);
165  h[1]->Fill(i+1,(float)t1->AdcPedestalRMS[i]/100);
166  h[2]->Fill(i+1,(float)t1->Status[i]);
167  }
168  TCanvas* c = canvas(1,3);
169  for(int j=0;j<3;j++)
170  {
171  c->cd(j+1);
172  h[j]->Draw();
173  }
174  c->Update();
175  return;
176 }
177 void draw(emcTriggerPed_st* t1)
178 {
179  clear();
180  h[0] = new TH1F("emcTriggerPed_BITCONV","",300,0,300);
181  h[1] = new TH1F("emcTriggerPed_PED","",4800,0,4800);
182  for(int c=0;c<30;c++)
183  {
184  for(int p=0;p<10;p++)
185  h[0]->Fill(c*10+p, (float)t1->BitConversionMode[c][p]);
186  for(int p=0;p<160;p++)
187  h[1]->Fill(c*160+p,(float)t1->Ped[c][p]/100) ;
188  }
189  TCanvas* q = canvas(1,2);
190  for(int j=0;j<2;j++)
191  {
192  q->cd(j+1);
193  h[j]->Draw();
194  }
195  q->Update();
196  return;
197 }
198 void draw(emcTriggerStatus_st* t1)
199 {
200  clear();
201  h[0] = new TH1F("emcTriggerStatus_Patch","",300,0,300);
202  h[1] = new TH1F("emcTriggerStatus_HighTower","",300,0,300);
203  h[2] = new TH1F("emcTriggerStatus_Tower","",4800,0,4800);
204  for(int c=0;c<30;c++)
205  {
206  for(int p=0;p<10;p++)
207  {
208  h[0]->Fill(c*10+p,t1->PatchStatus[c*10+p]) ;
209  h[1]->Fill(c*10+p,t1->HighTowerStatus[c*10+p]) ;
210  }
211  for(int p=0;p<160;p++)
212  h[2]->Fill(c*160+p,t1->TowerStatus[c][p]);
213  }
214  TCanvas* q = canvas(1,3);
215  for(int j=0;j<3;j++)
216  {
217  q->cd(j+1);
218  h[j]->Draw();
219  }
220  q->Update();
221  return;
222 }
223 void draw(emcTriggerLUT_st* t1)
224 {
225  clear();
226  h[0] = new TH1F("emcTriggerStatus_Tag","",300,0,300);
227  h[1] = new TH1F("emcTriggerStatus_Par0","",300,0,300);
228  h[2] = new TH1F("emcTriggerStatus_Par1","",300,0,300);
229  h[3] = new TH1F("emcTriggerStatus_Par2","",300,0,300);
230  h[4] = new TH1F("emcTriggerStatus_Par3","",300,0,300);
231  h[5] = new TH1F("emcTriggerStatus_Par4","",300,0,300);
232  h[6] = new TH1F("emcTriggerStatus_Par5","",300,0,300);
233  for(int c=0;c<30;c++)
234  {
235  for(int p=0;p<10;p++)
236  {
237  h[0]->Fill(c*30+p,t1->FormulaTag[c][p]) ;
238  h[1]->Fill(c*30+p,t1->FormulaParameter0[c][p]);
239  h[2]->Fill(c*30+p,t1->FormulaParameter1[c][p]);
240  h[3]->Fill(c*30+p,t1->FormulaParameter2[c][p]);
241  h[4]->Fill(c*30+p,t1->FormulaParameter3[c][p]);
242  h[5]->Fill(c*30+p,t1->FormulaParameter4[c][p]);
243  h[6]->Fill(c*30+p,t1->FormulaParameter5[c][p]);
244  }
245  }
246  TCanvas* q = canvas(1,7);
247  for(int j=0;j<7;j++)
248  {
249  q->cd(j+1);
250  h[j]->Draw();
251  }
252  q->Update();
253  return;
254 }
255