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

TimeHist Class Reference

A histogram of the time of hit strips. More...

#include <TimeHist.h>

Inheritance diagram for TimeHist:

MintView List of all members.

Public Member Functions

 TimeHist ()
virtual ~TimeHist ()
void Refresh ()
void SetMint (Mint *mint)
void Draw (Option_t *="")

Private Member Functions

 TimeHist (const TimeHist &rhs)
TimeHistoperator= (const TimeHist &rhs)
void UpdatePad ()

Private Attributes

ZoomPadfPad
TH1F * fHist
SigC::Ptr< RangeDoublefTimeRange

Detailed Description

A histogram of the time of hit strips.

Id
TimeHist.h,v 1.6 2005/07/21 20:26:36 bv Exp

Midad/Base

Contact: bv@bnl.gov

Created on: Thu Sep 12 14:36:34 2002

Definition at line 30 of file TimeHist.h.


Constructor & Destructor Documentation

TimeHist::TimeHist  ) 
 

Definition at line 24 of file TimeHist.cxx.

References fHist, fPad, and ZoomPad::SetScales().

00025     : fPad(0)
00026     , fHist(0)
00027 {
00028     fPad = new ZoomPad("TimeHistPad","Time Hist Pad");
00029     fPad->SetScales(1.0e9,1.0);
00030     fPad->Draw();
00031 
00032     TVirtualPad* old_pad = gPad;
00033 
00034     fPad->cd();
00035     fHist = new TH1F("TimeHist","Digit Times (ns)",100,0,100);
00036     fHist->Draw();
00037 
00038     gPad = old_pad;
00039 }

TimeHist::~TimeHist  )  [virtual]
 

Definition at line 42 of file TimeHist.cxx.

00043 {
00044 }

TimeHist::TimeHist const TimeHist rhs  )  [private]
 


Member Function Documentation

void TimeHist::Draw Option_t *  = ""  ) 
 

Definition at line 46 of file TimeHist.cxx.

References fPad.

Referenced by PageDisplay::MakeTimeHist().

00047 {
00048     fPad->Draw();
00049 }

TimeHist& TimeHist::operator= const TimeHist rhs  )  [private]
 

void TimeHist::Refresh  )  [virtual]
 

Implements MintView.

Definition at line 64 of file TimeHist.cxx.

References fHist, Mint::GetDigits(), MintView::GetMint(), Mint::GetTimeRange(), Range< TYPE >::Max(), Range< TYPE >::Min(), RangeDouble, and UpdatePad().

Referenced by PageDisplay::MakeTimeHist(), UserHist::Refresh(), SetMint(), and PageDisplay::UpdateDisplay().

00065 {
00066 //    cerr << "TimeHist::Refresh()\n";
00067 
00068     fHist->Reset();
00069     fHist->SetFillColor(2);
00070     fHist->SetFillStyle(1001);
00071 
00072     const CandDigitListHandle *cdlh = this->GetMint().GetDigits();
00073     if (! cdlh) return;    
00074 
00075     RangeDouble& r = this->GetMint().GetTimeRange();
00076     fHist->SetBins(100,r.Min()/Munits::ns, r.Max()/Munits::ns);
00077 
00078     vector<const CandDigitHandle*> dc = CDL2STLvector<const CandDigitHandle>(*cdlh);
00079 
00080     int siz = dc.size();
00081     for (int ind=0; ind < siz; ++ind) {
00082         fHist->Fill(dc[ind]->GetTime()/Munits::ns,dc[ind]->GetCharge());
00083     }
00084     this->UpdatePad();
00085 }

void TimeHist::SetMint Mint mint  )  [virtual]
 

Reimplemented from MintView.

Definition at line 50 of file TimeHist.cxx.

References Mint::GetTimeRange(), Range< TYPE >::modified, Refresh(), and MintView::SetMint().

Referenced by PageDisplay::MakeTimeHist(), and UserHist::UserHist().

00051 {
00052     this->MintView::SetMint(mint);
00053 
00054     mint->GetTimeRange().modified.connect(slot_class(*this,&TimeHist::Refresh));
00055         
00056 }

void TimeHist::UpdatePad  )  [private]
 

Definition at line 58 of file TimeHist.cxx.

References fPad, and ZoomPad::Update().

Referenced by Refresh().

00059 {
00060     fPad->Modified();
00061     fPad->Update();
00062 }


Member Data Documentation

TH1F* TimeHist::fHist [private]
 

Definition at line 54 of file TimeHist.h.

Referenced by Refresh(), and TimeHist().

ZoomPad* TimeHist::fPad [private]
 

Definition at line 53 of file TimeHist.h.

Referenced by Draw(), TimeHist(), and UpdatePad().

SigC::Ptr<RangeDouble> TimeHist::fTimeRange [private]
 

Definition at line 55 of file TimeHist.h.


The documentation for this class was generated from the following files:
Generated on Thu Nov 1 12:01:26 2007 for loon by  doxygen 1.3.9.1