SimQieClock Class Reference

#include <SimQieClock.h>

List of all members.

Public Member Functions

 SimQieClock (const VldContext &context)
virtual ~SimQieClock ()
virtual void Reset (const VldContext &)
virtual Int_t GetBucketForTime (Double_t time)
virtual Double_t GetTimeOfBucket (Int_t bucket)

Public Attributes

Double_t fPhase
Double_t fNDClock
Double_t fNDTick


Detailed Description

Id
SimQieClock.h,v 1.8 2007/01/15 20:05:54 rhatcher Exp

SimQIEClock

Little class to deal with QIE clock. The model here is that the QIE counter reset is tied to the start of the second, but with a phase of one clock tick. This means the same event simulated with a different time stamp will give slightly different digitization buckets.

n.tagg1@physics.ox.ac.uk

Definition at line 23 of file SimQieClock.h.


Constructor & Destructor Documentation

SimQieClock::SimQieClock ( const VldContext context  )  [inline]

Definition at line 42 of file SimQieClock.h.

References Reset().

00043 { Reset(context); }

virtual SimQieClock::~SimQieClock (  )  [inline, virtual]

Definition at line 27 of file SimQieClock.h.

00027 { }


Member Function Documentation

Int_t SimQieClock::GetBucketForTime ( Double_t  time  )  [inline, virtual]

Definition at line 45 of file SimQieClock.h.

References fNDClock, and fPhase.

Referenced by SimPmtM64::TimeToBucket().

00046 {
00047   return (int)floor(time*fNDClock+ fPhase);
00048 }

Double_t SimQieClock::GetTimeOfBucket ( Int_t  bucket  )  [inline, virtual]

Definition at line 50 of file SimQieClock.h.

References fNDTick, and fPhase.

Referenced by SimPmtM64::BucketToStartTime(), and SimPmtM64::BucketToStopTime().

00051 {
00052   return (Double_t)(bucket) * fNDTick - fPhase;
00053 }

void SimQieClock::Reset ( const VldContext  )  [virtual]

Definition at line 4 of file SimQieClock.cxx.

References fNDClock, fNDTick, fPhase, VldContext::GetDetector(), Calibrator::GetTDCConvert(), Calibrator::Instance(), and ElecType::kQIE.

Referenced by SimQieElectronics::Reset(), SimPmtM64::Reset(), and SimQieClock().

00005 {
00006   fNDTick = Calibrator::Instance().GetTDCConvert(RawChannelId(cx.GetDetector(),
00007                                                               ElecType::kQIE,
00008                                                               0,0)
00009                                                  );
00010   fNDClock = 1.0/fNDTick;
00011 
00012   // Turn off variable phase. Clock is now locked at 0 ticks = 0 ns.
00013   //const double kPi = 3.14159265358979323846;
00014   //fPhase = fmod(context.GetTimeStamp().GetSec(),kPi)/kPi;
00015   fPhase = 0;
00016 }


Member Data Documentation

Double_t SimQieClock::fNDClock

Definition at line 35 of file SimQieClock.h.

Referenced by GetBucketForTime(), and Reset().

Double_t SimQieClock::fNDTick

Definition at line 36 of file SimQieClock.h.

Referenced by SimPmtM64::GetBucketDuration(), GetTimeOfBucket(), and Reset().

Double_t SimQieClock::fPhase

Definition at line 34 of file SimQieClock.h.

Referenced by GetBucketForTime(), GetTimeOfBucket(), and Reset().


The documentation for this class was generated from the following files:
Generated on Thu Jul 10 22:53:43 2014 for loon by  doxygen 1.4.7