/[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.4 - (hide annotations) (download)
Mon Mar 20 11:52:33 2006 UTC (18 years, 8 months ago) by mocchiut
Branch: MAIN
Changes since 1.3: +3 -1 lines
Changed name of shared libraries from FCaloXXX_cxx.so to libFCaloXXX.so

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

  ViewVC Help
Powered by ViewVC 1.1.23