/[PAMELA software]/calo/flight/FQLOOK/macros/FCaloQLOOK.cxx
ViewVC logotype

Annotation of /calo/flight/FQLOOK/macros/FCaloQLOOK.cxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (hide annotations) (download)
Wed Mar 22 15:04:11 2006 UTC (18 years, 8 months ago) by mocchiut
Branch: MAIN
CVS Tags: v1r06
Changes since 1.6: +3 -1 lines
Added -O flag

1 mocchiut 1.1 //
2     // Check for possible errors and shows raw distribution of variables coming from the DSP (no calibrations needed) - Emiliano Mocchiutti
3     //
4 mocchiut 1.7 // FCaloQLOOK.c version 1.06 (2006-03-22)
5 mocchiut 1.1 //
6     // The only input needed is the path to the directory created by YODA for the data file you want to analyze.
7     //
8     // Changelog:
9 mocchiut 1.7 //
10     // 1.05 - 1.06 (2006-03-22): Add optimize flag in compiling the script!
11 mocchiut 1.6 //
12     // 1.04 - 1.05 (2006-03-22): Corrected wrong .C files.
13 mocchiut 1.5 //
14     // 1.03 - 1.04 (2006-03-20): Documentation updated.
15 mocchiut 1.4 //
16     // 1.02 - 1.03 (2006-03-20): Changed name of shared libraries (from FCaloQLOOK_cxx.so to libFCaloQLOOK.so).
17 mocchiut 1.1 //
18 mocchiut 1.3 // 1.01 - 1.02 (2006-03-13): Include files from YODA without "event" directory.
19     //
20 mocchiut 1.1 // 1.00 - 1.01 (2006-02-28): Works on YODA v6 output (single file), does not require anymore calocommon package.
21     //
22     // 0.00 - 1.00 (2006-02-28): Clone of CaloQLOOK.c (ground software).
23     //
24     #include <iostream>
25     #include <fstream>
26     //
27     #include <TObject.h>
28     #include <TString.h>
29     #include <TFile.h>
30     #include <TCanvas.h>
31     #include <TH1.h>
32     #include <TH1F.h>
33     #include <TH2D.h>
34     #include <TLatex.h>
35     #include <TPad.h>
36     #include <TPolyLine.h>
37     #include <TStyle.h>
38 mocchiut 1.2 #include <TSystem.h>
39 mocchiut 1.1 //
40 mocchiut 1.3 #include <PamelaRun.h>
41     #include <physics/calorimeter/CalorimeterEvent.h>
42 mocchiut 1.1 //
43     #include <FCaloQLOOKfun.h>
44     //
45     using namespace std;
46     //
47     void stringcopy(TString& s1, const TString& s2, Int_t from=0, Int_t to=0){
48     if ( to == 0 ){
49     Int_t t2length = s2.Length();
50     s1 = "";
51     to = t2length;
52     };
53     for (Int_t i = from; i<to; i++){
54     s1.Append(s2[i],1);
55     };
56     }
57     void stringappend(TString& s1, const TString& s2){
58     Int_t t2length = s2.Length();
59     for (Int_t i = 0; i<t2length; i++){
60     s1.Append(s2[i],1);
61     };
62     }
63    
64     TString getFilename(const TString filename){
65     const string fil = (const char*)filename;
66     Int_t posiz = fil.find("dw_");
67     if ( posiz == -1 ) posiz = fil.find("DW_");
68     if ( posiz == -1 ) return 0;
69     Int_t posiz2 = posiz+13;
70     TString file2;
71     stringcopy(file2,filename,posiz,posiz2);
72     TString pdat(".dat");
73     stringappend(file2,pdat);
74     return file2;
75     }
76    
77     void FCaloQLOOK(TString filename, Int_t fromevent=0, Int_t toevent=0, TString outDir="", TString saveas = "ps"){
78     gStyle->SetPaperSize(19.,25.);
79     const char* startingdir = gSystem->WorkingDirectory();
80     if ( !strcmp(outDir.Data(),"") ) outDir = startingdir;
81     //
82     //
83     ifstream myfile;
84     myfile.open(filename.Data());
85     if ( !myfile ){
86 mocchiut 1.2 printf(" %s :no such file, exiting...\n\n",filename.Data());
87 mocchiut 1.1 return;
88     };
89     myfile.close();
90     //
91     TFile *File = new TFile(filename.Data());
92     TTree *tr = (TTree*)File->Get("Physics");
93 mocchiut 1.2 if ( !tr ) {
94     printf(" Physics : no such tree in %s \n",filename.Data());
95     printf(" Exiting, are you sure this is a LEVEL0 not corrupted file? \n\n");
96     return;
97     };
98 mocchiut 1.1 //
99     // Define variables
100     //
101     Float_t ctshitthr = 0.65;
102     Float_t cbasethr = 0.95;
103     Float_t cdexythr = 0.995;
104     Float_t cdexycthr = 0.95;
105     //
106     pamela::calorimeter::CalorimeterEvent *ce = 0;
107     pamela::EventHeader *eh = 0;
108     pamela::PscuHeader *ph = 0;
109     //
110     UInt_t found;
111     tr->SetBranchStatus("*",0,&found); //disable all branches
112     //
113     found = 0;
114     tr->SetBranchStatus("iev*",1,&found);
115     // printf("enabled %i branches \n",found);
116     found = 0;
117     tr->SetBranchStatus("dexy*",1,&found);
118     // printf("enabled %i branches \n",found);
119     found = 0;
120     tr->SetBranchStatus("stwerr*",1,&found);
121     // printf("enabled %i branches \n",found);
122     found = 0;
123     tr->SetBranchStatus("perror*",1,&found);
124     // printf("enabled %i branches \n",found);
125     found = 0;
126     tr->SetBranchStatus("cal*",1,&found);
127     // printf("enabled %i branches \n",found);
128     found = 0;
129     tr->SetBranchStatus("base*",1,&found);
130     //printf("enabled %i branches \n",found);
131     found = 0;
132     tr->SetBranchStatus("Pscu*",1,&found);
133     //printf("enabled %i branches \n",found);
134     found = 0;
135     tr->SetBranchStatus("Calorimeter*",1,&found);
136     //printf("calo enabled %i branches \n",found);
137     found = 0;
138     tr->SetBranchStatus("Header*",1,&found);
139     //printf("head enabled %i branches \n",found);
140     //
141     tr->SetBranchAddress("Calorimeter", &ce);
142     tr->SetBranchAddress("Header", &eh);
143     //
144     Long64_t nevents = tr->GetEntries();
145     if ( nevents < 1 ) {
146     printf("The file is empty!\n");
147     return;
148     };
149     Int_t const size = nevents;
150     Double_t iev2[size+1];
151     Int_t ver[4][23], lver[4][23],shit[4][11], rshit[4][11], se,bl, pl, fulldiff[4],cshit, cpre[4],nullsh[4][11], lalarm[4];
152     se = 0;
153     pl = 0;
154     Float_t allbase = 0.;
155     Int_t tshit, trshit, compdata,rawdata, errorfull, calevn1, calevn2, calevn3, calevn4, pshit[4][11];
156     tshit = 0;
157     trshit = 0;
158     char *sezione;
159     Bool_t check = false;
160     sezione = "";
161     stringstream errore;
162     errore.str("");
163     //
164     TString fififile = getFilename(filename);
165     const char *file = fififile;
166     //
167     // book histograms
168     //
169     TH1F *h1;
170     TH1F *h1r;
171     TH1F *hdiff;
172     TH1F *Baseline;
173     TH1F *Dexy;
174     TH1F *Dexyc;
175     TH1F *Calstriphit;
176     TH1F *calev01;
177     TH1F *calev23;
178     TH1F *calev03;
179     TH2D *calev2;
180    
181     h1 = new TH1F("C7","Strips hit, compress mode",100,0.,200.);
182     h1r = new TH1F("C8","Strips hit, raw mode",100,-1,1);
183     h1r->SetBit(TH1F::kCanRebin);
184     hdiff = new TH1F("C6","Differences in full mode",100,-3,3);
185     hdiff->SetBit(TH1F::kCanRebin);
186     Baseline = new TH1F("C9","baselines",100,0,3);
187     Baseline->SetBit(TH1F::kCanRebin);
188     Dexy = new TH1F("C12","dexy",100,0.,37000.);
189     Dexyc = new TH1F("C10","dexyc",100,0,3);
190     Dexyc->SetBit(TH1F::kCanRebin);
191     Calstriphit = new TH1F("C11","calstriphit[1:4]",100,0.,200.);
192    
193     calev01 = new TH1F("C3","|calevnum(1)-calevnum(2)|",100,0,1);
194     calev01->SetBit(TH1F::kCanRebin);
195     calev23 = new TH1F("C4","|calevnum(3)-calevnum(4)|",100,0,1);
196     calev23->SetBit(TH1F::kCanRebin);
197     calev03 = new TH1F("C5","|calevnum(1)-calevnum(4)|",100,0,1);
198     calev03->SetBit(TH1F::kCanRebin);
199     calev2 = new TH2D("C2","calevnum(2)%iev",3000,0.,2.,100,0.,2.);
200     calev2->SetBit(TH2D::kCanRebin);
201    
202     //
203     // run over each event and take out some variables
204     //
205     if ( fromevent > toevent && toevent ){
206     printf("It must be fromevent < toevent \n");
207     return;
208     };
209    
210    
211     if ( fromevent > nevents+1 || fromevent < 0 ) {
212     printf("You can choose fromevent between 0 (all) and %i \n",(int)nevents+1);
213     return;
214     };
215    
216     if ( toevent > nevents+1 || toevent < 0 ) {
217     printf("You can choose toevent between 0 (all) and %i \n",(int)nevents+1);
218     return;
219     };
220     Int_t minevent = 0;
221     Int_t maxevent = 0;
222     if ( fromevent == 0 ) {
223     minevent = 0;
224     maxevent = nevents -1;
225     } else {
226     minevent = fromevent - 1;
227     if ( toevent > 0 ){
228     maxevent = toevent - 1;
229     } else {
230     maxevent = fromevent - 1;
231     };
232     };
233    
234     for (Int_t k = 0; k < 4; k++ ){
235     for (Int_t m = 0; m < 23 ; m++ ){
236     ver[k][m] = 0 ;
237     lver[k][m] = 0 ;
238     cpre[k]=0;
239     if ( m < 11 ) {
240     pshit[k][m] = 0;
241     nullsh[k][m] = 0;
242     };
243     lalarm[k] = 0;
244     };
245     };
246     Int_t pdone, bdone;
247     pdone = 0;
248     bdone = 0;
249     bool isCOMP = 0;
250     bool isFULL = 0;
251     bool isRAW = 0;
252     Int_t alldexy=0;
253     Int_t alldexy2=0;
254     Int_t stri=0;
255     Int_t fcheck = 0;
256     Int_t cestw=0;
257     Int_t cmask = 127 ;
258     compdata = 0;
259     rawdata = 0;
260     errorfull = 0;
261     calevn1 = 0;
262     calevn2 = 0;
263     calevn3 = 0;
264     calevn4 = 0;
265     fulldiff[0] = 0;
266     fulldiff[1] = 0;
267     fulldiff[2] = 0;
268     fulldiff[3] = 0;
269     printf("\n Processed events: \n\n");
270     unsigned short int calev0=0;
271     unsigned short int oldcalev0;
272     unsigned short int calev1=0;
273     unsigned short int oldcalev1;
274     unsigned short int calevv2=0;
275     unsigned short int oldcalev2;
276     unsigned short int calev3=0;
277     unsigned short int oldcalev3;
278     Int_t i = minevent;
279     Float_t headc = 0.;
280     Float_t headco = 0.;
281     Bool_t h1rcheck = false;
282     Int_t intshit = 0;
283     Int_t outtshit = 0;
284     Int_t incshit = 0;
285     Int_t outcshit = 0;
286     Int_t inbase = 0;
287     Int_t outbase = 0;
288     Int_t indexy = 0;
289     Int_t outdexy = 0;
290     Int_t indexyc = 0;
291     Int_t outdexyc = 0;
292     while ( i < maxevent+1){
293     tshit = 0;
294     trshit = 0;
295     tr->GetEntry(i);
296     iev2[i] = ce->iev;
297     //
298     ph = eh->GetPscuHeader();
299     headco = headc;
300     headc = ph->GetCounter();
301     calevn1 += (int)abs((int)(ce->calevnum[0]-ce->calevnum[1]));
302     calevn2 += (int)abs((int)(ce->calevnum[2]-ce->calevnum[3]));
303     calevn3 += (int)abs((int)(ce->calevnum[0]-ce->calevnum[3]));
304     calev01->Fill(abs((int)(ce->calevnum[0]-ce->calevnum[1])));
305     calev23->Fill(abs((int)(ce->calevnum[2]-ce->calevnum[3])));
306     calev03->Fill(abs((int)(ce->calevnum[0]-ce->calevnum[3])));
307     unsigned short calvnm2 = (unsigned short)ce->calevnum[2];
308     calev2->Fill(ce->iev,calvnm2);
309     calevn4 += (int)ce->calevnum[2];
310     oldcalev0 = calev0;
311     calev0 = (int)ce->calevnum[0];
312     oldcalev1 = calev1;
313     calev1 = (int)ce->calevnum[1];
314     oldcalev2 = calevv2;
315     calevv2 = (int)ce->calevnum[2];
316     oldcalev3 = calev3;
317     calev3 = (int)ce->calevnum[3];
318     goto jumpprintout;
319     if ( (headc - headco -1.) == 0. && ((calev0 - oldcalev0 - 1) > 0 || (calev1 - oldcalev1 - 1) > 0 || (calevv2 - oldcalev2 - 1) > 0 || (calev3 - oldcalev3 - 1) > 0) ){
320     if ( i != minevent ) {
321     printf(" %f 0 Event %i: %i\n",headco,i,oldcalev0);
322     printf(" %f 0 Event %i: %i\n",headc,i+1,calev0);
323     printf(" %f 1 Event %i: %i\n",headco,i,oldcalev1);
324     printf(" %f 1 Event %i: %i\n",headc,i+1,calev1);
325     printf(" %f 2 Event %i: %i\n",headco,i,oldcalev2);
326     printf(" %f 2 Event %i: %i\n",headc,i+1,calevv2);
327     printf(" %f 3 Event %i: %i\n",headco,i,oldcalev3);
328     printf(" %f 3 Event %i: %i\n",headc,i+1,calev3);
329     isRAW = 0;
330     if ( ce->stwerr[0] & (1 << 3)) isRAW = 1;
331     if ( (calev0 - oldcalev0 - 1) > 0 && !isRAW && ce->perror[0] != 129 && oldcalev0 != 0) {
332     ver[0][10]++;
333     };
334     isRAW = 0;
335     if ( ce->stwerr[0] & (1 << 3)) isRAW = 1;
336     if ( (calev1 - oldcalev1 - 1) > 0 && !isRAW && ce->perror[1] != 129 && oldcalev1 != 0 ){
337     ver[1][10]++;
338     };
339     isRAW = 0;
340     if ( ce->stwerr[0] & (1 << 3)) isRAW = 1;
341     if ( (calevv2 - oldcalev2 - 1) > 0 && !isRAW && ce->perror[2] != 129 && oldcalev2 != 0 ){
342     ver[2][10]++;
343     };
344     isRAW = 0;
345     if ( ce->stwerr[0] & (1 << 3)) isRAW = 1;
346     if ( (calev3 - oldcalev3 - 1) > 0 && !isRAW && ce->perror[3] != 129 && oldcalev3 != 0 ){
347     ver[3][10]++;
348     };
349     }
350     };
351     jumpprintout:
352     memcpy(shit, nullsh, sizeof(nullsh));
353     memcpy(rshit, nullsh, sizeof(nullsh));
354     for (Int_t l = 0; l < 2; l++ ){
355     for (Int_t ii = 0; ii < 22; ii++){
356     if (l == 0 && ii%2 == 0){
357     se = 3;
358     pl = ii/2;
359     pdone = 0;
360     };
361     if (l == 0 && ii%2 != 0){
362     se = 2;
363     pl = (ii-1)/2;
364     pdone = 0;
365     };
366     if (l == 1 && ii%2 == 0){
367     se = 0;
368     pl = ii/2;
369     pdone = 0;
370     };
371     if (l == 1 && ii%2 != 0){
372     se = 1;
373     pl = (ii-1)/2;
374     pdone = 0;
375     };
376    
377     isCOMP = 0;
378     isFULL = 0;
379     isRAW = 0;
380     if ( ce->stwerr[se] & (1 << 16) ) isCOMP = 1;
381     if ( ce->stwerr[se] & (1 << 17) ) isFULL = 1;
382     if ( ce->stwerr[se] & (1 << 3) ) isRAW = 1;
383     bl = -1;
384     for (Int_t kk = 0; kk < 96 ; kk++ ){
385     if ( kk%16 == 0 ){
386     bdone = 0;
387     bl++;
388     allbase = ce->base[l][ii][bl];
389     alldexy=0;
390     alldexy2=0;
391     stri=0;
392     for (Int_t e = 0; e < 16 ; e++ ){
393     stri = e + 16 * bl;
394     alldexy += (int)ce->dexyc[l][ii][stri];
395     alldexy2 += (int)ce->dexy[l][ii][stri];
396     };
397     };
398     if ( !isRAW ) {
399     //
400     if ( !pdone ){
401     if ( (ce->base[l][ii][bl]>32000 || ce->base[l][ii][bl] == 0 ) && ( alldexy > 512000 || alldexy == 0) && ce->perror[se] == 0 ) {
402     pdone = 1;
403     pshit[se][pl]++ ;
404     if ( (ce->stwerr[se] & (1 << 4)) == 0 ) lalarm[se]++;
405     lver[se][2]++ ;
406     };
407     }
408     //
409     if ( !bdone ){
410     Baseline->Fill(ce->base[l][ii][bl]);
411     if ( ce->base[l][ii][bl] > 2000. && ce->base[l][ii][bl] < 4500. ){
412     inbase++;
413     } else {
414     outbase++;
415     };
416     bdone = 1;
417     };
418     //
419     if (ce->dexyc[l][ii][kk] > 0 ) {
420     shit[se][pl]++ ;
421     compdata = 1;
422     };
423     //
424     if ( isFULL ) {
425     if ( ce->dexy[l][ii][kk] > 0 && ce->dexy[l][ii][kk] < 32000 ) {
426     rshit[se][pl]++ ;
427     rawdata = 1;
428     };
429     Dexy->Fill(ce->dexy[l][ii][kk]);
430     if ( ce->dexy[l][ii][kk] < 2000. || ce->dexy[l][ii][kk] > 5000. ) {
431     outdexy++;
432     } else {
433     indexy++;
434     };
435     if ( ce->dexyc[l][ii][kk]>0 && (ce->dexy[l][ii][kk]-ce->dexyc[l][ii][kk]) != 0 && ce->perror[se] != 132 && (ce->base[l][ii][bl] == 0 || ce->base[l][ii][bl] >32000) ){
436     hdiff->Fill(ce->dexyc[l][ii][kk]-ce->dexy[l][ii][kk]);
437     fulldiff[se]++;
438     errorfull = 1;
439     };
440     };
441     //
442     Dexyc->Fill(ce->dexyc[l][ii][kk]);
443     if ( ce->dexyc[l][ii][kk] != 0. && ( ce->dexyc[l][ii][kk] < 2000. || ce->dexyc[l][ii][kk] > 5000. ) ) {
444     outdexyc++;
445     } else {
446     indexyc++;
447     };
448     //
449     if (ce->dexyc[l][ii][kk] < 0 ) ver[se][21]++ ;
450     //
451     if ( allbase == 0. || allbase > 32000.) {
452     fcheck = 0;
453     for (Int_t nn = bl*16; nn < (bl+1)*16 ; nn++){
454     if ( ce->dexyc[l][ii][nn] > 0. && ce->dexyc[l][ii][nn] < 32000. ) fcheck++;
455     };
456     if ( fcheck ) {
457     cpre[se]++;
458     allbase = 1.;
459     };
460     };
461     //
462     } else {
463     if ( !pdone ){
464     if ( (alldexy2>512000 || alldexy2 == 0) && ce->perror[se] == 0 ) {
465     pdone = 1;
466     pshit[se][pl]++ ;
467     if ( (ce->stwerr[se] & (1 << 4)) == 0 ) lalarm[se]++;
468     lver[se][2]++ ;
469     };
470     };
471     if ( ce->dexy[l][ii][kk] > 0 && ce->dexy[l][ii][kk] < 32000 ) {
472     rshit[se][pl]++ ;
473     rawdata = 1;
474     };
475     Dexy->Fill(ce->dexy[l][ii][kk]);
476     if ( ce->dexy[l][ii][kk] < 2000. || ce->dexy[l][ii][kk] > 5000. ) {
477     outdexy++;
478     } else {
479     indexy++;
480     };
481     };
482     };
483     };
484     };
485     cshit = 0;
486     for (Int_t k = 0; k < 4 ; k++ ){
487     isCOMP = 0;
488     isFULL = 0;
489     if ( ce->stwerr[se] & (1 << 16) ) isCOMP = 1;
490     if ( ce->stwerr[se] & (1 << 17) ) isFULL = 1;
491     if ( isCOMP ) ver[k][16]++;
492     if ( isFULL ) ver[k][17]++;
493     cshit += (int)ce->calstriphit[k];
494     cestw=0;
495     if ( ce->stwerr[k] ) cestw = ce->stwerr[k] & cmask ;
496     if ( cestw ){
497     if ( cestw & (1 << 0) ) ver[k][6]++ ;
498     if ( cestw & (1 << 1) ) ver[k][5]++ ;
499     if ( cestw & (1 << 2) ) ver[k][4]++ ;
500     if ( cestw & (1 << 3) ) ver[k][3]++ ;
501     if ( cestw & (1 << 4) ) ver[k][2]++ ;
502     if ( cestw & (1 << 5) ) ver[k][1]++ ;
503     if ( cestw & (1 << 6) ) ver[k][0]++ ;
504     };
505     if ( ce->perror[k] != 0. ){
506     if (ce->perror[k] == 128) ver[k][7]++ ;
507     if (ce->perror[k] == 129) ver[k][8]++ ;
508     if (ce->perror[k] == 132) ver[k][11]++ ;
509     if (ce->perror[k] == 133) ver[k][12]++ ;
510     if (ce->perror[k] == 134) ver[k][13]++ ;
511     if (ce->perror[k] == 135) ver[k][14]++ ;
512     if (ce->perror[k] == 136) ver[k][15]++ ;
513     if (ce->perror[k] == 139) ver[k][18]++ ;
514     if (ce->perror[k] == 140) ver[k][19]++ ;
515     if (ce->perror[k] == 141) ver[k][20]++ ;
516     if (ce->perror[k] == 142) ver[k][22]++ ;
517     };
518     for (Int_t kk = 0; kk < 11 ; kk++ ){
519     tshit += shit[k][kk];
520     trshit += rshit[k][kk];
521     };
522     };
523     Calstriphit->Fill(cshit);
524     if ( (cshit > 0 && cshit < 25) || (cshit > 40 && cshit < 80) ){
525     incshit++;
526     } else {
527     outcshit++;
528     };
529     if ( tshit>0 ) h1->Fill(tshit);
530     if ( (tshit > 0 && tshit < 25) || (tshit > 40 && tshit < 80) ){
531     intshit++;
532     } else {
533     outtshit++;
534     };
535     if ( trshit>0 ) {
536     h1r->Fill(trshit);
537     if ( trshit < 4210 ){
538     h1rcheck = true;
539     // printf("ma come... trshit %i \n",trshit);
540     };
541     };
542     if ( i%1000 == 0 && i > 0 ) printf("%iK\n",i/1000);
543     i++;
544     };
545     printf("\n");
546    
547     //
548     // output figures, first sheet:
549     //
550     gStyle->SetOptDate(0);
551     gStyle->SetOptStat(1111);
552     TCanvas *figura = new TCanvas("Calorimeter_Detector_Report_1/3", "Calorimeter_Detector_Report_1/3", 1100, 900);
553     figura->SetFillColor(10);
554     figura->Range(0,0,100,100);
555     errore.str("");
556     errore << "EXPERT -- File: " << file;
557     errore << " ";
558     TLatex *t=new TLatex();
559     t->SetTextFont(32);
560     t->SetTextColor(1);
561     t->SetTextAlign(12);
562     t->SetTextSize(0.015);
563     t->DrawLatex(2.,99.,errore.str().c_str());
564     TPad *pd5;
565     TPad *pd6;
566     TPad *pad1;
567     TPad *pad2;
568     TPad *pad3;
569     TPad *pad4;
570     TPad *pd1;
571     TPad *pd2;
572     TPad *pd3;
573     TPad *pd4;
574     //
575     Double_t h1max;
576     TPolyLine *banda1;
577     TPolyLine *banda2;
578     Float_t ctshit = 0;
579     Float_t ccshit = 0;
580     Float_t cbase = 0;
581     Float_t cdexy = 0;
582     Float_t cdexyc = 0;
583     //
584     if ( compdata && rawdata ){
585     ctshit = (float)intshit/((float)outtshit + (float)intshit);
586     Int_t pd5col = 10;
587     Int_t pd6col = 10;
588     if ( ctshit < ctshitthr ) {
589     check = true;
590     pd5col = 45;
591     };
592     if ( h1rcheck ) {
593     check = true;
594     pd6col = 45;
595     };
596     pd5 = new TPad("pd5","This is pad5",0.51,0.51,0.98,0.98,pd5col);
597     pd6 = new TPad("pd6","This is pad6",0.51,0.02,0.98,0.49,pd6col);
598     pd5->SetTicks();
599     pd6->SetTicks();
600     pd5->Range(0,0,100,100);
601     pd6->Range(0,0,100,100);
602     figura->cd();
603     pd5->Draw();
604     pd5->cd();
605     h1->SetXTitle("Number of hit (dexyc>0)");
606     h1->SetYTitle("Number of events");
607     h1->Draw();
608     //
609     h1max = h1->GetMaximum()*1.05;
610     Double_t xc[4] = {0.,25.,25.,0.};
611     Double_t yc[4] = {0.,0.,h1max,h1max};
612     banda1 = new TPolyLine(4,xc,yc);
613     banda1->SetLineColor(5);
614     banda1->SetFillColor(5);
615     banda1->SetLineWidth(1);
616     banda1->Draw("fSAME");
617     Double_t xd[4] = {40.,80.,80.,40.};
618     Double_t yd[4] = {0.,0.,h1max,h1max};
619     banda2 = new TPolyLine(4,xd,yd);
620     banda2->SetLineColor(5);
621     banda2->SetFillColor(5);
622     banda2->SetLineWidth(1);
623     banda2->Draw("fSAME");
624     h1->Draw("SAME");
625     //
626     figura->cd();
627     pd6->Draw();
628     pd6->cd();
629     gPad->SetLogy();
630     h1r->SetXTitle("Number of hit (dexy>0)");
631     h1r->SetYTitle("Number of events");
632     h1r->Draw();
633     h1max = h1r->GetMaximum()*2.05;
634     Double_t xg[4] = {4220.,4230.,4230.,4220.};
635     Double_t yg[4] = {0.,0.,h1max,h1max};
636     banda1 = new TPolyLine(4,xg,yg);
637     banda1->SetLineColor(5);
638     banda1->SetFillColor(5);
639     banda1->SetLineWidth(1);
640     banda1->Draw("fSAME");
641     h1r->Draw("SAME");
642     };
643     if ( (compdata && !rawdata) || (!compdata && rawdata) ){
644     if ( tshit !=0 ) {
645     ctshit = (float)intshit/((float)outtshit + (float)intshit);
646     Int_t pd5col = 10;
647     if ( ctshit < ctshitthr ) {
648     check = true;
649     pd5col = 45;
650     };
651     pd5 = new TPad("pd5","This is pad5",0.51,0.02,0.98,0.98,pd5col);
652     pd5->Range(0,0,100,100);
653     pd5->SetTicks();
654     pd5->Draw();
655     pd5->cd();
656     h1->SetXTitle("Number of hit (dexyc>0)");
657     h1->SetYTitle("Number of events");
658     h1->Draw();
659     h1max = h1->GetMaximum()*1.05;
660     Double_t xe[4] = {0.,25.,25.,0.};
661     Double_t ye[4] = {0.,0.,h1max,h1max};
662     banda1 = new TPolyLine(4,xe,ye);
663     banda1->SetLineColor(5);
664     banda1->SetFillColor(5);
665     banda1->SetLineWidth(1);
666     banda1->Draw("fSAME");
667     Double_t xf[4] = {40.,80.,80.,40.};
668     Double_t yf[4] = {0.,0.,h1max,h1max};
669     banda2 = new TPolyLine(4,xf,yf);
670     banda2->SetLineColor(5);
671     banda2->SetFillColor(5);
672     banda2->SetLineWidth(1);
673     banda2->Draw("fSAME");
674     h1->Draw("SAME");
675     };
676     if ( trshit !=0 ) {
677     Int_t pd5col = 10;
678     if ( h1rcheck ) {
679     check = true;
680     pd5col = 45;
681     };
682     pd5 = new TPad("pd5","This is pad5",0.51,0.02,0.98,0.98,pd5col);
683     pd5->Range(0,0,100,100);
684     pd5->SetTicks();
685     pd5->Draw();
686     pd5->cd();
687     gPad->SetLogy();
688     h1r->SetXTitle("Number of hit (dexyc>0 or dexy>0)");
689     h1r->SetYTitle("Number of events");
690     h1r->Draw();
691     h1max = h1r->GetMaximum()*2.05;
692     Double_t xh[4] = {4220.,4230.,4230.,4220.};
693     Double_t yh[4] = {0.,0.,h1max,h1max};
694     banda1 = new TPolyLine(4,xh,yh);
695     banda1->SetLineColor(5);
696     banda1->SetFillColor(5);
697     banda1->SetLineWidth(1);
698     banda1->Draw("fSAME");
699     h1r->Draw("SAME");
700     };
701     };
702     if ( !errorfull ) {
703     if ( calevn1 || calevn2 || calevn3 ) {
704     pd1 = new TPad("pd1","This is pad1",0.02,0.51,0.24,0.98,45);
705     pd2 = new TPad("pd2","This is pad2",0.26,0.51,0.49,0.98,45);
706     pd3 = new TPad("pd3","This is pad3",0.02,0.02,0.24,0.49,45);
707     pd4 = new TPad("pd4","This is pad4",0.26,0.02,0.49,0.49,45);
708     figura->cd();
709     // printf("ou2! \n");
710     check = true;
711     pd1->Range(0,0,100,100);
712     pd2->Range(0,0,100,100);
713     pd3->Range(0,0,100,100);
714     pd4->Range(0,0,100,100);
715     pd1->Draw();
716     pd2->Draw();
717     pd3->Draw();
718     pd4->Draw();
719    
720     pd1->cd();
721     gPad->SetLogy();
722     calev01->SetXTitle("delta calevnum 1-2");
723     calev01->SetYTitle("Number of events");
724     calev01->Draw();
725    
726     pd2->cd();
727     gPad->SetLogy();
728     calev23->SetXTitle("delta calevnum 3-4");
729     calev23->SetYTitle("Number of events");
730     calev23->Draw();
731    
732     pd3->cd();
733     gPad->SetLogy();
734     calev03->SetXTitle("delta calevnum 1-4");
735     calev03->SetYTitle("Number of events");
736     calev03->Draw();
737    
738     pd4->cd();
739     calev2->SetYTitle("calevnum 2");
740     calev2->SetXTitle("iev");
741     calev2->Draw();
742     } else {
743     if ( calevn4 ) {
744     pd3 = new TPad("pd3","This is pad3",0.02,0.02,0.49,0.98,10);
745     figura->cd();
746     pd3->Range(0,0,100,100);
747     pd3->Draw();
748     pd3->cd();
749     calev2->SetYTitle("calevnum 2");
750     calev2->SetXTitle("iev");
751     calev2->Draw();
752     } else {
753     figura->cd();
754     t=new TLatex();
755     t->SetTextFont(32);
756     t->SetTextColor(1);
757     t->SetTextSize(0.04);
758     t->SetTextAlign(12);
759     t->DrawLatex(10.,49.,"No calevnum infos from DSP");
760     };
761     };
762     } else {
763     figura->cd();
764     check = true;
765     // printf("nou! \n");
766     pd1 = new TPad("pd1","This is pad1",0.02,0.02,0.49,0.98,45);
767     pd1->Range(0,0,100,100);
768     pd1->Draw();
769     pd1->cd();
770     gPad->SetLogy();
771     hdiff->SetXTitle("Differences in FULL mode");
772     hdiff->SetYTitle("Number of events");
773     hdiff->Draw();
774     };
775    
776     //
777     // output figures, second sheet:
778     //
779     TCanvas *figura2 = new TCanvas("Calorimeter_Detector_Report_2/3","Calorimeter_Detector_Report_2/3", 1100, 900);
780     if ( compdata ){
781     Int_t pd1col = 10;
782     Int_t pd2col = 10;
783     Int_t pd3col = 10;
784     Int_t pd4col = 10;
785     if ( (outdexy+indexy) ) {
786     cdexy = (float)indexy/((float)outdexy + (float)indexy);
787     if ( cdexy < cdexythr ) {
788     check = true;
789     pd4col = 45;
790     };
791     };
792     if ( (outcshit+incshit) ) {
793     ccshit = (float)incshit/((float)outcshit + (float)incshit);
794     if ( ccshit < ctshitthr ) {
795     check = true;
796     pd3col = 45;
797     };
798     };
799     if ( (outdexyc+indexyc) ) {
800     cdexyc = (float)indexyc/((float)outdexyc + (float)indexyc);
801     if ( cdexyc < cdexycthr ) {
802     check = true;
803     pd2col = 45;
804     };
805     };
806     if ( (outbase+inbase) ) {
807     cbase = (float)inbase/((float)outbase + (float)inbase);
808     if ( cbase < cbasethr ) {
809     check = true;
810     pd1col = 45;
811     };
812     };
813     figura2->SetFillColor(10);
814     figura2->Range(0,0,100,100);
815     errore.str("");
816     errore << "EXPERT -- File: " << file;
817     errore << " ";
818     t=new TLatex();
819     t->SetTextFont(32);
820     t->SetTextColor(1);
821     t->SetTextAlign(12);
822     t->SetTextSize(0.015);
823     t->DrawLatex(2.,99.,errore.str().c_str());
824     pd1 = new TPad("pd1","This is pad1",0.02,0.51,0.49,0.98,pd1col);
825     pd2 = new TPad("pd2","This is pad2",0.51,0.51,0.98,0.98,pd2col);
826     pd3 = new TPad("pd3","This is pad3",0.02,0.02,0.49,0.49,pd3col);
827     pd4 = new TPad("pd4","This is pad4",0.51,0.02,0.98,0.49,pd4col);
828     figura2->cd();
829     pd1->Range(0,0,100,100);
830     pd2->Range(0,0,100,100);
831     pd3->Range(0,0,100,100);
832     pd4->Range(0,0,100,100);
833     pd1->SetTicks();
834     pd2->SetTicks();
835     pd3->SetTicks();
836     pd4->SetTicks();
837     pd1->Draw();
838     pd2->Draw();
839     pd3->Draw();
840     pd4->Draw();
841     pd1->cd();
842     Baseline->SetXTitle("ADC channels");
843     Baseline->SetYTitle("Number of events");
844     Baseline->Draw();
845     h1max = Baseline->GetMaximum()*1.05;
846     Double_t xc[4] = {2000.,4500.,4500.,2000.};
847     Double_t yc[4] = {0.,0.,h1max,h1max};
848     banda1 = new TPolyLine(4,xc,yc);
849     banda1->SetLineColor(5);
850     banda1->SetFillColor(5);
851     banda1->SetLineWidth(1);
852     banda1->Draw("fSAME");
853     Baseline->Draw("SAME");
854     //
855     pd2->cd();
856     gPad->SetLogy();
857     Dexyc->SetXTitle("ADC channels");
858     Dexyc->SetYTitle("Number of events");
859     Dexyc->Draw();
860     h1max = Dexyc->GetMaximum()*2.05;
861     Double_t xe[4] = {2000.,5000.,5000.,2000.};
862     Double_t ye[4] = {0.,0.,h1max,h1max};
863     banda1 = new TPolyLine(4,xe,ye);
864     banda1->SetLineColor(5);
865     banda1->SetFillColor(5);
866     banda1->SetLineWidth(1);
867     banda1->Draw("fSAME");
868     Double_t xj[4] = {0.,40.,40.,0.};
869     Double_t yj[4] = {0.,0.,h1max,h1max};
870     banda2 = new TPolyLine(4,xj,yj);
871     banda2->SetLineColor(5);
872     banda2->SetFillColor(5);
873     banda2->SetLineWidth(1);
874     banda2->Draw("fSAME");
875     Dexyc->Draw("SAME");
876     //
877     pd3->cd();
878     Calstriphit->SetXTitle("Number of hit");
879     Calstriphit->SetYTitle("Number of events");
880     Calstriphit->Draw();
881     h1max = Calstriphit->GetMaximum()*1.05;
882     Double_t xg[4] = {0.,25.,25.,0.};
883     Double_t yg[4] = {0.,0.,h1max,h1max};
884     banda1 = new TPolyLine(4,xg,yg);
885     banda1->SetLineColor(5);
886     banda1->SetFillColor(5);
887     banda1->SetLineWidth(1);
888     banda1->Draw("fSAME");
889     Double_t xh[4] = {40.,80.,80.,40.};
890     Double_t yh[4] = {0.,0.,h1max,h1max};
891     banda2 = new TPolyLine(4,xh,yh);
892     banda2->SetLineColor(5);
893     banda2->SetFillColor(5);
894     banda2->SetLineWidth(1);
895     banda2->Draw("fSAME");
896     Calstriphit->Draw("SAME");
897     //
898     pd4->cd();
899     Dexy->SetXTitle("ADC channels");
900     Dexy->SetYTitle("Number of events");
901     Dexy->Draw();
902     h1max = Dexy->GetMaximum()*1.05;
903     Double_t xd[4] = {2000.,5000.,5000.,2000.};
904     Double_t yd[4] = {0.,0.,h1max,h1max};
905     banda1 = new TPolyLine(4,xd,yd);
906     banda1->SetLineColor(5);
907     banda1->SetFillColor(5);
908     banda1->SetLineWidth(1);
909     banda1->Draw("fSAME");
910     Dexy->Draw("SAME");
911     } else {
912     Int_t pd4col = 10;
913     if ( (outdexy+indexy) ) {
914     cdexy = (float)indexy/((float)outdexy + (float)indexy);
915     if ( cdexy < cdexythr ) {
916     check = true;
917     pd4col = 45;
918     };
919     };
920     figura2->SetFillColor(10);
921     figura2->Range(0,0,100,100);
922     errore.str("");
923     errore << "EXPERT -- File: " << file;
924     errore << " ";
925     t=new TLatex();
926     t->SetTextFont(32);
927     t->SetTextColor(1);
928     t->SetTextAlign(12);
929     t->SetTextSize(0.015);
930     t->DrawLatex(2.,99.,errore.str().c_str());
931     pd4 = new TPad("pd4","This is pad4",0.02,0.02,0.98,0.98,pd4col);
932     figura2->cd();
933     pd4->Range(0,0,100,100);
934     pd4->SetTicks();
935     pd4->Draw();
936     //
937     pd4->cd();
938     Dexy->SetXTitle("ADC channels");
939     Dexy->SetYTitle("Number of events");
940     Dexy->Draw();
941     h1max = Dexy->GetMaximum()*1.05;
942     Double_t xd[4] = {2000.,5000.,5000.,2000.};
943     Double_t yd[4] = {0.,0.,h1max,h1max};
944     banda1 = new TPolyLine(4,xd,yd);
945     banda1->SetLineColor(5);
946     banda1->SetFillColor(5);
947     banda1->SetLineWidth(1);
948     banda1->Draw("fSAME");
949     Dexy->Draw("SAME");
950     };
951     //
952     // output figures, report sheet:
953     //
954     TCanvas *rapporto= new TCanvas("Calorimeter_Detector_Report_3/3", "Calorimeter_Detector_Report_3/3", 1100, 900);
955     rapporto->SetFillColor(10);
956     rapporto->Range(0,0,100,100);
957     t=new TLatex();
958     t->SetTextFont(32);
959     t->SetTextColor(1);
960     t->SetTextSize(0.05);
961     t->SetTextAlign(12);
962     // t->DrawLatex(33.,95.,"Calorimeter quick look: ");
963     errore.str("");
964     errore << "BASIC: C1 - File: " << file;
965     errore << " ";
966     t->SetTextSize(0.02);
967     t->DrawLatex(2.,99.,errore.str().c_str());
968    
969     pad1 = new TPad("pad1","This is pad1",0.02,0.47,0.49,0.90,19);
970     pad2 = new TPad("pad2","This is pad2",0.51,0.47,0.98,0.90,19);
971     pad3 = new TPad("pad3","This is pad3",0.02,0.02,0.49,0.45,19);
972     pad4 = new TPad("pad4","This is pad4",0.51,0.02,0.98,0.45,19);
973     pad1->Range(0,0,100,100);
974     pad2->Range(0,0,100,100);
975     pad3->Range(0,0,100,100);
976     pad4->Range(0,0,100,100);
977    
978     pad1->Draw();
979     pad2->Draw();
980     pad3->Draw();
981     pad4->Draw();
982    
983     for (Int_t i = 0; i < 4; i++){
984     if (i == 2)
985     {
986     pad1->cd() ;
987     sezione = "** Section YE (x even) **";
988     }
989     if (i == 3)
990     {
991     pad2->cd();
992     sezione = "** Section YO (x odd) **";
993     }
994     if (i == 0)
995     {
996     pad3->cd();
997     sezione = "** Section XE (y odd) **";
998     }
999     if (i == 1)
1000     {
1001     pad4->cd();
1002     sezione = "** Section XO (y even) **";
1003     }
1004     t->SetTextFont(32);
1005     t->SetTextColor(1);
1006     t->SetTextSize(0.05);
1007     t->SetTextAlign(12);
1008     t->DrawLatex(33.,97.,sezione);
1009     t->SetTextSize(0.05);
1010     for (Int_t j = 0; j < 23; j++){
1011     if ( ver[i][j] || lver[i][j] ) {
1012     t->SetTextColor(50);
1013     if (j == 0) {
1014     errore.str("");
1015     errore << "* DSP ack error: " << ver[i][j];
1016     errore << " time(s)";
1017     t->DrawLatex(2.,30.,errore.str().c_str());
1018     check = true;
1019     }
1020     if (j == 1) {
1021     errore.str("");
1022     errore << "* Temperature alarm: " << ver[i][j];
1023     errore << " time(s)";
1024     t->DrawLatex(2.,74.,errore.str().c_str());
1025     check = true;
1026     }
1027     if (j == 2) {
1028     if ( lalarm[i] ){
1029     errore.str("");
1030     errore << "* Latch up: " << ver[i][j];
1031     errore << " (" << lalarm[i];
1032     errore << " NOT rec!): ";
1033     t->DrawLatex(0.,70.,errore.str().c_str());
1034     check = true;
1035     } else {
1036     errore.str("");
1037     errore << "* Latch up alarm: " << ver[i][j];
1038     errore << " time(s). View(s): ";
1039     t->DrawLatex(2.,70.,errore.str().c_str());
1040     check = true;
1041     };
1042     errore.str("");
1043     errore << "(" << lver[i][j];
1044     errore << " view(s))";
1045     t->DrawLatex(27.,65.,errore.str().c_str());
1046     Float_t inc=1.;
1047     for (Int_t e = 0; e < 11; e++){
1048     if ( pshit[i][e] ) {
1049     errore.str("");
1050     errore << " " << (e+1);
1051     errore << " ";
1052     t->DrawLatex(52.+inc,69.,errore.str().c_str());
1053     Int_t numer = pshit[i][e];
1054     errore.str("");
1055     errore << " (" << numer;
1056     errore << ") ";
1057     t->SetTextAngle(-70);
1058     t->DrawLatex(55.+inc,67.,errore.str().c_str());
1059     t->SetTextAngle(0);
1060     inc += 4.;
1061     }
1062     }
1063     }
1064     if (j == 3) {
1065     errore.str("");
1066     errore << "RAW mode: " << ver[i][j];
1067     errore << " time(s)";
1068     t->SetTextColor(32);
1069     t->DrawLatex(2.,90.,errore.str().c_str());
1070     }
1071     if (j == 4) {
1072     errore.str("");
1073     errore << "* CMD length error: " << ver[i][j];
1074     errore << " time(s)";
1075     t->DrawLatex(2.,66.,errore.str().c_str());
1076     check = true;
1077     }
1078     if (j == 5) {
1079     errore.str("");
1080     errore << "* Execution error: " << ver[i][j];
1081     errore << " time(s)";
1082     t->DrawLatex(2.,62.,errore.str().c_str());
1083     check = true;
1084     }
1085     if (j == 6) {
1086     errore.str("");
1087     errore << "* CRC error (st. word): " << ver[i][j];
1088     errore << " time(s)";
1089     t->DrawLatex(2.,58.,errore.str().c_str());
1090     check = true;
1091     }
1092     if (j == 7) {
1093     errore.str("");
1094     errore << "View or command not recognized: " << ver[i][j];
1095     errore << " time(s)";
1096     t->DrawLatex(2.,54.,errore.str().c_str());
1097     check = true;
1098     }
1099     if (j == 8) {
1100     errore.str("");
1101     errore << "Missing section: " << ver[i][j];
1102     errore << " time(s)";
1103     t->DrawLatex(2.,50.,errore.str().c_str());
1104     check = true;
1105     }
1106     if (j == 10) {
1107     errore.str("");
1108     errore << "Calevnum jump: " << ver[i][j];
1109     errore << " time(s)";
1110     t->DrawLatex(2.,42.,errore.str().c_str());
1111     check = true;
1112     }
1113     if (j == 11) {
1114     errore.str("");
1115     errore << "CRC error (data): " << ver[i][j];
1116     errore << " time(s)";
1117     t->DrawLatex(2.,38.,errore.str().c_str());
1118     check = true;
1119     }
1120     if (j == 12) {
1121     errore.str("");
1122     errore << "Length problems in RAW mode: " << ver[i][j];
1123     errore << " time(s)";
1124     t->DrawLatex(2.,34.,errore.str().c_str());
1125     check = true;
1126     }
1127     if (j == 13) {
1128     errore.str("");
1129     errore << "Length problems in COMPRESS mode: " << ver[i][j];
1130     errore << " time(s)";
1131     t->DrawLatex(2.,34.,errore.str().c_str());
1132     check = true;
1133     }
1134     if (j == 14) {
1135     errore.str("");
1136     errore << "Length problems in FULL mode: " << ver[i][j];
1137     errore << " time(s)";
1138     t->DrawLatex(2.,26.,errore.str().c_str());
1139     check = true;
1140     }
1141     if (j == 15) {
1142     errore.str("");
1143     errore << "Acquisition mode problems: " << ver[i][j];
1144     errore << " time(s)";
1145     t->DrawLatex(2.,22.,errore.str().c_str());
1146     check = true;
1147     }
1148     if (j == 16) {
1149     errore.str("");
1150     errore << "COMPRESS mode: " << ver[i][j];
1151     errore << " time(s)";
1152     t->SetTextColor(32);
1153     t->DrawLatex(2.,86.,errore.str().c_str());
1154     }
1155     if (j == 17) {
1156     errore.str("");
1157     errore << "FULL mode: " << ver[i][j];
1158     errore << " time(s)";
1159     t->SetTextColor(32);
1160     t->DrawLatex(2.,82.,errore.str().c_str());
1161     }
1162     if (j == 18) {
1163     errore.str("");
1164     errore << "Problems with coding: " << ver[i][j];
1165     errore << " time(s)";
1166     t->DrawLatex(2.,18.,errore.str().c_str());
1167     check = true;
1168     }
1169     if (j == 19) {
1170     errore.str("");
1171     errore << "Pedestal checksum wrong: " << ver[i][j];
1172     errore << " time(s)";
1173     t->DrawLatex(2.,14.,errore.str().c_str());
1174     check = true;
1175     }
1176     if (j == 20) {
1177     errore.str("");
1178     errore << "Thresholds checksum wrong: " << ver[i][j];
1179     errore << " time(s)";
1180     t->DrawLatex(2.,10.,errore.str().c_str());
1181     check = true;
1182     }
1183     if (j == 21) {
1184     errore.str("");
1185     errore << "WARNING! DEXYC < 0: " << ver[i][j];
1186     errore << " time(s)";
1187     t->DrawLatex(2.,6.,errore.str().c_str());
1188     check = true;
1189     }
1190     if (j == 22) {
1191     errore.str("");
1192     errore << "Packet length is zero (YODA input error), skipped: " << ver[i][j];
1193     errore << " time(s)";
1194     t->DrawLatex(2.,3.,errore.str().c_str());
1195     check = true;
1196     };
1197     };
1198     };
1199     t->SetTextColor(50);
1200     if ( fulldiff[i] !=0 ) {
1201     check = true;
1202     errore.str("");
1203     errore << "Full mode, differences between RAW and COMPRESS mode: " << fulldiff[i];
1204     errore << " time(s)";
1205     t->DrawLatex(2.,46.,errore.str().c_str());
1206     };
1207     if ( cpre[i] !=0 ) {
1208     errore.str("");
1209     errore << "Preamplifier fully transmitted: " << cpre[i];
1210     errore << " time(s)";
1211     t->SetTextColor(32);
1212     t->DrawLatex(2.,78.,errore.str().c_str());
1213     };
1214     };
1215     rapporto->cd();
1216     t->SetTextFont(32);
1217     t->SetTextColor(1);
1218     t->SetTextSize(0.05);
1219     t->SetTextAlign(12);
1220     t->DrawLatex(22.,95.,"Calorimeter quick look: ");
1221     //printf("check %i \n",check);
1222     if ( check ){
1223     t->SetTextColor(50);
1224     t->DrawLatex(60.,95.," WARNING, CHECK! ");
1225     printf("cdexyc %f cdexy %f ctshit %f cbase %f \n",cdexyc,cdexy,ctshit,cbase);
1226     } else {
1227     t->SetTextColor(32);
1228     t->DrawLatex(60.,95.," OK! ");
1229     };
1230     //
1231     const string fil = (const char*)filename;
1232     Int_t posiz = fil.find("dw_");
1233     if ( posiz == -1 ) posiz = fil.find("DW_");
1234     Int_t posiz2 = posiz+13;
1235     TString file2;
1236     stringcopy(file2,filename,posiz,posiz2);
1237     //
1238     const char *figrec = file2;
1239     const char *outdir = outDir;
1240     stringstream figsave;
1241     stringstream figsave1;
1242     stringstream figsave2;
1243     const char *format = saveas;
1244     if ( !strcmp(format,"ps") ) {
1245     figsave.str("");
1246     figsave << outdir << "/" ;
1247     figsave << figrec << "_qlook.";
1248     figsave << format << "(";
1249     rapporto->Print(figsave.str().c_str(),"Landscape");
1250     figsave1.str("");
1251     figsave1 << outdir << "/" ;
1252     figsave1 << figrec << "_qlook.";
1253     figsave1 << format;
1254     figura->Print(figsave1.str().c_str(),"Landscape");
1255     figsave2.str("");
1256     figsave2 << outdir << "/" ;
1257     figsave2 << figrec << "_qlook.";
1258     figsave2 << format << ")";
1259     figura2->Print(figsave2.str().c_str(),"Landscape");
1260     } else {
1261     figsave.str("");
1262     figsave << outdir << "/" ;
1263     figsave << figrec << "_qlook1.";
1264     figsave << format;
1265     figura->SaveAs(figsave.str().c_str());
1266     figsave.str("");
1267     figsave << outdir << "/" ;
1268     figsave << figrec << "_qlook2.";
1269     figsave << format;
1270     figura2->SaveAs(figsave.str().c_str());
1271     figsave.str("");
1272     figsave << outdir << "/" ;
1273     figsave << figrec << "_qlook3.";
1274     figsave << format;
1275     rapporto->SaveAs(figsave.str().c_str());
1276     };
1277     }
1278    

  ViewVC Help
Powered by ViewVC 1.1.23