Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

EventInfoPage Class Reference

Implement the "canvas" display page. More...

#include <EventInfoPage.h>

Inheritance diagram for EventInfoPage:

PageABC List of all members.

Public Member Functions

 EventInfoPage ()
 ~EventInfoPage ()
virtual TObject * Init (Mint *mint, PageDisplay *pd, GuiBox &box)
virtual void Update ()
 Implement to respond to a change in the data.
virtual void Print ()
 Implement to print your display.
virtual void WriteInfo (std::ostream &os) const
virtual void Unzoom ()
virtual void Rezoom ()
virtual void FullZoom ()
virtual void AutoZoom ()

Protected Member Functions

GuiTextViewGetTextView ()

Private Attributes

MintfMint
PageDisplayfPageDisplay
GuiTextViewfTextView
TGWindow * fMainWindow

Detailed Description

Implement the "canvas" display page.

Id
EventInfoPage.h,v 1.1 2005/05/25 09:33:46 tagg Exp

Midad

Sub classes should implement the Update() command in which they fill the canvas returned by GetCanvas() with whatever.

Contact: bv@bnl.gov

Created on: Tue Aug 20 11:03:07 2002

Definition at line 29 of file EventInfoPage.h.


Constructor & Destructor Documentation

EventInfoPage::EventInfoPage  ) 
 

Definition at line 32 of file EventInfoPage.cxx.

00033     : fMint(0),
00034       fPageDisplay(0),
00035       fTextView(0), 
00036       fMainWindow(0)
00037 {
00038 }

EventInfoPage::~EventInfoPage  ) 
 

Definition at line 40 of file EventInfoPage.cxx.

00041 {
00042 }


Member Function Documentation

virtual void EventInfoPage::AutoZoom  )  [inline, virtual]
 

Reimplemented from PageABC.

Definition at line 51 of file EventInfoPage.h.

00051 {};

virtual void EventInfoPage::FullZoom void   )  [inline, virtual]
 

Reimplemented from PageABC.

Definition at line 50 of file EventInfoPage.h.

00050 {};

GuiTextView & EventInfoPage::GetTextView  )  [protected]
 

Definition at line 122 of file EventInfoPage.cxx.

00123 {
00124   return *fTextView;
00125 }

TObject * EventInfoPage::Init Mint mint,
PageDisplay pd,
GuiBox box
[virtual]
 

Implement to fill box with whatever your page displays. If the page wishes to return a class to the initializer, then return an object which inherits from TObject, o.w. just return 0.

Implements PageABC.

Definition at line 44 of file EventInfoPage.cxx.

References GuiCompositeFrameBase::Add(), fMainWindow, fMint, fPageDisplay, and fTextView.

00045 {
00046   fMint = mint;
00047   fPageDisplay = pd;
00048 
00049   fMainWindow = dynamic_cast<TGWindow*>(&box);
00050   assert(fMainWindow);
00051   
00052   fTextView = SigC::manage(new GuiTextView(*fMainWindow,500,300));
00053   box.Add(*fTextView);
00054   
00055   fTextView->AddLine("EventInfoPage");
00056   return fTextView;
00057 }

void EventInfoPage::Print  )  [virtual]
 

Implement to print your display.

Implements PageABC.

Definition at line 59 of file EventInfoPage.cxx.

References WriteInfo().

00060 {
00061   WriteInfo(std::cout);
00062 }

virtual void EventInfoPage::Rezoom void   )  [inline, virtual]
 

Reimplemented from PageABC.

Definition at line 49 of file EventInfoPage.h.

00049 {};

virtual void EventInfoPage::Unzoom void   )  [inline, virtual]
 

Reimplemented from PageABC.

Definition at line 48 of file EventInfoPage.h.

00048 {};

void EventInfoPage::Update void   )  [virtual]
 

Implement to respond to a change in the data.

Reimplemented from PageABC.

Definition at line 64 of file EventInfoPage.cxx.

References fTextView, and WriteInfo().

00065 {
00066    fTextView->Clear();
00067 
00068    stringstream oss; // A handy way to push stream data to a buffer.
00069    WriteInfo(oss);
00070    
00071    // Copy it out line-for-line into the text view.
00072    char line[1000];
00073    while(!oss.eof()) {
00074      oss.getline(line,sizeof(line));
00075      fTextView->AddLine(line);
00076    }
00077 }

void EventInfoPage::WriteInfo std::ostream &  os  )  const [virtual]
 

Definition at line 79 of file EventInfoPage.cxx.

References VldTimeStamp::AsString(), DataUtil::dump_mom(), fMint, Form(), CandDigitListHandle::GetAbsTime(), VldContext::GetDetector(), Mint::GetJobC(), VldTimeStamp::GetNanoSec(), VldTimeStamp::GetSec(), VldContext::GetSimFlag(), SpillTimeFinder::GetTimeOfNextSpill(), SpillTimeFinder::GetTimeOfRecentSpill(), VldContext::GetTimeStamp(), CandHandle::GetVldContext(), SpillTimeFinder::Instance(), and JobC::Mom.

Referenced by Print(), and Update().

00080 {
00081   const MomNavigator* mom = &(fMint->GetJobC().Mom);
00082   const char* type = "CandDigitListHandle";
00083   const char* name = "canddigitlist";
00084 
00085   const CandDigitListHandle* cdlh =
00086     DataUtil::GetCandidate<CandDigitListHandle>(&(fMint->GetJobC().Mom),
00087                                                 type,name);
00088 
00089   if(cdlh) {
00090     VldContext cx = *(cdlh->GetVldContext());
00091     double digitListTime = cdlh->GetAbsTime();
00092     VldTimeStamp ts(cx.GetTimeStamp().GetSec(),0);
00093     ts.Add(digitListTime);
00094 
00095     VldContext digitCx(cx.GetDetector(),cx.GetSimFlag(),ts);
00096     
00097     os << "Digit list starts at time " << ts.AsString() << std::endl;
00098     
00099     VldTimeStamp prevSpill = SpillTimeFinder::Instance().GetTimeOfRecentSpill(digitCx);
00100     VldTimeStamp nextSpill = SpillTimeFinder::Instance().GetTimeOfNextSpill(digitCx);
00101     double prevDt = (ts-prevSpill).GetSec()*1.0 + (ts-prevSpill).GetNanoSec()*1e-9;
00102     double nextDt = (ts-nextSpill).GetSec()*1.0 + (ts-nextSpill).GetNanoSec()*1e-9;
00103     
00104     const char* prevDtStr = Form("%7.1lf s ",prevDt);
00105     if(prevDt<1.0) prevDtStr = Form("%7.1lf us",prevDt*1e6);
00106 
00107     const char* nextDtStr = Form("%7.1lf s ",nextDt);
00108     if(nextDt<1.0) nextDtStr = Form("%7.1lf us",nextDt*1e6);
00109 
00110 
00111     os << "Time relative to recent spill: " << prevDtStr << "\t" << prevSpill.AsString() << endl;
00112     os << "Time relative to next   spill: " << nextDtStr << "\t" << nextSpill.AsString() << endl;
00113     os << endl;
00114   }  
00115 
00116   // The the dump.
00117   DataUtil::dump_mom(mom,os);
00118   
00119 }


Member Data Documentation

TGWindow* EventInfoPage::fMainWindow [private]
 

Definition at line 61 of file EventInfoPage.h.

Referenced by Init().

Mint* EventInfoPage::fMint [private]
 

Definition at line 58 of file EventInfoPage.h.

Referenced by Init(), and WriteInfo().

PageDisplay* EventInfoPage::fPageDisplay [private]
 

Definition at line 59 of file EventInfoPage.h.

Referenced by Init().

GuiTextView* EventInfoPage::fTextView [private]
 

Definition at line 60 of file EventInfoPage.h.

Referenced by Init(), and Update().


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:09:09 2010 for loon by  doxygen 1.3.9.1