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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by mocchiut, Mon Mar 13 09:01:23 2006 UTC revision 1.18 by mocchiut, Fri Sep 29 06:22:43 2006 UTC
# Line 1  Line 1 
1  //  //
2  //   Check for possible errors and shows raw distribution of variables coming from the DSP (no calibrations needed) - Emiliano Mocchiutti  //   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.01  (2006-02-28)  //   FCaloQLOOK.c      version 1.14  (2006-09-29)
5  //  //
6  //   The only input needed is the path to the directory created by YODA for the data file you want to analyze.  //   The only input needed is the path to the directory created by YODA for the data file you want to analyze.
7  //  //
8  //   Changelog:  //   Changelog:
9  //  //
10    //   1.13 - 1.14 (2006-09-29): Flag the last entry in the txt file, count missing section when checking for DSP entries correspondence.
11    //
12    //   1.12 - 1.13 (2006-09-28): Give wrong number of events in compress mode, fixed.
13    //
14    //   1.11 - 1.12 (2006-09-22): Check for different number of events, put output in a file and write down errors for each event. Fixed jumpev bug.
15    //
16    //   1.09 - 1.11 (2006-07-17): Adapted to flight conditions.
17    //
18    //   1.07 - 1.09 (2006-05-29): Fixed bug in output filename when input is not in the form DW_YYMMDD_NNN. Bug in latchup alarm not coming from the status word, fixed.
19    //
20    //   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
21    //                             case of latchup alarm.
22    //
23    //   1.05 - 1.06 (2006-03-22): Add optimize flag in compiling the script!
24    //
25    //   1.04 - 1.05 (2006-03-22): Corrected wrong .C files.
26    //
27    //   1.03 - 1.04 (2006-03-20): Documentation updated.
28    //
29    //   1.02 - 1.03 (2006-03-20): Changed name of shared libraries (from FCaloQLOOK_cxx.so to libFCaloQLOOK.so).
30    //
31    //   1.01 - 1.02 (2006-03-13): Include files from YODA without "event" directory.
32    //
33  //   1.00 - 1.01 (2006-02-28): Works on YODA v6 output (single file), does not require anymore calocommon package.  //   1.00 - 1.01 (2006-02-28): Works on YODA v6 output (single file), does not require anymore calocommon package.
34  //  //
35  //   0.00 - 1.00 (2006-02-28): Clone of CaloQLOOK.c (ground software).  //   0.00 - 1.00 (2006-02-28): Clone of CaloQLOOK.c (ground software).
# Line 26  Line 49 
49  #include <TPolyLine.h>  #include <TPolyLine.h>
50  #include <TStyle.h>  #include <TStyle.h>
51  #include <TSystem.h>  #include <TSystem.h>
52    #include <TApplication.h>
53  //  //
54  #include <event/PamelaRun.h>  #include <PamelaRun.h>
55  #include <event/physics/calorimeter/CalorimeterEvent.h>  #include <physics/calorimeter/CalorimeterEvent.h>
56  //  //
57  #include <FCaloQLOOKfun.h>  #include <FCaloQLOOKfun.h>
58  //  //
# Line 52  void stringappend(TString& s1, const TSt Line 76  void stringappend(TString& s1, const TSt
76  }  }
77    
78  TString getFilename(const TString filename){  TString getFilename(const TString filename){
79    const string fil = (const char*)filename;    //
80    Int_t posiz = fil.find("dw_");    const string fil = gSystem->BaseName(filename.Data());
81    if ( posiz == -1 ) posiz = fil.find("DW_");    Int_t posiz = fil.find(".root");
82    if ( posiz == -1 ) return 0;    //
   Int_t posiz2 = posiz+13;  
83    TString file2;    TString file2;
84    stringcopy(file2,filename,posiz,posiz2);    if ( posiz == -1 ){
85    TString pdat(".dat");      file2 = gSystem->BaseName(filename.Data());
86    stringappend(file2,pdat);    } else {
87        Int_t posiz2 = 0;
88        stringcopy(file2,gSystem->BaseName(filename.Data()),posiz2,posiz);
89        TString pdat(".dat");
90        stringappend(file2,pdat);  
91      };
92    return file2;    return file2;
93  }  }
94    
95  void FCaloQLOOK(TString filename, Int_t fromevent=0, Int_t toevent=0, TString outDir="", TString saveas = "ps"){  void sighandler(UInt_t pkt_num, UInt_t obt, UInt_t entry, UInt_t section, UInt_t totev, Bool_t &evdone){
96      if ( !evdone ){    
97        printf("\n\n=================================================\n");
98        printf("PSCU-Pkt N. %u - OBT %u ms\n",pkt_num,obt);
99        printf("Total events %u\n",totev);
100        printf("(ROOT-tree entry %u )\n",entry);
101        if ( (totev-1) == entry ) printf("NOTICE: this is last entry! \n");
102        printf("=================================================\n");
103        evdone = true;
104      };
105      TString sec = "UNKNOWN";
106      if ( section == 0 ) sec = "XE";
107      if ( section == 1 ) sec = "XO";
108      if ( section == 2 ) sec = "YE";
109      if ( section == 3 ) sec = "YO";
110      printf(" Section %s (DSP n. %i) message: ",sec.Data(),section);
111    };
112    
113    void FCaloQLOOK(TString filename, Int_t fromevent=0, Int_t toevent=0, TString outDir="", TString saveas = "png", Bool_t iactive =false, Bool_t w4i=false){
114    gStyle->SetPaperSize(19.,25.);    gStyle->SetPaperSize(19.,25.);
115    const char* startingdir = gSystem->WorkingDirectory();    const char* startingdir = gSystem->WorkingDirectory();
116      //  printf(" basename is %s \n",gSystem->BaseName(filename.Data()));
117      //  printf(" getfilename is %s \n",getFilename(filename).Data());
118    if ( !strcmp(outDir.Data(),"") ) outDir = startingdir;    if ( !strcmp(outDir.Data(),"") ) outDir = startingdir;
119    //    //
120      TApplication *app = 0;
121      if ( iactive ) app = new TApplication("app",0,0);
122    //    //
123    ifstream myfile;    ifstream myfile;
124    myfile.open(filename.Data());    myfile.open(filename.Data());
# Line 91  void FCaloQLOOK(TString filename, Int_t Line 141  void FCaloQLOOK(TString filename, Int_t
141    Float_t ctshitthr = 0.65;    Float_t ctshitthr = 0.65;
142    Float_t cbasethr = 0.95;    Float_t cbasethr = 0.95;
143    Float_t cdexythr = 0.995;    Float_t cdexythr = 0.995;
144      //Float_t cdexythr = 0.90;
145    Float_t cdexycthr = 0.95;    Float_t cdexycthr = 0.95;
146      Float_t h1rth = 0.90;
147      Int_t calevnth = 13;
148    //    //
149    pamela::calorimeter::CalorimeterEvent *ce = 0;    pamela::calorimeter::CalorimeterEvent *ce = 0;
150    pamela::EventHeader *eh = 0;    pamela::EventHeader *eh = 0;
# Line 166  void FCaloQLOOK(TString filename, Int_t Line 219  void FCaloQLOOK(TString filename, Int_t
219    TH1F *calev01;    TH1F *calev01;
220    TH1F *calev23;    TH1F *calev23;
221    TH1F *calev03;    TH1F *calev03;
222      TH1F *lupstw[4];
223      TH1F *lup[4];
224    TH2D *calev2;    TH2D *calev2;
225    
226    h1 = new TH1F("C7","Strips hit, compress mode",100,0.,200.);    h1 = new TH1F("C7","Strips hit, compress mode",100,0.,200.);
# Line 175  void FCaloQLOOK(TString filename, Int_t Line 230  void FCaloQLOOK(TString filename, Int_t
230    hdiff->SetBit(TH1F::kCanRebin);    hdiff->SetBit(TH1F::kCanRebin);
231    Baseline = new TH1F("C9","baselines",100,0,3);    Baseline = new TH1F("C9","baselines",100,0,3);
232    Baseline->SetBit(TH1F::kCanRebin);    Baseline->SetBit(TH1F::kCanRebin);
233    Dexy = new TH1F("C12","dexy",100,0.,37000.);    Dexy = new TH1F("C12","dexy",100,0.,10000.);
234    Dexyc = new TH1F("C10","dexyc",100,0,3);    Dexy->SetBit(TH1F::kCanRebin);
235    Dexyc->SetBit(TH1F::kCanRebin);    Dexyc = new TH1F("C10","dexyc",100,-100.,37000.);
236    //  Dexyc->SetBit(TH1F::kCanRebin);
237    Calstriphit = new TH1F("C11","calstriphit[1:4]",100,0.,200.);    Calstriphit = new TH1F("C11","calstriphit[1:4]",100,0.,200.);
238            
239    calev01 = new TH1F("C3","|calevnum(1)-calevnum(2)|",100,0,1);    calev01 = new TH1F("C3","|calevnum(1)-calevnum(2)|",100,0,1);
# Line 188  void FCaloQLOOK(TString filename, Int_t Line 244  void FCaloQLOOK(TString filename, Int_t
244    calev03->SetBit(TH1F::kCanRebin);    calev03->SetBit(TH1F::kCanRebin);
245    calev2 = new TH2D("C2","calevnum(2)%iev",3000,0.,2.,100,0.,2.);    calev2 = new TH2D("C2","calevnum(2)%iev",3000,0.,2.,100,0.,2.);
246    calev2->SetBit(TH2D::kCanRebin);    calev2->SetBit(TH2D::kCanRebin);
247        
248      stringstream oss;
249      stringstream noss;
250      for ( Int_t i=0; i<4; i++){
251        oss.str("");
252        oss << "OBT stw latch up section " << i;
253        noss.str("");
254        noss << "C" << 21+i;
255        lupstw[i] = new TH1F(noss.str().c_str(),oss.str().c_str(),100,-1,1);
256        lupstw[i]->SetBit(TH1F::kCanRebin);
257        oss.str("");
258        oss << "OBT no stw latch up section " << i;
259        noss.str("");
260        noss << "C" << 25+i;
261        lup[i] = new TH1F(noss.str().c_str(),oss.str().c_str(),100,-1,1);
262        lup[i]->SetBit(TH1F::kCanRebin);
263      };
264    
265    //    //
266    // run over each event and take out some variables    // run over each event and take out some variables
267    //    //
# Line 236  void FCaloQLOOK(TString filename, Int_t Line 309  void FCaloQLOOK(TString filename, Int_t
309    Int_t pdone, bdone;    Int_t pdone, bdone;
310    pdone = 0;    pdone = 0;
311    bdone = 0;    bdone = 0;
312    bool isCOMP = 0;    bool isCOMP = false;
313    bool isFULL = 0;    bool isFULL = false;
314    bool isRAW = 0;    bool isRAW = false;
315    Int_t alldexy=0;    Int_t alldexy=0;
316    Int_t alldexy2=0;    Int_t alldexy2=0;
317    Int_t stri=0;    Int_t planebases=0;
318      //  Int_t stri=0;
319    Int_t fcheck = 0;    Int_t fcheck = 0;
320    Int_t cestw=0;    Int_t cestw=0;
321    Int_t cmask = 127 ;    Int_t cmask = 127 ;
# Line 256  void FCaloQLOOK(TString filename, Int_t Line 330  void FCaloQLOOK(TString filename, Int_t
330    fulldiff[1] = 0;    fulldiff[1] = 0;
331    fulldiff[2] = 0;    fulldiff[2] = 0;
332    fulldiff[3] = 0;      fulldiff[3] = 0;  
333    printf("\n Processed events: \n\n");    //  printf("\n Processed events: \n\n");
334      printf("\n Start processing: \n\n");
335    unsigned short int calev0=0;    unsigned short int calev0=0;
336    unsigned short int oldcalev0;    unsigned short int oldcalev0;
337    unsigned short int calev1=0;    unsigned short int calev1=0;
# Line 266  void FCaloQLOOK(TString filename, Int_t Line 341  void FCaloQLOOK(TString filename, Int_t
341    unsigned short int calev3=0;    unsigned short int calev3=0;
342    unsigned short int oldcalev3;    unsigned short int oldcalev3;
343    Int_t i = minevent;    Int_t i = minevent;
344    Float_t headc = 0.;    UInt_t headc = 0;
345    Float_t headco = 0.;    UInt_t headco = 0;
346    Bool_t h1rcheck = false;    Bool_t h1rcheck = false;
347      Int_t h1rin = 0;
348      Int_t h1rout = 0;
349    Int_t intshit = 0;    Int_t intshit = 0;
350    Int_t outtshit = 0;    Int_t outtshit = 0;
351    Int_t incshit = 0;    Int_t incshit = 0;
# Line 279  void FCaloQLOOK(TString filename, Int_t Line 356  void FCaloQLOOK(TString filename, Int_t
356    Int_t outdexy = 0;    Int_t outdexy = 0;
357    Int_t indexyc = 0;    Int_t indexyc = 0;
358    Int_t outdexyc = 0;    Int_t outdexyc = 0;
359      UInt_t obt = 0;
360      UInt_t minobt[4];
361      UInt_t maxobt[4];
362      UInt_t swminobt[4];
363      UInt_t swmaxobt[4];
364      Bool_t firstobt[4];
365      Bool_t swfirstobt[4];
366      for ( Int_t i = 0; i<4; i++){
367        minobt[i] = 0;
368        maxobt[i] = 0;
369        swminobt[i] = 0;
370        swmaxobt[i] = 0;
371        firstobt[i] = true;
372        swfirstobt[i] = true;
373      };
374      Bool_t evdone = false;
375      //
376    while ( i < maxevent+1){    while ( i < maxevent+1){
377        evdone = false;
378      tshit = 0;      tshit = 0;
379      trshit = 0;      trshit = 0;
380      tr->GetEntry(i);      tr->GetEntry(i);
# Line 288  void FCaloQLOOK(TString filename, Int_t Line 383  void FCaloQLOOK(TString filename, Int_t
383      ph = eh->GetPscuHeader();      ph = eh->GetPscuHeader();
384      headco = headc;      headco = headc;
385      headc = ph->GetCounter();      headc = ph->GetCounter();
386      calevn1 += (int)abs((int)(ce->calevnum[0]-ce->calevnum[1]));      obt = ph->GetOrbitalTime();
387      calevn2 += (int)abs((int)(ce->calevnum[2]-ce->calevnum[3]));      if ( (int)abs((int)(ce->calevnum[0]-ce->calevnum[1])) ) calevn1++;
388      calevn3 += (int)abs((int)(ce->calevnum[0]-ce->calevnum[3]));      if ( (int)abs((int)(ce->calevnum[2]-ce->calevnum[3])) ) calevn2++;
389        if ( (int)abs((int)(ce->calevnum[0]-ce->calevnum[3])) ) calevn3++;
390      calev01->Fill(abs((int)(ce->calevnum[0]-ce->calevnum[1])));      calev01->Fill(abs((int)(ce->calevnum[0]-ce->calevnum[1])));
391      calev23->Fill(abs((int)(ce->calevnum[2]-ce->calevnum[3])));      calev23->Fill(abs((int)(ce->calevnum[2]-ce->calevnum[3])));
392      calev03->Fill(abs((int)(ce->calevnum[0]-ce->calevnum[3])));      calev03->Fill(abs((int)(ce->calevnum[0]-ce->calevnum[3])));
# Line 305  void FCaloQLOOK(TString filename, Int_t Line 401  void FCaloQLOOK(TString filename, Int_t
401      calevv2 = (int)ce->calevnum[2];      calevv2 = (int)ce->calevnum[2];
402      oldcalev3 = calev3;      oldcalev3 = calev3;
403      calev3 = (int)ce->calevnum[3];      calev3 = (int)ce->calevnum[3];
404      goto jumpprintout;      //    goto jumpprintout;
405      if ( (headc - headco -1.) == 0. && ((calev0 - oldcalev0 - 1) > 0 || (calev1 - oldcalev1 - 1) > 0 || (calevv2 - oldcalev2 - 1) > 0 || (calev3 - oldcalev3 - 1) > 0) ){      if ( (headc - headco -1) == 0. && ((calev0 - oldcalev0 - 1) > 0 || (calev1 - oldcalev1 - 1) > 0 || (calevv2 - oldcalev2 - 1) > 0 || (calev3 - oldcalev3 - 1) > 0) ){
406        if ( i != minevent ) {        if ( i != minevent ) {
407          printf(" %f 0 Event %i: %i\n",headco,i,oldcalev0);  //      printf(" %f 0 Event %i: %i\n",headco,i,oldcalev0);
408          printf(" %f 0 Event %i: %i\n",headc,i+1,calev0);            //      printf(" %f 0 Event %i: %i\n",headc,i+1,calev0);          
409          printf(" %f 1 Event %i: %i\n",headco,i,oldcalev1);  //      printf(" %f 1 Event %i: %i\n",headco,i,oldcalev1);
410          printf(" %f 1 Event %i: %i\n",headc,i+1,calev1);            //      printf(" %f 1 Event %i: %i\n",headc,i+1,calev1);          
411          printf(" %f 2 Event %i: %i\n",headco,i,oldcalev2);  //      printf(" %f 2 Event %i: %i\n",headco,i,oldcalev2);
412          printf(" %f 2 Event %i: %i\n",headc,i+1,calevv2);            //      printf(" %f 2 Event %i: %i\n",headc,i+1,calevv2);          
413          printf(" %f 3 Event %i: %i\n",headco,i,oldcalev3);  //      printf(" %f 3 Event %i: %i\n",headco,i,oldcalev3);
414          printf(" %f 3 Event %i: %i\n",headc,i+1,calev3);          //      printf(" %f 3 Event %i: %i\n",headc,i+1,calev3);        
415          isRAW = 0;          isRAW = 0;
416          if ( ce->stwerr[0] & (1 << 3)) isRAW = 1;                  if ( ce->stwerr[0] & (1 << 3)) isRAW = 1;        
417          if ( (calev0 - oldcalev0 - 1) > 0 && !isRAW && ce->perror[0] != 129 && oldcalev0 != 0) {          if ( (calev0 - oldcalev0 - 1) > 0 && !isRAW && ce->perror[0] != 129 && oldcalev0 != 0) {
418            ver[0][10]++;            ver[0][10]++;
419              sighandler(headc,obt,i,0,nevents,evdone);
420              printf(" jump in the counter calev is %i oldcalev was %i \n",calev0,oldcalev0);
421          };          };
422          isRAW = 0;          isRAW = 0;
423          if ( ce->stwerr[0] & (1 << 3)) isRAW = 1;                  if ( ce->stwerr[0] & (1 << 3)) isRAW = 1;        
424          if ( (calev1 - oldcalev1 - 1) > 0 && !isRAW && ce->perror[1] != 129 && oldcalev1 != 0 ){          if ( (calev1 - oldcalev1 - 1) > 0 && !isRAW && ce->perror[1] != 129 && oldcalev1 != 0 ){
425            ver[1][10]++;            ver[1][10]++;
426              sighandler(headc,obt,i,1,nevents,evdone);
427              printf(" jump in the counter calev is %i oldcalev was %i \n",calev1,oldcalev1);
428          };          };
429          isRAW = 0;          isRAW = 0;
430          if ( ce->stwerr[0] & (1 << 3)) isRAW = 1;                  if ( ce->stwerr[0] & (1 << 3)) isRAW = 1;        
431          if ( (calevv2 - oldcalev2 - 1) > 0 && !isRAW && ce->perror[2] != 129 && oldcalev2 != 0 ){          if ( (calevv2 - oldcalev2 - 1) > 0 && !isRAW && ce->perror[2] != 129 && oldcalev2 != 0 ){
432            ver[2][10]++;            ver[2][10]++;
433              sighandler(headc,obt,i,2,nevents,evdone);
434              printf(" jump in the counter calev is %i oldcalev was %i \n",calevv2,oldcalev2);
435          };          };
436          isRAW = 0;          isRAW = 0;
437          if ( ce->stwerr[0] & (1 << 3)) isRAW = 1;                  if ( ce->stwerr[0] & (1 << 3)) isRAW = 1;        
438          if ( (calev3 - oldcalev3 - 1) > 0 && !isRAW && ce->perror[3] != 129 && oldcalev3 != 0 ){          if ( (calev3 - oldcalev3 - 1) > 0 && !isRAW && ce->perror[3] != 129 && oldcalev3 != 0 ){
439            ver[3][10]++;            ver[3][10]++;
440              sighandler(headc,obt,i,3,nevents,evdone);
441              printf(" jump in the counter calev is %i oldcalev was %i \n",calev3,oldcalev3);
442          };          };
443        }        }
444      };      };
445    jumpprintout:      //  jumpprintout:
446      memcpy(shit, nullsh, sizeof(nullsh));      memcpy(shit, nullsh, sizeof(nullsh));
447      memcpy(rshit, nullsh, sizeof(nullsh));      memcpy(rshit, nullsh, sizeof(nullsh));
448      for (Int_t l = 0; l < 2; l++ ){      for (Int_t l = 0; l < 2; l++ ){
# Line 362  void FCaloQLOOK(TString filename, Int_t Line 466  void FCaloQLOOK(TString filename, Int_t
466            se = 1;            se = 1;
467            pl = (ii-1)/2;            pl = (ii-1)/2;
468            pdone = 0;            pdone = 0;
469          };          };              
470                            isCOMP = false;
471          isCOMP = 0;          isFULL = false;
472          isFULL = 0;          isRAW = false;
473          isRAW = 0;          if ( ce->stwerr[se] & (1 << 16) ) isCOMP = true;
474          if ( ce->stwerr[se] & (1 << 16) ) isCOMP = 1;          if ( ce->stwerr[se] & (1 << 17) ) isFULL = true;
475          if ( ce->stwerr[se] & (1 << 17) ) isFULL = 1;          if ( ce->stwerr[se] & (1 << 3) ) isRAW = true;
         if ( ce->stwerr[se] & (1 << 3) ) isRAW = 1;  
476          bl = -1;          bl = -1;
477          for (Int_t kk = 0; kk < 96 ; kk++ ){          for (Int_t kk = 0; kk < 96 ; kk++ ){
478            if ( kk%16 == 0 ){            if ( kk%16 == 0 ){
479              bdone = 0;              bdone = 0;
480              bl++;              bl++;
481              allbase = ce->base[l][ii][bl];              allbase = ce->base[l][ii][bl];
482                //      alldexy=0;
483                //      alldexy2=0;
484                //      stri=0;
485                //      for (Int_t e = 0; e < 16 ; e++ ){
486                //        stri = e + 16 * bl;
487                //        alldexy += (int)ce->dexyc[l][ii][stri];
488                //        alldexy2 += (int)ce->dexy[l][ii][stri];
489                //      };
490              };
491              //
492              if ( kk == 0 ){
493                planebases = 0;
494              alldexy=0;              alldexy=0;
495              alldexy2=0;              alldexy2=0;
496              stri=0;              for (Int_t e = 0; e < 96 ; e++ ){
497              for (Int_t e = 0; e < 16 ; e++ ){                if ( e < 6 ) planebases += (int)ce->base[l][ii][e];
498                stri = e + 16 * bl;                alldexy += (int)ce->dexyc[l][ii][e];
499                alldexy += (int)ce->dexyc[l][ii][stri];                alldexy2 += (int)ce->dexy[l][ii][e];
               alldexy2 += (int)ce->dexy[l][ii][stri];  
500              };              };
501            };            };
502              //
503            if ( !isRAW ) {            if ( !isRAW ) {
504              //              //
505              if ( !pdone ){              if ( !pdone ){
506                if ( (ce->base[l][ii][bl]>32000 || ce->base[l][ii][bl] == 0 ) && ( alldexy > 512000 ||  alldexy == 0) && ce->perror[se] == 0 ) {                //              if ( (ce->base[l][ii][bl]>32000 || ce->base[l][ii][bl] == 0 ) && ( alldexy > 512000 ||  alldexy == 0) && ce->perror[se] == 0 ) {
507                  if ( (planebases>192000 || planebases == 0 ) && ( alldexy > 3072000 ||  alldexy == 0) && ce->perror[se] == 0 ) {
508                  pdone = 1;                  pdone = 1;
509                  pshit[se][pl]++ ;                  pshit[se][pl]++ ;
510                  if ( (ce->stwerr[se] & (1 << 4)) == 0 ) lalarm[se]++;                  if ( (ce->stwerr[se] & (1 << 4)) == 0 ) {
511                  lver[se][2]++ ;                    lalarm[se]++;
512                      lup[se]->Fill(obt);
513                      if ( firstobt[se] ) minobt[se] = obt;
514                      if ( obt > maxobt[se] ) maxobt[se] = obt;
515                    };
516                    lver[se][2]++ ;        
517                    sighandler(headc,obt,i,se,nevents,evdone);
518                    printf(" latch up (data) in DSP mode alldexy %i planebases %i \n",alldexy,planebases);
519                };                };
520              }              }
521              //              //
# Line 436  void FCaloQLOOK(TString filename, Int_t Line 559  void FCaloQLOOK(TString filename, Int_t
559                indexyc++;                                            indexyc++;                            
560              };              };
561              //              //
562              if (ce->dexyc[l][ii][kk] < 0 ) ver[se][21]++ ;              if (ce->dexyc[l][ii][kk] < 0 ){
563                  ver[se][21]++ ;
564                  sighandler(headc,obt,i,se,nevents,evdone);
565                  printf(" negative ADC values!! ce->dexyc[%i][%i][%i] = %f \n",l,ii,kk,ce->dexyc[l][ii][kk]);
566                };
567              //              //
568              if ( allbase == 0. || allbase > 32000.) {              if ( allbase == 0. || allbase > 32000.) {
569                fcheck = 0;                fcheck = 0;
# Line 451  void FCaloQLOOK(TString filename, Int_t Line 578  void FCaloQLOOK(TString filename, Int_t
578              //              //
579            } else {            } else {
580              if ( !pdone ){              if ( !pdone ){
581                if ( (alldexy2>512000 || alldexy2 == 0) && ce->perror[se] == 0 ) {                if ( ( alldexy2 > 3072000 ||  alldexy2 == 0) && ce->perror[se] == 0 ) {
582                    //            if ( (alldexy2>512000 || alldexy2 == 0) && ce->perror[se] == 0 ) {
583                  pdone = 1;                  pdone = 1;
584                  pshit[se][pl]++ ;                                          pshit[se][pl]++ ;                        
585                  if ( (ce->stwerr[se] & (1 << 4)) == 0 ) lalarm[se]++;                  if ( (ce->stwerr[se] & (1 << 4)) == 0 ){
586                      lalarm[se]++;
587                      lup[se]->Fill(obt);
588                      if ( firstobt[se] ) minobt[se] = obt;
589                      if ( obt > maxobt[se] ) maxobt[se] = obt;
590                    };
591                  lver[se][2]++ ;                  lver[se][2]++ ;
592                    sighandler(headc,obt,i,se,nevents,evdone);
593                    printf(" latch up (data) in RAW mode alldexy2 %i \n",alldexy2);
594                };                };
595              };              };
596              if ( ce->dexy[l][ii][kk] > 0 && ce->dexy[l][ii][kk] < 32000 ) {              if ( ce->dexy[l][ii][kk] > 0 && ce->dexy[l][ii][kk] < 32000 ) {
# Line 474  void FCaloQLOOK(TString filename, Int_t Line 609  void FCaloQLOOK(TString filename, Int_t
609      };      };
610      cshit = 0;      cshit = 0;
611      for (Int_t k = 0; k < 4 ; k++ ){      for (Int_t k = 0; k < 4 ; k++ ){
612        isCOMP = 0;        isCOMP = false;
613        isFULL = 0;        isFULL = false;
614        if ( ce->stwerr[se] & (1 << 16) ) isCOMP = 1;        cestw=0;
615        if ( ce->stwerr[se] & (1 << 17) ) isFULL = 1;        if ( ce->stwerr[k] ) cestw =  ce->stwerr[k] & cmask ;
616          if ( ce->stwerr[k] & (1 << 16) && !(cestw & (1 << 3)) ) isCOMP = true;
617          if ( ce->stwerr[k] & (1 << 17) && !(cestw & (1 << 3)) ) isFULL = true;
618          //
619        if ( isCOMP ) ver[k][16]++;        if ( isCOMP ) ver[k][16]++;
620        if ( isFULL ) ver[k][17]++;        if ( isFULL ) ver[k][17]++;
621        cshit += (int)ce->calstriphit[k];        cshit += (int)ce->calstriphit[k];
       cestw=0;  
       if ( ce->stwerr[k] ) cestw =  ce->stwerr[k] & cmask ;  
622        if ( cestw ){        if ( cestw ){
623          if ( cestw & (1 << 0) ) ver[k][6]++ ;          if ( cestw & (1 << 0) ){
624          if ( cestw & (1 << 1) ) ver[k][5]++ ;            ver[k][6]++ ;
625          if ( cestw & (1 << 2) ) ver[k][4]++ ;            sighandler(headc,obt,i,k,nevents,evdone);
626          if ( cestw & (1 << 3) ) ver[k][3]++ ;            printf(" CRC error (st. word) \n");
627          if ( cestw & (1 << 4) ) ver[k][2]++ ;          };
628          if ( cestw & (1 << 5) ) ver[k][1]++ ;          if ( cestw & (1 << 1) ){
629          if ( cestw & (1 << 6) ) ver[k][0]++ ;                      ver[k][5]++ ;
630              sighandler(headc,obt,i,k,nevents,evdone);
631              printf(" execution error \n");
632            };
633            if ( cestw & (1 << 2) ){
634              ver[k][4]++ ;
635              sighandler(headc,obt,i,k,nevents,evdone);
636              printf(" CMD length error \n");
637            };
638            if ( cestw & (1 << 3) ) ver[k][3]++ ; // raw mode
639            if ( cestw & (1 << 4) ){
640              ver[k][2]++ ;
641              sighandler(headc,obt,i,k,nevents,evdone);
642              printf(" latch up alarm (st. word)\n");
643              lupstw[k]->Fill(obt);
644              if ( swfirstobt[k] ) swminobt[k] = obt;
645              if ( obt > swmaxobt[k] ) swmaxobt[k] = obt;
646            };
647            if ( cestw & (1 << 5) ){
648              ver[k][1]++ ;
649              sighandler(headc,obt,i,k,nevents,evdone);
650              printf(" temperature alarm  \n");
651            };
652            if ( cestw & (1 << 6) ){
653              ver[k][0]++ ;        
654              sighandler(headc,obt,i,k,nevents,evdone);
655              printf(" DSP ack error \n");
656            };
657        };        };
658          if (  ce->stwerr[k] == 0 && ce->perror[k] == 0 ) ver[k][8]++ ;
659        if ( ce->perror[k] != 0. ){        if ( ce->perror[k] != 0. ){
660          if (ce->perror[k] == 128) ver[k][7]++ ;          if (ce->perror[k] == 128){
661          if (ce->perror[k] == 129) ver[k][8]++ ;            ver[k][7]++ ;
662          if (ce->perror[k] == 132) ver[k][11]++ ;            sighandler(headc,obt,i,k,nevents,evdone);
663          if (ce->perror[k] == 133) ver[k][12]++ ;            printf(" view or command not recognized \n");
664          if (ce->perror[k] == 134) ver[k][13]++ ;          };
665          if (ce->perror[k] == 135) ver[k][14]++ ;          if (ce->perror[k] == 129){
666          if (ce->perror[k] == 136) ver[k][15]++ ;            ver[k][8]++ ;
667          if (ce->perror[k] == 139) ver[k][18]++ ;            sighandler(headc,obt,i,k,nevents,evdone);
668          if (ce->perror[k] == 140) ver[k][19]++ ;            printf(" missing section \n");
669          if (ce->perror[k] == 141) ver[k][20]++ ;          };
670          if (ce->perror[k] == 142) ver[k][22]++ ;          if (ce->perror[k] == 132){
671              ver[k][11]++ ;
672              if ( ver[k][11] < 30 ){
673                sighandler(headc,obt,i,k,nevents,evdone);
674                printf(" CRC error (data) \n");
675              };
676              if ( ver[k][11] == 30 ){
677                sighandler(headc,obt,i,k,nevents,evdone);
678                printf(" CRC error (data) \n");
679                printf(" WARNING TOO MANY CRC ERRORS ON DATA FOR THIS SECTION \n");
680                printf(" THEY WILL NOT BE DISPLAYED HERE ANYMORE FOR THIS FILE! \n");
681              };
682            };
683            if (ce->perror[k] == 133){
684              ver[k][12]++ ;
685              sighandler(headc,obt,i,k,nevents,evdone);
686              printf(" length problems in RAW mode \n");
687            };
688            if (ce->perror[k] == 134){
689              ver[k][13]++ ;
690              sighandler(headc,obt,i,k,nevents,evdone);
691              printf(" length problems in COMPRESS mode \n");
692            };
693            if (ce->perror[k] == 135){
694              ver[k][14]++ ;
695              sighandler(headc,obt,i,k,nevents,evdone);
696              printf(" length problems in FULL mode \n");
697            };
698            if (ce->perror[k] == 136){
699              ver[k][15]++ ;
700              sighandler(headc,obt,i,k,nevents,evdone);
701              printf(" acquisition mode problems \n");
702            };
703            if (ce->perror[k] == 139){
704              ver[k][18]++ ;
705              sighandler(headc,obt,i,k,nevents,evdone);
706              printf(" problems with coding\n");
707            };
708            if (ce->perror[k] == 140){
709              ver[k][19]++ ;
710              sighandler(headc,obt,i,k,nevents,evdone);
711              printf(" pedestal checksum wrong\n");
712            };
713            if (ce->perror[k] == 141){
714              ver[k][20]++ ;
715              sighandler(headc,obt,i,k,nevents,evdone);
716              printf(" thresholds checksum wrong\n");
717            };
718            if (ce->perror[k] == 142){
719              ver[k][22]++ ;
720              sighandler(headc,obt,i,k,nevents,evdone);
721              printf(" packet length is zero (YODA input error), skipped\n");
722            };
723        };        };
724        for (Int_t kk = 0; kk < 11 ; kk++ ){        for (Int_t kk = 0; kk < 11 ; kk++ ){
725          tshit += shit[k][kk];          tshit += shit[k][kk];
726          trshit += rshit[k][kk];          trshit += rshit[k][kk];
727        };        };
728      };        };  
729      Calstriphit->Fill(cshit);      if (isCOMP || isFULL){
730      if ( (cshit > 0 && cshit < 25) || (cshit > 40 && cshit < 80) ){        Calstriphit->Fill(cshit);
731        incshit++;        //    if ( (cshit > 0 && cshit < 25) || (cshit > 40 && cshit < 80) ){
732      } else {        if ( (cshit > 10 && cshit < 100) ){
733        outcshit++;          incshit++;
734      };        } else {
735      if ( tshit>0 ) h1->Fill(tshit);          outcshit++;
736      if ( (tshit > 0 && tshit < 25) || (tshit > 40 && tshit < 80) ){        };
737        intshit++;        //
738      } else {        if ( tshit>0 ) h1->Fill(tshit);
739        outtshit++;        //    if ( (tshit > 0 && tshit < 25) || (tshit > 40 && tshit < 80) ){
740          if ( (tshit > 10 && tshit < 100) ){
741            intshit++;
742          } else {
743            outtshit++;
744          };
745      };      };
746      if ( trshit>0 ) {      if ( trshit>0 ) {
747        h1r->Fill(trshit);        h1r->Fill(trshit);
748        if ( trshit < 4210 ){        if ( trshit < 4210 ){
749          h1rcheck = true;          h1rout++;
750          //              printf("ma come... trshit %i \n",trshit);          //              printf("ma come... trshit %i \n",trshit);
751          } else {
752            h1rin++;
753        };        };
754      };      };
755      if ( i%1000 == 0 && i > 0 ) printf("%iK\n",i/1000);      //    if ( i%1000 == 0 && i > 0 ) printf("%iK\n",i/1000);
756      i++;      i++;
757    };    };
758    printf("\n");    printf("\n");
759          printf("\n end processing. \n\n");
760      if ( (float)h1rout/((float)h1rin+(float)h1rout) > h1rth ){
761        h1rcheck = true;
762      };    
763    //    //
764    //  output figures, first sheet:    //  output figures, first sheet:
765    //    //
# Line 553  void FCaloQLOOK(TString filename, Int_t Line 779  void FCaloQLOOK(TString filename, Int_t
779    t->DrawLatex(2.,99.,errore.str().c_str());    t->DrawLatex(2.,99.,errore.str().c_str());
780    TPad *pd5;    TPad *pd5;
781    TPad *pd6;    TPad *pd6;
782      TPad *pd7;
783      TPad *pd8;
784    TPad *pad1;    TPad *pad1;
785    TPad *pad2;    TPad *pad2;
786    TPad *pad3;    TPad *pad3;
# Line 597  void FCaloQLOOK(TString filename, Int_t Line 825  void FCaloQLOOK(TString filename, Int_t
825      h1->Draw();      h1->Draw();
826      //      //
827      h1max = h1->GetMaximum()*1.05;      h1max = h1->GetMaximum()*1.05;
828      Double_t xc[4] = {0.,25.,25.,0.};      Double_t xc[4] = {10.,100.,100.,10.};
829      Double_t yc[4] = {0.,0.,h1max,h1max};      Double_t yc[4] = {0.,0.,h1max,h1max};
830      banda1 = new TPolyLine(4,xc,yc);      banda1 = new TPolyLine(4,xc,yc);
831      banda1->SetLineColor(5);      banda1->SetLineColor(5);
832      banda1->SetFillColor(5);      banda1->SetFillColor(5);
833      banda1->SetLineWidth(1);      banda1->SetLineWidth(1);
834      banda1->Draw("fSAME");      banda1->Draw("fSAME");
835      Double_t xd[4] = {40.,80.,80.,40.};    //  Double_t xd[4] = {40.,80.,80.,40.};
836      Double_t yd[4] = {0.,0.,h1max,h1max};     // Double_t yd[4] = {0.,0.,h1max,h1max};
837      banda2 = new TPolyLine(4,xd,yd);     // banda2 = new TPolyLine(4,xd,yd);
838      banda2->SetLineColor(5);     // banda2->SetLineColor(5);
839      banda2->SetFillColor(5);     // banda2->SetFillColor(5);
840      banda2->SetLineWidth(1);     // banda2->SetLineWidth(1);
841      banda2->Draw("fSAME");      //banda2->Draw("fSAME");
842      h1->Draw("SAME");      h1->Draw("SAME");
843      //      //
844      figura->cd();      figura->cd();
# Line 647  void FCaloQLOOK(TString filename, Int_t Line 875  void FCaloQLOOK(TString filename, Int_t
875        h1->SetYTitle("Number of events");        h1->SetYTitle("Number of events");
876        h1->Draw();        h1->Draw();
877        h1max = h1->GetMaximum()*1.05;        h1max = h1->GetMaximum()*1.05;
878        Double_t xe[4] = {0.,25.,25.,0.};        Double_t xe[4] = {10.,100.,100.,10.};
879        Double_t ye[4] = {0.,0.,h1max,h1max};        Double_t ye[4] = {0.,0.,h1max,h1max};
880        banda1 = new TPolyLine(4,xe,ye);        banda1 = new TPolyLine(4,xe,ye);
881        banda1->SetLineColor(5);        banda1->SetLineColor(5);
882        banda1->SetFillColor(5);        banda1->SetFillColor(5);
883        banda1->SetLineWidth(1);        banda1->SetLineWidth(1);
884        banda1->Draw("fSAME");        banda1->Draw("fSAME");
885        Double_t xf[4] = {40.,80.,80.,40.};       // Double_t xf[4] = {40.,80.,80.,40.};
886        Double_t yf[4] = {0.,0.,h1max,h1max};       // Double_t yf[4] = {0.,0.,h1max,h1max};
887        banda2 = new TPolyLine(4,xf,yf);       // banda2 = new TPolyLine(4,xf,yf);
888        banda2->SetLineColor(5);       // banda2->SetLineColor(5);
889        banda2->SetFillColor(5);       // banda2->SetFillColor(5);
890        banda2->SetLineWidth(1);      //  banda2->SetLineWidth(1);
891        banda2->Draw("fSAME");       // banda2->Draw("fSAME");
892        h1->Draw("SAME");        h1->Draw("SAME");
893      };      };
894      if ( trshit !=0 ) {      if ( trshit !=0 ) {
# Line 690  void FCaloQLOOK(TString filename, Int_t Line 918  void FCaloQLOOK(TString filename, Int_t
918      };      };
919    };    };
920    if ( !errorfull ) {    if ( !errorfull ) {
921      if ( calevn1 || calevn2 || calevn3 ) {      if ( calevn1 > calevnth || calevn2 > calevnth || calevn3 > calevnth ) {
922        pd1 = new TPad("pd1","This is pad1",0.02,0.51,0.24,0.98,45);        pd1 = new TPad("pd1","This is pad1",0.02,0.51,0.24,0.98,45);
923        pd2 = new TPad("pd2","This is pad2",0.26,0.51,0.49,0.98,45);        pd2 = new TPad("pd2","This is pad2",0.26,0.51,0.49,0.98,45);
924        pd3 = new TPad("pd3","This is pad3",0.02,0.02,0.24,0.49,45);        pd3 = new TPad("pd3","This is pad3",0.02,0.02,0.24,0.49,45);
# Line 865  void FCaloQLOOK(TString filename, Int_t Line 1093  void FCaloQLOOK(TString filename, Int_t
1093      Dexyc->Draw("SAME");      Dexyc->Draw("SAME");
1094      //      //
1095      pd3->cd();      pd3->cd();
1096    //    gPad->SetLogy();
1097      Calstriphit->SetXTitle("Number of hit");      Calstriphit->SetXTitle("Number of hit");
1098      Calstriphit->SetYTitle("Number of events");      Calstriphit->SetYTitle("Number of events");
1099      Calstriphit->Draw();      Calstriphit->Draw();
1100      h1max = Calstriphit->GetMaximum()*1.05;      h1max = Calstriphit->GetMaximum()*1.05;
1101      Double_t xg[4] = {0.,25.,25.,0.};      Double_t xg[4] = {10.,100.,100.,10.};
1102      Double_t yg[4] = {0.,0.,h1max,h1max};      Double_t yg[4] = {0.,0.,h1max,h1max};
1103      banda1 = new TPolyLine(4,xg,yg);      banda1 = new TPolyLine(4,xg,yg);
1104      banda1->SetLineColor(5);      banda1->SetLineColor(5);
1105      banda1->SetFillColor(5);      banda1->SetFillColor(5);
1106      banda1->SetLineWidth(1);      banda1->SetLineWidth(1);
1107      banda1->Draw("fSAME");      banda1->Draw("fSAME");
1108      Double_t xh[4] = {40.,80.,80.,40.};    //  Double_t xh[4] = {40.,80.,80.,40.};
1109      Double_t yh[4] = {0.,0.,h1max,h1max};    //  Double_t yh[4] = {0.,0.,h1max,h1max};
1110      banda2 = new TPolyLine(4,xh,yh);    //  banda2 = new TPolyLine(4,xh,yh);
1111      banda2->SetLineColor(5);    //  banda2->SetLineColor(5);
1112      banda2->SetFillColor(5);    //  banda2->SetFillColor(5);
1113      banda2->SetLineWidth(1);    //  banda2->SetLineWidth(1);
1114      banda2->Draw("fSAME");    //  banda2->Draw("fSAME");
1115      Calstriphit->Draw("SAME");      Calstriphit->Draw("SAME");
1116      //      //
1117      pd4->cd();      pd4->cd();
1118        gPad->SetLogy();
1119      Dexy->SetXTitle("ADC channels");      Dexy->SetXTitle("ADC channels");
1120      Dexy->SetYTitle("Number of events");      Dexy->SetYTitle("Number of events");
1121      Dexy->Draw();      Dexy->Draw();
1122      h1max = Dexy->GetMaximum()*1.05;      //    h1max = Dexy->GetMaximum()*1.05;
1123        h1max = Dexy->GetMaximum()*2.05;
1124      Double_t xd[4] = {2000.,5000.,5000.,2000.};      Double_t xd[4] = {2000.,5000.,5000.,2000.};
1125      Double_t yd[4] = {0.,0.,h1max,h1max};      Double_t yd[4] = {0.,0.,h1max,h1max};
1126      banda1 = new TPolyLine(4,xd,yd);      banda1 = new TPolyLine(4,xd,yd);
# Line 925  void FCaloQLOOK(TString filename, Int_t Line 1156  void FCaloQLOOK(TString filename, Int_t
1156      pd4->Draw();      pd4->Draw();
1157      //      //
1158      pd4->cd();      pd4->cd();
1159        gPad->SetLogy();
1160      Dexy->SetXTitle("ADC channels");      Dexy->SetXTitle("ADC channels");
1161      Dexy->SetYTitle("Number of events");      Dexy->SetYTitle("Number of events");
1162      Dexy->Draw();      Dexy->Draw();
1163      h1max = Dexy->GetMaximum()*1.05;      //    h1max = Dexy->GetMaximum()*1.05;
1164        h1max = Dexy->GetMaximum()*2.05;
1165      Double_t xd[4] = {2000.,5000.,5000.,2000.};      Double_t xd[4] = {2000.,5000.,5000.,2000.};
1166      Double_t yd[4] = {0.,0.,h1max,h1max};      Double_t yd[4] = {0.,0.,h1max,h1max};
1167      banda1 = new TPolyLine(4,xd,yd);      banda1 = new TPolyLine(4,xd,yd);
# Line 939  void FCaloQLOOK(TString filename, Int_t Line 1172  void FCaloQLOOK(TString filename, Int_t
1172      Dexy->Draw("SAME");      Dexy->Draw("SAME");
1173    };      };  
1174    //    //
1175      TCanvas *figura3 = 0;
1176      Bool_t printfigure3 = false;
1177      for (Int_t i = 0; i<4; i++){
1178        if ( ver[i][2] || lver[i][2] ){
1179          printfigure3 = true;
1180          break;
1181        };
1182      };
1183      if ( printfigure3 ){
1184        figura3 = new TCanvas("Calorimeter_Detector_Report_2bis/3","Calorimeter_Detector_Report_2bis/3", 1100, 900);
1185        figura3->SetFillColor(10);
1186        figura3->Range(0,0,100,100);
1187        errore.str("");
1188        errore << "EXPERT  --  File: " << file;
1189        errore << " ";
1190        t=new TLatex();
1191        t->SetTextFont(32);
1192        t->SetTextColor(1);
1193        t->SetTextAlign(12);
1194        t->SetTextSize(0.015);
1195        t->DrawLatex(2.,99.,errore.str().c_str());
1196        pd1 = new TPad("pd1","This is pad1",0.02,0.51,0.49,0.73,45);
1197        pd5 = new TPad("pd5","This is pad5",0.02,0.76,0.49,0.98,45);
1198        pd2 = new TPad("pd2","This is pad2",0.51,0.51,0.98,0.73,45);
1199        pd6 = new TPad("pd6","This is pad6",0.51,0.76,0.98,0.98,45);
1200        pd3 = new TPad("pd3","This is pad3",0.02,0.02,0.49,0.23,45);
1201        pd7 = new TPad("pd7","This is pad7",0.02,0.26,0.49,0.49,45);
1202        pd4 = new TPad("pd4","This is pad4",0.51,0.02,0.98,0.23,45);
1203        pd8 = new TPad("pd8","This is pad8",0.51,0.26,0.98,0.49,45);
1204        figura3->cd();
1205        pd1->Range(0,0,100,100);
1206        pd2->Range(0,0,100,100);
1207        pd3->Range(0,0,100,100);
1208        pd4->Range(0,0,100,100);      
1209        pd1->SetTicks();
1210        pd2->SetTicks();
1211        pd3->SetTicks();
1212        pd4->SetTicks();
1213        pd1->Draw();
1214        pd2->Draw();
1215        pd3->Draw();
1216        pd4->Draw();
1217        pd5->Range(0,0,100,100);
1218        pd6->Range(0,0,100,100);
1219        pd7->Range(0,0,100,100);
1220        pd8->Range(0,0,100,100);      
1221        pd5->SetTicks();
1222        pd6->SetTicks();
1223        pd7->SetTicks();
1224        pd8->SetTicks();
1225        pd5->Draw();
1226        pd6->Draw();
1227        pd7->Draw();
1228        pd8->Draw();
1229        pd1->cd();
1230        lup[0]->SetAxisRange((Double_t)min(minobt[0],swminobt[0])*0.9,(Double_t)max(maxobt[0],swmaxobt[0])*1.1,"X");
1231        lup[0]->SetXTitle("OBT");
1232        lup[0]->SetYTitle("Number of events");
1233        lup[0]->Draw();
1234        pd5->cd();
1235        lupstw[0]->SetAxisRange((Double_t)min(minobt[0],swminobt[0])*0.9,(Double_t)max(maxobt[0],swmaxobt[0])*1.1,"X");
1236        //    lupstw[0]->SetAxisRange((Double_t)swminobt[0]*0.9,(Double_t)swmaxobt[0]*1.1,"X");
1237        lupstw[0]->SetXTitle("OBT");
1238        lupstw[0]->SetYTitle("Number of events");
1239        lupstw[0]->Draw();
1240        pd2->cd();
1241        lup[1]->SetAxisRange((Double_t)min(minobt[1],swminobt[1])*0.9,(Double_t)max(maxobt[1],swmaxobt[1])*1.1,"X");
1242        //    lup[1]->SetAxisRange((Double_t)minobt[1]*0.9,(Double_t)maxobt[1]*1.1,"X");
1243        lup[1]->SetXTitle("OBT");
1244        lup[1]->SetYTitle("Number of events");
1245        lup[1]->Draw();
1246        pd6->cd();
1247        lupstw[1]->SetAxisRange((Double_t)min(minobt[1],swminobt[1])*0.9,(Double_t)max(maxobt[1],swmaxobt[1])*1.1,"X");
1248        //    lupstw[1]->SetAxisRange((Double_t)swminobt[1]*0.9,(Double_t)swmaxobt[1]*1.1,"X");
1249        lupstw[1]->SetXTitle("OBT");
1250        lupstw[1]->SetYTitle("Number of events");
1251        lupstw[1]->Draw();
1252        pd3->cd();
1253        lup[2]->SetAxisRange((Double_t)min(minobt[2],swminobt[2])*0.9,(Double_t)max(maxobt[2],swmaxobt[2])*1.1,"X");
1254        //    lup[2]->SetAxisRange((Double_t)minobt[2]*0.9,(Double_t)maxobt[2]*1.1,"X");
1255        lup[2]->SetXTitle("OBT");
1256        lup[2]->SetYTitle("Number of events");
1257        lup[2]->Draw();
1258        pd7->cd();
1259        lupstw[2]->SetAxisRange((Double_t)min(minobt[2],swminobt[2])*0.9,(Double_t)max(maxobt[2],swmaxobt[2])*1.1,"X");
1260        //    lupstw[2]->SetAxisRange((Double_t)swminobt[2]*0.9,(Double_t)swmaxobt[2]*1.1,"X");
1261        lupstw[2]->SetXTitle("OBT");
1262        lupstw[2]->SetYTitle("Number of events");
1263        lupstw[2]->Draw();
1264        pd4->cd();
1265        lup[3]->SetAxisRange((Double_t)min(minobt[3],swminobt[3])*0.9,(Double_t)max(maxobt[3],swmaxobt[3])*1.1,"X");
1266        //    lup[3]->SetAxisRange((Double_t)minobt[3]*0.9,(Double_t)maxobt[3]*1.1,"X");
1267        lup[3]->SetXTitle("OBT");
1268        lup[3]->SetYTitle("Number of events");
1269        lup[3]->Draw();
1270        pd8->cd();
1271        lupstw[3]->SetAxisRange((Double_t)min(minobt[3],swminobt[3])*0.9,(Double_t)max(maxobt[3],swmaxobt[3])*1.1,"X");
1272        //    lupstw[3]->SetAxisRange((Double_t)swminobt[3]*0.9,(Double_t)swmaxobt[3]*1.1,"X");
1273        lupstw[3]->SetXTitle("OBT");
1274        lupstw[3]->SetYTitle("Number of events");
1275        lupstw[3]->Draw();
1276      };
1277      //
1278    //  output figures, report sheet:    //  output figures, report sheet:
1279    //    //
1280    TCanvas *rapporto= new TCanvas("Calorimeter_Detector_Report_3/3", "Calorimeter_Detector_Report_3/3", 1100, 900);    TCanvas *rapporto= new TCanvas("Calorimeter_Detector_Report_3/3", "Calorimeter_Detector_Report_3/3", 1100, 900);
# Line 969  void FCaloQLOOK(TString filename, Int_t Line 1305  void FCaloQLOOK(TString filename, Int_t
1305    pad2->Draw();    pad2->Draw();
1306    pad3->Draw();    pad3->Draw();
1307    pad4->Draw();    pad4->Draw();
1308      //
1309      Bool_t redevent = true;
1310      //
1311      if ( ver[0][3]+ver[0][16]+ver[0][17]+ver[0][8] == ver[1][3]+ver[1][16]+ver[1][17]+ver[1][8] && ver[1][3]+ver[1][16]+ver[1][17]+ver[1][8] == ver[2][3]+ver[2][16]+ver[2][17]+ver[2][8] && ver[2][3]+ver[2][16]+ver[2][17]+ver[2][8] == ver[3][3]+ver[3][16]+ver[3][17]+ver[3][8] ){
1312        redevent = false;
1313      };
1314      if ( redevent ) check = true;
1315      //
1316    for (Int_t i = 0; i < 4; i++){    for (Int_t i = 0; i < 4; i++){
1317      if (i == 2)      if (i == 2)
1318        {        {
# Line 1015  void FCaloQLOOK(TString filename, Int_t Line 1358  void FCaloQLOOK(TString filename, Int_t
1358            check = true;            check = true;
1359          }          }
1360          if (j == 2) {          if (j == 2) {
1361              //      printf("boh! lalarm[%i] = %i \n",i,lalarm[i]);
1362            if ( lalarm[i] ){            if ( lalarm[i] ){
1363              errore.str("");              errore.str("");
1364              errore << "* Latch up: " << ver[i][j];              errore << "* Latch up: " << ver[i][j];
1365              errore << " (" << lalarm[i];                      errore << " (" << lalarm[i];        
1366              errore << " NOT rec!): ";              errore << " NOT rec!): ";
1367              t->DrawLatex(0.,70.,errore.str().c_str());              t->DrawLatex(2.,70.,errore.str().c_str());
1368              check = true;              check = true;
1369            } else {            } else {
1370              errore.str("");              errore.str("");
# Line 1055  void FCaloQLOOK(TString filename, Int_t Line 1399  void FCaloQLOOK(TString filename, Int_t
1399            errore.str("");            errore.str("");
1400            errore << "RAW mode: " << ver[i][j];            errore << "RAW mode: " << ver[i][j];
1401            errore << " time(s)";            errore << " time(s)";
1402            t->SetTextColor(32);            if ( !redevent ) t->SetTextColor(32);
1403            t->DrawLatex(2.,90.,errore.str().c_str());            t->DrawLatex(2.,90.,errore.str().c_str());
1404          }          }
1405          if (j == 4) {          if (j == 4) {
# Line 1091  void FCaloQLOOK(TString filename, Int_t Line 1435  void FCaloQLOOK(TString filename, Int_t
1435            errore << "Missing section: " << ver[i][j];            errore << "Missing section: " << ver[i][j];
1436            errore << " time(s)";            errore << " time(s)";
1437            t->DrawLatex(2.,50.,errore.str().c_str());            t->DrawLatex(2.,50.,errore.str().c_str());
1438            check = true;            if ( ver[i][j] > 3 ) check = true;
1439          }          }
1440          if (j == 10) {          if (j == 10) {
1441            errore.str("");            errore.str("");
1442            errore << "Calevnum jump: " << ver[i][j];            errore << "Calevnum jump: " << ver[i][j];
1443            errore << " time(s)";            errore << " time(s)";
1444            t->DrawLatex(2.,42.,errore.str().c_str());            t->DrawLatex(2.,42.,errore.str().c_str());
1445            check = true;            if ( ver[i][j] > 3 ) check = true;
1446          }          }
1447          if (j == 11) {          if (j == 11) {
1448            errore.str("");            errore.str("");
1449            errore << "CRC error (data): " << ver[i][j];            errore << "CRC error (data): " << ver[i][j];
1450            errore << " time(s)";            errore << " time(s)";
1451            t->DrawLatex(2.,38.,errore.str().c_str());            t->DrawLatex(2.,38.,errore.str().c_str());
1452            check = true;            if ( ver[i][j] > 10 ) check = true;
1453          }          }
1454          if (j == 12) {          if (j == 12) {
1455            errore.str("");            errore.str("");
# Line 1139  void FCaloQLOOK(TString filename, Int_t Line 1483  void FCaloQLOOK(TString filename, Int_t
1483            errore.str("");            errore.str("");
1484            errore << "COMPRESS mode: " << ver[i][j];            errore << "COMPRESS mode: " << ver[i][j];
1485            errore << " time(s)";            errore << " time(s)";
1486            t->SetTextColor(32);            if ( !redevent ) t->SetTextColor(32);
1487            t->DrawLatex(2.,86.,errore.str().c_str());            t->DrawLatex(2.,86.,errore.str().c_str());
1488          }          }
1489          if (j == 17) {          if (j == 17) {
1490            errore.str("");            errore.str("");
1491            errore << "FULL mode: " << ver[i][j];            errore << "FULL mode: " << ver[i][j];
1492            errore << " time(s)";            errore << " time(s)";
1493            t->SetTextColor(32);            if ( !redevent ) t->SetTextColor(32);
1494            t->DrawLatex(2.,82.,errore.str().c_str());            t->DrawLatex(2.,82.,errore.str().c_str());
1495          }          }
1496          if (j == 18) {          if (j == 18) {
# Line 1218  void FCaloQLOOK(TString filename, Int_t Line 1562  void FCaloQLOOK(TString filename, Int_t
1562      t->DrawLatex(60.,95.," OK! ");            t->DrawLatex(60.,95.," OK! ");      
1563    };    };
1564    //    //
1565    const string fil = (const char*)filename;    //  const string fil = (const char*)filename;
1566    Int_t posiz = fil.find("dw_");    //  Int_t posiz = fil.find("dw_");
1567    if ( posiz == -1 ) posiz = fil.find("DW_");    //  if ( posiz == -1 ) posiz = fil.find("DW_");
1568    Int_t posiz2 = posiz+13;    //  Int_t posiz2 = posiz+13;
1569    TString file2;    //  TString file2;
1570    stringcopy(file2,filename,posiz,posiz2);    //  stringcopy(file2,filename,posiz,posiz2);
1571    //    //
1572      const string fil = gSystem->BaseName(filename.Data());
1573      Int_t posiz = fil.find(".root");
1574      //
1575      TString file2;
1576      if ( posiz == -1 ){
1577        file2 = gSystem->BaseName(filename.Data());
1578      } else {
1579        Int_t posiz2 = 0;
1580        stringcopy(file2,gSystem->BaseName(filename.Data()),posiz2,posiz);
1581      };
1582    const char *figrec = file2;    const char *figrec = file2;
1583      //
1584    const char *outdir = outDir;    const char *outdir = outDir;
1585    stringstream figsave;        stringstream figsave;    
1586    stringstream figsave1;        stringstream figsave1;    
# Line 1234  void FCaloQLOOK(TString filename, Int_t Line 1589  void FCaloQLOOK(TString filename, Int_t
1589    if ( !strcmp(format,"ps") ) {    if ( !strcmp(format,"ps") ) {
1590      figsave.str("");      figsave.str("");
1591      figsave << outdir << "/" ;      figsave << outdir << "/" ;
1592      figsave << figrec << "_qlook.";      figsave << figrec << "_CaloQLOOK.";
1593      figsave << format << "(";      figsave << format << "(";
1594      rapporto->Print(figsave.str().c_str(),"Landscape");          rapporto->Print(figsave.str().c_str(),"Landscape");    
1595      figsave1.str("");      figsave1.str("");
1596      figsave1 << outdir << "/" ;      figsave1 << outdir << "/" ;
1597      figsave1 << figrec << "_qlook.";      figsave1 << figrec << "_CaloQLOOK.";
1598      figsave1 << format;      figsave1 << format;
1599      figura->Print(figsave1.str().c_str(),"Landscape");      figura->Print(figsave1.str().c_str(),"Landscape");
1600      figsave2.str("");      figsave2.str("");
1601      figsave2 << outdir << "/" ;      figsave2 << outdir << "/" ;
1602      figsave2 << figrec << "_qlook.";      figsave2 << figrec << "_CaloQLOOK.";
1603      figsave2 << format << ")";      if ( printfigure3 ){
1604      figura2->Print(figsave2.str().c_str(),"Landscape");        figsave2 << format;
1605          figura2->Print(figsave2.str().c_str(),"Landscape");
1606          figsave2.str("");
1607          figsave2 << outdir << "/" ;
1608          figsave2 << figrec << "_CaloQLOOK.";
1609          figsave2 << format << ")";
1610          figura3->Print(figsave2.str().c_str(),"Landscape");
1611        } else {
1612          figsave2 << format << ")";;
1613          figura2->Print(figsave2.str().c_str(),"Landscape");
1614        };
1615    } else {    } else {
1616      figsave.str("");      figsave.str("");
1617      figsave << outdir << "/" ;      figsave << outdir << "/" ;
1618      figsave << figrec << "_qlook1.";      figsave << figrec << "_CaloQLOOK1.";
1619      figsave << format;      figsave << format;
1620      figura->SaveAs(figsave.str().c_str());      figura->SaveAs(figsave.str().c_str());
1621      figsave.str("");      figsave.str("");
1622      figsave << outdir << "/" ;      figsave << outdir << "/" ;
1623      figsave << figrec << "_qlook2.";      figsave << figrec << "_CaloQLOOK2.";
1624      figsave << format;      figsave << format;
1625      figura2->SaveAs(figsave.str().c_str());      figura2->SaveAs(figsave.str().c_str());
1626        if ( printfigure3 ){
1627          figsave.str("");
1628          figsave << outdir << "/" ;
1629          figsave << figrec << "_CaloQLOOK2bis.";
1630          figsave << format;
1631          figura3->SaveAs(figsave.str().c_str());
1632        };
1633      figsave.str("");      figsave.str("");
1634      figsave << outdir << "/" ;      figsave << outdir << "/" ;
1635      figsave << figrec << "_qlook3.";      figsave << figrec << "_CaloQLOOK3.";
1636      figsave << format;      figsave << format;
1637      rapporto->SaveAs(figsave.str().c_str());          rapporto->SaveAs(figsave.str().c_str());    
1638    };    };
1639      if ( iactive && w4i ){
1640        while ( gROOT->GetListOfCanvases()->FindObject(rapporto) || gROOT->GetListOfCanvases()->FindObject(figura3) || gROOT->GetListOfCanvases()->FindObject(figura2) || gROOT->GetListOfCanvases()->FindObject(figura) ){
1641          gSystem->ProcessEvents();
1642          gSystem->Sleep(10);
1643        };
1644      };
1645  }  }
1646    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.18

  ViewVC Help
Powered by ViewVC 1.1.23