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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Wed Jul 5 16:18:17 2006 UTC (18 years, 4 months ago) by campana
Branch: MAIN
CVS Tags: v1r06
Changes since 1.1: +14 -11 lines
New release Trigger Qlook Basic script

1 campana 1.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 OrbitalTime 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 campana 1.2 #include <TROOT.h>
20     #include <TFile.h>
21 campana 1.1 #include <TString.h>
22     #include <TObjString.h>
23     #include <TTree.h>
24     #include <TBranch.h>
25     #include <TGraph.h>
26     #include <TStyle.h>
27 campana 1.2 #include <TH1.h>
28 campana 1.1 #include <TPaveText.h>
29     #include <TCanvas.h>
30     #include <TLatex.h>
31     #include <TGraph.h>
32     #include <physics/trigger/TriggerEvent.h>
33     #include <EventHeader.h>
34     #include <PscuHeader.h>
35     #include <iostream>
36    
37     using namespace std;
38    
39     char bit(int decimal, char pos)
40     {
41     return( (decimal>>pos)%2 );
42     }
43    
44     void TriggerScanBasic(TString base, TString outDirectory = "", TString format = ""){
45    
46     std::stringstream sst;
47     if (outDirectory == "") outDirectory = base.Data();
48     TString filename = ((TObjString*)base.Tokenize('/')->Last())->GetString();
49    
50     TFile *file =new TFile(base.Data()) ;
51     if (!file){
52     printf("file not Found \n");
53     return;
54     }
55    
56     TTree *PhysicsTr = (TTree*)file->Get("Physics");
57     TBranch *TrigBr = PhysicsTr->GetBranch("Trigger");
58     TBranch *HeadBr = PhysicsTr->GetBranch("Header");
59    
60     pamela::EventHeader *eh = 0;
61     pamela::PscuHeader *ph = 0;
62    
63     pamela::trigger::TriggerEvent *triggerEvent = 0;
64    
65     PhysicsTr->SetBranchAddress("Trigger", &triggerEvent);
66     PhysicsTr->SetBranchAddress("Header", &eh);
67    
68     Long64_t nevents = TrigBr->GetEntries();
69     if (nevents <= 0) {
70     printf("nevents = %llu \n", nevents);
71     file->Close();
72     return;
73     }
74    
75     /* Histo DEF */
76    
77     /*
78     * S4 and Calorimeter Counters histograms
79     */
80     TCanvas *S4CalCanvas = new TCanvas("S4CalCanvas","S4CalCanvas", 1280, 1024);
81     S4CalCanvas->Divide(1,2);
82     //----------
83     sst.str("");
84     sst << "S4 Counters based on " << base.Data();
85     //----------
86     sst.str("");
87 campana 1.2 sst << "Calorimeter Rate Counters based on " << base.Data();
88     TH1F *S4Cal2Histo = new TH1F("S4Cal2Histo", sst.str().c_str(), 20, 0, 20);
89 campana 1.1
90     int i = 0;
91     Int_t size = nevents;
92    
93     Double_t *time = new Double_t[size];
94     Double_t *evCounter = new Double_t[size];
95     Double_t *deadTime = new Double_t[size];
96     Double_t *liveTime = new Double_t[size];
97     //
98     Double_t *trigrate0 = new Double_t[size];
99     Double_t *trigrate1 = new Double_t[size];
100     Double_t *trigrate2 = new Double_t[size];
101     Double_t *trigrate3 = new Double_t[size];
102     Double_t *trigrate4 = new Double_t[size];
103     Double_t *trigrate5 = new Double_t[size];
104     //
105     Double_t *pmt1 = new Double_t[size];
106     Double_t *pmt2 = new Double_t[size];
107     Double_t *pmt3 = new Double_t[size];
108     //
109     Double_t *s4rate = new Double_t[size];
110     //
111     while(i < nevents){
112     HeadBr->GetEntry(i);
113     TrigBr->GetEntry(i);
114    
115     /* time vector fill*/
116     ph = eh->GetPscuHeader();
117     time[i] = ph->GetOrbitalTime();
118    
119     /* eventCounter vector fill*/
120     evCounter[i] = triggerEvent->evcount;
121    
122     if( evCounter[i] > 1 ){
123    
124     /* live time vector fill*/
125     liveTime[i] = 0.16 * triggerEvent->dltime[0];
126    
127     /* dead time vector fill*/
128     deadTime[i] = 0.01 * triggerEvent->dltime[1];
129    
130     }
131    
132     gStyle->SetStatY(0.85);
133    
134    
135     /* PMT Plane Counters */
136    
137     pmt1[i] = 1.*triggerEvent->pmtpl[0];
138     pmt2[i] = 1.*triggerEvent->pmtpl[1];
139     pmt3[i] = 1.*triggerEvent->pmtpl[2];
140    
141     /* Trigger Rate Counters*/
142    
143     trigrate0[i] = (1/4.)*triggerEvent->trigrate[0];
144     trigrate1[i] = (1/4.)*triggerEvent->trigrate[1];
145     trigrate2[i] = (1/4.)*triggerEvent->trigrate[2];
146     trigrate3[i] = (1/4.)*triggerEvent->trigrate[3];
147     trigrate4[i] = (1/4.)*triggerEvent->trigrate[4];
148     trigrate5[i] = (1/4.)*triggerEvent->trigrate[5];
149    
150     /* S4 and Calorimeter Counters fill*/
151    
152     s4rate[i] = triggerEvent->s4calcount[0];
153     S4Cal2Histo->Fill(triggerEvent->s4calcount[1]);
154 campana 1.2
155 campana 1.1 i++;
156     }
157    
158     gStyle->SetOptStat(111111);
159     gStyle->SetStatH(0.15);
160     gStyle->SetStatW(0.15);
161    
162     /*
163     * Event Counter graph
164     */
165     TCanvas *EvCounterCanvas = new TCanvas("EvCounterCanvas","EvCounterCanvas", 1280, 1024);
166     //----------
167     sst.str("");
168     sst << "Event Counter";
169     TGraph *evCounterGraph = new TGraph(nevents, time, evCounter);
170     evCounterGraph->SetTitle(sst.str().c_str());
171     evCounterGraph->GetXaxis()->SetTitle("OrbitalTime");
172     evCounterGraph->GetXaxis()->CenterTitle();
173     evCounterGraph->Draw("APL");
174    
175     /*
176     * Dead and Live time graphs
177     */
178     TCanvas *DeadLiveCanvas = new TCanvas("DeadLiveCanvas","DeadLiveCanvas", 1280, 1024);
179     DeadLiveCanvas->Divide(1,2);
180     //----------
181     sst.str("");
182     sst << "Graph of Dead Time vs OBT based on " << base.Data();
183     TGraph *DeadTimeGraph = new TGraph(nevents, time, deadTime);
184     DeadLiveCanvas->cd(1);
185     sst.str("");
186     sst << "Dead Time";
187     DeadTimeGraph->SetTitle(sst.str().c_str());
188     DeadTimeGraph->SetFillColor(2);
189     DeadTimeGraph->GetXaxis()->SetTitle("OrbitalTime");
190     DeadTimeGraph->GetXaxis()->CenterTitle();
191     DeadTimeGraph->GetYaxis()->SetTitle("DeadTime(ms)");
192     DeadTimeGraph->GetYaxis()->CenterTitle();
193     DeadTimeGraph->SetMaximum(100);
194     DeadTimeGraph->Draw("AP");
195     //----------
196     sst.str("");
197     sst << "Graph of Live Time vs OBT based on " << base.Data();
198     TGraph *LiveTimeGraph = new TGraph(nevents, (const Double_t*)time, (const Double_t*)liveTime);
199     DeadLiveCanvas->cd(2);
200     sst.str("");
201     sst << "Live Time";
202     LiveTimeGraph->SetTitle(sst.str().c_str());
203     LiveTimeGraph->SetFillColor(2);
204     LiveTimeGraph->GetXaxis()->SetTitle("OrbitalTime");
205     LiveTimeGraph->GetXaxis()->CenterTitle();
206     LiveTimeGraph->GetYaxis()->SetTitle("LiveTime(ms)");
207     LiveTimeGraph->GetYaxis()->CenterTitle();
208     LiveTimeGraph->Draw("AP");
209    
210     /*
211     * PMT Plane Counters Graph
212     */
213    
214     TCanvas *PMTCanvas = new TCanvas("PMTCanvas","PMTCanvas", 1280, 1024);
215     PMTCanvas->Divide(1,3);
216     //----------
217     sst.str("");
218     sst << "Graph of PMT Plane Counters (S11 AND S12) vs OBT based on " << base.Data();
219     TGraph *PMT1Graph = new TGraph(nevents, time, pmt1);
220     PMTCanvas->cd(1);
221     sst.str("");
222     sst << "PMT Plane Counters (S11 AND S12)";
223     PMT1Graph->SetTitle(sst.str().c_str());
224     PMT1Graph->SetFillColor(2);
225     PMT1Graph->GetXaxis()->SetTitle("OrbitalTime");
226     PMT1Graph->GetXaxis()->CenterTitle();
227     PMT1Graph->GetYaxis()->SetTitle("PMT Plane Counters");
228     PMT1Graph->GetYaxis()->CenterTitle();
229     PMT1Graph->Draw("AP");
230     //----------
231     sst.str("");
232     sst << "Graph PMT Plane Counters (S21 AND S22) vs OBT based on " << base.Data();
233     TGraph *PMT2Graph = new TGraph(nevents, time, pmt2);
234     PMTCanvas->cd(2);
235     sst.str("");
236     sst << "PMT Plane Counters (S21 AND S22)";
237     PMT2Graph->SetTitle(sst.str().c_str());
238     PMT2Graph->SetFillColor(2);
239     PMT2Graph->GetXaxis()->SetTitle("OrbitalTime");
240     PMT2Graph->GetXaxis()->CenterTitle();
241     PMT2Graph->GetYaxis()->SetTitle("PMT Plane Counters");
242     PMT2Graph->GetYaxis()->CenterTitle();
243     PMT2Graph->Draw("AP");
244     //----------
245     sst.str("");
246     sst << "Graph PMT Plane Counters (S31 AND S32) vs OBT based on " << base.Data();
247     TGraph *PMT3Graph = new TGraph(nevents, time, pmt3);
248     PMTCanvas->cd(3);
249     sst.str("");
250     sst << "PMT Plane Counters (S31 AND S32)";
251     PMT3Graph->SetTitle(sst.str().c_str());
252     PMT3Graph->SetFillColor(2);
253     PMT3Graph->GetXaxis()->SetTitle("OrbitalTime");
254     PMT3Graph->GetXaxis()->CenterTitle();
255     PMT3Graph->GetYaxis()->SetTitle("PMT Plane Rate Counters");
256     PMT3Graph->GetYaxis()->CenterTitle();
257     PMT3Graph->Draw("AP");
258     //
259     //----------
260    
261     /*
262     * Trigger Rate Counters draw
263     */
264    
265     TCanvas *TrigRate1Canvas = new TCanvas("TrigRate1Canvas","TrigRate1Canvas", 1280, 1024);
266     TrigRate1Canvas->Divide(1,3);
267     //----------
268     sst.str("");
269     sst << "Graph of Trigger Rate Counters (S11 OR S12) AND (S21 OR S22) AND (S31 OR S32) vs OBT based on " << base.Data();
270    
271     TGraph *TrigRate0Graph = new TGraph(nevents, time, trigrate0);
272     TrigRate1Canvas->cd(1);
273     sst.str("");
274     sst << "Trigger Rate Counters (S11 OR S12) AND (S21 OR S22) AND (S31 OR S32)";
275     TrigRate0Graph->SetTitle(sst.str().c_str());
276     TrigRate0Graph->SetFillColor(2);
277     TrigRate0Graph->GetXaxis()->SetTitle("OrbitalTime");
278     TrigRate0Graph->GetXaxis()->CenterTitle();
279 campana 1.2 TrigRate0Graph->GetYaxis()->SetTitle("Trigger Rate Counters (Hz)");
280 campana 1.1 TrigRate0Graph->GetYaxis()->CenterTitle();
281     TrigRate0Graph->Draw("AP");
282     //----------
283     sst.str("");
284     sst << "Graph Trigger Rate Counters (S11 AND S12) AND (S21 AND S22) AND (S31 AND S32) vs OBT based on " << base.Data();
285     TGraph *TrigRate1Graph = new TGraph(nevents, time, trigrate1);
286     TrigRate1Canvas->cd(2);
287     sst.str("");
288     sst << "Trigger Rate Counters (S11 AND S12) AND (S21 AND S22) AND (S31 AND S32)";
289     TrigRate1Graph->SetTitle(sst.str().c_str());
290     TrigRate1Graph->SetFillColor(2);
291     TrigRate1Graph->GetXaxis()->SetTitle("OrbitalTime");
292     TrigRate1Graph->GetXaxis()->CenterTitle();
293 campana 1.2 TrigRate1Graph->GetYaxis()->SetTitle("Trigger Rate Counters (Hz)");
294 campana 1.1 TrigRate1Graph->GetYaxis()->CenterTitle();
295     TrigRate1Graph->Draw("AP");
296     //----------
297     sst.str("");
298     sst << "Graph Trigger Rate Counters (S21 OR S22) AND (S31 OR S32) vs OBT based on " << base.Data();
299     TGraph *TrigRate2Graph = new TGraph(nevents, time, trigrate2);
300     TrigRate1Canvas->cd(3);
301     sst.str("");
302     sst << "Trigger Rate Counters (S21 OR S22) AND (S31 OR S32) ";
303     TrigRate2Graph->SetTitle(sst.str().c_str());
304     TrigRate2Graph->SetFillColor(2);
305     TrigRate2Graph->GetXaxis()->SetTitle("OrbitalTime");
306     TrigRate2Graph->GetXaxis()->CenterTitle();
307 campana 1.2 TrigRate2Graph->GetYaxis()->SetTitle("Trigger Rate Counters (Hz)");
308 campana 1.1 TrigRate2Graph->GetYaxis()->CenterTitle();
309     TrigRate2Graph->Draw("AP");
310     //
311     //----------
312     //
313     TCanvas *TrigRate2Canvas = new TCanvas("TrigRate2Canvas","TrigRate2Canvas", 1280, 1024);
314     TrigRate2Canvas->Divide(1,3);
315     //----------
316     sst.str("");
317     sst << "Graph of Trigger Rate Counters (S21 AND S22) AND (S31 AND S32) vs OBT based on " << base.Data();
318    
319     TGraph *TrigRate3Graph = new TGraph(nevents, time, trigrate3);
320     TrigRate2Canvas->cd(1);
321     sst.str("");
322     sst << "Trigger Rate Counters (S21 AND S22) AND (S31 AND S32)";
323     TrigRate3Graph->SetTitle(sst.str().c_str());
324     TrigRate3Graph->SetFillColor(2);
325     TrigRate3Graph->GetXaxis()->SetTitle("OrbitalTime");
326     TrigRate3Graph->GetXaxis()->CenterTitle();
327 campana 1.2 TrigRate3Graph->GetYaxis()->SetTitle("Trigger Rate Counters (Hz)");
328 campana 1.1 TrigRate3Graph->GetYaxis()->CenterTitle();
329     TrigRate3Graph->Draw("AP");
330     //----------
331     sst.str("");
332     sst << "Graph Trigger Rate Counters S12 AND (S21 AND S22) vs OBT based on " << base.Data();
333     TGraph *TrigRate4Graph = new TGraph(nevents, time, trigrate4);
334     TrigRate2Canvas->cd(2);
335     sst.str("");
336     sst << "Trigger Rate Counters S12 AND (S21 AND S22)";
337     TrigRate4Graph->SetTitle(sst.str().c_str());
338     TrigRate4Graph->SetFillColor(2);
339     TrigRate4Graph->GetXaxis()->SetTitle("OrbitalTime");
340     TrigRate4Graph->GetXaxis()->CenterTitle();
341 campana 1.2 TrigRate4Graph->GetYaxis()->SetTitle("Trigger Rate Counters (Hz)");
342 campana 1.1 TrigRate4Graph->GetYaxis()->CenterTitle();
343     TrigRate4Graph->Draw("AP");
344     //----------
345     sst.str("");
346     sst << "Graph Trigger Rate Counters (S11 OR S12) AND (S31 OR S32) vs OBT based on " << base.Data();
347     TGraph *TrigRate5Graph = new TGraph(nevents, time, trigrate5);
348     TrigRate2Canvas->cd(3);
349     sst.str("");
350     sst << "Trigger Rate Counters (S11 OR S12) AND (S31 OR S32)";
351     TrigRate5Graph->SetTitle(sst.str().c_str());
352     TrigRate5Graph->SetFillColor(2);
353     TrigRate5Graph->GetXaxis()->SetTitle("OrbitalTime");
354     TrigRate5Graph->GetXaxis()->CenterTitle();
355 campana 1.2 TrigRate5Graph->GetYaxis()->SetTitle("Trigger Rate Counters (Hz)");
356 campana 1.1 TrigRate5Graph->GetYaxis()->CenterTitle();
357     TrigRate5Graph->Draw("AP");
358     //----------
359    
360     gStyle->SetOptStat("mr");
361    
362     /* S4 and Calorimeter Counters draw*/
363     TGraph *s4RateGraph = new TGraph(nevents, time, s4rate);
364     S4CalCanvas->cd(1);
365     sst.str("");
366     sst << "S4 Trigger Rate Counters";
367     s4RateGraph->SetTitle(sst.str().c_str());
368     s4RateGraph->SetFillColor(2);
369     s4RateGraph->GetXaxis()->SetTitle("OrbitalTime");
370     s4RateGraph->GetXaxis()->CenterTitle();
371 campana 1.2 s4RateGraph->GetYaxis()->SetTitle("Trigger Rate Counters (Hz)");
372 campana 1.1 s4RateGraph->GetYaxis()->CenterTitle();
373     s4RateGraph->Draw("AP");
374     //----------
375     S4CalCanvas->cd(2);
376 campana 1.2 gPad->SetLogy(1);
377 campana 1.1 S4Cal2Histo->GetXaxis()->SetTitle("Hz");
378     S4Cal2Histo->Draw();
379     //
380     //
381     //
382     gStyle->SetOptStat("mr");
383     gStyle->SetStatH(0.3);
384     gStyle->SetStatW(0.3);
385    
386     TH1 *htemp;
387    
388     TCanvas *RatePMT1 = new TCanvas("RatePMT1", "Rate PMT S11A", 1);
389     RatePMT1->Divide (3,3);
390     //----------
391     RatePMT1->cd(1);
392     PhysicsTr->Draw("pmtcount1[0]");
393     htemp = (TH1*)gPad->GetPrimitive("htemp");
394     htemp->SetTitle("S111A");
395     //----------
396     RatePMT1->cd (2);
397     PhysicsTr->Draw("pmtcount1[1]");
398     htemp = (TH1*)gPad->GetPrimitive("htemp");
399     htemp->SetTitle("S112A");
400     //----------
401     RatePMT1->cd (3);
402     PhysicsTr->Draw("pmtcount1[2]");
403     htemp = (TH1*)gPad->GetPrimitive("htemp");
404     htemp->SetTitle("S113A");
405     //----------
406     RatePMT1->cd(4);
407     PhysicsTr->Draw("pmtcount1[3]");
408     htemp = (TH1*)gPad->GetPrimitive("htemp");
409     htemp->SetTitle("S114A");
410     //----------
411     RatePMT1->cd(5);
412     PhysicsTr->Draw("pmtcount1[4]");
413     htemp = (TH1*)gPad->GetPrimitive("htemp");
414     htemp->SetTitle("S115A");
415     //----------
416     RatePMT1->cd(6);
417     PhysicsTr->Draw("pmtcount1[5]");
418     htemp = (TH1*)gPad->GetPrimitive("htemp");
419     htemp->SetTitle("S116A");
420     //----------
421     RatePMT1->cd(7);
422     PhysicsTr->Draw("pmtcount1[6]");
423     htemp = (TH1*)gPad->GetPrimitive("htemp");
424     htemp->SetTitle("S117A");
425     //----------
426     RatePMT1->cd(8);
427     PhysicsTr->Draw("pmtcount1[7]");
428     htemp = (TH1*)gPad->GetPrimitive("htemp");
429     htemp->SetTitle("S118A");
430    
431     TCanvas *RatePMT2 = new TCanvas("RatePMT2", "Rate PMT S11B", 1);
432     RatePMT2->Divide (3,3);
433     //----------
434     RatePMT2->cd(1);
435     PhysicsTr-> Draw("pmtcount1[8]");
436     htemp = (TH1*)gPad->GetPrimitive("htemp");
437     htemp->SetTitle("S111B");
438     //----------
439     RatePMT2->cd(2);
440     PhysicsTr->Draw("pmtcount1[9]");
441     htemp = (TH1*)gPad->GetPrimitive("htemp");
442     htemp->SetTitle("S112B");
443     //----------
444     RatePMT2->cd(3);
445     PhysicsTr->Draw("pmtcount1[10]");
446     htemp = (TH1*)gPad->GetPrimitive("htemp");
447     htemp->SetTitle("S113B");
448     //----------
449     RatePMT2->cd(4);
450     PhysicsTr->Draw("pmtcount1[11]");
451     htemp = (TH1*)gPad->GetPrimitive("htemp");
452     htemp->SetTitle("S114B");
453     //----------
454     RatePMT2->cd(5);
455     PhysicsTr-> Draw("pmtcount1[12]");
456     htemp = (TH1*)gPad->GetPrimitive("htemp");
457     htemp->SetTitle("S115B");
458     //----------
459     RatePMT2->cd(6);
460     PhysicsTr-> Draw("pmtcount1[13]");
461     htemp = (TH1*)gPad->GetPrimitive("htemp");
462     htemp->SetTitle("S116B");
463     //----------
464     RatePMT2->cd(7);
465     PhysicsTr-> Draw("pmtcount1[14]");
466     htemp = (TH1*)gPad->GetPrimitive("htemp");
467     htemp->SetTitle("S117B");
468     //----------
469     RatePMT2->cd(8);
470     PhysicsTr->Draw("pmtcount1[15]");
471     htemp = (TH1*)gPad->GetPrimitive("htemp");
472     htemp->SetTitle("S118B");
473    
474     TCanvas *RatePMT3 = new TCanvas("RatePMT3", "Rate PMT S12", 1);
475     RatePMT3->Divide (3,4);
476     //----------
477     RatePMT3->cd(1);
478     PhysicsTr-> Draw("pmtcount1[16]");
479     htemp = (TH1*)gPad->GetPrimitive("htemp");
480     htemp->SetTitle("S121A");
481     //----------
482     RatePMT3->cd(2);
483     PhysicsTr-> Draw("pmtcount1[17]");
484     htemp = (TH1*)gPad->GetPrimitive("htemp");
485     htemp->SetTitle("S122A");
486     //----------
487     RatePMT3->cd (3);
488     PhysicsTr-> Draw("pmtcount1[18]");
489     htemp = (TH1*)gPad->GetPrimitive("htemp");
490     htemp->SetTitle("S123A");
491     //----------
492     RatePMT3->cd(4);
493     PhysicsTr->Draw("pmtcount1[19]");
494     htemp = (TH1*)gPad->GetPrimitive("htemp");
495     htemp->SetTitle("S124A");
496     //----------
497     RatePMT3->cd(5);
498     PhysicsTr-> Draw("pmtcount1[20]");
499     htemp = (TH1*)gPad->GetPrimitive("htemp");
500     htemp->SetTitle("S125A");
501     //----------
502     RatePMT3->cd(6);
503     PhysicsTr-> Draw("pmtcount1[21]");
504     htemp = (TH1*)gPad->GetPrimitive("htemp");
505     htemp->SetTitle("S126A");
506     //----------
507     RatePMT3->cd(7);
508     PhysicsTr->Draw("pmtcount1[22]");
509     htemp = (TH1*)gPad->GetPrimitive("htemp");
510     htemp->SetTitle("S121B");
511     //----------
512     RatePMT3->cd(8);
513     PhysicsTr-> Draw("pmtcount1[23]");
514     htemp = (TH1*)gPad->GetPrimitive("htemp");
515     htemp->SetTitle("S122B");
516     //----------
517     RatePMT3->cd (9);
518     PhysicsTr->Draw("pmtcount2[0]");
519     htemp = (TH1*)gPad->GetPrimitive("htemp");
520     htemp->SetTitle("S123B");
521     //----------
522     RatePMT3->cd (10);
523     PhysicsTr->Draw("pmtcount2[1]");
524     htemp = (TH1*)gPad->GetPrimitive("htemp");
525     htemp->SetTitle("S124B");
526     //----------
527     RatePMT3->cd (11);
528     PhysicsTr->Draw("pmtcount2[2]");
529     htemp = (TH1*)gPad->GetPrimitive("htemp");
530     htemp->SetTitle("S125B");
531     //----------
532     RatePMT3->cd (12);
533     PhysicsTr->Draw("pmtcount2[3]");
534     htemp = (TH1*)gPad->GetPrimitive("htemp");
535     htemp->SetTitle("S126B");
536    
537     TCanvas *RatePMT4 = new TCanvas("RatePMT4", "Rate PMT S2", 1);
538     RatePMT4->Divide (3,3);
539     //----------
540     RatePMT4->cd (1);
541     PhysicsTr-> Draw("pmtcount2[4]");
542     htemp = (TH1*)gPad->GetPrimitive("htemp");
543     htemp->SetTitle("S211A");
544     //----------
545     RatePMT4->cd (2);
546     PhysicsTr-> Draw("pmtcount2[5]");
547     htemp = (TH1*)gPad->GetPrimitive("htemp");
548     htemp->SetTitle("S212A");
549     //----------
550     RatePMT4->cd (3);
551     PhysicsTr-> Draw("pmtcount2[6]");
552     htemp = (TH1*)gPad->GetPrimitive("htemp");
553     htemp->SetTitle("S211B");
554     //----------
555     RatePMT4->cd (4);
556     PhysicsTr-> Draw("pmtcount2[7]");
557     htemp = (TH1*)gPad->GetPrimitive("htemp");
558     htemp->SetTitle("S212B");
559     //----------
560     RatePMT4->cd (5);
561     PhysicsTr-> Draw("pmtcount2[8]");
562     htemp = (TH1*)gPad->GetPrimitive("htemp");
563     htemp->SetTitle("S221A");
564     //----------
565     RatePMT4->cd (6);
566     PhysicsTr-> Draw("pmtcount2[9]");
567     htemp = (TH1*)gPad->GetPrimitive("htemp");
568     htemp->SetTitle("S222A");
569     //----------
570     RatePMT4->cd (7);
571     PhysicsTr-> Draw("pmtcount2[10]");
572     htemp = (TH1*)gPad->GetPrimitive("htemp");
573     htemp->SetTitle("S221B");
574     //----------
575     RatePMT4->cd (8);
576     PhysicsTr->Draw("pmtcount2[11]");
577     htemp = (TH1*)gPad->GetPrimitive("htemp");
578     htemp->SetTitle("S222B");
579    
580     TCanvas *RatePMT5 = new TCanvas("RatePMT5", "Rate PMT S3", 1);
581     RatePMT5->Divide (3,4);
582     //----------
583     RatePMT5->cd (1);
584     PhysicsTr-> Draw("pmtcount2[12]");
585     htemp = (TH1*)gPad->GetPrimitive("htemp");
586     htemp->SetTitle("S311A");
587     //----------
588     RatePMT5->cd (2);
589     PhysicsTr-> Draw("pmtcount2[13]");
590     htemp = (TH1*)gPad->GetPrimitive("htemp");
591     htemp->SetTitle("S312A");
592     //----------
593     RatePMT5->cd (3);
594     PhysicsTr-> Draw("pmtcount2[14]");
595     htemp = (TH1*)gPad->GetPrimitive("htemp");
596     htemp->SetTitle("S313A");
597     //----------
598     RatePMT5->cd (4);
599     PhysicsTr-> Draw("pmtcount2[15]");
600     htemp = (TH1*)gPad->GetPrimitive("htemp");
601     htemp->SetTitle("S311B");
602     //----------
603     RatePMT5->cd (5);
604     PhysicsTr-> Draw("pmtcount2[16]");
605     htemp = (TH1*)gPad->GetPrimitive("htemp");
606     htemp->SetTitle("S312B");
607     //----------
608     RatePMT5->cd (6);
609     PhysicsTr-> Draw("pmtcount2[17]");
610     htemp = (TH1*)gPad->GetPrimitive("htemp");
611     htemp->SetTitle("S313B");
612     //----------
613     RatePMT5->cd (7);
614     PhysicsTr-> Draw("pmtcount2[18]");
615     htemp = (TH1*)gPad->GetPrimitive("htemp");
616     htemp->SetTitle("S321A");
617     //----------
618     RatePMT5->cd (8);
619     PhysicsTr-> Draw("pmtcount2[19]");
620     htemp = (TH1*)gPad->GetPrimitive("htemp");
621     htemp->SetTitle("S322A");
622     //----------
623     RatePMT5->cd (9);
624     PhysicsTr-> Draw("pmtcount2[20]");
625     htemp = (TH1*)gPad->GetPrimitive("htemp");
626     htemp->SetTitle("S323A");
627     //----------
628     RatePMT5->cd (10);
629     PhysicsTr-> Draw("pmtcount2[21]");
630     htemp = (TH1*)gPad->GetPrimitive("htemp");
631     htemp->SetTitle("S321B");
632     //----------
633     RatePMT5->cd (11);
634     PhysicsTr-> Draw("pmtcount2[22]");
635     htemp = (TH1*)gPad->GetPrimitive("htemp");
636     htemp->SetTitle("S322B");
637     //----------
638     gStyle->SetOptStat("mr");
639     gStyle->SetStatH(0.3);
640     gStyle->SetStatW(0.3);
641     RatePMT5->cd (12);
642     PhysicsTr-> Draw("pmtcount2[23]");
643     htemp = (TH1*)gPad->GetPrimitive("htemp");
644     htemp->SetTitle("S323B");
645    
646     // print the output
647     const char *saveas = format;
648     if ( !strcmp(saveas,"ps") ) {
649     // ------print the ps
650    
651     gStyle->SetOptStat(111111);
652    
653     sst.str("");
654     sst << outDirectory.Data() << filename.Data() << "TriggerScanBasic." << saveas << "(";
655     EvCounterCanvas->Print(sst.str().c_str());
656     DeadLiveCanvas->Print(sst.str().c_str());
657     PMTCanvas->Print(sst.str().c_str());
658     TrigRate1Canvas->Print(sst.str().c_str());
659     TrigRate2Canvas->Print(sst.str().c_str());
660    
661     gStyle->SetOptStat("mr");
662     S4CalCanvas->Print(sst.str().c_str());
663    
664     gStyle->SetOptStat("mr");
665     RatePMT1->Print(sst.str().c_str());
666     RatePMT2->Print(sst.str().c_str());
667     RatePMT3->Print(sst.str().c_str());
668     RatePMT4->Print(sst.str().c_str());
669     //
670     sst.str("");
671     sst << outDirectory.Data() << filename.Data() << "TriggerScanBasic." << saveas << ")";
672     RatePMT5->Print(sst.str().c_str());
673    
674     } else {
675    
676     gStyle->SetOptStat(111111);
677    
678     sst.str("");
679     sst << outDirectory.Data() << filename.Data() << "TriggerScanBasic1." << saveas;
680     EvCounterCanvas->SaveAs(sst.str().c_str());
681    
682     sst.str("");
683     sst << outDirectory.Data() << filename.Data() << "TriggerScanBasic2." << saveas;
684     DeadLiveCanvas->SaveAs(sst.str().c_str());
685    
686     sst.str("");
687     sst << outDirectory.Data() << filename.Data() << "TriggerScanBasic3." << saveas;
688     PMTCanvas->SaveAs(sst.str().c_str());
689    
690     sst.str("");
691     sst << outDirectory.Data() << filename.Data() << "TriggerScanBasic4." << saveas;
692     TrigRate1Canvas->SaveAs(sst.str().c_str());
693    
694     sst.str("");
695     sst << outDirectory.Data() << filename.Data() << "TriggerScanBasic5." << saveas;
696     TrigRate2Canvas->SaveAs(sst.str().c_str());
697    
698     sst.str("");
699     sst << outDirectory.Data() << filename.Data() << "TriggerScanBasic6." << saveas;
700     S4CalCanvas->SaveAs(sst.str().c_str());
701    
702     gStyle->SetOptStat("mr");
703    
704     sst.str("");
705     sst << outDirectory.Data() << filename.Data() << "TriggerScanBasic13." << saveas;
706     RatePMT1->SaveAs(sst.str().c_str());
707    
708     sst.str("");
709     sst << outDirectory.Data() << filename.Data() << "TriggerScanBasic14." << saveas;
710     RatePMT2->SaveAs(sst.str().c_str());
711    
712     sst.str("");
713     sst << outDirectory.Data() << filename.Data() << "TriggerScanBasic15." << saveas;
714     RatePMT3->SaveAs(sst.str().c_str());
715    
716     sst.str("");
717     sst << outDirectory.Data() << filename.Data() << "TriggerScanBasic16." << saveas;
718     RatePMT4->SaveAs(sst.str().c_str());
719    
720     gStyle->SetOptStat("mr");
721    
722     sst.str("");
723     sst << outDirectory.Data() << filename.Data() << "TriggerScanBasic17." << saveas;
724     RatePMT5->SaveAs(sst.str().c_str());
725    
726     }
727    
728     }
729    
730    
731     int main(int argc, char* argv[]){
732     TString path;
733     TString outDir ="./";
734     TString format ="ps";
735    
736     if (argc < 2){
737     printf("You have to insert at least the file to analyze \n");
738     printf("Try '--help' for more information. \n");
739     exit(1);
740     }
741    
742     if (!strcmp(argv[1], "--help")){
743     printf( "Usage: TriggerScanBasic FILE [OPTION] \n");
744     printf( "\t --help Print this help and exit \n");
745     printf( "\t -outDir[path] Path where to put the output [default ./] \n");
746     printf( "\t -format[ps] Format for output files [default 'ps'] \n");
747     exit(1);
748     }
749    
750    
751     path=argv[1];
752    
753     for (int i = 2; i < argc; i++){
754    
755     if (!strcmp(argv[i], "-outDir")){
756     if (++i >= argc){
757     printf( "-outDir needs arguments. \n");
758     printf( "Try '--help' for more information. \n");
759     exit(1);
760     }
761     else{
762     outDir = argv[i];
763     continue;
764     }
765     }
766    
767    
768    
769     if (!strcmp(argv[i], "-format")){
770     if (++i >= argc){
771     printf( "-format needs arguments. \n");
772     printf( "Try '--help' for more information. \n");
773     exit(1);
774     }
775     else{
776     format = argv[i];
777     continue;
778     }
779     }
780     }
781    
782     TriggerScanBasic(argv[1], outDir, format);
783    
784     }

  ViewVC Help
Powered by ViewVC 1.1.23