/[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.6 - (hide annotations) (download)
Wed Mar 22 14:01:57 2006 UTC (18 years, 8 months ago) by mocchiut
Branch: MAIN
CVS Tags: v1r05
Changes since 1.5: +3 -1 lines
Documentation updated, small changes in lib names

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

  ViewVC Help
Powered by ViewVC 1.1.23