/[PAMELA software]/quicklook/QLflightTmtc_Header/HeaderScan.cpp
ViewVC logotype

Diff of /quicklook/QLflightTmtc_Header/HeaderScan.cpp

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

revision 1.9 by pam-rm2, Fri Sep 8 08:26:47 2006 UTC revision 1.10 by pam-rm2, Tue Sep 26 10:12:11 2006 UTC
# Line 203  void HeaderScan(TString base, TString ou Line 203  void HeaderScan(TString base, TString ou
203    TMultiGraph *packeCounter = new TMultiGraph();    TMultiGraph *packeCounter = new TMultiGraph();
204    
205    oss1.str("");    oss1.str("");
206    oss1 << filename.Data() <<": Physics Packet per minute.  Start time = " << obmin << ", End time = "<< obmax <<" ms";    oss1 << "Physics Packet per minute.  Start time = " << obmin << ", End time = "<< obmax <<" ms";
207    TGraph *rate1= new TGraph(nbin, (const Double_t*)Minute, (const Double_t*)Eventsperminute);    TGraph *rate1= new TGraph(nbin, (const Double_t*)Minute, (const Double_t*)Eventsperminute);
208    rate1->SetMarkerColor(kBlack);    rate1->SetMarkerColor(kBlack);
209    rate1->SetMarkerSize(.1);    rate1->SetMarkerSize(.1);
# Line 212  void HeaderScan(TString base, TString ou Line 212  void HeaderScan(TString base, TString ou
212    
213    TGraph *packetLength1= new TGraph(nevents, (const Double_t*)OBTime, (const Double_t*)PacketLenght);    TGraph *packetLength1= new TGraph(nevents, (const Double_t*)OBTime, (const Double_t*)PacketLenght);
214    oss2.str("");    oss2.str("");
215    oss2 << filename.Data() <<": Lenght of Physic packets";    oss2 <<"Lenght of Physic packets";
216    packetLength1->SetMarkerColor(2);    packetLength1->SetMarkerColor(2);
217    packetLength1->SetMarkerSize(.5);    packetLength1->SetMarkerSize(.3);
218    packetLength1->SetMarkerStyle(21);    packetLength1->SetMarkerStyle(21);
219    packetLength->Add(packetLength1);    packetLength->Add(packetLength1);
220    
221    TGraph *packeCounter1= new TGraph(nevents, (const Double_t*)OBTime, (const Double_t*)PscuCounter);    TGraph *packeCounter1= new TGraph(nevents, (const Double_t*)OBTime, (const Double_t*)PscuCounter);
222    oss3.str("");    oss3.str("");
223    oss3 << filename.Data() <<": Physics Counter vs. OBT";    oss3 <<"Physics Counter vs. OBT";
224    packeCounter1->SetMarkerColor(4);    packeCounter1->SetMarkerColor(4);
225    packeCounter1->SetMarkerSize(.2);    packeCounter1->SetMarkerSize(.2);
226    packeCounter1->SetMarkerStyle(21);    packeCounter1->SetMarkerStyle(21);
# Line 228  void HeaderScan(TString base, TString ou Line 228  void HeaderScan(TString base, TString ou
228    
229    //------------ Create and Draw Canvas ---------------------//    //------------ Create and Draw Canvas ---------------------//
230    TCanvas *finalCanv = new TCanvas("Header", base, 1200, 1600);    TCanvas *finalCanv = new TCanvas("Header", base, 1200, 1600);
231    finalCanv->Divide(1,5);    finalCanv->Divide(1,6);
232    finalCanv->SetFillColor(10);    finalCanv->SetFillColor(10);
233    
234    TPad *all2= new TPad ("","", 0, 0, 1, 1);    TPad *all2= new TPad ("","", 0, 0, 1, 1);
# Line 241  void HeaderScan(TString base, TString ou Line 241  void HeaderScan(TString base, TString ou
241    all->SetFillColor(10);    all->SetFillColor(10);
242    TPad *all1= new TPad ("","", 0, 0, 1, 1);    TPad *all1= new TPad ("","", 0, 0, 1, 1);
243    all1->SetFillColor(10);    all1->SetFillColor(10);
   TPad *pad = new TPad("pad","pad", .80,.45,.90,.75);  
   pad->SetFillColor(10);  
244    
245    TLine li;    TLine li;
246    li.SetLineStyle(4);    li.SetLineStyle(4);
# Line 278  void HeaderScan(TString base, TString ou Line 276  void HeaderScan(TString base, TString ou
276      }        }  
277    }    }
278        
279      RunHeadTr->GetEntry(0);
280      ph = eH->GetPscuHeader();
281      ULong_t TimeSync = reh->LAST_TIME_SYNC_INFO;
282      ULong_t ObtSync = reh->OBT_TIME_SYNC;
283      //cout<<"TimeSync "<<reh->LAST_TIME_SYNC_INFO<<"\n";
284      //cout<<"ObtSync "<<reh->OBT_TIME_SYNC<<"\n";
285    
286    finalCanv->cd(1);    finalCanv->cd(1);
287    stringstream ws1, ws2;    stringstream ws1, ws2;
288    ws1.str("");    ws1.str("");
# Line 368  void HeaderScan(TString base, TString ou Line 373  void HeaderScan(TString base, TString ou
373    Long64_t nevntskey=0;    Long64_t nevntskey=0;
374    list = file->GetListOfKeys();    list = file->GetListOfKeys();
375    numkey = file->GetNkeys();    numkey = file->GetNkeys();
376    Double_t salto;    ULong_t salto;
377    for (Int_t m=0; m<numkey; m++){    for (Int_t m=0; m<numkey; m++){
378      key = list->At(m);      key = list->At(m);
379      name=(char *)(key->GetName());      name=(char *)(key->GetName());
# Line 431  void HeaderScan(TString base, TString ou Line 436  void HeaderScan(TString base, TString ou
436     all1->cd();     all1->cd();
437    
438     oss1.str("");     oss1.str("");
439     oss1 << filename.Data() <<": PscuCounter vs FileOffset.";     oss1 <<"PscuCounter vs FileOffset.";
440     mg1->Draw("AP");     mg1->Draw("AP");
441     mg1->GetXaxis()->SetTitle("File Offset");     mg1->GetXaxis()->SetTitle("File Offset");
442     mg1->GetXaxis()->CenterTitle();     mg1->GetXaxis()->CenterTitle();
# Line 456  void HeaderScan(TString base, TString ou Line 461  void HeaderScan(TString base, TString ou
461     finalCanv->cd(5);     finalCanv->cd(5);
462     all->Draw();     all->Draw();
463     all->cd();     all->cd();
     
464     oss3.str("");     oss3.str("");
465     oss3 << filename.Data() <<" OBT vs FileOffset. First packet at "<<primotempo <<" ms, last packet at "<<ultimotempo<<" ms.";     oss3 << "OBT vs FileOffset";
466     mg2->Draw("AP");     mg2->Draw("AP");
467     mg2->GetXaxis()->SetTitle("File Offset");     mg2->GetXaxis()->SetTitle("File Offset");
468     mg2->GetXaxis()->CenterTitle();     mg2->GetXaxis()->CenterTitle();
# Line 469  void HeaderScan(TString base, TString ou Line 473  void HeaderScan(TString base, TString ou
473     mg2->GetYaxis()->SetTitleSize(0.06);     mg2->GetYaxis()->SetTitleSize(0.06);
474     mg2->GetYaxis()->SetLabelSize(0.05);     mg2->GetYaxis()->SetLabelSize(0.05);
475     mg2->GetYaxis()->SetTitleOffset(0.6);     mg2->GetYaxis()->SetTitleOffset(0.6);
    pad->Draw();  
    pad->cd();  
    stringa.str("");  
    stringa << "jump at: "<<salto<<" ms \n";  
    if(salto != primotempo) lat->DrawLatex(0.08, 0.8,stringa.str().c_str());  
476    
477     finalCanv->cd(5);     finalCanv->cd(5);
478     TPaveText *pt4=0;     TPaveText *pt4=0;
479     pt4 = new TPaveText (.38 ,.91,.92,1);     pt4 = new TPaveText (.70,.91,.90,1);
480     pt4->AddText(oss3.str().c_str());     pt4->AddText(oss3.str().c_str());
481     pt4->SetTextColor(kBlue);     pt4->SetTextColor(kBlue);
482     pt4->SetFillColor(10);     pt4->SetFillColor(10);
483     pt4->SetBorderSize(0);     pt4->SetBorderSize(0);
484     pt4->Draw();     pt4->Draw();
485    
486       finalCanv->cd(6);
487       ULong_t primotempoABS=TimeSync+((primotempo/1000)-ObtSync);
488       ULong_t obmaxABS=TimeSync+((lastime/1000)-ObtSync);
489       ULong_t saltoABS=TimeSync+((salto/1000)-ObtSync);
490       ULong_t ultimotempoABS=TimeSync+((ultimotempo/1000)-ObtSync);
491    
492       TPaveText *pt5=0;
493       pt5 = new TPaveText (0,0,1,1);
494       stringa.str("");
495       stringa << "  Filename:   "<<filename.Data()<<"\n";
496       TText *t1=pt5->AddText(0.25,0.95,stringa.str().c_str());
497       t1->SetTextSize(0.1);
498       stringa.str("");
499       stringa << "  OBT (ms)            ABS TIME (s)";
500       TText *t2=pt5->AddText(0.32,0.75,stringa.str().c_str());
501       t2->SetTextSize(0.07);
502       stringa.str("");
503       stringa << "New data start at:   "<<primotempo<<"         "<<primotempoABS;
504       TText *t3=pt5->AddText(0.25,0.60,stringa.str().c_str());
505       t3->SetTextSize(0.08);
506       stringa.str("");
507       stringa << "New data end at:     "<<lastime<<"         "<<obmaxABS;
508       TText *t4=pt5->AddText(0.25,0.50,stringa.str().c_str());
509       t4->SetTextSize(0.08);
510       if(primotempo!=salto || lastime!=ultimotempo){
511         stringa.str("");
512         stringa << "Old data start at:   "<<salto<<"        "<<saltoABS;
513         TText *t5=pt5->AddText(0.65,0.60,stringa.str().c_str());
514         t5->SetTextSize(0.08);
515         stringa.str("");
516         stringa << "Old data end at:     "<<ultimotempo<<"        "<<ultimotempoABS;
517         TText *t6=pt5->AddText(0.65,0.50,stringa.str().c_str());
518         t6->SetTextSize(0.08);
519         stringa.str("");
520         stringa << "  OBT (ms)          ABS TIME (s)";
521         TText *t2=pt5->AddText(0.72,0.75,stringa.str().c_str());
522         t2->SetTextSize(0.07);
523       }
524       pt5->SetTextColor(kBlack);
525       pt5->SetFillColor(10);
526       pt5->SetBorderSize(0);
527       pt5->Draw();
528    
529     finalCanv->Update();     finalCanv->Update();
530    
531     oss1.str("");     oss1.str("");

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

  ViewVC Help
Powered by ViewVC 1.1.23