/[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.8 - (hide annotations) (download)
Tue May 23 13:28:22 2006 UTC (18 years, 6 months ago) by mocchiut
Branch: MAIN
CVS Tags: v1r07
Changes since 1.7: +162 -9 lines
Small bug corrected and new 'expert' figures added

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

  ViewVC Help
Powered by ViewVC 1.1.23