/[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.11 by pam-fi, Thu Jul 20 11:09:33 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 v1r06
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      printf("\nsono io\n");
41    //    //
42    //   obtain information about the data file and select the output dir    //   obtain information about the data file and select the output dir
43    const string filepath=file.Data();    Int_t dwpos = file.Last('/');
44    Int_t dwpos = filepath.rfind("/");    Int_t dwpos1 = file.Last('.');
   Int_t dwpos1 = filepath.find(".root");  
   TString fpath=(filepath.c_str());  
45    TString base,ffile ;    TString base,ffile ;
46    stringcopy(ffile,fpath,dwpos+1,dwpos1);    ffile=file(dwpos+1,dwpos1-(dwpos+1));
47    stringcopy(base,fpath,0,dwpos);    if(dwpos>0) base=file(0,dwpos);
   if(dwpos>0) base+="/";  
48    
49    TString out;    TString out;
50    if(outdir.Length()==0){    if(outdir.Length()==0){
# Line 65  void FTrkQLook_EXPERT(TString file,Int_t Line 52  void FTrkQLook_EXPERT(TString file,Int_t
52    }else{    }else{
53      out = outdir;      out = outdir;
54    }    }
55      if(out.Last('/')+1<out.Length()) out+="/";
56    
57    //    //
58    // inizialise the variables and open the file    // inizialise the variables and open the file
# Line 80  void FTrkQLook_EXPERT(TString file,Int_t Line 68  void FTrkQLook_EXPERT(TString file,Int_t
68    pamela::PacketType *pctp=0;    pamela::PacketType *pctp=0;
69    
70    TFile *datafile = new TFile(file);    TFile *datafile = new TFile(file);
71      if ( !datafile ){
72        printf("No data file, exiting...\n");
73        return;
74      }
75    
76    TTree *tree = (TTree*)datafile->Get("TsbT");    TTree *tree = (TTree*)datafile->Get("TsbT");
77    tree->SetBranchAddress("TsbT",&event);    tree->SetBranchAddress("TsbT",&event);
# Line 140  void FTrkQLook_EXPERT(TString file,Int_t Line 132  void FTrkQLook_EXPERT(TString file,Int_t
132      nevent=maxevent-minevent ;      nevent=maxevent-minevent ;
133    }    }
134    
135    Long64_t obt=0;    //
136    const Int_t sizeH=neventH;    // information about the RunHeader
137    ULong64_t HOBT[sizeH];    ULong64_t HOBT[neventH];
138    Int_t trk_cal_us[sizeH],countrun=1;    Int_t trk_cal_us[neventH];
139    for (Int_t vi=0; vi<sizeH;vi++){    for (Int_t vi=0; vi<neventH;vi++){
140      HOBT[vi]=0;      HOBT[vi]=0;
141      trk_cal_us[vi]=0;      trk_cal_us[vi]=0;
142    }    }
# Line 153  void FTrkQLook_EXPERT(TString file,Int_t Line 145  void FTrkQLook_EXPERT(TString file,Int_t
145      pH = eH->GetPscuHeader();      pH = eH->GetPscuHeader();
146      HOBT[ev]= pH->GetOrbitalTime();      HOBT[ev]= pH->GetOrbitalTime();
147      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);  
148    }    }
149    
150    //    //
# Line 173  void FTrkQLook_EXPERT(TString file,Int_t Line 162  void FTrkQLook_EXPERT(TString file,Int_t
162      maxsize+=tmpSize;      maxsize+=tmpSize;
163    }    }
164    const Int_t tsize=maxsize;    const Int_t tsize=maxsize;
165    Int_t tempt[tsize][5],xt[tsize], tempt_tmp[tsize];    Int_t tempt[tsize][5];
166      Int_t countnboot=1;
167      ULong64_t xt[tsize];
168    //    //
169    // information about the temperatures    // information about the temperatures
170    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 172  void FTrkQLook_EXPERT(TString file,Int_t
172      tmpSize = event->Records->GetEntries();      tmpSize = event->Records->GetEntries();
173      for (Int_t j = 0; j < tmpSize; j++){      for (Int_t j = 0; j < tmpSize; j++){
174        record = (pamela::TsbTRecord*)event->Records->At(j);        record = (pamela::TsbTRecord*)event->Records->At(j);
175        xt[siztmp]=record->RECORD_OBT;  //0.051*record->RECORD_OBT;        xt[siztmp]=record->RECORD_OBT;
176        if((xt[siztmp]<xt[siztmp-1]) && siztmp>0)        if((xt[siztmp]<xt[siztmp-1]) && siztmp>0)
177          countrun+=1;          countnboot+=1;
178                
179        for (Int_t z = 0; z < 5; z++){        for (Int_t z = 0; z < 5; z++){
180          tempt[siztmp][z] = record->TEMPERATURES[z+1];              tempt[siztmp][z] = record->TEMPERATURES[z+1];    
# Line 191  void FTrkQLook_EXPERT(TString file,Int_t Line 182  void FTrkQLook_EXPERT(TString file,Int_t
182        siztmp++;        siztmp++;
183      }      }
184    }    }
185  //   printf("\ncountrun=%d\n",countrun);    countnboot+=2*(Int_t)nevent/MAXSTORAGE;
186    countrun+=(Int_t)nevent/30000;    //   printf("\ncountnboot=%d\n",countnboot);
187        
188    //    //
189    // 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 203  void FTrkQLook_EXPERT(TString file,Int_t
203    // write the file for the TrkAlarm packet    // write the file for the TrkAlarm packet
204    if(alnevent==0) alarm1 <<endl<< "------>  NO ALARM!!! <-------"<< endl;    if(alnevent==0) alarm1 <<endl<< "------>  NO ALARM!!! <-------"<< endl;
205    else{    else{
206        Long64_t obt=0;
207      for (Int_t ev=0; ev<alnevent; ev++){      for (Int_t ev=0; ev<alnevent; ev++){
208        altr->GetEntry(ev);        altr->GetEntry(ev);
209        ph = aleh->GetPscuHeader();        ph = aleh->GetPscuHeader();
# Line 269  void FTrkQLook_EXPERT(TString file,Int_t Line 261  void FTrkQLook_EXPERT(TString file,Int_t
261      }      }
262    }    }
263    
264      //
265      // Set Style options
266    gStyle->SetLabelSize(0.05,"x");    gStyle->SetLabelSize(0.05,"x");
267    gStyle->SetLabelSize(0.06,"y");    gStyle->SetLabelSize(0.06,"y");
268    gStyle->SetStatFontSize(0.075);    gStyle->SetStatFontSize(0.075);
# Line 283  void FTrkQLook_EXPERT(TString file,Int_t Line 276  void FTrkQLook_EXPERT(TString file,Int_t
276    gStyle->SetTitleSize(0.06,"y");    gStyle->SetTitleSize(0.06,"y");
277    gStyle->SetTitleSize(0.055,"x");    gStyle->SetTitleSize(0.055,"x");
278    
279    //*************************************************************************************    //
280      //book pads and histos    // Define output canvas, histos and graphs
281      //***************************************************************************************    TCanvas *CompTimeCanv[countnboot],*EventNumCanv[countnboot],*TempCanv[countnboot];
   
   TCanvas *CompTimeCanv[countrun],*EventNumCanv[countrun],*TempCanv[countrun];  
282    TCanvas *IlluminaCanv,*LandauCanv1,*LandauCanv2,*LandauCanv3;    TCanvas *IlluminaCanv,*LandauCanv1,*LandauCanv2,*LandauCanv3;
283    
284    TH1F *landau1[12],*landau2[12],*landau3[12],*illuminazione[12];    TH1F *landau1[12],*landau2[12],*landau3[12],*illuminazione[12];
285      TGraph *comprtime[12][countnboot],*temp[5][countnboot],*eventnumb[countnboot];
286    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];
287    
288    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 309  void FTrkQLook_EXPERT(TString file,Int_t
309    };                };            
310        
311    
   
312    //***************************************************************************************    //***************************************************************************************
313    // LOOP on each event    // LOOP on each event
314    //***************************************************************************************    //***************************************************************************************
# Line 332  void FTrkQLook_EXPERT(TString file,Int_t Line 323  void FTrkQLook_EXPERT(TString file,Int_t
323    
324    Int_t cntpgtemp=0,cntpgdat=0;    Int_t cntpgtemp=0,cntpgdat=0;
325    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];  
326    
327    for(Int_t ii=0; ii<countrun;ii++){    //
328      // Fill temperature graphs
329      for(Int_t ii=0; ii<countnboot;ii++){
330      //****************************************************************************************      //****************************************************************************************
331      //Output figures --- Fifth sheet:      //Temperature Output Pages
332      //****************************************************************************************      //****************************************************************************************
333      fromfile.str("");      fromfile.str("");
334      fromfile<<"FTrkQLook_EXPERT      File: "<<ffile;      fromfile<<"FTrkQLook_EXPERT      File: "<<ffile;
# Line 381  void FTrkQLook_EXPERT(TString file,Int_t Line 373  void FTrkQLook_EXPERT(TString file,Int_t
373        /* -----------> pad for histograms  */        /* -----------> pad for histograms  */
374        pad6[i] = new TPad("pad6"," ",tposx1,tposy-thpad,tposx0,tposy,18,0,0);        pad6[i] = new TPad("pad6"," ",tposx1,tposy-thpad,tposx0,tposy,18,0,0);
375    
376        Int_t v=0,xt_tmp[tsize];        Int_t v=0;
377          Double_t xt_tmp[tsize], tempt_tmp[tsize];
378        for (Int_t ev=countTEMP; ev<tsize; ev++){        for (Int_t ev=countTEMP; ev<tsize; ev++){
379                
380          if(ev==tsize-1 && i==4) countTEMP=tsize-1;          if(ev==tsize-1 && i==4) countTEMP=tsize-1;
# Line 391  void FTrkQLook_EXPERT(TString file,Int_t Line 384  void FTrkQLook_EXPERT(TString file,Int_t
384          }          }
385          else{          else{
386            if(tempt[ev][i]!=65535){            if(tempt[ev][i]!=65535){
387              tempt_tmp[v]=(Int_t)(((3.3*tempt[ev][i]/4096)-0.586)/0.0231);              tempt_tmp[v]=(Double_t)((Int_t)(((3.3*tempt[ev][i]/4096)-0.586)/0.0231));
388              if(tempt_tmp[v]>0) xt_tmp[v++]=xt[ev];              if(tempt_tmp[v]>0) xt_tmp[v++]=(Double_t)xt[ev];
389            }            }
390          }          }
391        }        }
# Line 428  void FTrkQLook_EXPERT(TString file,Int_t Line 421  void FTrkQLook_EXPERT(TString file,Int_t
421    }    }
422    
423    
424    for(Int_t ii=0; ii<countrun;ii++){    //
425      TPaveText *pt1;    // Fill compressiontime and eventnumber graphs and DSP warnings
426      TPad *pt,*pt0;         //pad for histos    for(Int_t ii=0; ii<countnboot;ii++){
427        TPad *pt;         //pad for histos
428        
     ofstream warning(out + "warning.txt",ios::out);  
   
429      //****************************************************************************************      //****************************************************************************************
430      //Output figures --- First sheet:      //COMPRESSIONTIME vs. OBT Output Pages
431      //****************************************************************************************      //****************************************************************************************
432      fromfile.str("");      fromfile.str("");
433      fromfile<<"FTrkQLook_EXPERT      File: "<<ffile;      fromfile<<"FTrkQLook_EXPERT      File: "<<ffile;
# Line 456  void FTrkQLook_EXPERT(TString file,Int_t Line 448  void FTrkQLook_EXPERT(TString file,Int_t
448      isfile.str("");      isfile.str("");
449    
450      //****************************************************************************************      //****************************************************************************************
451      //Output figures --- Second sheet:      //DSP EVENT NUMBER Output Pages
452      //****************************************************************************************      //****************************************************************************************
453    
454      isfile<<"WARNINGS on DSP EVENT NUMBER   pag"<<ii+1;      isfile<<"DSP EVENT NUMBER vs. OBT   pag"<<ii+1;
455      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);
456      EventNumCanv[ii]->SetFillColor(10);      EventNumCanv[ii]->SetFillColor(10);
457      EventNumCanv[ii]->Range(0,0,100,100);      EventNumCanv[ii]->Range(0,0,100,100);
# Line 472  void FTrkQLook_EXPERT(TString file,Int_t Line 464  void FTrkQLook_EXPERT(TString file,Int_t
464      t1->SetTextColor(1);      t1->SetTextColor(1);
465      t1->SetTextAlign(12);      t1->SetTextAlign(12);
466      t1->SetTextSize(0.02);      t1->SetTextSize(0.02);
467      t1->DrawLatex(65.,98.7,isfile.str().c_str());      t1->DrawLatex(62.,98.7,isfile.str().c_str());
468      isfile.str("");      isfile.str("");
469    
470      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 496  void FTrkQLook_EXPERT(TString file,Int_t
496        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);
497        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);
498      }      }
     //**********************************************************************************  
     // Fill Graphs and Histos  
     //**********************************************************************************  
499        
500      //      //
501      // information about the tracker data      // Obtain information about the tracker data
502      Int_t warning_dspnumber=0;      // and fill graphs and histos
503      Float_t x[MAXSTORAGE];  
504        Int_t al=0;
505        Double_t x[MAXSTORAGE];
506      Float_t yc[MAXSTORAGE][12];      Float_t yc[MAXSTORAGE][12];
507      Float_t eventint[MAXSTORAGE];      Double_t eventint[MAXSTORAGE];
508        Int_t eventn[12];
509        
510      for (Int_t ev=minev; ev<maxevent; ev++){      for (Int_t ev=minev; ev<maxevent; ev++){
511        tr->GetEntry(ev);        tr->GetEntry(ev);
512        ph = eh->GetPscuHeader();        ph = eh->GetPscuHeader();
513        cod = eh->GetCounter();        cod = eh->GetCounter();
514        
515    
516        if(ev==maxevent-1) maxev=maxevent-1;        if(ev==maxevent-1) maxev=maxevent-1;
517    
518        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 525  void FTrkQLook_EXPERT(TString file,Int_t
525                    
526          Int_t dsp=0;          Int_t dsp=0;
527          for(Int_t i=0; i<12; i++){          for(Int_t i=0; i<12; i++){
528              if(te->DSPnumber[i]<1 || te->DSPnumber[i]>12) {
529                ALARM=1;
530                break;
531              }
532    
533            dsp=te->DSPnumber[i]-1;            dsp=te->DSPnumber[i]-1;
534            yc[(ev-minev)][dsp]= 0.051*te->compressiontime[i];            yc[(ev-minev)][dsp]= 0.051*te->compressiontime[i];
535              
536              //
537              // Fill Cluster Signal and Lighting of the view histos
538            for(Int_t j=0;j<3;j++){            for(Int_t j=0;j<3;j++){
539              if(te->signcluster[i][j]!=0){              if(te->signcluster[i][j]!=0){
540                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 544  void FTrkQLook_EXPERT(TString file,Int_t
544            }            }
545            if(trk_cal_us[cod->Get(pctp->RunHeader)]!=104){            if(trk_cal_us[cod->Get(pctp->RunHeader)]!=104){
546              if(!(dsp%2)){              if(!(dsp%2)){
547                //              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]));
548                  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]));
549                  //      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]));  
550              }              }
551              else{              else{
552                // 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]);
553                  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]);
554                  // 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]);  
555              }              }
556            }            }
557    
# Line 574  void FTrkQLook_EXPERT(TString file,Int_t Line 568  void FTrkQLook_EXPERT(TString file,Int_t
568            //**************************************************************************************            //**************************************************************************************
569            // warning for internal number            // warning for internal number
570            //**************************************************************************************            //**************************************************************************************
571            if(i<=10){            if(i<=10 && te->eventn[i]!=te->eventn[i+1]) ALARM=1;
572              if(te->eventn[i]!=te->eventn[i+1]){            if((ev-minev)>=1 && eventn[i]+1!=te->eventn[i] && te->eventn[i]!=1) ALARM=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];  
           }  
573          }          }
574            eventint[(ev-minev)]=te->eventn[0];
575    
         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;  
           }  
         }  
         
576          //********************************************************************************************          //********************************************************************************************
577          // file ALARM          // file DSP warning
578          //********************************************************************************************          //********************************************************************************************
579    
580          if(ALARM==1) {            if(ALARM==1) {  
581              al=1;
582            alarm <<endl<< "================================================="<< endl;            alarm <<endl<< "================================================="<< endl;
583            alarm << "PSCU-Pkt N. "<< ph->GetCounter() ;            alarm << "PSCU-Pkt N. "<< ph->GetCounter() ;
584            alarm << " - OBT "<< ph->GetOrbitalTime() << " ms"<<endl;            alarm << " - OBT "<< ph->GetOrbitalTime() << " ms"<<endl;
585            alarm << "(ROOT-tree entry "<<ev<<")"<<endl;            alarm << "Total events "<<nevent<<endl;
586              alarm << "(ROOT-tree entry "<<ev<<" in page "<<ii+1<<" )"<<endl;
587            alarm << "================================================="<< endl;            alarm << "================================================="<< endl;
588                        
589            alarm << " DSPn";            alarm << " DSPn";
590            alarm << " Event";            alarm << " Counter";
591              alarm << " previous";
592            alarm << " Words";            alarm << " Words";
593            alarm << " crc";            alarm << " crc";
594            alarm << "  FC";            alarm << "  FC";
# Line 620  void FTrkQLook_EXPERT(TString file,Int_t Line 601  void FTrkQLook_EXPERT(TString file,Int_t
601                        
602            for(Int_t i=0; i<12 ; i++){            for(Int_t i=0; i<12 ; i++){
603              alarm.width(5); alarm << te->DSPnumber[i];              alarm.width(5); alarm << te->DSPnumber[i];
604              alarm.width(6); alarm << te->eventn[i];              alarm.width(8); alarm << te->eventn[i];
605                alarm.width(8); alarm << eventn[i];
606              alarm.width(6); alarm << te->DATAlength[i];              alarm.width(6); alarm << te->DATAlength[i];
607              alarm.width(4); alarm << te->crc[i];              alarm.width(4); alarm << te->crc[i];
608              alarm.width(4); alarm << te->fc[i];              alarm.width(4); alarm << te->fc[i];
# Line 635  void FTrkQLook_EXPERT(TString file,Int_t Line 617  void FTrkQLook_EXPERT(TString file,Int_t
617              alarm    << endl;              alarm    << endl;
618            }            }
619          }          }
620            for(Int_t i=0; i<12 ; i++)
621              eventn[i]=te->eventn[i];
622        }        }
623      }      }
624      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;  
625    
626        //
627        // Draw the graphs
628      for (Int_t i=0; i<12 ; i++){      for (Int_t i=0; i<12 ; i++){
629        Float_t yyc[maxev-minev];        Double_t yyc[maxev-minev];
630        for (Int_t v=0; v<maxev-minev; v++){        for (Int_t v=0; v<maxev-minev; v++){
631          yyc[v]=yc[v][i];          yyc[v]=yc[v][i];
632        }        }
# Line 658  void FTrkQLook_EXPERT(TString file,Int_t Line 643  void FTrkQLook_EXPERT(TString file,Int_t
643        comprtime[i][ii]->GetXaxis()->CenterTitle();        comprtime[i][ii]->GetXaxis()->CenterTitle();
644        comprtime[i][ii]->GetYaxis()->SetTitle("compressiontime (ms)");        comprtime[i][ii]->GetYaxis()->SetTitle("compressiontime (ms)");
645        comprtime[i][ii]->GetYaxis()->CenterTitle();        comprtime[i][ii]->GetYaxis()->CenterTitle();
646        comprtime[i][ii]->GetYaxis()->SetRangeUser(0,2);        // comprtime[i][ii]->GetYaxis()->SetRangeUser(0,3);
647        comprtime[i][ii]->Draw("ap");        comprtime[i][ii]->Draw("ap");
648        oss1.str("");        oss1.str("");
649        CompTimeCanv[ii]->Update();        CompTimeCanv[ii]->Update();
650      }      }
651        
652      EventNumCanv[ii]->cd();      EventNumCanv[ii]->cd();
653      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();  
654      pt->SetFillColor(10);      pt->SetFillColor(10);
655      pt->SetFrameFillColor(10);      pt->SetFrameFillColor(10);
656      pt->Draw();      pt->Draw();
657      pt->cd();      pt->cd();
658      eventnumb[ii]=new TGraph(maxev-minev,x,eventint);      eventnumb[ii]=new TGraph(maxev-minev,x,eventint);
659      eventnumb[ii]->SetTitle("");      eventnumb[ii]->SetTitle("");
660      eventnumb[ii]->GetXaxis()->SetLabelSize(0.04);      eventnumb[ii]->GetXaxis()->SetLabelSize(0.02);
661      eventnumb[ii]->GetXaxis()->SetTitleSize(0.04);      eventnumb[ii]->GetXaxis()->SetTitleSize(0.03);
662      eventnumb[ii]->GetXaxis()->SetTitle("OBT (ms)");      eventnumb[ii]->GetXaxis()->SetTitle("OBT (ms)");
663      eventnumb[ii]->GetXaxis()->CenterTitle();      eventnumb[ii]->GetXaxis()->CenterTitle();
664      eventnumb[ii]->GetXaxis()->SetTickLength(0.01);      eventnumb[ii]->GetXaxis()->SetTickLength(0.01);
665      eventnumb[ii]->GetXaxis()->SetTitleOffset(1.2);      eventnumb[ii]->GetXaxis()->SetTitleOffset(1.1);
666      eventnumb[ii]->GetYaxis()->SetLabelSize(0.04);      eventnumb[ii]->GetYaxis()->SetLabelSize(0.02);
667      eventnumb[ii]->GetYaxis()->SetTitleSize(0.04);      eventnumb[ii]->GetYaxis()->SetTitleSize(0.03);
668      eventnumb[ii]->GetYaxis()->SetTitle("DSP event-number");      eventnumb[ii]->GetYaxis()->SetTitle("DSP event-number");
669      eventnumb[ii]->GetYaxis()->CenterTitle();      eventnumb[ii]->GetYaxis()->CenterTitle();
670      eventnumb[ii]->GetYaxis()->SetTitleOffset(1.5);      eventnumb[ii]->GetYaxis()->SetTitleOffset(2.);
671      eventnumb[ii]->SetMarkerStyle(21);      eventnumb[ii]->SetMarkerStyle(21);
672      eventnumb[ii]->SetMarkerColor(kBlue);      eventnumb[ii]->SetMarkerColor(kBlue);
673      eventnumb[ii]->SetMarkerSize(0.3);      eventnumb[ii]->SetMarkerSize(0.2);
674      eventnumb[ii]->Draw("ap");      eventnumb[ii]->Draw("ap");
675      EventNumCanv[ii]->Update();      EventNumCanv[ii]->Update();
676            
   
     warning.close();  
677      minev=maxev;      minev=maxev;
678      if(maxev==maxevent-1) {      if(maxev==maxevent-1) {
679        cntpgdat=ii+1;        cntpgdat=ii+1;
680        break;        break;
681      }      }
682        
683    }    }
684    
685    
686    alarm.close();    alarm.close();
687    
688    //****************************************************************************************    //****************************************************************************************
689    //Output figures --- Third sheet:    //Cluster Signal ladder1 Output Pages
690    //****************************************************************************************    //****************************************************************************************
691    
692    fromfile.str("");    fromfile.str("");
# Line 736  void FTrkQLook_EXPERT(TString file,Int_t Line 709  void FTrkQLook_EXPERT(TString file,Int_t
709    isfile.str("");    isfile.str("");
710        
711    //****************************************************************************************    //****************************************************************************************
712    //Output figures --- Third sheet:    //Cluster Signal ladder2 Output Pages
713    //****************************************************************************************    //****************************************************************************************
714    
715    isfile<<"Cluster Signal ladder2";    isfile<<"Cluster Signal ladder2";
# Line 757  void FTrkQLook_EXPERT(TString file,Int_t Line 730  void FTrkQLook_EXPERT(TString file,Int_t
730    isfile.str("");    isfile.str("");
731    
732    //****************************************************************************************    //****************************************************************************************
733    //Output figures --- Third sheet:    //Cluster Signal ladder3 Output Pages
734    //****************************************************************************************    //****************************************************************************************
735    
736    isfile<<"Cluster Signal ladder3";    isfile<<"Cluster Signal ladder3";
# Line 778  void FTrkQLook_EXPERT(TString file,Int_t Line 751  void FTrkQLook_EXPERT(TString file,Int_t
751    isfile.str("");    isfile.str("");
752        
753    //****************************************************************************************    //****************************************************************************************
754    //Output figures --- Fourth sheet:    //Lighting of the views Output Pages
755    //****************************************************************************************    //****************************************************************************************
756    
757    isfile<<"lighting of the views";    isfile<<"lighting of the views";
# Line 797  void FTrkQLook_EXPERT(TString file,Int_t Line 770  void FTrkQLook_EXPERT(TString file,Int_t
770    t1->DrawLatex(70.,98.7,isfile.str().c_str());    t1->DrawLatex(70.,98.7,isfile.str().c_str());
771    isfile.str("");    isfile.str("");
772        
773      //
774      // Draw the histos
775    for (Int_t i=0; i<12 ; i++){    for (Int_t i=0; i<12 ; i++){
776                    
777      TBox b;      TBox b;
# Line 861  void FTrkQLook_EXPERT(TString file,Int_t Line 836  void FTrkQLook_EXPERT(TString file,Int_t
836    }    }
837    
838    printf("... end of packets. \n");    printf("... end of packets. \n");
839    
840    //*************************************************************************    //*************************************************************************
841    // Save output Files    // Save output Files
842    //*************************************************************************    //*************************************************************************
# Line 911  void FTrkQLook_EXPERT(TString file,Int_t Line 887  void FTrkQLook_EXPERT(TString file,Int_t
887        out1.str("");        out1.str("");
888        out1<<ffile<<"_FTrkQLook_EXPERT-EvNum-pag"<<fl+1<<"."<<outfile.Data();        out1<<ffile<<"_FTrkQLook_EXPERT-EvNum-pag"<<fl+1<<"."<<outfile.Data();
889        if(fl<cntpgdat) EventNumCanv[fl]->Print(out+out1.str().c_str());        if(fl<cntpgdat) EventNumCanv[fl]->Print(out+out1.str().c_str());
890        if(fl==countrun-1){        if(fl==totpg-1){
891          out1.str("");          out1.str("");
892          out1<<ffile<<"_FTrkQLook_EXPERT-LandauL1."<<outfile.Data();          out1<<ffile<<"_FTrkQLook_EXPERT-LandauL1."<<outfile.Data();
893          LandauCanv1->Print(out+out1.str().c_str());          LandauCanv1->Print(out+out1.str().c_str());
# Line 928  void FTrkQLook_EXPERT(TString file,Int_t Line 904  void FTrkQLook_EXPERT(TString file,Int_t
904      }      }
905    }      }  
906    
907      //
908      // Convert ps to pdf if required
909    if(!strcmp(outfile.Data(),"pdf")){    if(!strcmp(outfile.Data(),"pdf")){
910      stringstream com;      stringstream com;
911      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 918  void FTrkQLook_EXPERT(TString file,Int_t
918      com.str("");      com.str("");
919    }    }
920    
   command.str("");  
   command<<"rm -f "<<out<<"warning.txt";  
   system(command.str().c_str());  
     
921    gROOT->Reset();    gROOT->Reset();
922    return;    return;
923  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.23