| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

DayaBay::DaqLtbFrame Class Reference

Class that wraps the DAQ data read from a LTB frame. More...

#include <DaqLtbFrame.h>

Collaboration diagram for DayaBay::DaqLtbFrame:

[legend]
List of all members.

Public Member Functions

 DaqLtbFrame (const DybDaq::LtbFrame &ltbFrame, const DayaBay::Detector &detector)
 Constructor for read-only instance.
 DaqLtbFrame (const unsigned int readoutType, const DayaBay::Trigger::TriggerType_t &triggerType, const TimeStamp &triggerTime, const unsigned int hitSum, const unsigned int energySum, const bool totalEsum, const bool highEsum, const bool lowEsum, const unsigned int crossTriggerSource, const DayaBay::Detector &detector)
 Constructor for read-write instance.
 DaqLtbFrame ()
 Default Constructor.
virtual ~DaqLtbFrame ()
 Destroys this instance of the class.
virtual std::ostream & fillStream (std::ostream &s) const
 Fill the ASCII output stream.
const TimeStamptriggerTime () const
 Returns the TimeStamp of this frame.
Trigger::TriggerType_t triggerType () const
 Returns the trigger type of this frame.
unsigned int hitSum () const
 Returns the total hits summation for the object.
bool totalEsum () const
 Returns true if this total energy summation threshold is passed.
bool highEsum () const
 Returns true if this high energy summation threshold is passed.
bool lowEsum () const
 Returns true if this low energy summation threshold is passed.
unsigned int energySum () const
 Returns the total energy summation for the object.
DybDaq::LtbFrameltbFrame ()
 Returns the LtbFrame wrapped by this frame.

Static Public Member Functions

static void * operator new (size_t size)
 operator new
static void * operator new (size_t size, void *pObj)
 placement operator new it is needed by libstdc++ 3.2.3 (e.g.
static void operator delete (void *p)
 operator delete
static void operator delete (void *p, void *pObj)
 placement operator delete not sure if really needed, but it does not harm

Private Attributes

DybDaq::LtbFramem_ltbFrame
 The wrapped LtbFrame instance.
const DayaBay::Detectorm_detector
 The detector with which this frame is associated.
TimeStampm_triggerTime
 The TimeStamp of this frame.
DayaBay::Trigger::TriggerType_tm_triggerType
 The Trigger type of this frame.

Detailed Description

Class that wraps the DAQ data read from a LTB frame.

Author:
sjpatton@lbl.gov created Mon Apr 11 03:44:53 2011

Definition at line 42 of file DaqLtbFrame.h.


Constructor & Destructor Documentation

DaqLtbFrame::DaqLtbFrame ( const DybDaq::LtbFrame ltbFrame,
const DayaBay::Detector detector 
)

Constructor for read-only instance.

Definition at line 22 of file DaqLtbFrame.cc.

00023                                                           :
00024     m_ltbFrame(const_cast<LtbFrame*>(&ltbFrame)),
00025     m_detector(&detector),
00026     m_triggerTime(0),
00027     m_triggerType(0) {
00028 }

DaqLtbFrame::DaqLtbFrame ( const unsigned int  readoutType,
const DayaBay::Trigger::TriggerType_t triggerType,
const TimeStamp triggerTime,
const unsigned int  hitSum,
const unsigned int  energySum,
const bool  totalEsum,
const bool  highEsum,
const bool  lowEsum,
const unsigned int  crossTriggerSource,
const DayaBay::Detector detector 
)

Constructor for read-write instance.

Definition at line 30 of file DaqLtbFrame.cc.

00039                                                           :
00040     m_ltbFrame(0),
00041     m_detector(&detector),
00042     m_triggerTime(0),
00043     m_triggerType(0) {
00044     const LtbTraits& traits = LtbTraits::defaultTraits();
00045     const LtbTraits::LtbDateTime* dateTime = traits.makeDateTime(triggerTime.GetSec());
00046     m_ltbFrame = new LtbFrame(readoutType,
00047                               0,
00048                               *dateTime,
00049                               triggerTime.GetNanoSec() * 2,
00050                               0,
00051                               hitSum,
00052                               totalEsum,
00053                               highEsum,
00054                               lowEsum,
00055                               energySum,
00056                               crossTriggerSource,
00057                               false,
00058                               false,
00059                               false,
00060                               true,
00061                               false,
00062                               false,
00063                               0,
00064                               traits);
00065     delete dateTime;
00066     if(0 != (triggerType & DayaBay::Trigger::kManual)) {
00067         m_ltbFrame->setTriggerLine(LtbTraits::kManualTrigger);
00068     }
00069     if(0 != (triggerType & DayaBay::Trigger::kCross)) {
00070         m_ltbFrame->setTriggerLine(LtbTraits::kCrossTrigger);
00071     }
00072     if(0 != (triggerType & DayaBay::Trigger::kPeriodic)) {
00073         m_ltbFrame->setTriggerLine(LtbTraits::kPeriodicTrigger);
00074     }
00075     // FIXME: Need to add all Esum trigger types to offline convention
00076     if(0 != (triggerType & DayaBay::Trigger::kESum)) {
00077         m_ltbFrame->setTriggerLine(LtbTraits::kEsumAdcTrg);
00078     }
00079     if(0 != (triggerType & DayaBay::Trigger::kESum)) {
00080         m_ltbFrame->setTriggerLine(LtbTraits::kHighEsumCompTrg);
00081     }
00082     if(0 != (triggerType & DayaBay::Trigger::kESum)) {
00083         m_ltbFrame->setTriggerLine(LtbTraits::kLowEsumCompTrg);
00084     }
00085     if(0 != (triggerType & DayaBay::Trigger::kESum)) {
00086         m_ltbFrame->setTriggerLine(LtbTraits::kAllEsumCompTrg);
00087     }
00088 }

DayaBay::DaqLtbFrame::DaqLtbFrame (  )  [inline]

Default Constructor.

Definition at line 63 of file DaqLtbFrame.h.

00063                   : m_ltbFrame(0),
00064                     m_detector(0),
00065                     m_triggerTime(0),
00066                     m_triggerType(0) {}

DaqLtbFrame::~DaqLtbFrame (  )  [virtual]

Destroys this instance of the class.

Definition at line 90 of file DaqLtbFrame.cc.

00090                           {
00091     if (0 != m_triggerType) {
00092         delete m_triggerType;
00093     }
00094     if (0 != m_triggerTime) {
00095         delete m_triggerTime;
00096     }
00097 }


Member Function Documentation

std::ostream & DayaBay::DaqLtbFrame::fillStream ( std::ostream &  s  )  const [inline, virtual]

Fill the ASCII output stream.

Definition at line 155 of file DaqLtbFrame.h.

00156 {
00157   s << "{ " << "ltbFrame :      " << m_ltbFrame << std::endl
00158             << "detector :      " << m_detector << std::endl
00159             << "triggerTime :   " << m_triggerTime << std::endl
00160             << "triggerType :   " << m_triggerType << std::endl << " }";
00161   return s;
00162 }

const TimeStamp & DaqLtbFrame::triggerTime (  )  const

Returns the TimeStamp of this frame.

Definition at line 157 of file DaqLtbFrame.cc.

00157                                                 {
00158     if (0 == m_triggerTime) {
00159         TimeStamp** triggerTime = const_cast<TimeStamp**>(&m_triggerTime);
00160         if(m_ltbFrame->usingUtc()){
00161             // TODO: Write this
00162             *(triggerTime) = new TimeStamp(0,
00163                                            0);
00164         } else {
00165             *(triggerTime) = new TimeStamp(m_ltbFrame->dateTime().unixTime(),
00166                                            ((m_ltbFrame->halfNanoseconds() + m_ltbFrame->accumulation()) / 2));
00167         }
00168     }
00169     return *m_triggerTime;
00170 }

DayaBay::Trigger::TriggerType_t DaqLtbFrame::triggerType (  )  const

Returns the trigger type of this frame.

Definition at line 99 of file DaqLtbFrame.cc.

00099                                                            {
00100     if (0 == m_triggerType) {
00101         unsigned int triggerType = DayaBay::Trigger::kUnknown;
00102         if(m_ltbFrame->isTriggerLineSet(LtbTraits::kManualTrigger)) {
00103             triggerType |= DayaBay::Trigger::kManual;
00104         }
00105         if(m_ltbFrame->isTriggerLineSet(LtbTraits::kCrossTrigger)) {
00106             triggerType |= DayaBay::Trigger::kCross;
00107         }
00108         if(m_ltbFrame->isTriggerLineSet(LtbTraits::kPeriodicTrigger)) {
00109             triggerType |= DayaBay::Trigger::kPeriodic;
00110         }
00111         if(m_ltbFrame->isTriggerLineSet(LtbTraits::kMultiplicityTrigger)) {
00112             triggerType |= DayaBay::Trigger::kMult;
00113         }
00114         // FIXME: Need to add all Esum trigger types to offline convention
00115         if(m_ltbFrame->isTriggerLineSet(LtbTraits::kEsumAdcTrg)) {
00116             triggerType |= DayaBay::Trigger::kESum;
00117         }
00118         if(m_ltbFrame->isTriggerLineSet(LtbTraits::kHighEsumCompTrg)) {
00119             triggerType |= DayaBay::Trigger::kESum;
00120         }
00121         if(m_ltbFrame->isTriggerLineSet(LtbTraits::kLowEsumCompTrg)) {
00122             triggerType |= DayaBay::Trigger::kESum;
00123         }
00124         if(m_ltbFrame->isTriggerLineSet(LtbTraits::kAllEsumCompTrg)) {
00125             triggerType |= DayaBay::Trigger::kESum;
00126         }
00127         
00128         switch(m_detector->detectorId()) {
00129         case DetectorId::kAD1:
00130             triggerType |= DayaBay::Trigger::kAD1;
00131             break;
00132         case DetectorId::kAD2:
00133             triggerType |= DayaBay::Trigger::kAD2;
00134             break;
00135         case DetectorId::kAD3:
00136             triggerType |= DayaBay::Trigger::kAD3;
00137             break;
00138         case DetectorId::kAD4:
00139             triggerType |= DayaBay::Trigger::kAD4;
00140             break;
00141         case DetectorId::kIWS:
00142             triggerType |= DayaBay::Trigger::kIWS;
00143             break;
00144         case DetectorId::kOWS:
00145             triggerType |= DayaBay::Trigger::kOWS;
00146             break;
00147         default:
00148             break;
00149         }
00150         DayaBay::Trigger::TriggerType_t** type = const_cast<DayaBay::Trigger::TriggerType_t**>(&m_triggerType);
00151         *(type) = new DayaBay::Trigger::TriggerType_t(static_cast<DayaBay::Trigger::TriggerType_t>(triggerType)); 
00152     }
00153     return *m_triggerType;
00154 }

unsigned int DaqLtbFrame::hitSum (  )  const

Returns the total hits summation for the object.

Definition at line 176 of file DaqLtbFrame.cc.

00176                                        {
00177     return m_ltbFrame->hitSum();
00178 }

bool DaqLtbFrame::totalEsum (  )  const

Returns true if this total energy summation threshold is passed.

Definition at line 180 of file DaqLtbFrame.cc.

00180                                   {
00181     return m_ltbFrame->totalEsum();
00182 }

bool DaqLtbFrame::highEsum (  )  const

Returns true if this high energy summation threshold is passed.

Definition at line 184 of file DaqLtbFrame.cc.

00184                                  {
00185     return m_ltbFrame->highEsum();
00186 }

bool DaqLtbFrame::lowEsum (  )  const

Returns true if this low energy summation threshold is passed.

Definition at line 188 of file DaqLtbFrame.cc.

00188                                 {
00189     return m_ltbFrame->lowEsum();
00190 }

unsigned int DaqLtbFrame::energySum (  )  const

Returns the total energy summation for the object.

Definition at line 192 of file DaqLtbFrame.cc.

00192                                           {
00193     return m_ltbFrame->energySum();
00194 }

LtbFrame * DaqLtbFrame::ltbFrame (  ) 

Returns the LtbFrame wrapped by this frame.

Definition at line 172 of file DaqLtbFrame.cc.

00172                                 {
00173     return m_ltbFrame;
00174 }

static void* DayaBay::DaqLtbFrame::operator new ( size_t  size  )  [inline, static]

operator new

Definition at line 101 of file DaqLtbFrame.h.

00102     {
00103       return ( sizeof(DaqLtbFrame) == size ? 
00104                boost::singleton_pool<DaqLtbFrame, sizeof(DaqLtbFrame)>::malloc() :
00105                ::operator new(size) );
00106     }

static void* DayaBay::DaqLtbFrame::operator new ( size_t  size,
void *  pObj 
) [inline, static]

placement operator new it is needed by libstdc++ 3.2.3 (e.g.

in std::vector) it is not needed in libstdc++ >= 3.4

Definition at line 111 of file DaqLtbFrame.h.

00112     {
00113       return ::operator new (size,pObj);
00114     }

static void DayaBay::DaqLtbFrame::operator delete ( void *  p  )  [inline, static]

operator delete

Definition at line 117 of file DaqLtbFrame.h.

00118     {
00119       boost::singleton_pool<DaqLtbFrame, sizeof(DaqLtbFrame)>::is_from(p) ?
00120       boost::singleton_pool<DaqLtbFrame, sizeof(DaqLtbFrame)>::free(p) :
00121       ::operator delete(p);
00122     }

static void DayaBay::DaqLtbFrame::operator delete ( void *  p,
void *  pObj 
) [inline, static]

placement operator delete not sure if really needed, but it does not harm

Definition at line 126 of file DaqLtbFrame.h.

00127     {
00128       ::operator delete (p, pObj);
00129     }


Member Data Documentation

DybDaq::LtbFrame* DayaBay::DaqLtbFrame::m_ltbFrame [private]

The wrapped LtbFrame instance.

Definition at line 135 of file DaqLtbFrame.h.

const DayaBay::Detector* DayaBay::DaqLtbFrame::m_detector [private]

The detector with which this frame is associated.

Definition at line 136 of file DaqLtbFrame.h.

TimeStamp* DayaBay::DaqLtbFrame::m_triggerTime [private]

The TimeStamp of this frame.

Definition at line 137 of file DaqLtbFrame.h.

DayaBay::Trigger::TriggerType_t* DayaBay::DaqLtbFrame::m_triggerType [private]

The Trigger type of this frame.

Definition at line 138 of file DaqLtbFrame.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:24:29 2011 for DaqEvent by doxygen 1.4.7