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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Mon Mar 20 13:40:44 2006 UTC (18 years, 8 months ago) by mocchiut
Branch: MAIN
CVS Tags: v1r04
Changes since 1.4: +3 -1 lines
Updated the operation manual

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

  ViewVC Help
Powered by ViewVC 1.1.23