/[PAMELA software]/quicklook/tracker/flight/macros/FTrkQLook_EXPERT.cxx
ViewVC logotype

Diff of /quicklook/tracker/flight/macros/FTrkQLook_EXPERT.cxx

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

revision 1.6 by pam-fi, Thu Jun 8 10:33:53 2006 UTC revision 1.9 by pam-fi, Sun Jul 2 17:41:15 2006 UTC
# Line 1  Line 1 
1  /**  /**
2   * FTrkQLook_EXPERT   * FTrkQLook_EXPERT.cxx
3   *   *
4   * autor: D.Fedele   * autor: D.Fedele
5   * version 2.0   * version v1r05
6   * Parameters:   * Parameters:
7   *      file - the data file to analyze   *      file - the data file to analyze
8   *      fromevent - first event to analyze   *      fromevent - first event to analyze
# Line 19  Line 19 
19  #include <TLatex.h>  #include <TLatex.h>
20  #include <TCanvas.h>  #include <TCanvas.h>
21  #include <TGraph.h>  #include <TGraph.h>
22    #include <TFile.h>
23  #include <TTree.h>  #include <TTree.h>
24  #include <TStyle.h>  #include <TStyle.h>
25  //  //
# Line 34  Line 35 
35  //  //
36  #define MAXSTORAGE 50000  #define MAXSTORAGE 50000
37    
 void stringcopy(TString& s1, const TString& s2, Int_t from=0, Int_t to=0){      
   if ( to == 0 ){  
     Int_t t2length = s2.Length();  
     s1 = "";  
     to = t2length;  
   };  
   for (Int_t i = from; i<to; i++){  
     s1.Append(s2[i],1);  
   };  
 };  
   
   
38  void FTrkQLook_EXPERT(TString file,Int_t fromevent,Int_t toevent, TString outdir, TString outfile)  void FTrkQLook_EXPERT(TString file,Int_t fromevent,Int_t toevent, TString outdir, TString outfile)
39  {  {
40    //    //
41    //   obtain information about the data file and select the output dir    //   obtain information about the data file and select the output dir
42    const string filepath=file.Data();    Int_t dwpos = file.Last('/');
43    Int_t dwpos = filepath.rfind("/");    Int_t dwpos1 = file.Last('.');
   Int_t dwpos1 = filepath.find(".root");  
   TString fpath=(filepath.c_str());  
44    TString base,ffile ;    TString base,ffile ;
45    stringcopy(ffile,fpath,dwpos+1,dwpos1);    ffile=file(dwpos+1,dwpos1-(dwpos+1));
46    stringcopy(base,fpath,0,dwpos);    if(dwpos>0) base=file(0,dwpos);
   if(dwpos>0) base+="/";  
47    
48    TString out;    TString out;
49    if(outdir.Length()==0){    if(outdir.Length()==0){
# Line 65  void FTrkQLook_EXPERT(TString file,Int_t Line 51  void FTrkQLook_EXPERT(TString file,Int_t
51    }else{    }else{
52      out = outdir;      out = outdir;
53    }    }
54      if(out.Last('/')+1<out.Length()) out+="/";
55    
56    //    //
57    // inizialise the variables and open the file    // inizialise the variables and open the file
# Line 80  void FTrkQLook_EXPERT(TString file,Int_t Line 67  void FTrkQLook_EXPERT(TString file,Int_t
67    pamela::PacketType *pctp=0;    pamela::PacketType *pctp=0;
68    
69    TFile *datafile = new TFile(file);    TFile *datafile = new TFile(file);
70      if ( !datafile ){
71        printf("No data file, exiting...\n");
72        return;
73      }
74    
75    TTree *tree = (TTree*)datafile->Get("TsbT");    TTree *tree = (TTree*)datafile->Get("TsbT");
76    tree->SetBranchAddress("TsbT",&event);    tree->SetBranchAddress("TsbT",&event);
# Line 140  void FTrkQLook_EXPERT(TString file,Int_t Line 131  void FTrkQLook_EXPERT(TString file,Int_t
131      nevent=maxevent-minevent ;      nevent=maxevent-minevent ;
132    }    }
133    
134    Long64_t obt=0;    //
135    const Int_t sizeH=neventH;    // information about the RunHeader
136    ULong64_t HOBT[sizeH];    ULong64_t HOBT[neventH];
137    Int_t trk_cal_us[sizeH],countrun=1;    Int_t trk_cal_us[neventH];
138    for (Int_t vi=0; vi<sizeH;vi++){    for (Int_t vi=0; vi<neventH;vi++){
139      HOBT[vi]=0;      HOBT[vi]=0;
140      trk_cal_us[vi]=0;      trk_cal_us[vi]=0;
141    }    }
# Line 153  void FTrkQLook_EXPERT(TString file,Int_t Line 144  void FTrkQLook_EXPERT(TString file,Int_t
144      pH = eH->GetPscuHeader();      pH = eH->GetPscuHeader();
145      HOBT[ev]= pH->GetOrbitalTime();      HOBT[ev]= pH->GetOrbitalTime();
146      trk_cal_us[ev]=reh->TRK_CALIB_USED;      trk_cal_us[ev]=reh->TRK_CALIB_USED;
 //     if((HOBT[ev]<HOBT[ev-1]) && ev>0)  
 //       countrun+=1;  
     //   printf("\n%lld\t\tcountrun=%d\n",HOBT[ev],countrun);  
147    }    }
148    
149    //    //
# Line 174  void FTrkQLook_EXPERT(TString file,Int_t Line 162  void FTrkQLook_EXPERT(TString file,Int_t
162    }    }
163    const Int_t tsize=maxsize;    const Int_t tsize=maxsize;
164    Int_t tempt[tsize][5],xt[tsize], tempt_tmp[tsize];    Int_t tempt[tsize][5],xt[tsize], tempt_tmp[tsize];
165      Int_t countnboot=1;
166    //    //
167    // information about the temperatures    // information about the temperatures
168    for (Int_t ev=0; ev<tnevent; ev++){    for (Int_t ev=0; ev<tnevent; ev++){
# Line 181  void FTrkQLook_EXPERT(TString file,Int_t Line 170  void FTrkQLook_EXPERT(TString file,Int_t
170      tmpSize = event->Records->GetEntries();      tmpSize = event->Records->GetEntries();
171      for (Int_t j = 0; j < tmpSize; j++){      for (Int_t j = 0; j < tmpSize; j++){
172        record = (pamela::TsbTRecord*)event->Records->At(j);        record = (pamela::TsbTRecord*)event->Records->At(j);
173        xt[siztmp]=record->RECORD_OBT;  //0.051*record->RECORD_OBT;        xt[siztmp]=record->RECORD_OBT;
174        if((xt[siztmp]<xt[siztmp-1]) && siztmp>0)        if((xt[siztmp]<xt[siztmp-1]) && siztmp>0)
175          countrun+=1;          countnboot+=1;
176                
177        for (Int_t z = 0; z < 5; z++){        for (Int_t z = 0; z < 5; z++){
178          tempt[siztmp][z] = record->TEMPERATURES[z+1];              tempt[siztmp][z] = record->TEMPERATURES[z+1];    
# Line 191  void FTrkQLook_EXPERT(TString file,Int_t Line 180  void FTrkQLook_EXPERT(TString file,Int_t
180        siztmp++;        siztmp++;
181      }      }
182    }    }
183  //   printf("\ncountrun=%d\n",countrun);    countnboot+=2*(Int_t)nevent/MAXSTORAGE;
184    countrun+=(Int_t)nevent/30000;    //   printf("\ncountnboot=%d\n",countnboot);
185        
186    //    //
187    // open the output text files for the alarms    // open the output text files for the alarms
# Line 212  void FTrkQLook_EXPERT(TString file,Int_t Line 201  void FTrkQLook_EXPERT(TString file,Int_t
201    // write the file for the TrkAlarm packet    // write the file for the TrkAlarm packet
202    if(alnevent==0) alarm1 <<endl<< "------>  NO ALARM!!! <-------"<< endl;    if(alnevent==0) alarm1 <<endl<< "------>  NO ALARM!!! <-------"<< endl;
203    else{    else{
204        Long64_t obt=0;
205      for (Int_t ev=0; ev<alnevent; ev++){      for (Int_t ev=0; ev<alnevent; ev++){
206        altr->GetEntry(ev);        altr->GetEntry(ev);
207        ph = aleh->GetPscuHeader();        ph = aleh->GetPscuHeader();
# Line 269  void FTrkQLook_EXPERT(TString file,Int_t Line 259  void FTrkQLook_EXPERT(TString file,Int_t
259      }      }
260    }    }
261    
262      //
263      // Set Style options
264    gStyle->SetLabelSize(0.05,"x");    gStyle->SetLabelSize(0.05,"x");
265    gStyle->SetLabelSize(0.06,"y");    gStyle->SetLabelSize(0.06,"y");
266    gStyle->SetStatFontSize(0.075);    gStyle->SetStatFontSize(0.075);
# Line 283  void FTrkQLook_EXPERT(TString file,Int_t Line 274  void FTrkQLook_EXPERT(TString file,Int_t
274    gStyle->SetTitleSize(0.06,"y");    gStyle->SetTitleSize(0.06,"y");
275    gStyle->SetTitleSize(0.055,"x");    gStyle->SetTitleSize(0.055,"x");
276    
277    //*************************************************************************************    //
278      //book pads and histos    // Define output canvas, histos and graphs
279      //***************************************************************************************    TCanvas *CompTimeCanv[countnboot],*EventNumCanv[countnboot],*TempCanv[countnboot];
   
   TCanvas *CompTimeCanv[countrun],*EventNumCanv[countrun],*TempCanv[countrun];  
280    TCanvas *IlluminaCanv,*LandauCanv1,*LandauCanv2,*LandauCanv3;    TCanvas *IlluminaCanv,*LandauCanv1,*LandauCanv2,*LandauCanv3;
281    
282    TH1F *landau1[12],*landau2[12],*landau3[12],*illuminazione[12];    TH1F *landau1[12],*landau2[12],*landau3[12],*illuminazione[12];
283      TGraph *comprtime[12][countnboot],*temp[5][countnboot],*eventnumb[countnboot];
284    TPad *pad1[12],*pad2[12],*pad3[12],*pad4[12],*pad5[12],*pad6[5];    TPad *pad1[12],*pad2[12],*pad3[12],*pad4[12],*pad5[12],*pad6[5];
285    
286    for(Int_t n = 0; n<12; n++) {    for(Int_t n = 0; n<12; n++) {
# Line 317  void FTrkQLook_EXPERT(TString file,Int_t Line 307  void FTrkQLook_EXPERT(TString file,Int_t
307    };                };            
308        
309    
   
310    //***************************************************************************************    //***************************************************************************************
311    // LOOP on each event    // LOOP on each event
312    //***************************************************************************************    //***************************************************************************************
# Line 332  void FTrkQLook_EXPERT(TString file,Int_t Line 321  void FTrkQLook_EXPERT(TString file,Int_t
321    
322    Int_t cntpgtemp=0,cntpgdat=0;    Int_t cntpgtemp=0,cntpgdat=0;
323    Int_t minev=minevent,maxev=maxevent,countTEMP=0;    Int_t minev=minevent,maxev=maxevent,countTEMP=0;
   TGraph *comprtime[12][countrun],*temp[5][countrun],*eventnumb[countrun];  
324    
325    for(Int_t ii=0; ii<countrun;ii++){    //
326      // Fill temperature graphs
327      for(Int_t ii=0; ii<countnboot;ii++){
328      //****************************************************************************************      //****************************************************************************************
329      //Output figures --- Fifth sheet:      //Temperature Output Pages
330      //****************************************************************************************      //****************************************************************************************
331      fromfile.str("");      fromfile.str("");
332      fromfile<<"FTrkQLook_EXPERT      File: "<<ffile;      fromfile<<"FTrkQLook_EXPERT      File: "<<ffile;
# Line 428  void FTrkQLook_EXPERT(TString file,Int_t Line 418  void FTrkQLook_EXPERT(TString file,Int_t
418    }    }
419    
420    
421    for(Int_t ii=0; ii<countrun;ii++){    //
422      TPaveText *pt1;    // Fill compressiontime and eventnumber graphs and DSP warnings
423      TPad *pt,*pt0;         //pad for histos    for(Int_t ii=0; ii<countnboot;ii++){
424        TPad *pt;         //pad for histos
425        
     ofstream warning(out + "warning.txt",ios::out);  
   
426      //****************************************************************************************      //****************************************************************************************
427      //Output figures --- First sheet:      //COMPRESSIONTIME vs. OBT Output Pages
428      //****************************************************************************************      //****************************************************************************************
429      fromfile.str("");      fromfile.str("");
430      fromfile<<"FTrkQLook_EXPERT      File: "<<ffile;      fromfile<<"FTrkQLook_EXPERT      File: "<<ffile;
# Line 456  void FTrkQLook_EXPERT(TString file,Int_t Line 445  void FTrkQLook_EXPERT(TString file,Int_t
445      isfile.str("");      isfile.str("");
446    
447      //****************************************************************************************      //****************************************************************************************
448      //Output figures --- Second sheet:      //DSP EVENT NUMBER Output Pages
449      //****************************************************************************************      //****************************************************************************************
450    
451      isfile<<"WARNINGS on DSP EVENT NUMBER   pag"<<ii+1;      isfile<<"DSP EVENT NUMBER vs. OBT   pag"<<ii+1;
452      EventNumCanv[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200);      EventNumCanv[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200);
453      EventNumCanv[ii]->SetFillColor(10);      EventNumCanv[ii]->SetFillColor(10);
454      EventNumCanv[ii]->Range(0,0,100,100);      EventNumCanv[ii]->Range(0,0,100,100);
# Line 472  void FTrkQLook_EXPERT(TString file,Int_t Line 461  void FTrkQLook_EXPERT(TString file,Int_t
461      t1->SetTextColor(1);      t1->SetTextColor(1);
462      t1->SetTextAlign(12);      t1->SetTextAlign(12);
463      t1->SetTextSize(0.02);      t1->SetTextSize(0.02);
464      t1->DrawLatex(65.,98.7,isfile.str().c_str());      t1->DrawLatex(62.,98.7,isfile.str().c_str());
465      isfile.str("");      isfile.str("");
466    
467      Float_t posy = 0.95;    // up y-coord - top pads      Float_t posy = 0.95;    // up y-coord - top pads
# Line 504  void FTrkQLook_EXPERT(TString file,Int_t Line 493  void FTrkQLook_EXPERT(TString file,Int_t
493        pad4[n] = new TPad("pad4"," ",posx1,posy-hpad,posx0,posy,18,0,0);        pad4[n] = new TPad("pad4"," ",posx1,posy-hpad,posx0,posy,18,0,0);
494        pad5[n] = new TPad("pad5"," ",posx1,posy-hpad,posx0,posy,18,0,0);        pad5[n] = new TPad("pad5"," ",posx1,posy-hpad,posx0,posy,18,0,0);
495      }      }
     //**********************************************************************************  
     // Fill Graphs and Histos  
     //**********************************************************************************  
496        
497      //      //
498      // information about the tracker data      // Obtain information about the tracker data
499      Int_t warning_dspnumber=0;      // and fill graphs and histos
500    
501        Int_t al=0;
502      Float_t x[MAXSTORAGE];      Float_t x[MAXSTORAGE];
503      Float_t yc[MAXSTORAGE][12];      Float_t yc[MAXSTORAGE][12];
504      Float_t eventint[MAXSTORAGE];      Float_t eventint[MAXSTORAGE];
# Line 519  void FTrkQLook_EXPERT(TString file,Int_t Line 507  void FTrkQLook_EXPERT(TString file,Int_t
507        tr->GetEntry(ev);        tr->GetEntry(ev);
508        ph = eh->GetPscuHeader();        ph = eh->GetPscuHeader();
509        cod = eh->GetCounter();        cod = eh->GetCounter();
510        
511    
512        if(ev==maxevent-1) maxev=maxevent-1;        if(ev==maxevent-1) maxev=maxevent-1;
513    
514        if((ph->GetOrbitalTime()<x[ev-minev-1] && ev-minev!=0) || ev-minev==MAXSTORAGE){        if((ph->GetOrbitalTime()<x[ev-minev-1] && ev-minev!=0) || ev-minev==MAXSTORAGE){
# Line 532  void FTrkQLook_EXPERT(TString file,Int_t Line 521  void FTrkQLook_EXPERT(TString file,Int_t
521                    
522          Int_t dsp=0;          Int_t dsp=0;
523          for(Int_t i=0; i<12; i++){          for(Int_t i=0; i<12; i++){
524              if(te->DSPnumber[i]<1 || te->DSPnumber[i]>12) {
525                ALARM=1;
526                break;
527              }
528    
529            dsp=te->DSPnumber[i]-1;            dsp=te->DSPnumber[i]-1;
530            yc[(ev-minev)][dsp]= 0.051*te->compressiontime[i];            yc[(ev-minev)][dsp]= 0.051*te->compressiontime[i];
531              
532              //
533              // Fill Cluster Signal and Lighting of the view histos
534            for(Int_t j=0;j<3;j++){            for(Int_t j=0;j<3;j++){
535              if(te->signcluster[i][j]!=0){              if(te->signcluster[i][j]!=0){
536                if((te->addrcluster[i][j]>6 && te->addrcluster[i][j]<505) ||(te->addrcluster[i][j]>518 && te->addrcluster[i][j]<1018)){                if((te->addrcluster[i][j]>6 && te->addrcluster[i][j]<505) ||(te->addrcluster[i][j]>518 && te->addrcluster[i][j]<1018)){
# Line 544  void FTrkQLook_EXPERT(TString file,Int_t Line 540  void FTrkQLook_EXPERT(TString file,Int_t
540            }            }
541            if(trk_cal_us[cod->Get(pctp->RunHeader)]!=104){            if(trk_cal_us[cod->Get(pctp->RunHeader)]!=104){
542              if(!(dsp%2)){              if(!(dsp%2)){
543                //              if((te->addrcluster[i][0]>6 && te->addrcluster[i][0]<505) ||(te->addrcluster[i][0]>518 && te->addrcluster[i][0]<1018))                if(te->signcluster[i][0]!=0) landau1[dsp]->Fill((Float_t)(1024.-te->signcluster[i][0]));
544                  if(te->signcluster[i][0]!=0) landau1[dsp]->Fill((Float_t)(1024.-te->signcluster[i][0]));                if(te->signcluster[i][1]!=0) landau2[dsp]->Fill((Float_t)(1024.-te->signcluster[i][1]));
545                  //      if((te->addrcluster[i][1]>6 && te->addrcluster[i][1]<505) ||(te->addrcluster[i][1]>518 && te->addrcluster[i][1]<1018))                if(te->signcluster[i][2]!=0) landau3[dsp]->Fill((Float_t)(1024.-te->signcluster[i][2]));
                 if(te->signcluster[i][1]!=0) landau2[dsp]->Fill((Float_t)(1024.-te->signcluster[i][1]));  
                 // if((te->addrcluster[i][2]>6 && te->addrcluster[i][2]<505) ||(te->addrcluster[i][2]>518 && te->addrcluster[i][2]<1018))  
                 if(te->signcluster[i][2]!=0) landau3[dsp]->Fill((Float_t)(1024.-te->signcluster[i][2]));  
546              }              }
547              else{              else{
548                // if((te->addrcluster[i][0]>6 && te->addrcluster[i][0]<505) ||(te->addrcluster[i][0]>518 && te->addrcluster[i][0]<1018))                if(te->signcluster[i][0]!=0) landau1[dsp]->Fill((Float_t)te->signcluster[i][0]);
549                  if(te->signcluster[i][0]!=0) landau1[dsp]->Fill((Float_t)te->signcluster[i][0]);                if(te->signcluster[i][1]!=0) landau2[dsp]->Fill((Float_t)te->signcluster[i][1]);
550                  // if((te->addrcluster[i][1]>6 && te->addrcluster[i][1]<505) ||(te->addrcluster[i][1]>518 && te->addrcluster[i][1]<1018))                if(te->signcluster[i][2]!=0) landau3[dsp]->Fill((Float_t)te->signcluster[i][2]);
                 if(te->signcluster[i][1]!=0) landau2[dsp]->Fill((Float_t)te->signcluster[i][1]);  
                 //      if((te->addrcluster[i][2]>6 && te->addrcluster[i][2]<505) ||(te->addrcluster[i][2]>518 && te->addrcluster[i][2]<1018))  
                 if(te->signcluster[i][2]!=0) landau3[dsp]->Fill((Float_t)te->signcluster[i][2]);  
551              }              }
552            }            }
553    
554            WARNING[i]=0;            WARNING[i]=0;
555            if(te->fc[i]!=0 || te->fl1[i]!=0 || te->fl2[i]!=0 || te->fl3[i]!=0 || te->fl4[i]!=0 || te->fl5[i]!=0 || te->fl6[i]!=0){            if(te->fc[i]!=0 || te->fl1[i]!=0 || te->fl2[i]!=0 || te->fl3[i]!=0 || te->fl4[i]!=0 || te->fl5[i]!=0 || te->fl6[i]!=0){
556              ALARM = 1;      //general alarm              ALARM = 1;      //general alarm
557                al=1;
558              WARNING[i] = 1; // DSP warning              WARNING[i] = 1; // DSP warning
559            };            };
560    
561            if(te->alarm[i]!=0){ // hardware alarm            if(te->alarm[i]!=0){ // hardware alarm
562              ALARM = 1;              ALARM = 1;
563                al=1;
564            };            };
565                
566            //**************************************************************************************            //**************************************************************************************
567            // warning for internal number            // warning for internal number
568            //**************************************************************************************            //**************************************************************************************
569            if(i<=10){            if(i<=10 && te->eventn[i]!=te->eventn[i+1]) ALARM=1;
             if(te->eventn[i]!=te->eventn[i+1]){  
               warning_dspnumber++;  
               warning<< "==> WARNING!!    Check entry "<< ev<<" (DSP "<<dsp<<")" <<endl<<  
                 "eventn["<<i<<"]= "<<te->eventn[i]<<"!= eventn["<<i+1<<"]= "<< te->eventn[i+1]<<endl;  
             }  
             else  
               eventint[(ev-minev)]=te->eventn[0];  
           }  
570          }          }
571            eventint[(ev-minev)]=te->eventn[0];
572            if((ev-minev)>=1 && eventint[(ev-minev)]!=eventint[(ev-minev)-1]+1 && eventint[(ev-minev)]!=1)
573               ALARM=1;
574    
         if(ev<=maxevent-1){  
   
           if((ev-minev)>=1 && eventint[(ev-minev)]!=eventint[(ev-minev)-1]+1 && eventint[(ev-minev)]!=1){  
             warning_dspnumber++;  
             warning<< "==> WARNING!!    Check entry "<< ev<<endl<<  
               " DSP event num.= "<< eventint[(ev-minev)]<<  
               " is different from (previus+1) ="<<eventint[(ev-minev)-1]+1 <<"\n"<<endl;  
           }  
         }  
         
575          //********************************************************************************************          //********************************************************************************************
576          // file ALARM          // file DSP warning
577          //********************************************************************************************          //********************************************************************************************
578    
579          if(ALARM==1) {            if(ALARM==1) {  
580            alarm <<endl<< "================================================="<< endl;            alarm <<endl<< "================================================="<< endl;
581            alarm << "PSCU-Pkt N. "<< ph->GetCounter() ;            alarm << "PSCU-Pkt N. "<< ph->GetCounter() ;
582            alarm << " - OBT "<< ph->GetOrbitalTime() << " ms"<<endl;            alarm << " - OBT "<< ph->GetOrbitalTime() << " ms"<<endl;
583            alarm << "(ROOT-tree entry "<<ev<<")"<<endl;            alarm << "Total events "<<nevent<<endl;
584              alarm << "(ROOT-tree entry "<<ev<<" in page "<<ii+1<<" )"<<endl;
585            alarm << "================================================="<< endl;            alarm << "================================================="<< endl;
586                        
587            alarm << " DSPn";            alarm << " DSPn";
588            alarm << " Event";            alarm << " Counter";
589              alarm << " previous";
590            alarm << " Words";            alarm << " Words";
591            alarm << " crc";            alarm << " crc";
592            alarm << "  FC";            alarm << "  FC";
# Line 620  void FTrkQLook_EXPERT(TString file,Int_t Line 599  void FTrkQLook_EXPERT(TString file,Int_t
599                        
600            for(Int_t i=0; i<12 ; i++){            for(Int_t i=0; i<12 ; i++){
601              alarm.width(5); alarm << te->DSPnumber[i];              alarm.width(5); alarm << te->DSPnumber[i];
602              alarm.width(6); alarm << te->eventn[i];              alarm.width(8); alarm << te->eventn[i];
603                alarm.width(8); alarm << eventint[(ev-minev)-1];
604              alarm.width(6); alarm << te->DATAlength[i];              alarm.width(6); alarm << te->DATAlength[i];
605              alarm.width(4); alarm << te->crc[i];              alarm.width(4); alarm << te->crc[i];
606              alarm.width(4); alarm << te->fc[i];              alarm.width(4); alarm << te->fc[i];
# Line 637  void FTrkQLook_EXPERT(TString file,Int_t Line 617  void FTrkQLook_EXPERT(TString file,Int_t
617          }          }
618        }        }
619      }      }
620      if(ALARM==0) alarm << endl<< "------>  NO ALARM!!! <-------"<<endl;      if(al==0) alarm << endl<< "Page "<<ii+1<< ": ------>  NO ALARM!!! <-------"<<endl;
     if(warning_dspnumber==0) warning<<"NONE"<<endl;  
621    
622        //
623        // Draw the graphs
624      for (Int_t i=0; i<12 ; i++){      for (Int_t i=0; i<12 ; i++){
625        Float_t yyc[maxev-minev];        Float_t yyc[maxev-minev];
626        for (Int_t v=0; v<maxev-minev; v++){        for (Int_t v=0; v<maxev-minev; v++){
# Line 658  void FTrkQLook_EXPERT(TString file,Int_t Line 639  void FTrkQLook_EXPERT(TString file,Int_t
639        comprtime[i][ii]->GetXaxis()->CenterTitle();        comprtime[i][ii]->GetXaxis()->CenterTitle();
640        comprtime[i][ii]->GetYaxis()->SetTitle("compressiontime (ms)");        comprtime[i][ii]->GetYaxis()->SetTitle("compressiontime (ms)");
641        comprtime[i][ii]->GetYaxis()->CenterTitle();        comprtime[i][ii]->GetYaxis()->CenterTitle();
642        comprtime[i][ii]->GetYaxis()->SetRangeUser(0,2);        comprtime[i][ii]->GetYaxis()->SetRangeUser(0,3);
643        comprtime[i][ii]->Draw("ap");        comprtime[i][ii]->Draw("ap");
644        oss1.str("");        oss1.str("");
645        CompTimeCanv[ii]->Update();        CompTimeCanv[ii]->Update();
646      }      }
647        
648      EventNumCanv[ii]->cd();      EventNumCanv[ii]->cd();
649      pt0=new TPad("pt0"," ",0.704,0.004,0.996,0.98);      pt = new TPad("pt"," ",0.02,0.01,1.,0.98,18,0,0);
     pt1 = new TPaveText(0.004,0.004,0.986,0.996);  
     pt = new TPad("pt"," ",0.004,0.004,0.7,0.98,18,0,0);  
     pt1->SetFillColor(10);  
     pt1->ReadFile(out + "warning.txt");  
     pt1->SetTextAlign(22);  
     pt1->SetTextSize(0.035);  
     pt0->SetFillColor(10);  
     pt0->SetFrameFillColor(10);  
     pt0->Draw();  
     pt0->cd();  
     pt1->Draw();  
     EventNumCanv[ii]->cd();  
650      pt->SetFillColor(10);      pt->SetFillColor(10);
651      pt->SetFrameFillColor(10);      pt->SetFrameFillColor(10);
652      pt->Draw();      pt->Draw();
653      pt->cd();      pt->cd();
654      eventnumb[ii]=new TGraph(maxev-minev,x,eventint);      eventnumb[ii]=new TGraph(maxev-minev,x,eventint);
655      eventnumb[ii]->SetTitle("");      eventnumb[ii]->SetTitle("");
656      eventnumb[ii]->GetXaxis()->SetLabelSize(0.04);      eventnumb[ii]->GetXaxis()->SetLabelSize(0.02);
657      eventnumb[ii]->GetXaxis()->SetTitleSize(0.04);      eventnumb[ii]->GetXaxis()->SetTitleSize(0.03);
658      eventnumb[ii]->GetXaxis()->SetTitle("OBT (ms)");      eventnumb[ii]->GetXaxis()->SetTitle("OBT (ms)");
659      eventnumb[ii]->GetXaxis()->CenterTitle();      eventnumb[ii]->GetXaxis()->CenterTitle();
660      eventnumb[ii]->GetXaxis()->SetTickLength(0.01);      eventnumb[ii]->GetXaxis()->SetTickLength(0.01);
661      eventnumb[ii]->GetXaxis()->SetTitleOffset(1.2);      eventnumb[ii]->GetXaxis()->SetTitleOffset(1.1);
662      eventnumb[ii]->GetYaxis()->SetLabelSize(0.04);      eventnumb[ii]->GetYaxis()->SetLabelSize(0.02);
663      eventnumb[ii]->GetYaxis()->SetTitleSize(0.04);      eventnumb[ii]->GetYaxis()->SetTitleSize(0.03);
664      eventnumb[ii]->GetYaxis()->SetTitle("DSP event-number");      eventnumb[ii]->GetYaxis()->SetTitle("DSP event-number");
665      eventnumb[ii]->GetYaxis()->CenterTitle();      eventnumb[ii]->GetYaxis()->CenterTitle();
666      eventnumb[ii]->GetYaxis()->SetTitleOffset(1.5);      eventnumb[ii]->GetYaxis()->SetTitleOffset(2.);
667      eventnumb[ii]->SetMarkerStyle(21);      eventnumb[ii]->SetMarkerStyle(21);
668      eventnumb[ii]->SetMarkerColor(kBlue);      eventnumb[ii]->SetMarkerColor(kBlue);
669      eventnumb[ii]->SetMarkerSize(0.3);      eventnumb[ii]->SetMarkerSize(0.2);
670      eventnumb[ii]->Draw("ap");      eventnumb[ii]->Draw("ap");
671      EventNumCanv[ii]->Update();      EventNumCanv[ii]->Update();
672            
   
     warning.close();  
673      minev=maxev;      minev=maxev;
674      if(maxev==maxevent-1) {      if(maxev==maxevent-1) {
675        cntpgdat=ii+1;        cntpgdat=ii+1;
676        break;        break;
677      }      }
678        
679    }    }
680    
681    
682    alarm.close();    alarm.close();
683    
684    //****************************************************************************************    //****************************************************************************************
685    //Output figures --- Third sheet:    //Cluster Signal ladder1 Output Pages
686    //****************************************************************************************    //****************************************************************************************
687    
688    fromfile.str("");    fromfile.str("");
# Line 736  void FTrkQLook_EXPERT(TString file,Int_t Line 705  void FTrkQLook_EXPERT(TString file,Int_t
705    isfile.str("");    isfile.str("");
706        
707    //****************************************************************************************    //****************************************************************************************
708    //Output figures --- Third sheet:    //Cluster Signal ladder2 Output Pages
709    //****************************************************************************************    //****************************************************************************************
710    
711    isfile<<"Cluster Signal ladder2";    isfile<<"Cluster Signal ladder2";
# Line 757  void FTrkQLook_EXPERT(TString file,Int_t Line 726  void FTrkQLook_EXPERT(TString file,Int_t
726    isfile.str("");    isfile.str("");
727    
728    //****************************************************************************************    //****************************************************************************************
729    //Output figures --- Third sheet:    //Cluster Signal ladder3 Output Pages
730    //****************************************************************************************    //****************************************************************************************
731    
732    isfile<<"Cluster Signal ladder3";    isfile<<"Cluster Signal ladder3";
# Line 778  void FTrkQLook_EXPERT(TString file,Int_t Line 747  void FTrkQLook_EXPERT(TString file,Int_t
747    isfile.str("");    isfile.str("");
748        
749    //****************************************************************************************    //****************************************************************************************
750    //Output figures --- Fourth sheet:    //Lighting of the views Output Pages
751    //****************************************************************************************    //****************************************************************************************
752    
753    isfile<<"lighting of the views";    isfile<<"lighting of the views";
# Line 797  void FTrkQLook_EXPERT(TString file,Int_t Line 766  void FTrkQLook_EXPERT(TString file,Int_t
766    t1->DrawLatex(70.,98.7,isfile.str().c_str());    t1->DrawLatex(70.,98.7,isfile.str().c_str());
767    isfile.str("");    isfile.str("");
768        
769      //
770      // Draw the histos
771    for (Int_t i=0; i<12 ; i++){    for (Int_t i=0; i<12 ; i++){
772                    
773      TBox b;      TBox b;
# Line 861  void FTrkQLook_EXPERT(TString file,Int_t Line 832  void FTrkQLook_EXPERT(TString file,Int_t
832    }    }
833    
834    printf("... end of packets. \n");    printf("... end of packets. \n");
835    
836    //*************************************************************************    //*************************************************************************
837    // Save output Files    // Save output Files
838    //*************************************************************************    //*************************************************************************
# Line 911  void FTrkQLook_EXPERT(TString file,Int_t Line 883  void FTrkQLook_EXPERT(TString file,Int_t
883        out1.str("");        out1.str("");
884        out1<<ffile<<"_FTrkQLook_EXPERT-EvNum-pag"<<fl+1<<"."<<outfile.Data();        out1<<ffile<<"_FTrkQLook_EXPERT-EvNum-pag"<<fl+1<<"."<<outfile.Data();
885        if(fl<cntpgdat) EventNumCanv[fl]->Print(out+out1.str().c_str());        if(fl<cntpgdat) EventNumCanv[fl]->Print(out+out1.str().c_str());
886        if(fl==countrun-1){        if(fl==totpg-1){
887          out1.str("");          out1.str("");
888          out1<<ffile<<"_FTrkQLook_EXPERT-LandauL1."<<outfile.Data();          out1<<ffile<<"_FTrkQLook_EXPERT-LandauL1."<<outfile.Data();
889          LandauCanv1->Print(out+out1.str().c_str());          LandauCanv1->Print(out+out1.str().c_str());
# Line 928  void FTrkQLook_EXPERT(TString file,Int_t Line 900  void FTrkQLook_EXPERT(TString file,Int_t
900      }      }
901    }      }  
902    
903      //
904      // Convert ps to pdf if required
905    if(!strcmp(outfile.Data(),"pdf")){    if(!strcmp(outfile.Data(),"pdf")){
906      stringstream com;      stringstream com;
907      com<<"ps2pdf13 "<<out<<ffile<<"_FTrkQLook_EXPERT.ps "<<out<<ffile<<"_FTrkQLook_EXPERT.pdf";      com<<"ps2pdf13 "<<out<<ffile<<"_FTrkQLook_EXPERT.ps "<<out<<ffile<<"_FTrkQLook_EXPERT.pdf";
# Line 940  void FTrkQLook_EXPERT(TString file,Int_t Line 914  void FTrkQLook_EXPERT(TString file,Int_t
914      com.str("");      com.str("");
915    }    }
916    
   command.str("");  
   command<<"rm -f "<<out<<"warning.txt";  
   system(command.str().c_str());  
     
917    gROOT->Reset();    gROOT->Reset();
918    return;    return;
919  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.23