/[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.8 by mocchiut, Tue May 23 13:28:22 2006 UTC revision 1.13 by mocchiut, Thu Aug 3 15:25:45 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.07  (2006-05-23)  //   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  //   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.  //                             case of latchup alarm.
16  //  //
# Line 65  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 = "png"){
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 104  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 190  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 273  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 301  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 336  void FCaloQLOOK(TString filename, Int_t Line 353  void FCaloQLOOK(TString filename, Int_t
353      headco = headc;      headco = headc;
354      headc = ph->GetCounter();      headc = ph->GetCounter();
355      obt = ph->GetOrbitalTime();      obt = ph->GetOrbitalTime();
356      calevn1 += (int)abs((int)(ce->calevnum[0]-ce->calevnum[1]));      if ( (int)abs((int)(ce->calevnum[0]-ce->calevnum[1])) ) calevn1++;
357      calevn2 += (int)abs((int)(ce->calevnum[2]-ce->calevnum[3]));      if ( (int)abs((int)(ce->calevnum[2]-ce->calevnum[3])) ) calevn2++;
358      calevn3 += (int)abs((int)(ce->calevnum[0]-ce->calevnum[3]));      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 424  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 ) {                  if ( (ce->stwerr[se] & (1 << 4)) == 0 ) {
# Line 504  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 ){                  if ( (ce->stwerr[se] & (1 << 4)) == 0 ){
# Line 573  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 662  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 712  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 755  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 930  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();
998        gPad->SetLogy();
999      Dexy->SetXTitle("ADC channels");      Dexy->SetXTitle("ADC channels");
1000      Dexy->SetYTitle("Number of events");      Dexy->SetYTitle("Number of events");
1001      Dexy->Draw();      Dexy->Draw();
1002      h1max = Dexy->GetMaximum()*1.05;      //    h1max = Dexy->GetMaximum()*1.05;
1003        h1max = Dexy->GetMaximum()*2.05;
1004      Double_t xd[4] = {2000.,5000.,5000.,2000.};      Double_t xd[4] = {2000.,5000.,5000.,2000.};
1005      Double_t yd[4] = {0.,0.,h1max,h1max};      Double_t yd[4] = {0.,0.,h1max,h1max};
1006      banda1 = new TPolyLine(4,xd,yd);      banda1 = new TPolyLine(4,xd,yd);
# Line 990  void FCaloQLOOK(TString filename, Int_t Line 1036  void FCaloQLOOK(TString filename, Int_t
1036      pd4->Draw();      pd4->Draw();
1037      //      //
1038      pd4->cd();      pd4->cd();
1039        gPad->SetLogy();
1040      Dexy->SetXTitle("ADC channels");      Dexy->SetXTitle("ADC channels");
1041      Dexy->SetYTitle("Number of events");      Dexy->SetYTitle("Number of events");
1042      Dexy->Draw();      Dexy->Draw();
1043      h1max = Dexy->GetMaximum()*1.05;      //    h1max = Dexy->GetMaximum()*1.05;
1044        h1max = Dexy->GetMaximum()*2.05;
1045      Double_t xd[4] = {2000.,5000.,5000.,2000.};      Double_t xd[4] = {2000.,5000.,5000.,2000.};
1046      Double_t yd[4] = {0.,0.,h1max,h1max};      Double_t yd[4] = {0.,0.,h1max,h1max};
1047      banda1 = new TPolyLine(4,xd,yd);      banda1 = new TPolyLine(4,xd,yd);
# Line 1059  void FCaloQLOOK(TString filename, Int_t Line 1107  void FCaloQLOOK(TString filename, Int_t
1107      pd7->Draw();      pd7->Draw();
1108      pd8->Draw();      pd8->Draw();
1109      pd1->cd();      pd1->cd();
1110      lup[0]->SetAxisRange((Double_t)minobt[0]*0.9,(Double_t)maxobt[0]*1.1,"X");      lup[0]->SetAxisRange((Double_t)min(minobt[0],swminobt[0])*0.9,(Double_t)max(maxobt[0],swmaxobt[0])*1.1,"X");
1111        lup[0]->SetXTitle("OBT");
1112        lup[0]->SetYTitle("Number of events");
1113      lup[0]->Draw();      lup[0]->Draw();
1114      pd5->cd();      pd5->cd();
1115      lupstw[0]->SetAxisRange((Double_t)swminobt[0]*0.9,(Double_t)swmaxobt[0]*1.1,"X");      lupstw[0]->SetAxisRange((Double_t)min(minobt[0],swminobt[0])*0.9,(Double_t)max(maxobt[0],swmaxobt[0])*1.1,"X");
1116        //    lupstw[0]->SetAxisRange((Double_t)swminobt[0]*0.9,(Double_t)swmaxobt[0]*1.1,"X");
1117        lupstw[0]->SetXTitle("OBT");
1118        lupstw[0]->SetYTitle("Number of events");
1119      lupstw[0]->Draw();      lupstw[0]->Draw();
1120      pd2->cd();      pd2->cd();
1121      lup[1]->SetAxisRange((Double_t)minobt[1]*0.9,(Double_t)maxobt[1]*1.1,"X");      lup[1]->SetAxisRange((Double_t)min(minobt[1],swminobt[1])*0.9,(Double_t)max(maxobt[1],swmaxobt[1])*1.1,"X");
1122        //    lup[1]->SetAxisRange((Double_t)minobt[1]*0.9,(Double_t)maxobt[1]*1.1,"X");
1123        lup[1]->SetXTitle("OBT");
1124        lup[1]->SetYTitle("Number of events");
1125      lup[1]->Draw();      lup[1]->Draw();
1126      pd6->cd();      pd6->cd();
1127      lupstw[1]->SetAxisRange((Double_t)swminobt[1]*0.9,(Double_t)swmaxobt[1]*1.1,"X");      lupstw[1]->SetAxisRange((Double_t)min(minobt[1],swminobt[1])*0.9,(Double_t)max(maxobt[1],swmaxobt[1])*1.1,"X");
1128        //    lupstw[1]->SetAxisRange((Double_t)swminobt[1]*0.9,(Double_t)swmaxobt[1]*1.1,"X");
1129        lupstw[1]->SetXTitle("OBT");
1130        lupstw[1]->SetYTitle("Number of events");
1131      lupstw[1]->Draw();      lupstw[1]->Draw();
1132      pd3->cd();      pd3->cd();
1133      lup[2]->SetAxisRange((Double_t)minobt[2]*0.9,(Double_t)maxobt[2]*1.1,"X");      lup[2]->SetAxisRange((Double_t)min(minobt[2],swminobt[2])*0.9,(Double_t)max(maxobt[2],swmaxobt[2])*1.1,"X");
1134        //    lup[2]->SetAxisRange((Double_t)minobt[2]*0.9,(Double_t)maxobt[2]*1.1,"X");
1135        lup[2]->SetXTitle("OBT");
1136        lup[2]->SetYTitle("Number of events");
1137      lup[2]->Draw();      lup[2]->Draw();
1138      pd7->cd();      pd7->cd();
1139      lupstw[2]->SetAxisRange((Double_t)swminobt[2]*0.9,(Double_t)swmaxobt[2]*1.1,"X");      lupstw[2]->SetAxisRange((Double_t)min(minobt[2],swminobt[2])*0.9,(Double_t)max(maxobt[2],swmaxobt[2])*1.1,"X");
1140        //    lupstw[2]->SetAxisRange((Double_t)swminobt[2]*0.9,(Double_t)swmaxobt[2]*1.1,"X");
1141        lupstw[2]->SetXTitle("OBT");
1142        lupstw[2]->SetYTitle("Number of events");
1143      lupstw[2]->Draw();      lupstw[2]->Draw();
1144      pd4->cd();      pd4->cd();
1145      lup[3]->SetAxisRange((Double_t)minobt[3]*0.9,(Double_t)maxobt[3]*1.1,"X");      lup[3]->SetAxisRange((Double_t)min(minobt[3],swminobt[3])*0.9,(Double_t)max(maxobt[3],swmaxobt[3])*1.1,"X");
1146        //    lup[3]->SetAxisRange((Double_t)minobt[3]*0.9,(Double_t)maxobt[3]*1.1,"X");
1147        lup[3]->SetXTitle("OBT");
1148        lup[3]->SetYTitle("Number of events");
1149      lup[3]->Draw();      lup[3]->Draw();
1150      pd8->cd();      pd8->cd();
1151      lupstw[3]->SetAxisRange((Double_t)swminobt[3]*0.9,(Double_t)swmaxobt[3]*1.1,"X");      lupstw[3]->SetAxisRange((Double_t)min(minobt[3],swminobt[3])*0.9,(Double_t)max(maxobt[3],swmaxobt[3])*1.1,"X");
1152        //    lupstw[3]->SetAxisRange((Double_t)swminobt[3]*0.9,(Double_t)swmaxobt[3]*1.1,"X");
1153        lupstw[3]->SetXTitle("OBT");
1154        lupstw[3]->SetYTitle("Number of events");
1155      lupstw[3]->Draw();      lupstw[3]->Draw();
1156    };    };
1157    //    //
# Line 1237  void FCaloQLOOK(TString filename, Int_t Line 1308  void FCaloQLOOK(TString filename, Int_t
1308            errore << "Missing section: " << ver[i][j];            errore << "Missing section: " << ver[i][j];
1309            errore << " time(s)";            errore << " time(s)";
1310            t->DrawLatex(2.,50.,errore.str().c_str());            t->DrawLatex(2.,50.,errore.str().c_str());
1311            check = true;            if ( ver[i][j] > 3 ) check = true;
1312          }          }
1313          if (j == 10) {          if (j == 10) {
1314            errore.str("");            errore.str("");
# Line 1251  void FCaloQLOOK(TString filename, Int_t Line 1322  void FCaloQLOOK(TString filename, Int_t
1322            errore << "CRC error (data): " << ver[i][j];            errore << "CRC error (data): " << ver[i][j];
1323            errore << " time(s)";            errore << " time(s)";
1324            t->DrawLatex(2.,38.,errore.str().c_str());            t->DrawLatex(2.,38.,errore.str().c_str());
1325            check = true;            if ( ver[i][j] > 10 ) check = true;
1326          }          }
1327          if (j == 12) {          if (j == 12) {
1328            errore.str("");            errore.str("");
# Line 1364  void FCaloQLOOK(TString filename, Int_t Line 1435  void FCaloQLOOK(TString filename, Int_t
1435      t->DrawLatex(60.,95.," OK! ");            t->DrawLatex(60.,95.," OK! ");      
1436    };    };
1437    //    //
1438    const string fil = (const char*)filename;    //  const string fil = (const char*)filename;
1439    Int_t posiz = fil.find("dw_");    //  Int_t posiz = fil.find("dw_");
1440    if ( posiz == -1 ) posiz = fil.find("DW_");    //  if ( posiz == -1 ) posiz = fil.find("DW_");
1441    Int_t posiz2 = posiz+13;    //  Int_t posiz2 = posiz+13;
1442    TString file2;    //  TString file2;
1443    stringcopy(file2,filename,posiz,posiz2);    //  stringcopy(file2,filename,posiz,posiz2);
1444      //
1445      const string fil = gSystem->BaseName(filename.Data());
1446      Int_t posiz = fil.find(".root");
1447    //    //
1448      TString file2;
1449      if ( posiz == -1 ){
1450        file2 = gSystem->BaseName(filename.Data());
1451      } else {
1452        Int_t posiz2 = 0;
1453        stringcopy(file2,gSystem->BaseName(filename.Data()),posiz2,posiz);
1454      };
1455    const char *figrec = file2;    const char *figrec = file2;
1456      //
1457    const char *outdir = outDir;    const char *outdir = outDir;
1458    stringstream figsave;        stringstream figsave;    
1459    stringstream figsave1;        stringstream figsave1;    
# Line 1380  void FCaloQLOOK(TString filename, Int_t Line 1462  void FCaloQLOOK(TString filename, Int_t
1462    if ( !strcmp(format,"ps") ) {    if ( !strcmp(format,"ps") ) {
1463      figsave.str("");      figsave.str("");
1464      figsave << outdir << "/" ;      figsave << outdir << "/" ;
1465      figsave << figrec << "_qlook.";      figsave << figrec << "_CaloQLOOK.";
1466      figsave << format << "(";      figsave << format << "(";
1467      rapporto->Print(figsave.str().c_str(),"Landscape");          rapporto->Print(figsave.str().c_str(),"Landscape");    
1468      figsave1.str("");      figsave1.str("");
1469      figsave1 << outdir << "/" ;      figsave1 << outdir << "/" ;
1470      figsave1 << figrec << "_qlook.";      figsave1 << figrec << "_CaloQLOOK.";
1471      figsave1 << format;      figsave1 << format;
1472      figura->Print(figsave1.str().c_str(),"Landscape");      figura->Print(figsave1.str().c_str(),"Landscape");
1473      figsave2.str("");      figsave2.str("");
1474      figsave2 << outdir << "/" ;      figsave2 << outdir << "/" ;
1475      figsave2 << figrec << "_qlook.";      figsave2 << figrec << "_CaloQLOOK.";
1476      if ( printfigure3 ){      if ( printfigure3 ){
1477        figsave2 << format;        figsave2 << format;
1478        figura2->Print(figsave2.str().c_str(),"Landscape");        figura2->Print(figsave2.str().c_str(),"Landscape");
1479        figsave2.str("");        figsave2.str("");
1480        figsave2 << outdir << "/" ;        figsave2 << outdir << "/" ;
1481        figsave2 << figrec << "_qlook.";        figsave2 << figrec << "_CaloQLOOK.";
1482        figsave2 << format << ")";        figsave2 << format << ")";
1483        figura3->Print(figsave2.str().c_str(),"Landscape");        figura3->Print(figsave2.str().c_str(),"Landscape");
1484      } else {      } else {
# Line 1406  void FCaloQLOOK(TString filename, Int_t Line 1488  void FCaloQLOOK(TString filename, Int_t
1488    } else {    } else {
1489      figsave.str("");      figsave.str("");
1490      figsave << outdir << "/" ;      figsave << outdir << "/" ;
1491      figsave << figrec << "_qlook1.";      figsave << figrec << "_CaloQLOOK1.";
1492      figsave << format;      figsave << format;
1493      figura->SaveAs(figsave.str().c_str());      figura->SaveAs(figsave.str().c_str());
1494      figsave.str("");      figsave.str("");
1495      figsave << outdir << "/" ;      figsave << outdir << "/" ;
1496      figsave << figrec << "_qlook2.";      figsave << figrec << "_CaloQLOOK2.";
1497      figsave << format;      figsave << format;
1498      figura2->SaveAs(figsave.str().c_str());      figura2->SaveAs(figsave.str().c_str());
1499      if ( printfigure3 ){      if ( printfigure3 ){
1500        figsave.str("");        figsave.str("");
1501        figsave << outdir << "/" ;        figsave << outdir << "/" ;
1502        figsave << figrec << "_qlook2bis.";        figsave << figrec << "_CaloQLOOK2bis.";
1503        figsave << format;        figsave << format;
1504        figura3->SaveAs(figsave.str().c_str());        figura3->SaveAs(figsave.str().c_str());
1505      };      };
1506      figsave.str("");      figsave.str("");
1507      figsave << outdir << "/" ;      figsave << outdir << "/" ;
1508      figsave << figrec << "_qlook3.";      figsave << figrec << "_CaloQLOOK3.";
1509      figsave << format;      figsave << format;
1510      rapporto->SaveAs(figsave.str().c_str());          rapporto->SaveAs(figsave.str().c_str());    
1511    };    };

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.23