/[PAMELA software]/quicklook/trigger/src/TriggerScanBasic.cpp
ViewVC logotype

Contents of /quicklook/trigger/src/TriggerScanBasic.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Thu Sep 21 08:51:05 2006 UTC (18 years, 4 months ago) by campana
Branch: MAIN
CVS Tags: v1r07, v1r08
Changes since 1.2: +793 -233 lines
Trigger Qlook modified

1 /*
2 * TriggerScanBasic
3 * Author Nagni
4 * Modified by G. De Rosa
5 * Version 1.2
6 * Date 27 Apr 2006
7 * Version 1.4
8 * Date 26 Jun 2006: Inserted dependences on OnBoardTime and modified histogram ranges.
9 *
10 * Description:
11 * Describe the performance of the Trigger.
12 *
13 * Parameters:
14 * TString base - the path to the root directory for the specific Pamela unpack session
15 * TString outDirectory - the path where to save the output image (Default = base)
16 * TString format - the format which will be used for save the produced images (Default = "ps")
17 */
18
19 #include <TROOT.h>
20 #include <TFile.h>
21 #include <TString.h>
22 #include <TObjString.h>
23 #include <TTree.h>
24 #include <TBranch.h>
25 #include <TGraph.h>
26 #include <TStyle.h>
27 #include <TH1.h>
28 #include <TH2S.h>
29 #include <TPaveText.h>
30 #include <TCanvas.h>
31 #include <TLatex.h>
32 #include <TGraph.h>
33 #include <physics/trigger/TriggerEvent.h>
34 #include <EventHeader.h>
35 #include <PscuHeader.h>
36 #include <iostream>
37
38 using namespace std;
39
40 char bit(int decimal, char pos)
41 {
42 return( (decimal>>pos)%2 );
43 }
44
45 void TriggerScanBasic(TString base, TString outDirectory = "", TString format = ""){
46
47 std::stringstream sst;
48 if (outDirectory == "") outDirectory = base.Data();
49 TString filename = ((TObjString*)base.Tokenize('/')->Last())->GetString();
50
51 TFile *file =new TFile(base.Data()) ;
52 if (!file){
53 printf("file not Found \n");
54 return;
55 }
56
57 TTree *PhysicsTr = (TTree*)file->Get("Physics");
58 TBranch *TrigBr = PhysicsTr->GetBranch("Trigger");
59 TBranch *HeadBr = PhysicsTr->GetBranch("Header");
60
61 pamela::EventHeader *eh = 0;
62 pamela::PscuHeader *ph = 0;
63
64 pamela::trigger::TriggerEvent *triggerEvent = 0;
65
66 PhysicsTr->SetBranchAddress("Trigger", &triggerEvent);
67 PhysicsTr->SetBranchAddress("Header", &eh);
68
69 Long64_t nevents = TrigBr->GetEntries();
70 if (nevents <= 0) {
71 printf("nevents = %llu \n", nevents);
72 file->Close();
73 return;
74 }
75
76 /* Histo DEF */
77
78 /*
79 * S4 and Calorimeter Counters histograms
80 */
81 TCanvas *S4CalCanvas = new TCanvas("S4CalCanvas","S4CalCanvas", 1280, 1024);
82 S4CalCanvas->Divide(1,2);
83 //----------
84 sst.str("");
85 sst << "S4 Counters based on " << base.Data();
86 //----------
87 sst.str("");
88 sst << "Calorimeter Rate Counters based on " << base.Data();
89 TH1F *S4Cal2Histo = new TH1F("S4Cal2Histo", sst.str().c_str(), 20, 0, 20);
90
91 int i = 0;
92 Int_t size = nevents;
93
94 Double_t *time = new Double_t[size];
95 Double_t *evCounter = new Double_t[size];
96 Double_t *deadTime = new Double_t[size];
97 Double_t *liveTime = new Double_t[size];
98 //
99 Double_t *trigrate0 = new Double_t[size];
100 Double_t *trigrate1 = new Double_t[size];
101 Double_t *trigrate2 = new Double_t[size];
102 Double_t *trigrate3 = new Double_t[size];
103 Double_t *trigrate4 = new Double_t[size];
104 Double_t *trigrate5 = new Double_t[size];
105 //
106 Double_t *pmt1 = new Double_t[size];
107 Double_t *pmt2 = new Double_t[size];
108 Double_t *pmt3 = new Double_t[size];
109 //
110 Double_t *s4rate = new Double_t[size];
111 //
112 Double_t *pmt1_0 = new Double_t[size];
113 Double_t *pmt1_1 = new Double_t[size];
114 Double_t *pmt1_2 = new Double_t[size];
115 Double_t *pmt1_3 = new Double_t[size];
116 Double_t *pmt1_4 = new Double_t[size];
117 Double_t *pmt1_5 = new Double_t[size];
118 Double_t *pmt1_6 = new Double_t[size];
119 Double_t *pmt1_7 = new Double_t[size];
120 Double_t *pmt1_8 = new Double_t[size];
121 Double_t *pmt1_9 = new Double_t[size];
122 Double_t *pmt1_10 = new Double_t[size];
123 Double_t *pmt1_11 = new Double_t[size];
124 Double_t *pmt1_12 = new Double_t[size];
125 Double_t *pmt1_13 = new Double_t[size];
126 Double_t *pmt1_14 = new Double_t[size];
127 Double_t *pmt1_15 = new Double_t[size];
128 Double_t *pmt1_16 = new Double_t[size];
129 Double_t *pmt1_17 = new Double_t[size];
130 Double_t *pmt1_18 = new Double_t[size];
131 Double_t *pmt1_19 = new Double_t[size];
132 Double_t *pmt1_20 = new Double_t[size];
133 Double_t *pmt1_21 = new Double_t[size];
134 Double_t *pmt1_22 = new Double_t[size];
135 Double_t *pmt1_23 = new Double_t[size];
136 //
137 Double_t *pmt2_0 = new Double_t[size];
138 Double_t *pmt2_1 = new Double_t[size];
139 Double_t *pmt2_2 = new Double_t[size];
140 Double_t *pmt2_3 = new Double_t[size];
141 Double_t *pmt2_4 = new Double_t[size];
142 Double_t *pmt2_5 = new Double_t[size];
143 Double_t *pmt2_6 = new Double_t[size];
144 Double_t *pmt2_7 = new Double_t[size];
145 Double_t *pmt2_8 = new Double_t[size];
146 Double_t *pmt2_9 = new Double_t[size];
147 Double_t *pmt2_10 = new Double_t[size];
148 Double_t *pmt2_11 = new Double_t[size];
149 Double_t *pmt2_12 = new Double_t[size];
150 Double_t *pmt2_13 = new Double_t[size];
151 Double_t *pmt2_14 = new Double_t[size];
152 Double_t *pmt2_15 = new Double_t[size];
153 Double_t *pmt2_16 = new Double_t[size];
154 Double_t *pmt2_17 = new Double_t[size];
155 Double_t *pmt2_18 = new Double_t[size];
156 Double_t *pmt2_19 = new Double_t[size];
157 Double_t *pmt2_20 = new Double_t[size];
158 Double_t *pmt2_21 = new Double_t[size];
159 Double_t *pmt2_22 = new Double_t[size];
160 Double_t *pmt2_23 = new Double_t[size];
161 //
162 while(i < nevents){
163 HeadBr->GetEntry(i);
164 TrigBr->GetEntry(i);
165
166 /* time vector fill*/
167 ph = eh->GetPscuHeader();
168 time[i] = ph->GetOrbitalTime();
169
170 /* eventCounter vector fill*/
171 evCounter[i] = triggerEvent->evcount;
172
173 if( evCounter[i] > 1 ){
174
175 /* live time vector fill*/
176 liveTime[i] = 0.16 * triggerEvent->dltime[0];
177
178 /* dead time vector fill*/
179 deadTime[i] = 0.01 * triggerEvent->dltime[1];
180
181 }
182
183 gStyle->SetStatY(0.85);
184
185
186 /* PMT Plane Counters */
187
188 pmt1[i] = 1.*triggerEvent->pmtpl[0];
189 pmt2[i] = 1.*triggerEvent->pmtpl[1];
190 pmt3[i] = 1.*triggerEvent->pmtpl[2];
191
192 /* Trigger Rate Counters*/
193
194 trigrate0[i] = (1/4.)*triggerEvent->trigrate[0];
195 trigrate1[i] = (1/4.)*triggerEvent->trigrate[1];
196 trigrate2[i] = (1/4.)*triggerEvent->trigrate[2];
197 trigrate3[i] = (1/4.)*triggerEvent->trigrate[3];
198 trigrate4[i] = (1/4.)*triggerEvent->trigrate[4];
199 trigrate5[i] = (1/4.)*triggerEvent->trigrate[5];
200
201 /* S4 and Calorimeter Counters fill*/
202
203 s4rate[i] = triggerEvent->s4calcount[0];
204 S4Cal2Histo->Fill(triggerEvent->s4calcount[1]);
205 //
206
207 /* pmtcount1 */
208 pmt1_0[i] = triggerEvent->pmtcount1[0];
209 pmt1_1[i] = triggerEvent->pmtcount1[1];
210 pmt1_2[i] = triggerEvent->pmtcount1[2];
211 pmt1_3[i] = triggerEvent->pmtcount1[3];
212 pmt1_4[i] = triggerEvent->pmtcount1[4];
213 pmt1_5[i] = triggerEvent->pmtcount1[5];
214 pmt1_6[i] = triggerEvent->pmtcount1[6];
215 pmt1_7[i] = triggerEvent->pmtcount1[7];
216 pmt1_8[i] = triggerEvent->pmtcount1[8];
217 pmt1_9[i] = triggerEvent->pmtcount1[9];
218 pmt1_10[i] = triggerEvent->pmtcount1[10];
219 pmt1_11[i] = triggerEvent->pmtcount1[11];
220 pmt1_12[i] = triggerEvent->pmtcount1[12];
221 pmt1_13[i] = triggerEvent->pmtcount1[13];
222 pmt1_14[i] = triggerEvent->pmtcount1[14];
223 pmt1_15[i] = triggerEvent->pmtcount1[15];
224 pmt1_16[i] = triggerEvent->pmtcount1[16];
225 pmt1_17[i] = triggerEvent->pmtcount1[17];
226 pmt1_18[i] = triggerEvent->pmtcount1[18];
227 pmt1_19[i] = triggerEvent->pmtcount1[19];
228 pmt1_20[i] = triggerEvent->pmtcount1[20];
229 pmt1_21[i] = triggerEvent->pmtcount1[21];
230 pmt1_22[i] = triggerEvent->pmtcount1[22];
231 pmt1_23[i] = triggerEvent->pmtcount1[23];
232
233
234 /* pmtcount2 */
235
236 pmt2_0[i] = triggerEvent->pmtcount2[0];
237 pmt2_1[i] = triggerEvent->pmtcount2[1];
238 pmt2_2[i] = triggerEvent->pmtcount2[2];
239 pmt2_3[i] = triggerEvent->pmtcount2[3];
240 pmt2_4[i] = triggerEvent->pmtcount2[4];
241 pmt2_5[i] = triggerEvent->pmtcount2[5];
242 pmt2_6[i] = triggerEvent->pmtcount2[6];
243 pmt2_7[i] = triggerEvent->pmtcount2[7];
244 pmt2_8[i] = triggerEvent->pmtcount2[8];
245 pmt2_9[i] = triggerEvent->pmtcount2[9];
246 pmt2_10[i] = triggerEvent->pmtcount2[10];
247 pmt2_11[i] = triggerEvent->pmtcount2[11];
248 pmt2_12[i] = triggerEvent->pmtcount2[12];
249 pmt2_13[i] = triggerEvent->pmtcount2[13];
250 pmt2_14[i] = triggerEvent->pmtcount2[14];
251 pmt2_15[i] = triggerEvent->pmtcount2[15];
252 pmt2_16[i] = triggerEvent->pmtcount2[16];
253 pmt2_17[i] = triggerEvent->pmtcount2[17];
254 pmt2_18[i] = triggerEvent->pmtcount2[18];
255 pmt2_19[i] = triggerEvent->pmtcount2[19];
256 pmt2_20[i] = triggerEvent->pmtcount2[20];
257 pmt2_21[i] = triggerEvent->pmtcount2[21];
258 pmt2_22[i] = triggerEvent->pmtcount2[22];
259 pmt2_23[i] = triggerEvent->pmtcount2[23];
260 //
261 i++;
262 }
263
264 gStyle->SetOptStat(111111);
265 gStyle->SetStatH(0.15);
266 gStyle->SetStatW(0.15);
267
268 /*
269 * Event Counter graph
270 */
271 TCanvas *EvCounterCanvas = new TCanvas("EvCounterCanvas","EvCounterCanvas", 1280, 1024);
272 //----------
273 sst.str("");
274 sst << "Event Counter";
275 TGraph *evCounterGraph = new TGraph(nevents, time, evCounter);
276 evCounterGraph->SetTitle(sst.str().c_str());
277 evCounterGraph->GetXaxis()->SetTitle("OnBoardTime");
278 evCounterGraph->GetXaxis()->CenterTitle();
279 evCounterGraph->Draw("APL");
280
281 /*
282 * Dead and Live time graphs
283 */
284 TCanvas *DeadLiveCanvas = new TCanvas("DeadLiveCanvas","DeadLiveCanvas", 1280, 1024);
285 DeadLiveCanvas->Divide(1,2);
286 //----------
287 sst.str("");
288 sst << "Graph of Dead Time vs OBT based on " << base.Data();
289 TGraph *DeadTimeGraph = new TGraph(nevents, time, deadTime);
290 DeadLiveCanvas->cd(1);
291 sst.str("");
292 sst << "Dead Time";
293 DeadTimeGraph->SetTitle(sst.str().c_str());
294 DeadTimeGraph->SetFillColor(2);
295 DeadTimeGraph->GetXaxis()->SetTitle("OnBoardTime");
296 DeadTimeGraph->GetXaxis()->CenterTitle();
297 DeadTimeGraph->GetYaxis()->SetTitle("DeadTime(ms)");
298 DeadTimeGraph->GetYaxis()->CenterTitle();
299 // DeadTimeGraph->SetMaximum(100);
300 DeadTimeGraph->Draw("AP");
301 //----------
302 sst.str("");
303 sst << "Graph of Live Time vs OBT based on " << base.Data();
304 TGraph *LiveTimeGraph = new TGraph(nevents, (const Double_t*)time, (const Double_t*)liveTime);
305 DeadLiveCanvas->cd(2);
306 sst.str("");
307 sst << "Live Time";
308 LiveTimeGraph->SetTitle(sst.str().c_str());
309 LiveTimeGraph->SetFillColor(2);
310 LiveTimeGraph->GetXaxis()->SetTitle("OnBoardTime");
311 LiveTimeGraph->GetXaxis()->CenterTitle();
312 LiveTimeGraph->GetYaxis()->SetTitle("LiveTime(ms)");
313 LiveTimeGraph->GetYaxis()->CenterTitle();
314 LiveTimeGraph->Draw("AP");
315
316 /*
317 * PMT Plane Counters Graph
318 */
319
320 TCanvas *PMTCanvas = new TCanvas("PMTCanvas","PMTCanvas", 1280, 1024);
321 PMTCanvas->Divide(1,3);
322 //----------
323 sst.str("");
324 sst << "Graph of PMT Plane Counters (S11 AND S12) vs OBT based on " << base.Data();
325 TGraph *PMT1Graph = new TGraph(nevents, time, pmt1);
326 PMTCanvas->cd(1);
327 sst.str("");
328 sst << "PMT Plane Counters (S11 AND S12)";
329 PMT1Graph->SetTitle(sst.str().c_str());
330 PMT1Graph->SetFillColor(2);
331 PMT1Graph->GetXaxis()->SetTitle("OnBoardTime");
332 PMT1Graph->GetXaxis()->CenterTitle();
333 PMT1Graph->GetYaxis()->SetTitle("PMT Plane Counters");
334 PMT1Graph->GetYaxis()->CenterTitle();
335 PMT1Graph->Draw("AP");
336 //----------
337 sst.str("");
338 sst << "Graph PMT Plane Counters (S21 AND S22) vs OBT based on " << base.Data();
339 TGraph *PMT2Graph = new TGraph(nevents, time, pmt2);
340 PMTCanvas->cd(2);
341 sst.str("");
342 sst << "PMT Plane Counters (S21 AND S22)";
343 PMT2Graph->SetTitle(sst.str().c_str());
344 PMT2Graph->SetFillColor(2);
345 PMT2Graph->GetXaxis()->SetTitle("OnBoardTime");
346 PMT2Graph->GetXaxis()->CenterTitle();
347 PMT2Graph->GetYaxis()->SetTitle("PMT Plane Counters");
348 PMT2Graph->GetYaxis()->CenterTitle();
349 PMT2Graph->Draw("AP");
350 //----------
351 sst.str("");
352 sst << "Graph PMT Plane Counters (S31 AND S32) vs OBT based on " << base.Data();
353 TGraph *PMT3Graph = new TGraph(nevents, time, pmt3);
354 PMTCanvas->cd(3);
355 sst.str("");
356 sst << "PMT Plane Counters (S31 AND S32)";
357 PMT3Graph->SetTitle(sst.str().c_str());
358 PMT3Graph->SetFillColor(2);
359 PMT3Graph->GetXaxis()->SetTitle("OnBoardTime");
360 PMT3Graph->GetXaxis()->CenterTitle();
361 PMT3Graph->GetYaxis()->SetTitle("PMT Plane Rate Counters");
362 PMT3Graph->GetYaxis()->CenterTitle();
363 PMT3Graph->Draw("AP");
364 //
365 //----------
366
367 /*
368 * Trigger Rate Counters draw
369 */
370
371 TCanvas *TrigRate1Canvas = new TCanvas("TrigRate1Canvas","TrigRate1Canvas", 1280, 1024);
372 TrigRate1Canvas->Divide(1,3);
373 //----------
374 sst.str("");
375 sst << "Graph of Trigger Rate Counters (S11 OR S12) AND (S21 OR S22) AND (S31 OR S32) vs OBT based on " << base.Data();
376
377 TGraph *TrigRate0Graph = new TGraph(nevents, time, trigrate0);
378 TrigRate1Canvas->cd(1);
379 sst.str("");
380 sst << "Trigger Rate Counters (S11 OR S12) AND (S21 OR S22) AND (S31 OR S32)";
381 TrigRate0Graph->SetTitle(sst.str().c_str());
382 TrigRate0Graph->SetFillColor(2);
383 TrigRate0Graph->GetXaxis()->SetTitle("OnBoardTime");
384 TrigRate0Graph->GetXaxis()->CenterTitle();
385 TrigRate0Graph->GetYaxis()->SetTitle("Trigger Rate Counters (Hz)");
386 TrigRate0Graph->GetYaxis()->CenterTitle();
387 TrigRate0Graph->Draw("AP");
388 //----------
389 sst.str("");
390 sst << "Graph Trigger Rate Counters (S11 AND S12) AND (S21 AND S22) AND (S31 AND S32) vs OBT based on " << base.Data();
391 TGraph *TrigRate1Graph = new TGraph(nevents, time, trigrate1);
392 TrigRate1Canvas->cd(2);
393 sst.str("");
394 sst << "Trigger Rate Counters (S11 AND S12) AND (S21 AND S22) AND (S31 AND S32)";
395 TrigRate1Graph->SetTitle(sst.str().c_str());
396 TrigRate1Graph->SetFillColor(2);
397 TrigRate1Graph->GetXaxis()->SetTitle("OnBoardTime");
398 TrigRate1Graph->GetXaxis()->CenterTitle();
399 TrigRate1Graph->GetYaxis()->SetTitle("Trigger Rate Counters (Hz)");
400 TrigRate1Graph->GetYaxis()->CenterTitle();
401 TrigRate1Graph->Draw("AP");
402 //----------
403 sst.str("");
404 sst << "Graph Trigger Rate Counters (S21 OR S22) AND (S31 OR S32) vs OBT based on " << base.Data();
405 TGraph *TrigRate2Graph = new TGraph(nevents, time, trigrate2);
406 TrigRate1Canvas->cd(3);
407 sst.str("");
408 sst << "Trigger Rate Counters (S21 OR S22) AND (S31 OR S32) ";
409 TrigRate2Graph->SetTitle(sst.str().c_str());
410 TrigRate2Graph->SetFillColor(2);
411 TrigRate2Graph->GetXaxis()->SetTitle("OnBoardTime");
412 TrigRate2Graph->GetXaxis()->CenterTitle();
413 TrigRate2Graph->GetYaxis()->SetTitle("Trigger Rate Counters (Hz)");
414 TrigRate2Graph->GetYaxis()->CenterTitle();
415 TrigRate2Graph->Draw("AP");
416 //
417 //----------
418 //
419 TCanvas *TrigRate2Canvas = new TCanvas("TrigRate2Canvas","TrigRate2Canvas", 1280, 1024);
420 TrigRate2Canvas->Divide(1,3);
421 //----------
422 sst.str("");
423 sst << "Graph of Trigger Rate Counters (S21 AND S22) AND (S31 AND S32) vs OBT based on " << base.Data();
424
425 TGraph *TrigRate3Graph = new TGraph(nevents, time, trigrate3);
426 TrigRate2Canvas->cd(1);
427 sst.str("");
428 sst << "Trigger Rate Counters (S21 AND S22) AND (S31 AND S32)";
429 TrigRate3Graph->SetTitle(sst.str().c_str());
430 TrigRate3Graph->SetFillColor(2);
431 TrigRate3Graph->GetXaxis()->SetTitle("OnBoardTime");
432 TrigRate3Graph->GetXaxis()->CenterTitle();
433 TrigRate3Graph->GetYaxis()->SetTitle("Trigger Rate Counters (Hz)");
434 TrigRate3Graph->GetYaxis()->CenterTitle();
435 TrigRate3Graph->Draw("AP");
436 //----------
437 sst.str("");
438 sst << "Graph Trigger Rate Counters S12 AND (S21 AND S22) vs OBT based on " << base.Data();
439 TGraph *TrigRate4Graph = new TGraph(nevents, time, trigrate4);
440 TrigRate2Canvas->cd(2);
441 sst.str("");
442 sst << "Trigger Rate Counters S12 AND (S21 AND S22)";
443 TrigRate4Graph->SetTitle(sst.str().c_str());
444 TrigRate4Graph->SetFillColor(2);
445 TrigRate4Graph->GetXaxis()->SetTitle("OnBoardTime");
446 TrigRate4Graph->GetXaxis()->CenterTitle();
447 TrigRate4Graph->GetYaxis()->SetTitle("Trigger Rate Counters (Hz)");
448 TrigRate4Graph->GetYaxis()->CenterTitle();
449 TrigRate4Graph->Draw("AP");
450 //----------
451 sst.str("");
452 sst << "Graph Trigger Rate Counters (S11 OR S12) AND (S31 OR S32) vs OBT based on " << base.Data();
453 TGraph *TrigRate5Graph = new TGraph(nevents, time, trigrate5);
454 TrigRate2Canvas->cd(3);
455 sst.str("");
456 sst << "Trigger Rate Counters (S11 OR S12) AND (S31 OR S32)";
457 TrigRate5Graph->SetTitle(sst.str().c_str());
458 TrigRate5Graph->SetFillColor(2);
459 TrigRate5Graph->GetXaxis()->SetTitle("OnBoardTime");
460 TrigRate5Graph->GetXaxis()->CenterTitle();
461 TrigRate5Graph->GetYaxis()->SetTitle("Trigger Rate Counters (Hz)");
462 TrigRate5Graph->GetYaxis()->CenterTitle();
463 TrigRate5Graph->Draw("AP");
464 //----------
465
466 gStyle->SetOptStat("mr");
467
468 /* S4 and Calorimeter Counters draw*/
469 TGraph *s4RateGraph = new TGraph(nevents, time, s4rate);
470 S4CalCanvas->cd(1);
471 sst.str("");
472 sst << "S4 Trigger Rate Counters";
473 s4RateGraph->SetTitle(sst.str().c_str());
474 s4RateGraph->SetFillColor(2);
475 s4RateGraph->GetXaxis()->SetTitle("OnBoardTime");
476 s4RateGraph->GetXaxis()->CenterTitle();
477 s4RateGraph->GetYaxis()->SetTitle("Trigger Rate Counters (Hz)");
478 s4RateGraph->GetYaxis()->CenterTitle();
479 s4RateGraph->Draw("AP");
480 //----------
481 S4CalCanvas->cd(2);
482 gPad->SetLogy(1);
483 S4Cal2Histo->GetXaxis()->SetTitle("Hz");
484 S4Cal2Histo->Draw();
485 //
486 //
487 //
488 gStyle->SetOptStat("mr");
489 gStyle->SetStatH(0.3);
490 gStyle->SetStatW(0.3);
491
492
493 //----------
494 TCanvas *RatePMT1 = new TCanvas("RatePMT1", "Rate PMT S11A", 1);
495 RatePMT1->Divide (3,3);
496 //----------
497 sst.str("");
498 sst << "pmtcount1[0] vs OBT based on " << base.Data();
499 TGraph *PMT1_0Graph = new TGraph(nevents, time, pmt1_0);
500 RatePMT1->cd(1);
501 sst.str("");
502 sst << "PMT S111A";
503 PMT1_0Graph->SetTitle(sst.str().c_str());
504 PMT1_0Graph->SetFillColor(2);
505 PMT1_0Graph->GetXaxis()->SetTitle("OnBoardTime");
506 PMT1_0Graph->GetXaxis()->CenterTitle();
507 PMT1_0Graph->GetYaxis()->SetTitle("PMT Counters");
508 PMT1_0Graph->GetYaxis()->CenterTitle();
509 PMT1_0Graph->Draw("AP");
510 //delete PMT1_0Graph;
511 //----------
512 sst.str("");
513 sst << "pmtcount1[0] vs OBT based on " << base.Data();
514 TGraph *PMT1_1Graph = new TGraph(nevents, time, pmt1_1);
515 RatePMT1->cd(2);
516 sst.str("");
517 sst << "PMT S112A";
518 PMT1_1Graph->SetTitle(sst.str().c_str());
519 PMT1_1Graph->SetFillColor(2);
520 PMT1_1Graph->GetXaxis()->SetTitle("OnBoardTime");
521 PMT1_1Graph->GetXaxis()->CenterTitle();
522 PMT1_1Graph->GetYaxis()->SetTitle("PMT Counters");
523 PMT1_1Graph->GetYaxis()->CenterTitle();
524 PMT1_1Graph->Draw("AP");
525 //----------
526 sst.str("");
527 sst << "pmtcount1[0] vs OBT based on " << base.Data();
528 TGraph *PMT1_2Graph = new TGraph(nevents, time, pmt1_2);
529 RatePMT1->cd(3);
530 sst.str("");
531 sst << "PMT S113A";
532 PMT1_2Graph->SetTitle(sst.str().c_str());
533 PMT1_2Graph->SetFillColor(2);
534 PMT1_2Graph->GetXaxis()->SetTitle("OnBoardTime");
535 PMT1_2Graph->GetXaxis()->CenterTitle();
536 PMT1_2Graph->GetYaxis()->SetTitle("PMT Counters");
537 PMT1_2Graph->GetYaxis()->CenterTitle();
538 PMT1_2Graph->Draw("AP");
539 //----------
540 sst.str("");
541 sst << "pmtcount1[0] vs OBT based on " << base.Data();
542 TGraph *PMT1_3Graph = new TGraph(nevents, time, pmt1_3);
543 RatePMT1->cd(4);
544 sst.str("");
545 sst << "PMT S114A";
546 PMT1_3Graph->SetTitle(sst.str().c_str());
547 PMT1_3Graph->SetFillColor(2);
548 PMT1_3Graph->GetXaxis()->SetTitle("OnBoardTime");
549 PMT1_3Graph->GetXaxis()->CenterTitle();
550 PMT1_3Graph->GetYaxis()->SetTitle("PMT Counters");
551 PMT1_3Graph->GetYaxis()->CenterTitle();
552 PMT1_3Graph->Draw("AP");
553 //----------
554 sst.str("");
555 sst << "pmtcount1[0] vs OBT based on " << base.Data();
556 TGraph *PMT1_4Graph = new TGraph(nevents, time, pmt1_4);
557 RatePMT1->cd(5);
558 sst.str("");
559 sst << "PMT S115A";
560 PMT1_4Graph->SetTitle(sst.str().c_str());
561 PMT1_4Graph->SetFillColor(2);
562 PMT1_4Graph->GetXaxis()->SetTitle("OnBoardTime");
563 PMT1_4Graph->GetXaxis()->CenterTitle();
564 PMT1_4Graph->GetYaxis()->SetTitle("PMT Counters");
565 PMT1_4Graph->GetYaxis()->CenterTitle();
566 PMT1_4Graph->Draw("AP");
567 //----------
568 sst.str("");
569 sst << "pmtcount1[0] vs OBT based on " << base.Data();
570 TGraph *PMT1_5Graph = new TGraph(nevents, time, pmt1_5);
571 RatePMT1->cd(6);
572 sst.str("");
573 sst << "PMT S116A";
574 PMT1_5Graph->SetTitle(sst.str().c_str());
575 PMT1_5Graph->SetFillColor(2);
576 PMT1_5Graph->GetXaxis()->SetTitle("OnBoardTime");
577 PMT1_5Graph->GetXaxis()->CenterTitle();
578 PMT1_5Graph->GetYaxis()->SetTitle("PMT Counters");
579 PMT1_5Graph->GetYaxis()->CenterTitle();
580 PMT1_5Graph->Draw("AP");
581 //----------
582 sst.str("");
583 sst << "pmtcount1[0] vs OBT based on " << base.Data();
584 TGraph *PMT1_6Graph = new TGraph(nevents, time, pmt1_6);
585 RatePMT1->cd(7);
586 sst.str("");
587 sst << "PMT S117A";
588 PMT1_6Graph->SetTitle(sst.str().c_str());
589 PMT1_6Graph->SetFillColor(2);
590 PMT1_6Graph->GetXaxis()->SetTitle("OnBoardTime");
591 PMT1_6Graph->GetXaxis()->CenterTitle();
592 PMT1_6Graph->GetYaxis()->SetTitle("PMT Counters");
593 PMT1_6Graph->GetYaxis()->CenterTitle();
594 PMT1_6Graph->Draw("AP");
595 //----------
596 sst.str("");
597 sst << "pmtcount1[0] vs OBT based on " << base.Data();
598 TGraph *PMT1_7Graph = new TGraph(nevents, time, pmt1_7);
599 RatePMT1->cd(8);
600 sst.str("");
601 sst << "PMT S118A";
602 PMT1_7Graph->SetTitle(sst.str().c_str());
603 PMT1_7Graph->SetFillColor(2);
604 PMT1_7Graph->GetXaxis()->SetTitle("OnBoardTime");
605 PMT1_7Graph->GetXaxis()->CenterTitle();
606 PMT1_7Graph->GetYaxis()->SetTitle("PMT Counters");
607 PMT1_7Graph->GetYaxis()->CenterTitle();
608 PMT1_7Graph->Draw("AP");
609
610 ////////////////
611
612 TCanvas *RatePMT2 = new TCanvas("RatePMT2", "Rate PMT S11B", 1);
613 RatePMT2->Divide (3,3);
614 //----------
615 sst.str("");
616 sst << "pmtcount1[0] vs OBT based on " << base.Data();
617 TGraph *PMT1_8Graph = new TGraph(nevents, time, pmt1_8);
618 RatePMT2->cd(1);
619 sst.str("");
620 sst << "PMT S111B";
621 PMT1_8Graph->SetTitle(sst.str().c_str());
622 PMT1_8Graph->SetFillColor(2);
623 PMT1_8Graph->GetXaxis()->SetTitle("OnBoardTime");
624 PMT1_8Graph->GetXaxis()->CenterTitle();
625 PMT1_8Graph->GetYaxis()->SetTitle("PMT Counters");
626 PMT1_8Graph->GetYaxis()->CenterTitle();
627 PMT1_8Graph->Draw("AP");
628 //----------
629 sst.str("");
630 sst << "pmtcount1[0] vs OBT based on " << base.Data();
631 TGraph *PMT1_9Graph = new TGraph(nevents, time, pmt1_9);
632 RatePMT2->cd(2);
633 sst.str("");
634 sst << "PMT S112B";
635 PMT1_9Graph->SetTitle(sst.str().c_str());
636 PMT1_9Graph->SetFillColor(2);
637 PMT1_9Graph->GetXaxis()->SetTitle("OnBoardTime");
638 PMT1_9Graph->GetXaxis()->CenterTitle();
639 PMT1_9Graph->GetYaxis()->SetTitle("PMT Counters");
640 PMT1_9Graph->GetYaxis()->CenterTitle();
641 PMT1_9Graph->Draw("AP");
642 //----------
643 sst.str("");
644 sst << "pmtcount1[0] vs OBT based on " << base.Data();
645 TGraph *PMT1_10Graph = new TGraph(nevents, time, pmt1_10);
646 RatePMT2->cd(3);
647 sst.str("");
648 sst << "PMT S113B";
649 PMT1_10Graph->SetTitle(sst.str().c_str());
650 PMT1_10Graph->SetFillColor(2);
651 PMT1_10Graph->GetXaxis()->SetTitle("OnBoardTime");
652 PMT1_10Graph->GetXaxis()->CenterTitle();
653 PMT1_10Graph->GetYaxis()->SetTitle("PMT Counters");
654 PMT1_10Graph->GetYaxis()->CenterTitle();
655 PMT1_10Graph->Draw("AP");
656 //----------
657 sst.str("");
658 sst << "pmtcount1[0] vs OBT based on " << base.Data();
659 TGraph *PMT1_11Graph = new TGraph(nevents, time, pmt1_11);
660 RatePMT2->cd(4);
661 sst.str("");
662 sst << "PMT S114B";
663 PMT1_11Graph->SetTitle(sst.str().c_str());
664 PMT1_11Graph->SetFillColor(2);
665 PMT1_11Graph->GetXaxis()->SetTitle("OnBoardTime");
666 PMT1_11Graph->GetXaxis()->CenterTitle();
667 PMT1_11Graph->GetYaxis()->SetTitle("PMT Counters");
668 PMT1_11Graph->GetYaxis()->CenterTitle();
669 PMT1_11Graph->Draw("AP");
670 //----------
671 sst.str("");
672 sst << "pmtcount1[0] vs OBT based on " << base.Data();
673 TGraph *PMT1_12Graph = new TGraph(nevents, time, pmt1_12);
674 RatePMT2->cd(5);
675 sst.str("");
676 sst << "PMT S115B";
677 PMT1_12Graph->SetTitle(sst.str().c_str());
678 PMT1_12Graph->SetFillColor(2);
679 PMT1_12Graph->GetXaxis()->SetTitle("OnBoardTime");
680 PMT1_12Graph->GetXaxis()->CenterTitle();
681 PMT1_12Graph->GetYaxis()->SetTitle("PMT Counters");
682 PMT1_12Graph->GetYaxis()->CenterTitle();
683 PMT1_12Graph->Draw("AP");
684 //----------
685 sst.str("");
686 sst << "pmtcount1[0] vs OBT based on " << base.Data();
687 TGraph *PMT1_13Graph = new TGraph(nevents, time, pmt1_13);
688 RatePMT2->cd(6);
689 sst.str("");
690 sst << "PMT S116B";
691 PMT1_13Graph->SetTitle(sst.str().c_str());
692 PMT1_13Graph->SetFillColor(2);
693 PMT1_13Graph->GetXaxis()->SetTitle("OnBoardTime");
694 PMT1_13Graph->GetXaxis()->CenterTitle();
695 PMT1_13Graph->GetYaxis()->SetTitle("PMT Counters");
696 PMT1_13Graph->GetYaxis()->CenterTitle();
697 PMT1_13Graph->Draw("AP");
698 //----------
699 sst.str("");
700 sst << "pmtcount1[0] vs OBT based on " << base.Data();
701 TGraph *PMT1_14Graph = new TGraph(nevents, time, pmt1_14);
702 RatePMT2->cd(7);
703 sst.str("");
704 sst << "PMT S117B";
705 PMT1_14Graph->SetTitle(sst.str().c_str());
706 PMT1_14Graph->SetFillColor(2);
707 PMT1_14Graph->GetXaxis()->SetTitle("OnBoardTime");
708 PMT1_14Graph->GetXaxis()->CenterTitle();
709 PMT1_14Graph->GetYaxis()->SetTitle("PMT Counters");
710 PMT1_14Graph->GetYaxis()->CenterTitle();
711 PMT1_14Graph->Draw("AP");
712 //----------
713 sst.str("");
714 sst << "pmtcount1[0] vs OBT based on " << base.Data();
715 TGraph *PMT1_15Graph = new TGraph(nevents, time, pmt1_15);
716 RatePMT2->cd(8);
717 sst.str("");
718 sst << "PMT S118B";
719 PMT1_15Graph->SetTitle(sst.str().c_str());
720 PMT1_15Graph->SetFillColor(2);
721 PMT1_15Graph->GetXaxis()->SetTitle("OnBoardTime");
722 PMT1_15Graph->GetXaxis()->CenterTitle();
723 PMT1_15Graph->GetYaxis()->SetTitle("PMT Counters");
724 PMT1_15Graph->GetYaxis()->CenterTitle();
725 PMT1_15Graph->Draw("AP");
726
727 ///////////////
728
729
730 TCanvas *RatePMT3 = new TCanvas("RatePMT3", "Rate PMT S11B", 1);
731 RatePMT3->Divide (3,4);
732 //----------
733 sst.str("");
734 sst << "pmtcount1[0] vs OBT based on " << base.Data();
735 TGraph *PMT1_16Graph = new TGraph(nevents, time, pmt1_16);
736 RatePMT3->cd(1);
737 sst.str("");
738 sst << "PMT S121A";
739 PMT1_16Graph->SetTitle(sst.str().c_str());
740 PMT1_16Graph->SetFillColor(2);
741 PMT1_16Graph->GetXaxis()->SetTitle("OnBoardTime");
742 PMT1_16Graph->GetXaxis()->CenterTitle();
743 PMT1_16Graph->GetYaxis()->SetTitle("PMT Counters");
744 PMT1_16Graph->GetYaxis()->CenterTitle();
745 PMT1_16Graph->Draw("AP");
746 //----------
747 sst.str("");
748 sst << "pmtcount1[0] vs OBT based on " << base.Data();
749 TGraph *PMT1_17Graph = new TGraph(nevents, time, pmt1_17);
750 RatePMT3->cd(2);
751 sst.str("");
752 sst << "PMT S122A";
753 PMT1_17Graph->SetTitle(sst.str().c_str());
754 PMT1_17Graph->SetFillColor(2);
755 PMT1_17Graph->GetXaxis()->SetTitle("OnBoardTime");
756 PMT1_17Graph->GetXaxis()->CenterTitle();
757 PMT1_17Graph->GetYaxis()->SetTitle("PMT Counters");
758 PMT1_17Graph->GetYaxis()->CenterTitle();
759 PMT1_17Graph->Draw("AP");
760 //----------
761 sst.str("");
762 sst << "pmtcount1[0] vs OBT based on " << base.Data();
763 TGraph *PMT1_18Graph = new TGraph(nevents, time, pmt1_18);
764 RatePMT3->cd(3);
765 sst.str("");
766 sst << "PMT S123A";
767 PMT1_18Graph->SetTitle(sst.str().c_str());
768 PMT1_18Graph->SetFillColor(2);
769 PMT1_18Graph->GetXaxis()->SetTitle("OnBoardTime");
770 PMT1_18Graph->GetXaxis()->CenterTitle();
771 PMT1_18Graph->GetYaxis()->SetTitle("PMT Counters");
772 PMT1_18Graph->GetYaxis()->CenterTitle();
773 PMT1_18Graph->Draw("AP");
774 //----------
775 sst.str("");
776 sst << "pmtcount1[0] vs OBT based on " << base.Data();
777 TGraph *PMT1_19Graph = new TGraph(nevents, time, pmt1_19);
778 RatePMT3->cd(4);
779 sst.str("");
780 sst << "PMT S124A";
781 PMT1_19Graph->SetTitle(sst.str().c_str());
782 PMT1_19Graph->SetFillColor(2);
783 PMT1_19Graph->GetXaxis()->SetTitle("OnBoardTime");
784 PMT1_19Graph->GetXaxis()->CenterTitle();
785 PMT1_19Graph->GetYaxis()->SetTitle("PMT Counters");
786 PMT1_19Graph->GetYaxis()->CenterTitle();
787 PMT1_19Graph->Draw("AP");
788 //----------
789 sst.str("");
790 sst << "pmtcount1[0] vs OBT based on " << base.Data();
791 TGraph *PMT1_20Graph = new TGraph(nevents, time, pmt1_20);
792 RatePMT3->cd(5);
793 sst.str("");
794 sst << "PMT S125A";
795 PMT1_20Graph->SetTitle(sst.str().c_str());
796 PMT1_20Graph->SetFillColor(2);
797 PMT1_20Graph->GetXaxis()->SetTitle("OnBoardTime");
798 PMT1_20Graph->GetXaxis()->CenterTitle();
799 PMT1_20Graph->GetYaxis()->SetTitle("PMT Counters");
800 PMT1_20Graph->GetYaxis()->CenterTitle();
801 PMT1_20Graph->Draw("AP");
802 //----------
803 sst.str("");
804 sst << "pmtcount1[0] vs OBT based on " << base.Data();
805 TGraph *PMT1_21Graph = new TGraph(nevents, time, pmt1_21);
806 RatePMT3->cd(6);
807 sst.str("");
808 sst << "PMT S126A";
809 PMT1_21Graph->SetTitle(sst.str().c_str());
810 PMT1_21Graph->SetFillColor(2);
811 PMT1_21Graph->GetXaxis()->SetTitle("OnBoardTime");
812 PMT1_21Graph->GetXaxis()->CenterTitle();
813 PMT1_21Graph->GetYaxis()->SetTitle("PMT Counters");
814 PMT1_21Graph->GetYaxis()->CenterTitle();
815 PMT1_21Graph->Draw("AP");
816 //----------
817 sst.str("");
818 sst << "pmtcount1[0] vs OBT based on " << base.Data();
819 TGraph *PMT1_22Graph = new TGraph(nevents, time, pmt1_22);
820 RatePMT3->cd(7);
821 sst.str("");
822 sst << "PMT S121B";
823 PMT1_22Graph->SetTitle(sst.str().c_str());
824 PMT1_22Graph->SetFillColor(2);
825 PMT1_22Graph->GetXaxis()->SetTitle("OnBoardTime");
826 PMT1_22Graph->GetXaxis()->CenterTitle();
827 PMT1_22Graph->GetYaxis()->SetTitle("PMT Counters");
828 PMT1_22Graph->GetYaxis()->CenterTitle();
829 PMT1_22Graph->Draw("AP");
830 //----------
831 sst.str("");
832 sst << "pmtcount1[0] vs OBT based on " << base.Data();
833 TGraph *PMT1_23Graph = new TGraph(nevents, time, pmt1_23);
834 RatePMT3->cd(8);
835 sst.str("");
836 sst << "PMT S122B";
837 PMT1_23Graph->SetTitle(sst.str().c_str());
838 PMT1_23Graph->SetFillColor(2);
839 PMT1_23Graph->GetXaxis()->SetTitle("OnBoardTime");
840 PMT1_23Graph->GetXaxis()->CenterTitle();
841 PMT1_23Graph->GetYaxis()->SetTitle("PMT Counters");
842 PMT1_23Graph->GetYaxis()->CenterTitle();
843 PMT1_23Graph->Draw("AP");
844
845 /////////////////////////
846
847 //----------
848 sst.str("");
849 sst << "pmtcount1[0] vs OBT based on " << base.Data();
850 TGraph *PMT2_0Graph = new TGraph(nevents, time, pmt2_0);
851 RatePMT3->cd(9);
852 sst.str("");
853 sst << "PMT S123B";
854 PMT2_0Graph->SetTitle(sst.str().c_str());
855 PMT2_0Graph->SetFillColor(2);
856 PMT2_0Graph->GetXaxis()->SetTitle("OnBoardTime");
857 PMT2_0Graph->GetXaxis()->CenterTitle();
858 PMT2_0Graph->GetYaxis()->SetTitle("PMT Counters");
859 PMT2_0Graph->GetYaxis()->CenterTitle();
860 PMT2_0Graph->Draw("AP");
861
862 //----------
863 sst.str("");
864 sst << "pmtcount1[0] vs OBT based on " << base.Data();
865 TGraph *PMT2_1Graph = new TGraph(nevents, time, pmt2_1);
866 RatePMT3->cd(10);
867 sst.str("");
868 sst << "PMT S124B";
869 PMT2_1Graph->SetTitle(sst.str().c_str());
870 PMT2_1Graph->SetFillColor(2);
871 PMT2_1Graph->GetXaxis()->SetTitle("OnBoardTime");
872 PMT2_1Graph->GetXaxis()->CenterTitle();
873 PMT2_1Graph->GetYaxis()->SetTitle("PMT Counters");
874 PMT2_1Graph->GetYaxis()->CenterTitle();
875 PMT2_1Graph->Draw("AP");
876
877 //----------
878 sst.str("");
879 sst << "pmtcount1[0] vs OBT based on " << base.Data();
880 TGraph *PMT2_2Graph = new TGraph(nevents, time, pmt2_2);
881 RatePMT3->cd(11);
882 sst.str("");
883 sst << "PMT S125B";
884 PMT2_2Graph->SetTitle(sst.str().c_str());
885 PMT2_2Graph->SetFillColor(2);
886 PMT2_2Graph->GetXaxis()->SetTitle("OnBoardTime");
887 PMT2_2Graph->GetXaxis()->CenterTitle();
888 PMT2_2Graph->GetYaxis()->SetTitle("PMT Counters");
889 PMT2_2Graph->GetYaxis()->CenterTitle();
890 PMT2_2Graph->Draw("AP");
891
892 //----------
893 sst.str("");
894 sst << "pmtcount1[0] vs OBT based on " << base.Data();
895 TGraph *PMT2_3Graph = new TGraph(nevents, time, pmt2_3);
896 RatePMT3->cd(12);
897 sst.str("");
898 sst << "PMT S126B";
899 PMT2_3Graph->SetTitle(sst.str().c_str());
900 PMT2_3Graph->SetFillColor(2);
901 PMT2_3Graph->GetXaxis()->SetTitle("OnBoardTime");
902 PMT2_3Graph->GetXaxis()->CenterTitle();
903 PMT2_3Graph->GetYaxis()->SetTitle("PMT Counters");
904 PMT2_3Graph->GetYaxis()->CenterTitle();
905 PMT2_3Graph->Draw("AP");
906
907 ////////////////////
908
909
910 TCanvas *RatePMT4 = new TCanvas("RatePMT4", "Rate PMT S11B", 1);
911 RatePMT4->Divide (3,3);
912 //----------
913 sst.str("");
914 sst << "pmtcount1[0] vs OBT based on " << base.Data();
915 TGraph *PMT2_4Graph = new TGraph(nevents, time, pmt2_4);
916 RatePMT4->cd(1);
917 sst.str("");
918 sst << "PMT S211A";
919 PMT2_4Graph->SetTitle(sst.str().c_str());
920 PMT2_4Graph->SetFillColor(2);
921 PMT2_4Graph->GetXaxis()->SetTitle("OnBoardTime");
922 PMT2_4Graph->GetXaxis()->CenterTitle();
923 PMT2_4Graph->GetYaxis()->SetTitle("PMT Counters");
924 PMT2_4Graph->GetYaxis()->CenterTitle();
925 PMT2_4Graph->Draw("AP");
926 //----------
927 sst.str("");
928 sst << "pmtcount1[0] vs OBT based on " << base.Data();
929 TGraph *PMT2_5Graph = new TGraph(nevents, time, pmt2_5);
930 RatePMT4->cd(2);
931 sst.str("");
932 sst << "PMT S212A";
933 PMT2_5Graph->SetTitle(sst.str().c_str());
934 PMT2_5Graph->SetFillColor(2);
935 PMT2_5Graph->GetXaxis()->SetTitle("OnBoardTime");
936 PMT2_5Graph->GetXaxis()->CenterTitle();
937 PMT2_5Graph->GetYaxis()->SetTitle("PMT Counters");
938 PMT2_5Graph->GetYaxis()->CenterTitle();
939 PMT2_5Graph->Draw("AP");
940 //----------
941 sst.str("");
942 sst << "pmtcount1[0] vs OBT based on " << base.Data();
943 TGraph *PMT2_6Graph = new TGraph(nevents, time, pmt2_6);
944 RatePMT4->cd(3);
945 sst.str("");
946 sst << "PMT S211B";
947 PMT2_6Graph->SetTitle(sst.str().c_str());
948 PMT2_6Graph->SetFillColor(2);
949 PMT2_6Graph->GetXaxis()->SetTitle("OnBoardTime");
950 PMT2_6Graph->GetXaxis()->CenterTitle();
951 PMT2_6Graph->GetYaxis()->SetTitle("PMT Counters");
952 PMT2_6Graph->GetYaxis()->CenterTitle();
953 PMT2_6Graph->Draw("AP");
954 //----------
955 sst.str("");
956 sst << "pmtcount1[0] vs OBT based on " << base.Data();
957 TGraph *PMT2_7Graph = new TGraph(nevents, time, pmt2_7);
958 RatePMT4->cd(4);
959 sst.str("");
960 sst << "PMT S212B";
961 PMT2_7Graph->SetTitle(sst.str().c_str());
962 PMT2_7Graph->SetFillColor(2);
963 PMT2_7Graph->GetXaxis()->SetTitle("OnBoardTime");
964 PMT2_7Graph->GetXaxis()->CenterTitle();
965 PMT2_7Graph->GetYaxis()->SetTitle("PMT Counters");
966 PMT2_7Graph->GetYaxis()->CenterTitle();
967 PMT2_7Graph->Draw("AP");
968 //----------
969 sst.str("");
970 sst << "pmtcount1[0] vs OBT based on " << base.Data();
971 TGraph *PMT2_8Graph = new TGraph(nevents, time, pmt2_8);
972 RatePMT4->cd(5);
973 sst.str("");
974 sst << "PMT S221A";
975 PMT2_8Graph->SetTitle(sst.str().c_str());
976 PMT2_8Graph->SetFillColor(2);
977 PMT2_8Graph->GetXaxis()->SetTitle("OnBoardTime");
978 PMT2_8Graph->GetXaxis()->CenterTitle();
979 PMT2_8Graph->GetYaxis()->SetTitle("PMT Counters");
980 PMT2_8Graph->GetYaxis()->CenterTitle();
981 PMT2_8Graph->Draw("AP");
982 //----------
983 sst.str("");
984 sst << "pmtcount1[0] vs OBT based on " << base.Data();
985 TGraph *PMT2_9Graph = new TGraph(nevents, time, pmt2_9);
986 RatePMT4->cd(6);
987 sst.str("");
988 sst << "PMT S222A";
989 PMT2_9Graph->SetTitle(sst.str().c_str());
990 PMT2_9Graph->SetFillColor(2);
991 PMT2_9Graph->GetXaxis()->SetTitle("OnBoardTime");
992 PMT2_9Graph->GetXaxis()->CenterTitle();
993 PMT2_9Graph->GetYaxis()->SetTitle("PMT Counters");
994 PMT2_9Graph->GetYaxis()->CenterTitle();
995 PMT2_9Graph->Draw("AP");
996 //----------
997 sst.str("");
998 sst << "pmtcount1[0] vs OBT based on " << base.Data();
999 TGraph *PMT2_10Graph = new TGraph(nevents, time, pmt2_10);
1000 RatePMT4->cd(7);
1001 sst.str("");
1002 sst << "PMT S221B";
1003 PMT2_10Graph->SetTitle(sst.str().c_str());
1004 PMT2_10Graph->SetFillColor(2);
1005 PMT2_10Graph->GetXaxis()->SetTitle("OnBoardTime");
1006 PMT2_10Graph->GetXaxis()->CenterTitle();
1007 PMT2_10Graph->GetYaxis()->SetTitle("PMT Counters");
1008 PMT2_10Graph->GetYaxis()->CenterTitle();
1009 PMT2_10Graph->Draw("AP");
1010 //----------
1011 sst.str("");
1012 sst << "pmtcount1[0] vs OBT based on " << base.Data();
1013 TGraph *PMT2_11Graph = new TGraph(nevents, time, pmt2_11);
1014 RatePMT4->cd(8);
1015 sst.str("");
1016 sst << "PMT S222B ";
1017 PMT2_11Graph->SetTitle(sst.str().c_str());
1018 PMT2_11Graph->SetFillColor(2);
1019 PMT2_11Graph->GetXaxis()->SetTitle("OnBoardTime");
1020 PMT2_11Graph->GetXaxis()->CenterTitle();
1021 PMT2_11Graph->GetYaxis()->SetTitle("PMT Counters");
1022 PMT2_11Graph->GetYaxis()->CenterTitle();
1023 PMT2_11Graph->Draw("AP");
1024
1025 /////////////////////////
1026
1027
1028 TCanvas *RatePMT5 = new TCanvas("RatePMT5", "Rate PMT S311A", 1);
1029 RatePMT5->Divide (3,4);
1030 //----------
1031 sst.str("");
1032 sst << "pmtcount1[0] vs OBT based on " << base.Data();
1033 TGraph *PMT2_12Graph = new TGraph(nevents, time, pmt2_12);
1034 RatePMT5->cd(1);
1035 sst.str("");
1036 sst << "PMT S311A ";
1037 PMT2_12Graph->SetTitle(sst.str().c_str());
1038 PMT2_12Graph->SetFillColor(2);
1039 PMT2_12Graph->GetXaxis()->SetTitle("OnBoardTime");
1040 PMT2_12Graph->GetXaxis()->CenterTitle();
1041 PMT2_12Graph->GetYaxis()->SetTitle("PMT Counters");
1042 PMT2_12Graph->GetYaxis()->CenterTitle();
1043 PMT2_12Graph->Draw("AP");
1044 //----------
1045 sst.str("");
1046 sst << "pmtcount1[0] vs OBT based on " << base.Data();
1047 TGraph *PMT2_13Graph = new TGraph(nevents, time, pmt2_13);
1048 RatePMT5->cd(2);
1049 sst.str("");
1050 sst << "PMT S312A";
1051 PMT2_13Graph->SetTitle(sst.str().c_str());
1052 PMT2_13Graph->SetFillColor(2);
1053 PMT2_13Graph->GetXaxis()->SetTitle("OnBoardTime");
1054 PMT2_13Graph->GetXaxis()->CenterTitle();
1055 PMT2_13Graph->GetYaxis()->SetTitle("PMT Counters");
1056 PMT2_13Graph->GetYaxis()->CenterTitle();
1057 PMT2_13Graph->Draw("AP");
1058 //----------
1059 sst.str("");
1060 sst << "pmtcount1[0] vs OBT based on " << base.Data();
1061 TGraph *PMT2_14Graph = new TGraph(nevents, time, pmt2_14);
1062 RatePMT5->cd(3);
1063 sst.str("");
1064 sst << "PMT S313A";
1065 PMT2_14Graph->SetTitle(sst.str().c_str());
1066 PMT2_14Graph->SetFillColor(2);
1067 PMT2_14Graph->GetXaxis()->SetTitle("OnBoardTime");
1068 PMT2_14Graph->GetXaxis()->CenterTitle();
1069 PMT2_14Graph->GetYaxis()->SetTitle("PMT Counters");
1070 PMT2_14Graph->GetYaxis()->CenterTitle();
1071 PMT2_14Graph->Draw("AP");
1072 //----------
1073 sst.str("");
1074 sst << "pmtcount1[0] vs OBT based on " << base.Data();
1075 TGraph *PMT2_15Graph = new TGraph(nevents, time, pmt2_15);
1076 RatePMT5->cd(4);
1077 sst.str("");
1078 sst << "PMT S311B";
1079 PMT2_15Graph->SetTitle(sst.str().c_str());
1080 PMT2_15Graph->SetFillColor(2);
1081 PMT2_15Graph->GetXaxis()->SetTitle("OnBoardTime");
1082 PMT2_15Graph->GetXaxis()->CenterTitle();
1083 PMT2_15Graph->GetYaxis()->SetTitle("PMT Counters");
1084 PMT2_15Graph->GetYaxis()->CenterTitle();
1085 PMT2_15Graph->Draw("AP");
1086 //----------
1087 sst.str("");
1088 sst << "pmtcount1[0] vs OBT based on " << base.Data();
1089 TGraph *PMT2_16Graph = new TGraph(nevents, time, pmt2_16);
1090 RatePMT5->cd(5);
1091 sst.str("");
1092 sst << "PMT S312B";
1093 PMT2_16Graph->SetTitle(sst.str().c_str());
1094 PMT2_16Graph->SetFillColor(2);
1095 PMT2_16Graph->GetXaxis()->SetTitle("OnBoardTime");
1096 PMT2_16Graph->GetXaxis()->CenterTitle();
1097 PMT2_16Graph->GetYaxis()->SetTitle("PMT Counters");
1098 PMT2_16Graph->GetYaxis()->CenterTitle();
1099 PMT2_16Graph->Draw("AP");
1100 //----------
1101 sst.str("");
1102 sst << "pmtcount1[0] vs OBT based on " << base.Data();
1103 TGraph *PMT2_17Graph = new TGraph(nevents, time, pmt2_17);
1104 RatePMT5->cd(6);
1105 sst.str("");
1106 sst << "PMT S313B";
1107 PMT2_17Graph->SetTitle(sst.str().c_str());
1108 PMT2_17Graph->SetFillColor(2);
1109 PMT2_17Graph->GetXaxis()->SetTitle("OnBoardTime");
1110 PMT2_17Graph->GetXaxis()->CenterTitle();
1111 PMT2_17Graph->GetYaxis()->SetTitle("PMT Counters");
1112 PMT2_17Graph->GetYaxis()->CenterTitle();
1113 PMT2_17Graph->Draw("AP");
1114 //----------
1115 sst.str("");
1116 sst << "pmtcount1[0] vs OBT based on " << base.Data();
1117 TGraph *PMT2_18Graph = new TGraph(nevents, time, pmt2_18);
1118 RatePMT5->cd(7);
1119 sst.str("");
1120 sst << "PMT S321A";
1121 PMT2_18Graph->SetTitle(sst.str().c_str());
1122 PMT2_18Graph->SetFillColor(2);
1123 PMT2_18Graph->GetXaxis()->SetTitle("OnBoardTime");
1124 PMT2_18Graph->GetXaxis()->CenterTitle();
1125 PMT2_18Graph->GetYaxis()->SetTitle("PMT Counters");
1126 PMT2_18Graph->GetYaxis()->CenterTitle();
1127 PMT2_18Graph->Draw("AP");
1128 //----------
1129 sst.str("");
1130 sst << "pmtcount1[0] vs OBT based on " << base.Data();
1131 TGraph *PMT2_19Graph = new TGraph(nevents, time, pmt2_19);
1132 RatePMT5->cd(8);
1133 sst.str("");
1134 sst << "PMT S322A";
1135 PMT2_19Graph->SetTitle(sst.str().c_str());
1136 PMT2_19Graph->SetFillColor(2);
1137 PMT2_19Graph->GetXaxis()->SetTitle("OnBoardTime");
1138 PMT2_19Graph->GetXaxis()->CenterTitle();
1139 PMT2_19Graph->GetYaxis()->SetTitle("PMT Counters");
1140 PMT2_19Graph->GetYaxis()->CenterTitle();
1141 PMT2_19Graph->Draw("AP");
1142
1143 /////////////////////////
1144
1145 //----------
1146 sst.str("");
1147 sst << "pmtcount1[0] vs OBT based on " << base.Data();
1148 TGraph *PMT2_20Graph = new TGraph(nevents, time, pmt2_20);
1149 RatePMT5->cd(9);
1150 sst.str("");
1151 sst << "PMT S323A";
1152 PMT2_20Graph->SetTitle(sst.str().c_str());
1153 PMT2_20Graph->SetFillColor(2);
1154 PMT2_20Graph->GetXaxis()->SetTitle("OnBoardTime");
1155 PMT2_20Graph->GetXaxis()->CenterTitle();
1156 PMT2_20Graph->GetYaxis()->SetTitle("PMT Counters");
1157 PMT2_20Graph->GetYaxis()->CenterTitle();
1158 PMT2_20Graph->Draw("AP");
1159
1160 //----------
1161 sst.str("");
1162 sst << "pmtcount1[0] vs OBT based on " << base.Data();
1163 TGraph *PMT2_21Graph = new TGraph(nevents, time, pmt2_21);
1164 RatePMT5->cd(10);
1165 sst.str("");
1166 sst << "PMT S321B";
1167 PMT2_21Graph->SetTitle(sst.str().c_str());
1168 PMT2_21Graph->SetFillColor(2);
1169 PMT2_21Graph->GetXaxis()->SetTitle("OnBoardTime");
1170 PMT2_21Graph->GetXaxis()->CenterTitle();
1171 PMT2_21Graph->GetYaxis()->SetTitle("PMT Counters");
1172 PMT2_21Graph->GetYaxis()->CenterTitle();
1173 PMT2_21Graph->Draw("AP");
1174
1175 //----------
1176 sst.str("");
1177 sst << "pmtcount1[0] vs OBT based on " << base.Data();
1178 TGraph *PMT2_22Graph = new TGraph(nevents, time, pmt2_22);
1179 RatePMT5->cd(11);
1180 sst.str("");
1181 sst << "PMT S322B";
1182 PMT2_22Graph->SetTitle(sst.str().c_str());
1183 PMT2_22Graph->SetFillColor(2);
1184 PMT2_22Graph->GetXaxis()->SetTitle("OnBoardTime");
1185 PMT2_22Graph->GetXaxis()->CenterTitle();
1186 PMT2_22Graph->GetYaxis()->SetTitle("PMT Counters");
1187 PMT2_22Graph->GetYaxis()->CenterTitle();
1188 PMT2_22Graph->Draw("AP");
1189
1190 //----------
1191 sst.str("");
1192 sst << "pmtcount1[0] vs OBT based on " << base.Data();
1193 TGraph *PMT2_23Graph = new TGraph(nevents, time, pmt2_23);
1194 RatePMT5->cd(12);
1195 sst.str("");
1196 sst << "PMT S323B";
1197 PMT2_23Graph->SetTitle(sst.str().c_str());
1198 PMT2_23Graph->SetFillColor(2);
1199 PMT2_23Graph->GetXaxis()->SetTitle("OnBoardTime");
1200 PMT2_23Graph->GetXaxis()->CenterTitle();
1201 PMT2_23Graph->GetYaxis()->SetTitle("PMT Counters");
1202 PMT2_23Graph->GetYaxis()->CenterTitle();
1203 PMT2_23Graph->Draw("AP");
1204
1205
1206 // print the output
1207 const char *saveas = format;
1208 if ( !strcmp(saveas,"ps") ) {
1209 // ------print the ps
1210
1211 gStyle->SetOptStat(111111);
1212
1213 sst.str("");
1214 sst << outDirectory.Data() << filename.Data() << "TriggerScanBasic." << saveas << "(";
1215 EvCounterCanvas->Print(sst.str().c_str());
1216 DeadLiveCanvas->Print(sst.str().c_str());
1217 PMTCanvas->Print(sst.str().c_str());
1218 TrigRate1Canvas->Print(sst.str().c_str());
1219 TrigRate2Canvas->Print(sst.str().c_str());
1220
1221 gStyle->SetOptStat("mr");
1222 S4CalCanvas->Print(sst.str().c_str());
1223
1224 gStyle->SetOptStat("mr");
1225 RatePMT1->Print(sst.str().c_str());
1226 RatePMT2->Print(sst.str().c_str());
1227 RatePMT3->Print(sst.str().c_str());
1228 RatePMT4->Print(sst.str().c_str());
1229 //
1230 sst.str("");
1231 sst << outDirectory.Data() << filename.Data() << "TriggerScanBasic." << saveas << ")";
1232 RatePMT5->Print(sst.str().c_str());
1233
1234 } else {
1235
1236 gStyle->SetOptStat(111111);
1237
1238 sst.str("");
1239 sst << outDirectory.Data() << filename.Data() << "TriggerScanBasic1." << saveas;
1240 EvCounterCanvas->SaveAs(sst.str().c_str());
1241
1242 sst.str("");
1243 sst << outDirectory.Data() << filename.Data() << "TriggerScanBasic2." << saveas;
1244 DeadLiveCanvas->SaveAs(sst.str().c_str());
1245
1246 sst.str("");
1247 sst << outDirectory.Data() << filename.Data() << "TriggerScanBasic3." << saveas;
1248 PMTCanvas->SaveAs(sst.str().c_str());
1249
1250 sst.str("");
1251 sst << outDirectory.Data() << filename.Data() << "TriggerScanBasic4." << saveas;
1252 TrigRate1Canvas->SaveAs(sst.str().c_str());
1253
1254 sst.str("");
1255 sst << outDirectory.Data() << filename.Data() << "TriggerScanBasic5." << saveas;
1256 TrigRate2Canvas->SaveAs(sst.str().c_str());
1257
1258 sst.str("");
1259 sst << outDirectory.Data() << filename.Data() << "TriggerScanBasic6." << saveas;
1260 S4CalCanvas->SaveAs(sst.str().c_str());
1261
1262 gStyle->SetOptStat("mr");
1263
1264 sst.str("");
1265 sst << outDirectory.Data() << filename.Data() << "TriggerScanBasic7." << saveas;
1266 RatePMT1->SaveAs(sst.str().c_str());
1267
1268 sst.str("");
1269 sst << outDirectory.Data() << filename.Data() << "TriggerScanBasic8." << saveas;
1270 RatePMT2->SaveAs(sst.str().c_str());
1271
1272 sst.str("");
1273 sst << outDirectory.Data() << filename.Data() << "TriggerScanBasic9." << saveas;
1274 RatePMT3->SaveAs(sst.str().c_str());
1275
1276 sst.str("");
1277 sst << outDirectory.Data() << filename.Data() << "TriggerScanBasic10." << saveas;
1278 RatePMT4->SaveAs(sst.str().c_str());
1279
1280 gStyle->SetOptStat("mr");
1281
1282 sst.str("");
1283 sst << outDirectory.Data() << filename.Data() << "TriggerScanBasic11." << saveas;
1284 RatePMT5->SaveAs(sst.str().c_str());
1285
1286 }
1287
1288 }
1289
1290
1291 int main(int argc, char* argv[]){
1292 TString path;
1293 TString outDir ="./";
1294 TString format ="ps";
1295
1296 if (argc < 2){
1297 printf("You have to insert at least the file to analyze \n");
1298 printf("Try '--help' for more information. \n");
1299 exit(1);
1300 }
1301
1302 if (!strcmp(argv[1], "--help")){
1303 printf( "Usage: TriggerScanBasic FILE [OPTION] \n");
1304 printf( "\t --help Print this help and exit \n");
1305 printf( "\t -outDir[path] Path where to put the output [default ./] \n");
1306 printf( "\t -format[ps] Format for output files [default 'ps'] \n");
1307 exit(1);
1308 }
1309
1310
1311 path=argv[1];
1312
1313 for (int i = 2; i < argc; i++){
1314
1315 if (!strcmp(argv[i], "-outDir")){
1316 if (++i >= argc){
1317 printf( "-outDir needs arguments. \n");
1318 printf( "Try '--help' for more information. \n");
1319 exit(1);
1320 }
1321 else{
1322 outDir = argv[i];
1323 continue;
1324 }
1325 }
1326
1327
1328
1329 if (!strcmp(argv[i], "-format")){
1330 if (++i >= argc){
1331 printf( "-format needs arguments. \n");
1332 printf( "Try '--help' for more information. \n");
1333 exit(1);
1334 }
1335 else{
1336 format = argv[i];
1337 continue;
1338 }
1339 }
1340 }
1341
1342 TriggerScanBasic(argv[1], outDir, format);
1343
1344 }

  ViewVC Help
Powered by ViewVC 1.1.23