/[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.6 by mocchiut, Wed Mar 22 14:01:57 2006 UTC revision 1.12 by mocchiut, Mon Jul 17 08:51:11 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.05  (2006-03-22)  //   FCaloQLOOK.c      version 1.11  (2006-07-17)
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.09 - 1.11 (2006-07-17): Adapted to flight conditions.
11    //
12    //   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.
13    //
14    //   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
15    //                             case of latchup alarm.
16    //
17    //   1.05 - 1.06 (2006-03-22): Add optimize flag in compiling the script!
18    //
19  //   1.04 - 1.05 (2006-03-22): Corrected wrong .C files.  //   1.04 - 1.05 (2006-03-22): Corrected wrong .C files.
20  //  //
21  //   1.03 - 1.04 (2006-03-20): Documentation updated.  //   1.03 - 1.04 (2006-03-20): Documentation updated.
# Line 60  void stringappend(TString& s1, const TSt Line 69  void stringappend(TString& s1, const TSt
69  }  }
70    
71  TString getFilename(const TString filename){  TString getFilename(const TString filename){
72    const string fil = (const char*)filename;    //
73    Int_t posiz = fil.find("dw_");    const string fil = gSystem->BaseName(filename.Data());
74    if ( posiz == -1 ) posiz = fil.find("DW_");    Int_t posiz = fil.find(".root");
75    if ( posiz == -1 ) return 0;    //
   Int_t posiz2 = posiz+13;  
76    TString file2;    TString file2;
77    stringcopy(file2,filename,posiz,posiz2);    if ( posiz == -1 ){
78    TString pdat(".dat");      file2 = gSystem->BaseName(filename.Data());
79    stringappend(file2,pdat);    } else {
80        Int_t posiz2 = 0;
81        stringcopy(file2,gSystem->BaseName(filename.Data()),posiz2,posiz);
82        TString pdat(".dat");
83        stringappend(file2,pdat);  
84      };
85    return file2;    return file2;
86  }  }
87    
88  void FCaloQLOOK(TString filename, Int_t fromevent=0, Int_t toevent=0, TString outDir="", TString saveas = "ps"){  void FCaloQLOOK(TString filename, Int_t fromevent=0, Int_t toevent=0, TString outDir="", TString saveas = "ps"){
89    gStyle->SetPaperSize(19.,25.);    gStyle->SetPaperSize(19.,25.);
90    const char* startingdir = gSystem->WorkingDirectory();    const char* startingdir = gSystem->WorkingDirectory();
91      //  printf(" basename is %s \n",gSystem->BaseName(filename.Data()));
92      //  printf(" getfilename is %s \n",getFilename(filename).Data());
93    if ( !strcmp(outDir.Data(),"") ) outDir = startingdir;    if ( !strcmp(outDir.Data(),"") ) outDir = startingdir;
94    //    //
95    //    //
# Line 99  void FCaloQLOOK(TString filename, Int_t Line 114  void FCaloQLOOK(TString filename, Int_t
114    Float_t ctshitthr = 0.65;    Float_t ctshitthr = 0.65;
115    Float_t cbasethr = 0.95;    Float_t cbasethr = 0.95;
116    Float_t cdexythr = 0.995;    Float_t cdexythr = 0.995;
117      //Float_t cdexythr = 0.90;
118    Float_t cdexycthr = 0.95;    Float_t cdexycthr = 0.95;
119      Float_t h1rth = 0.90;
120      Int_t calevnth = 13;
121    //    //
122    pamela::calorimeter::CalorimeterEvent *ce = 0;    pamela::calorimeter::CalorimeterEvent *ce = 0;
123    pamela::EventHeader *eh = 0;    pamela::EventHeader *eh = 0;
# Line 174  void FCaloQLOOK(TString filename, Int_t Line 192  void FCaloQLOOK(TString filename, Int_t
192    TH1F *calev01;    TH1F *calev01;
193    TH1F *calev23;    TH1F *calev23;
194    TH1F *calev03;    TH1F *calev03;
195      TH1F *lupstw[4];
196      TH1F *lup[4];
197    TH2D *calev2;    TH2D *calev2;
198    
199    h1 = new TH1F("C7","Strips hit, compress mode",100,0.,200.);    h1 = new TH1F("C7","Strips hit, compress mode",100,0.,200.);
# Line 183  void FCaloQLOOK(TString filename, Int_t Line 203  void FCaloQLOOK(TString filename, Int_t
203    hdiff->SetBit(TH1F::kCanRebin);    hdiff->SetBit(TH1F::kCanRebin);
204    Baseline = new TH1F("C9","baselines",100,0,3);    Baseline = new TH1F("C9","baselines",100,0,3);
205    Baseline->SetBit(TH1F::kCanRebin);    Baseline->SetBit(TH1F::kCanRebin);
206    Dexy = new TH1F("C12","dexy",100,0.,37000.);    Dexy = new TH1F("C12","dexy",100,0.,10000.);
207    Dexyc = new TH1F("C10","dexyc",100,0,3);    Dexy->SetBit(TH1F::kCanRebin);
208    Dexyc->SetBit(TH1F::kCanRebin);    Dexyc = new TH1F("C10","dexyc",100,-100.,37000.);
209    //  Dexyc->SetBit(TH1F::kCanRebin);
210    Calstriphit = new TH1F("C11","calstriphit[1:4]",100,0.,200.);    Calstriphit = new TH1F("C11","calstriphit[1:4]",100,0.,200.);
211            
212    calev01 = new TH1F("C3","|calevnum(1)-calevnum(2)|",100,0,1);    calev01 = new TH1F("C3","|calevnum(1)-calevnum(2)|",100,0,1);
# Line 196  void FCaloQLOOK(TString filename, Int_t Line 217  void FCaloQLOOK(TString filename, Int_t
217    calev03->SetBit(TH1F::kCanRebin);    calev03->SetBit(TH1F::kCanRebin);
218    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.);
219    calev2->SetBit(TH2D::kCanRebin);    calev2->SetBit(TH2D::kCanRebin);
220        
221      stringstream oss;
222      stringstream noss;
223      for ( Int_t i=0; i<4; i++){
224        oss.str("");
225        oss << "OBT stw latch up section " << i;
226        noss.str("");
227        noss << "C" << 21+i;
228        lupstw[i] = new TH1F(noss.str().c_str(),oss.str().c_str(),100,-1,1);
229        lupstw[i]->SetBit(TH1F::kCanRebin);
230        oss.str("");
231        oss << "OBT no stw latch up section " << i;
232        noss.str("");
233        noss << "C" << 25+i;
234        lup[i] = new TH1F(noss.str().c_str(),oss.str().c_str(),100,-1,1);
235        lup[i]->SetBit(TH1F::kCanRebin);
236      };
237    
238    //    //
239    // run over each event and take out some variables    // run over each event and take out some variables
240    //    //
# Line 249  void FCaloQLOOK(TString filename, Int_t Line 287  void FCaloQLOOK(TString filename, Int_t
287    bool isRAW = 0;    bool isRAW = 0;
288    Int_t alldexy=0;    Int_t alldexy=0;
289    Int_t alldexy2=0;    Int_t alldexy2=0;
290    Int_t stri=0;    Int_t planebases=0;
291      //  Int_t stri=0;
292    Int_t fcheck = 0;    Int_t fcheck = 0;
293    Int_t cestw=0;    Int_t cestw=0;
294    Int_t cmask = 127 ;    Int_t cmask = 127 ;
# Line 277  void FCaloQLOOK(TString filename, Int_t Line 316  void FCaloQLOOK(TString filename, Int_t
316    Float_t headc = 0.;    Float_t headc = 0.;
317    Float_t headco = 0.;    Float_t headco = 0.;
318    Bool_t h1rcheck = false;    Bool_t h1rcheck = false;
319      Int_t h1rin = 0;
320      Int_t h1rout = 0;
321    Int_t intshit = 0;    Int_t intshit = 0;
322    Int_t outtshit = 0;    Int_t outtshit = 0;
323    Int_t incshit = 0;    Int_t incshit = 0;
# Line 287  void FCaloQLOOK(TString filename, Int_t Line 328  void FCaloQLOOK(TString filename, Int_t
328    Int_t outdexy = 0;    Int_t outdexy = 0;
329    Int_t indexyc = 0;    Int_t indexyc = 0;
330    Int_t outdexyc = 0;    Int_t outdexyc = 0;
331      Int_t obt = 0;
332      Int_t minobt[4];
333      Int_t maxobt[4];
334      Int_t swminobt[4];
335      Int_t swmaxobt[4];
336      Bool_t firstobt[4];
337      Bool_t swfirstobt[4];
338      for ( Int_t i = 0; i<4; i++){
339        minobt[i] = 0;
340        maxobt[i] = 0;
341        swminobt[i] = 0;
342        swmaxobt[i] = 0;
343        firstobt[i] = true;
344        swfirstobt[i] = true;
345      };
346    while ( i < maxevent+1){    while ( i < maxevent+1){
347      tshit = 0;      tshit = 0;
348      trshit = 0;      trshit = 0;
# Line 296  void FCaloQLOOK(TString filename, Int_t Line 352  void FCaloQLOOK(TString filename, Int_t
352      ph = eh->GetPscuHeader();      ph = eh->GetPscuHeader();
353      headco = headc;      headco = headc;
354      headc = ph->GetCounter();      headc = ph->GetCounter();
355      calevn1 += (int)abs((int)(ce->calevnum[0]-ce->calevnum[1]));      obt = ph->GetOrbitalTime();
356      calevn2 += (int)abs((int)(ce->calevnum[2]-ce->calevnum[3]));      if ( (int)abs((int)(ce->calevnum[0]-ce->calevnum[1])) ) calevn1++;
357      calevn3 += (int)abs((int)(ce->calevnum[0]-ce->calevnum[3]));      if ( (int)abs((int)(ce->calevnum[2]-ce->calevnum[3])) ) calevn2++;
358        if ( (int)abs((int)(ce->calevnum[0]-ce->calevnum[3])) ) calevn3++;
359        //    calevn1 += (int)abs((int)(ce->calevnum[0]-ce->calevnum[1]));
360        //    calevn2 += (int)abs((int)(ce->calevnum[2]-ce->calevnum[3]));
361        //    calevn3 += (int)abs((int)(ce->calevnum[0]-ce->calevnum[3]));
362      calev01->Fill(abs((int)(ce->calevnum[0]-ce->calevnum[1])));      calev01->Fill(abs((int)(ce->calevnum[0]-ce->calevnum[1])));
363      calev23->Fill(abs((int)(ce->calevnum[2]-ce->calevnum[3])));      calev23->Fill(abs((int)(ce->calevnum[2]-ce->calevnum[3])));
364      calev03->Fill(abs((int)(ce->calevnum[0]-ce->calevnum[3])));      calev03->Fill(abs((int)(ce->calevnum[0]-ce->calevnum[3])));
# Line 384  void FCaloQLOOK(TString filename, Int_t Line 444  void FCaloQLOOK(TString filename, Int_t
444              bdone = 0;              bdone = 0;
445              bl++;              bl++;
446              allbase = ce->base[l][ii][bl];              allbase = ce->base[l][ii][bl];
447                //      alldexy=0;
448                //      alldexy2=0;
449                //      stri=0;
450                //      for (Int_t e = 0; e < 16 ; e++ ){
451                //        stri = e + 16 * bl;
452                //        alldexy += (int)ce->dexyc[l][ii][stri];
453                //        alldexy2 += (int)ce->dexy[l][ii][stri];
454                //      };
455              };
456              //
457              if ( kk == 0 ){
458                planebases = 0;
459              alldexy=0;              alldexy=0;
460              alldexy2=0;              alldexy2=0;
461              stri=0;              for (Int_t e = 0; e < 96 ; e++ ){
462              for (Int_t e = 0; e < 16 ; e++ ){                if ( e < 6 ) planebases += (int)ce->base[l][ii][e];
463                stri = e + 16 * bl;                alldexy += (int)ce->dexyc[l][ii][e];
464                alldexy += (int)ce->dexyc[l][ii][stri];                alldexy2 += (int)ce->dexy[l][ii][e];
               alldexy2 += (int)ce->dexy[l][ii][stri];  
465              };              };
466            };            };
467              //
468            if ( !isRAW ) {            if ( !isRAW ) {
469              //              //
470              if ( !pdone ){              if ( !pdone ){
471                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 ) {
472                  if ( (planebases>192000 || planebases == 0 ) && ( alldexy > 3072000 ||  alldexy == 0) && ce->perror[se] == 0 ) {
473                  pdone = 1;                  pdone = 1;
474                  pshit[se][pl]++ ;                  pshit[se][pl]++ ;
475                  if ( (ce->stwerr[se] & (1 << 4)) == 0 ) lalarm[se]++;                  if ( (ce->stwerr[se] & (1 << 4)) == 0 ) {
476                  lver[se][2]++ ;                    lalarm[se]++;
477                      lup[se]->Fill(obt);
478                      if ( firstobt[se] ) minobt[se] = obt;
479                      if ( obt > maxobt[se] ) maxobt[se] = obt;
480                    };
481                    lver[se][2]++ ;        
482                };                };
483              }              }
484              //              //
# Line 459  void FCaloQLOOK(TString filename, Int_t Line 537  void FCaloQLOOK(TString filename, Int_t
537              //              //
538            } else {            } else {
539              if ( !pdone ){              if ( !pdone ){
540                if ( (alldexy2>512000 || alldexy2 == 0) && ce->perror[se] == 0 ) {                if ( ( alldexy2 > 3072000 ||  alldexy2 == 0) && ce->perror[se] == 0 ) {
541                    //            if ( (alldexy2>512000 || alldexy2 == 0) && ce->perror[se] == 0 ) {
542                  pdone = 1;                  pdone = 1;
543                  pshit[se][pl]++ ;                                          pshit[se][pl]++ ;                        
544                  if ( (ce->stwerr[se] & (1 << 4)) == 0 ) lalarm[se]++;                  if ( (ce->stwerr[se] & (1 << 4)) == 0 ){
545                      lalarm[se]++;
546                      lup[se]->Fill(obt);
547                      if ( firstobt[se] ) minobt[se] = obt;
548                      if ( obt > maxobt[se] ) maxobt[se] = obt;
549                    };
550                  lver[se][2]++ ;                  lver[se][2]++ ;
551                };                };
552              };              };
# Line 496  void FCaloQLOOK(TString filename, Int_t Line 580  void FCaloQLOOK(TString filename, Int_t
580          if ( cestw & (1 << 1) ) ver[k][5]++ ;          if ( cestw & (1 << 1) ) ver[k][5]++ ;
581          if ( cestw & (1 << 2) ) ver[k][4]++ ;          if ( cestw & (1 << 2) ) ver[k][4]++ ;
582          if ( cestw & (1 << 3) ) ver[k][3]++ ;          if ( cestw & (1 << 3) ) ver[k][3]++ ;
583          if ( cestw & (1 << 4) ) ver[k][2]++ ;          if ( cestw & (1 << 4) ){
584              ver[k][2]++ ;
585              lupstw[k]->Fill(obt);
586              if ( swfirstobt[k] ) swminobt[k] = obt;
587              if ( obt > swmaxobt[k] ) swmaxobt[k] = obt;
588            };
589          if ( cestw & (1 << 5) ) ver[k][1]++ ;          if ( cestw & (1 << 5) ) ver[k][1]++ ;
590          if ( cestw & (1 << 6) ) ver[k][0]++ ;                    if ( cestw & (1 << 6) ) ver[k][0]++ ;          
591        };        };
# Line 518  void FCaloQLOOK(TString filename, Int_t Line 607  void FCaloQLOOK(TString filename, Int_t
607          trshit += rshit[k][kk];          trshit += rshit[k][kk];
608        };        };
609      };        };  
610      Calstriphit->Fill(cshit);      if (isCOMP || isFULL){
611      if ( (cshit > 0 && cshit < 25) || (cshit > 40 && cshit < 80) ){        Calstriphit->Fill(cshit);
612        incshit++;        //    if ( (cshit > 0 && cshit < 25) || (cshit > 40 && cshit < 80) ){
613      } else {        if ( (cshit > 10 && cshit < 100) ){
614        outcshit++;          incshit++;
615      };        } else {
616      if ( tshit>0 ) h1->Fill(tshit);          outcshit++;
617      if ( (tshit > 0 && tshit < 25) || (tshit > 40 && tshit < 80) ){        };
618        intshit++;        //
619      } else {        if ( tshit>0 ) h1->Fill(tshit);
620        outtshit++;        //    if ( (tshit > 0 && tshit < 25) || (tshit > 40 && tshit < 80) ){
621          if ( (tshit > 10 && tshit < 100) ){
622            intshit++;
623          } else {
624            outtshit++;
625          };
626      };      };
627      if ( trshit>0 ) {      if ( trshit>0 ) {
628        h1r->Fill(trshit);        h1r->Fill(trshit);
629        if ( trshit < 4210 ){        if ( trshit < 4210 ){
630          h1rcheck = true;          h1rout++;
631          //              printf("ma come... trshit %i \n",trshit);          //              printf("ma come... trshit %i \n",trshit);
632          } else {
633            h1rin++;
634        };        };
635      };      };
636      if ( i%1000 == 0 && i > 0 ) printf("%iK\n",i/1000);      if ( i%1000 == 0 && i > 0 ) printf("%iK\n",i/1000);
637      i++;      i++;
638    };    };
639    printf("\n");    printf("\n");
640          if ( (float)h1rout/((float)h1rin+(float)h1rout) > h1rth ){
641        h1rcheck = true;
642      };    
643    //    //
644    //  output figures, first sheet:    //  output figures, first sheet:
645    //    //
# Line 561  void FCaloQLOOK(TString filename, Int_t Line 659  void FCaloQLOOK(TString filename, Int_t
659    t->DrawLatex(2.,99.,errore.str().c_str());    t->DrawLatex(2.,99.,errore.str().c_str());
660    TPad *pd5;    TPad *pd5;
661    TPad *pd6;    TPad *pd6;
662      TPad *pd7;
663      TPad *pd8;
664    TPad *pad1;    TPad *pad1;
665    TPad *pad2;    TPad *pad2;
666    TPad *pad3;    TPad *pad3;
# Line 605  void FCaloQLOOK(TString filename, Int_t Line 705  void FCaloQLOOK(TString filename, Int_t
705      h1->Draw();      h1->Draw();
706      //      //
707      h1max = h1->GetMaximum()*1.05;      h1max = h1->GetMaximum()*1.05;
708      Double_t xc[4] = {0.,25.,25.,0.};      Double_t xc[4] = {10.,100.,100.,10.};
709      Double_t yc[4] = {0.,0.,h1max,h1max};      Double_t yc[4] = {0.,0.,h1max,h1max};
710      banda1 = new TPolyLine(4,xc,yc);      banda1 = new TPolyLine(4,xc,yc);
711      banda1->SetLineColor(5);      banda1->SetLineColor(5);
712      banda1->SetFillColor(5);      banda1->SetFillColor(5);
713      banda1->SetLineWidth(1);      banda1->SetLineWidth(1);
714      banda1->Draw("fSAME");      banda1->Draw("fSAME");
715      Double_t xd[4] = {40.,80.,80.,40.};    //  Double_t xd[4] = {40.,80.,80.,40.};
716      Double_t yd[4] = {0.,0.,h1max,h1max};     // Double_t yd[4] = {0.,0.,h1max,h1max};
717      banda2 = new TPolyLine(4,xd,yd);     // banda2 = new TPolyLine(4,xd,yd);
718      banda2->SetLineColor(5);     // banda2->SetLineColor(5);
719      banda2->SetFillColor(5);     // banda2->SetFillColor(5);
720      banda2->SetLineWidth(1);     // banda2->SetLineWidth(1);
721      banda2->Draw("fSAME");      //banda2->Draw("fSAME");
722      h1->Draw("SAME");      h1->Draw("SAME");
723      //      //
724      figura->cd();      figura->cd();
# Line 655  void FCaloQLOOK(TString filename, Int_t Line 755  void FCaloQLOOK(TString filename, Int_t
755        h1->SetYTitle("Number of events");        h1->SetYTitle("Number of events");
756        h1->Draw();        h1->Draw();
757        h1max = h1->GetMaximum()*1.05;        h1max = h1->GetMaximum()*1.05;
758        Double_t xe[4] = {0.,25.,25.,0.};        Double_t xe[4] = {10.,100.,100.,10.};
759        Double_t ye[4] = {0.,0.,h1max,h1max};        Double_t ye[4] = {0.,0.,h1max,h1max};
760        banda1 = new TPolyLine(4,xe,ye);        banda1 = new TPolyLine(4,xe,ye);
761        banda1->SetLineColor(5);        banda1->SetLineColor(5);
762        banda1->SetFillColor(5);        banda1->SetFillColor(5);
763        banda1->SetLineWidth(1);        banda1->SetLineWidth(1);
764        banda1->Draw("fSAME");        banda1->Draw("fSAME");
765        Double_t xf[4] = {40.,80.,80.,40.};       // Double_t xf[4] = {40.,80.,80.,40.};
766        Double_t yf[4] = {0.,0.,h1max,h1max};       // Double_t yf[4] = {0.,0.,h1max,h1max};
767        banda2 = new TPolyLine(4,xf,yf);       // banda2 = new TPolyLine(4,xf,yf);
768        banda2->SetLineColor(5);       // banda2->SetLineColor(5);
769        banda2->SetFillColor(5);       // banda2->SetFillColor(5);
770        banda2->SetLineWidth(1);      //  banda2->SetLineWidth(1);
771        banda2->Draw("fSAME");       // banda2->Draw("fSAME");
772        h1->Draw("SAME");        h1->Draw("SAME");
773      };      };
774      if ( trshit !=0 ) {      if ( trshit !=0 ) {
# Line 698  void FCaloQLOOK(TString filename, Int_t Line 798  void FCaloQLOOK(TString filename, Int_t
798      };      };
799    };    };
800    if ( !errorfull ) {    if ( !errorfull ) {
801      if ( calevn1 || calevn2 || calevn3 ) {      if ( calevn1 > calevnth || calevn2 > calevnth || calevn3 > calevnth ) {
802        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);
803        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);
804        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 873  void FCaloQLOOK(TString filename, Int_t Line 973  void FCaloQLOOK(TString filename, Int_t
973      Dexyc->Draw("SAME");      Dexyc->Draw("SAME");
974      //      //
975      pd3->cd();      pd3->cd();
976    //    gPad->SetLogy();
977      Calstriphit->SetXTitle("Number of hit");      Calstriphit->SetXTitle("Number of hit");
978      Calstriphit->SetYTitle("Number of events");      Calstriphit->SetYTitle("Number of events");
979      Calstriphit->Draw();      Calstriphit->Draw();
980      h1max = Calstriphit->GetMaximum()*1.05;      h1max = Calstriphit->GetMaximum()*1.05;
981      Double_t xg[4] = {0.,25.,25.,0.};      Double_t xg[4] = {10.,100.,100.,10.};
982      Double_t yg[4] = {0.,0.,h1max,h1max};      Double_t yg[4] = {0.,0.,h1max,h1max};
983      banda1 = new TPolyLine(4,xg,yg);      banda1 = new TPolyLine(4,xg,yg);
984      banda1->SetLineColor(5);      banda1->SetLineColor(5);
985      banda1->SetFillColor(5);      banda1->SetFillColor(5);
986      banda1->SetLineWidth(1);      banda1->SetLineWidth(1);
987      banda1->Draw("fSAME");      banda1->Draw("fSAME");
988      Double_t xh[4] = {40.,80.,80.,40.};    //  Double_t xh[4] = {40.,80.,80.,40.};
989      Double_t yh[4] = {0.,0.,h1max,h1max};    //  Double_t yh[4] = {0.,0.,h1max,h1max};
990      banda2 = new TPolyLine(4,xh,yh);    //  banda2 = new TPolyLine(4,xh,yh);
991      banda2->SetLineColor(5);    //  banda2->SetLineColor(5);
992      banda2->SetFillColor(5);    //  banda2->SetFillColor(5);
993      banda2->SetLineWidth(1);    //  banda2->SetLineWidth(1);
994      banda2->Draw("fSAME");    //  banda2->Draw("fSAME");
995      Calstriphit->Draw("SAME");      Calstriphit->Draw("SAME");
996      //      //
997      pd4->cd();      pd4->cd();
# Line 947  void FCaloQLOOK(TString filename, Int_t Line 1048  void FCaloQLOOK(TString filename, Int_t
1048      Dexy->Draw("SAME");      Dexy->Draw("SAME");
1049    };      };  
1050    //    //
1051      TCanvas *figura3 = 0;
1052      Bool_t printfigure3 = false;
1053      for (Int_t i = 0; i<4; i++){
1054        if ( ver[i][2] || lver[i][2] ){
1055          printfigure3 = true;
1056          break;
1057        };
1058      };
1059      if ( printfigure3 ){
1060        figura3 = new TCanvas("Calorimeter_Detector_Report_2bis/3","Calorimeter_Detector_Report_2bis/3", 1100, 900);
1061        figura3->SetFillColor(10);
1062        figura3->Range(0,0,100,100);
1063        errore.str("");
1064        errore << "EXPERT  --  File: " << file;
1065        errore << " ";
1066        t=new TLatex();
1067        t->SetTextFont(32);
1068        t->SetTextColor(1);
1069        t->SetTextAlign(12);
1070        t->SetTextSize(0.015);
1071        t->DrawLatex(2.,99.,errore.str().c_str());
1072        pd1 = new TPad("pd1","This is pad1",0.02,0.51,0.49,0.73,45);
1073        pd5 = new TPad("pd5","This is pad5",0.02,0.76,0.49,0.98,45);
1074        pd2 = new TPad("pd2","This is pad2",0.51,0.51,0.98,0.73,45);
1075        pd6 = new TPad("pd6","This is pad6",0.51,0.76,0.98,0.98,45);
1076        pd3 = new TPad("pd3","This is pad3",0.02,0.02,0.49,0.23,45);
1077        pd7 = new TPad("pd7","This is pad7",0.02,0.26,0.49,0.49,45);
1078        pd4 = new TPad("pd4","This is pad4",0.51,0.02,0.98,0.23,45);
1079        pd8 = new TPad("pd8","This is pad8",0.51,0.26,0.98,0.49,45);
1080        figura3->cd();
1081        pd1->Range(0,0,100,100);
1082        pd2->Range(0,0,100,100);
1083        pd3->Range(0,0,100,100);
1084        pd4->Range(0,0,100,100);      
1085        pd1->SetTicks();
1086        pd2->SetTicks();
1087        pd3->SetTicks();
1088        pd4->SetTicks();
1089        pd1->Draw();
1090        pd2->Draw();
1091        pd3->Draw();
1092        pd4->Draw();
1093        pd5->Range(0,0,100,100);
1094        pd6->Range(0,0,100,100);
1095        pd7->Range(0,0,100,100);
1096        pd8->Range(0,0,100,100);      
1097        pd5->SetTicks();
1098        pd6->SetTicks();
1099        pd7->SetTicks();
1100        pd8->SetTicks();
1101        pd5->Draw();
1102        pd6->Draw();
1103        pd7->Draw();
1104        pd8->Draw();
1105        pd1->cd();
1106        lup[0]->SetAxisRange((Double_t)min(minobt[0],swminobt[0])*0.9,(Double_t)max(maxobt[0],swmaxobt[0])*1.1,"X");
1107        lup[0]->SetXTitle("OBT");
1108        lup[0]->SetYTitle("Number of events");
1109        lup[0]->Draw();
1110        pd5->cd();
1111        lupstw[0]->SetAxisRange((Double_t)min(minobt[0],swminobt[0])*0.9,(Double_t)max(maxobt[0],swmaxobt[0])*1.1,"X");
1112        //    lupstw[0]->SetAxisRange((Double_t)swminobt[0]*0.9,(Double_t)swmaxobt[0]*1.1,"X");
1113        lupstw[0]->SetXTitle("OBT");
1114        lupstw[0]->SetYTitle("Number of events");
1115        lupstw[0]->Draw();
1116        pd2->cd();
1117        lup[1]->SetAxisRange((Double_t)min(minobt[1],swminobt[1])*0.9,(Double_t)max(maxobt[1],swmaxobt[1])*1.1,"X");
1118        //    lup[1]->SetAxisRange((Double_t)minobt[1]*0.9,(Double_t)maxobt[1]*1.1,"X");
1119        lup[1]->SetXTitle("OBT");
1120        lup[1]->SetYTitle("Number of events");
1121        lup[1]->Draw();
1122        pd6->cd();
1123        lupstw[1]->SetAxisRange((Double_t)min(minobt[1],swminobt[1])*0.9,(Double_t)max(maxobt[1],swmaxobt[1])*1.1,"X");
1124        //    lupstw[1]->SetAxisRange((Double_t)swminobt[1]*0.9,(Double_t)swmaxobt[1]*1.1,"X");
1125        lupstw[1]->SetXTitle("OBT");
1126        lupstw[1]->SetYTitle("Number of events");
1127        lupstw[1]->Draw();
1128        pd3->cd();
1129        lup[2]->SetAxisRange((Double_t)min(minobt[2],swminobt[2])*0.9,(Double_t)max(maxobt[2],swmaxobt[2])*1.1,"X");
1130        //    lup[2]->SetAxisRange((Double_t)minobt[2]*0.9,(Double_t)maxobt[2]*1.1,"X");
1131        lup[2]->SetXTitle("OBT");
1132        lup[2]->SetYTitle("Number of events");
1133        lup[2]->Draw();
1134        pd7->cd();
1135        lupstw[2]->SetAxisRange((Double_t)min(minobt[2],swminobt[2])*0.9,(Double_t)max(maxobt[2],swmaxobt[2])*1.1,"X");
1136        //    lupstw[2]->SetAxisRange((Double_t)swminobt[2]*0.9,(Double_t)swmaxobt[2]*1.1,"X");
1137        lupstw[2]->SetXTitle("OBT");
1138        lupstw[2]->SetYTitle("Number of events");
1139        lupstw[2]->Draw();
1140        pd4->cd();
1141        lup[3]->SetAxisRange((Double_t)min(minobt[3],swminobt[3])*0.9,(Double_t)max(maxobt[3],swmaxobt[3])*1.1,"X");
1142        //    lup[3]->SetAxisRange((Double_t)minobt[3]*0.9,(Double_t)maxobt[3]*1.1,"X");
1143        lup[3]->SetXTitle("OBT");
1144        lup[3]->SetYTitle("Number of events");
1145        lup[3]->Draw();
1146        pd8->cd();
1147        lupstw[3]->SetAxisRange((Double_t)min(minobt[3],swminobt[3])*0.9,(Double_t)max(maxobt[3],swmaxobt[3])*1.1,"X");
1148        //    lupstw[3]->SetAxisRange((Double_t)swminobt[3]*0.9,(Double_t)swmaxobt[3]*1.1,"X");
1149        lupstw[3]->SetXTitle("OBT");
1150        lupstw[3]->SetYTitle("Number of events");
1151        lupstw[3]->Draw();
1152      };
1153      //
1154    //  output figures, report sheet:    //  output figures, report sheet:
1155    //    //
1156    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 1023  void FCaloQLOOK(TString filename, Int_t Line 1227  void FCaloQLOOK(TString filename, Int_t
1227            check = true;            check = true;
1228          }          }
1229          if (j == 2) {          if (j == 2) {
1230              //      printf("boh! lalarm[%i] = %i \n",i,lalarm[i]);
1231            if ( lalarm[i] ){            if ( lalarm[i] ){
1232              errore.str("");              errore.str("");
1233              errore << "* Latch up: " << ver[i][j];              errore << "* Latch up: " << ver[i][j];
1234              errore << " (" << lalarm[i];                      errore << " (" << lalarm[i];        
1235              errore << " NOT rec!): ";              errore << " NOT rec!): ";
1236              t->DrawLatex(0.,70.,errore.str().c_str());              t->DrawLatex(2.,70.,errore.str().c_str());
1237              check = true;              check = true;
1238            } else {            } else {
1239              errore.str("");              errore.str("");
# Line 1099  void FCaloQLOOK(TString filename, Int_t Line 1304  void FCaloQLOOK(TString filename, Int_t
1304            errore << "Missing section: " << ver[i][j];            errore << "Missing section: " << ver[i][j];
1305            errore << " time(s)";            errore << " time(s)";
1306            t->DrawLatex(2.,50.,errore.str().c_str());            t->DrawLatex(2.,50.,errore.str().c_str());
1307            check = true;            if ( ver[i][j] > 3 ) check = true;
1308          }          }
1309          if (j == 10) {          if (j == 10) {
1310            errore.str("");            errore.str("");
# Line 1113  void FCaloQLOOK(TString filename, Int_t Line 1318  void FCaloQLOOK(TString filename, Int_t
1318            errore << "CRC error (data): " << ver[i][j];            errore << "CRC error (data): " << ver[i][j];
1319            errore << " time(s)";            errore << " time(s)";
1320            t->DrawLatex(2.,38.,errore.str().c_str());            t->DrawLatex(2.,38.,errore.str().c_str());
1321            check = true;            if ( ver[i][j] > 10 ) check = true;
1322          }          }
1323          if (j == 12) {          if (j == 12) {
1324            errore.str("");            errore.str("");
# Line 1226  void FCaloQLOOK(TString filename, Int_t Line 1431  void FCaloQLOOK(TString filename, Int_t
1431      t->DrawLatex(60.,95.," OK! ");            t->DrawLatex(60.,95.," OK! ");      
1432    };    };
1433    //    //
1434    const string fil = (const char*)filename;    //  const string fil = (const char*)filename;
1435    Int_t posiz = fil.find("dw_");    //  Int_t posiz = fil.find("dw_");
1436    if ( posiz == -1 ) posiz = fil.find("DW_");    //  if ( posiz == -1 ) posiz = fil.find("DW_");
1437    Int_t posiz2 = posiz+13;    //  Int_t posiz2 = posiz+13;
1438    TString file2;    //  TString file2;
1439    stringcopy(file2,filename,posiz,posiz2);    //  stringcopy(file2,filename,posiz,posiz2);
1440      //
1441      const string fil = gSystem->BaseName(filename.Data());
1442      Int_t posiz = fil.find(".root");
1443    //    //
1444      TString file2;
1445      if ( posiz == -1 ){
1446        file2 = gSystem->BaseName(filename.Data());
1447      } else {
1448        Int_t posiz2 = 0;
1449        stringcopy(file2,gSystem->BaseName(filename.Data()),posiz2,posiz);
1450      };
1451    const char *figrec = file2;    const char *figrec = file2;
1452      //
1453    const char *outdir = outDir;    const char *outdir = outDir;
1454    stringstream figsave;        stringstream figsave;    
1455    stringstream figsave1;        stringstream figsave1;    
# Line 1242  void FCaloQLOOK(TString filename, Int_t Line 1458  void FCaloQLOOK(TString filename, Int_t
1458    if ( !strcmp(format,"ps") ) {    if ( !strcmp(format,"ps") ) {
1459      figsave.str("");      figsave.str("");
1460      figsave << outdir << "/" ;      figsave << outdir << "/" ;
1461      figsave << figrec << "_qlook.";      figsave << figrec << "_CaloQLOOK.";
1462      figsave << format << "(";      figsave << format << "(";
1463      rapporto->Print(figsave.str().c_str(),"Landscape");          rapporto->Print(figsave.str().c_str(),"Landscape");    
1464      figsave1.str("");      figsave1.str("");
1465      figsave1 << outdir << "/" ;      figsave1 << outdir << "/" ;
1466      figsave1 << figrec << "_qlook.";      figsave1 << figrec << "_CaloQLOOK.";
1467      figsave1 << format;      figsave1 << format;
1468      figura->Print(figsave1.str().c_str(),"Landscape");      figura->Print(figsave1.str().c_str(),"Landscape");
1469      figsave2.str("");      figsave2.str("");
1470      figsave2 << outdir << "/" ;      figsave2 << outdir << "/" ;
1471      figsave2 << figrec << "_qlook.";      figsave2 << figrec << "_CaloQLOOK.";
1472      figsave2 << format << ")";      if ( printfigure3 ){
1473      figura2->Print(figsave2.str().c_str(),"Landscape");        figsave2 << format;
1474          figura2->Print(figsave2.str().c_str(),"Landscape");
1475          figsave2.str("");
1476          figsave2 << outdir << "/" ;
1477          figsave2 << figrec << "_CaloQLOOK.";
1478          figsave2 << format << ")";
1479          figura3->Print(figsave2.str().c_str(),"Landscape");
1480        } else {
1481          figsave2 << format << ")";;
1482          figura2->Print(figsave2.str().c_str(),"Landscape");
1483        };
1484    } else {    } else {
1485      figsave.str("");      figsave.str("");
1486      figsave << outdir << "/" ;      figsave << outdir << "/" ;
1487      figsave << figrec << "_qlook1.";      figsave << figrec << "_CaloQLOOK1.";
1488      figsave << format;      figsave << format;
1489      figura->SaveAs(figsave.str().c_str());      figura->SaveAs(figsave.str().c_str());
1490      figsave.str("");      figsave.str("");
1491      figsave << outdir << "/" ;      figsave << outdir << "/" ;
1492      figsave << figrec << "_qlook2.";      figsave << figrec << "_CaloQLOOK2.";
1493      figsave << format;      figsave << format;
1494      figura2->SaveAs(figsave.str().c_str());      figura2->SaveAs(figsave.str().c_str());
1495        if ( printfigure3 ){
1496          figsave.str("");
1497          figsave << outdir << "/" ;
1498          figsave << figrec << "_CaloQLOOK2bis.";
1499          figsave << format;
1500          figura3->SaveAs(figsave.str().c_str());
1501        };
1502      figsave.str("");      figsave.str("");
1503      figsave << outdir << "/" ;      figsave << outdir << "/" ;
1504      figsave << figrec << "_qlook3.";      figsave << figrec << "_CaloQLOOK3.";
1505      figsave << format;      figsave << format;
1506      rapporto->SaveAs(figsave.str().c_str());          rapporto->SaveAs(figsave.str().c_str());    
1507    };    };

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.23