/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
DayaBay::DaqLtb Class Reference

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

#include <DaqLtb.h>

Collaboration diagram for DayaBay::DaqLtb:
Collaboration graph
[legend]

List of all members.

Public Types

typedef std::vector
< DayaBay::DaqLtbFrame * > 
LtbFramePtrList
 A list containing pointers to the LTB frames.

Public Member Functions

 DaqLtb (const DybDaq::LtbReadout &ltbReadout, const DayaBay::Detector &detector)
 Constructor for read-only instance.
 DaqLtb (const unsigned int localTriggerNumber, const unsigned int rawTriggerTotal, const unsigned int ltbStatus, const DayaBay::Detector &detector)
 Constructor for read-write instance.
 DaqLtb ()
 Default Constructor.
virtual ~DaqLtb ()
 Destroys this instance of the class.
virtual std::ostream & fillStream (std::ostream &s) const
 Fill the ASCII output stream.
bool hasTriggers () const
 Returns true when this readout contains triggers.
const TimeStampearliestTriggerTime () const
 Returns the earliest trigger time in this crate.
const TimeStamplatestTriggerTime () const
 Returns the latest trigger time in this crate.
Trigger::TriggerType_t triggerType () const
 Returns the composite trigger type of this crate.
const LtbFramePtrListframes () const
 Returns the list of LTB frames.
unsigned int localTriggerNumber () const
 Returns the local trigger number of this readout.
const DybDaq::LtbReadoutltbReadout () const
 Returns the LtbReadout being wrapped by this class.
bool addFrame (DaqLtbFrame *frame)
 Adds a new DaqLtbFrame to this object.
void fixTriggerTime (const TimeStamp &time)
 fix the trigger time of this readout.

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::LtbReadoutm_ltbReadout
 The wrapped LtbReadout instance.
const DayaBay::Detectorm_detector
 The detector with which this frame is associated.
LtbFramePtrListm_framePtrs
 The list containing pointers to the LTB frames in this readout.
DayaBay::Trigger::TriggerType_t m_triggerType
 The composite trigger type of this crate.

Detailed Description

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

Author:
sjpatton@lbl.gov created Thu Dec 5 17:51:51 2013

Definition at line 42 of file DaqLtb.h.


Member Typedef Documentation

A list containing pointers to the LTB frames.

Definition at line 47 of file DaqLtb.h.


Constructor & Destructor Documentation

DaqLtb::DaqLtb ( const DybDaq::LtbReadout ltbReadout,
const DayaBay::Detector detector 
)

Constructor for read-only instance.

Definition at line 25 of file DaqLtb.cc.

                                         :
    m_ltbReadout(const_cast<LtbReadout*>(&ltbReadout)),
    m_detector(&detector),
    m_framePtrs(0),
    m_triggerType(DayaBay::Trigger::kNone) {
}
DaqLtb::DaqLtb ( const unsigned int  localTriggerNumber,
const unsigned int  rawTriggerTotal,
const unsigned int  ltbStatus,
const DayaBay::Detector detector 
)

Constructor for read-write instance.

Definition at line 33 of file DaqLtb.cc.

                                         :
    m_ltbReadout(new LtbReadout(localTriggerNumber,
                                rawTriggerTotal,
                                ltbStatus,
                                false,
                                LtbTraits::defaultTraits())),
    m_detector(&detector),
    m_framePtrs(0),
    m_triggerType(DayaBay::Trigger::kNone) {
}
DayaBay::DaqLtb::DaqLtb ( ) [inline]

Default Constructor.

Definition at line 60 of file DaqLtb.h.

DaqLtb::~DaqLtb ( ) [virtual]

Destroys this instance of the class.

Definition at line 47 of file DaqLtb.cc.

                {
    if (0 != m_framePtrs) {
        LtbFramePtrList::iterator finished = m_framePtrs->end();
        for(LtbFramePtrList::iterator frame = m_framePtrs->begin();
            frame != finished;
            ++frame) {
            delete *frame;
        }
        delete m_framePtrs;
    }
}

Member Function Documentation

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

Fill the ASCII output stream.

Definition at line 155 of file DaqLtb.h.

{
  s << "{ " << "ltbReadout :    " << m_ltbReadout << std::endl
            << "detector :      " << m_detector << std::endl
            << "framePtrs :     " << m_framePtrs << std::endl
            << "triggerType :   " << m_triggerType << std::endl << " }";
  return s;
}
bool DaqLtb::hasTriggers ( ) const

Returns true when this readout contains triggers.

Definition at line 59 of file DaqLtb.cc.

                               {
  const DaqLtb::LtbFramePtrList& ltbFrameList = frames();
  return !ltbFrameList.empty();
}
const TimeStamp & DaqLtb::earliestTriggerTime ( ) const

Returns the earliest trigger time in this crate.

Definition at line 64 of file DaqLtb.cc.

                                                   {
    const DaqLtbFrame& frame = *(frames().front());
    return frame.triggerTime();
}
const TimeStamp & DaqLtb::latestTriggerTime ( ) const

Returns the latest trigger time in this crate.

Definition at line 69 of file DaqLtb.cc.

                                                 {
    const DaqLtbFrame& frame = *(frames().back());
    return frame.triggerTime();
}
DayaBay::Trigger::TriggerType_t DaqLtb::triggerType ( ) const

Returns the composite trigger type of this crate.

Definition at line 74 of file DaqLtb.cc.

                                                      {
    frames();
    return m_triggerType;
}
const DaqLtb::LtbFramePtrList & DaqLtb::frames ( ) const

Returns the list of LTB frames.

Definition at line 79 of file DaqLtb.cc.

                                                  {
    if (0 == m_framePtrs) {
        DayaBay::Trigger::TriggerType_t* cumulativeType = const_cast<DayaBay::Trigger::TriggerType_t*>(&m_triggerType);
        LtbFramePtrList** framePtrs = const_cast<LtbFramePtrList**>(&m_framePtrs);
        *(framePtrs) = new LtbFramePtrList();
        const LtbReadout::LtbFramePtrList& frames = m_ltbReadout->ltbFrames();
        const LtbReadout::LtbFramePtrList::const_iterator finished = frames.end();
        for (LtbReadout::LtbFramePtrList::const_iterator frame = frames.begin();
             finished != frame;
             ++frame) {
            DaqLtbFrame* daqFrame = new DaqLtbFrame(*(*frame),
                                                    *m_detector);
            *(cumulativeType) = (DayaBay::Trigger::TriggerType_t)(m_triggerType | daqFrame->triggerType());
            (*framePtrs)->push_back(daqFrame);
        }
    }
    return *m_framePtrs;
}
unsigned int DaqLtb::localTriggerNumber ( ) const

Returns the local trigger number of this readout.

Definition at line 98 of file DaqLtb.cc.

const LtbReadout * DaqLtb::ltbReadout ( ) const

Returns the LtbReadout being wrapped by this class.

Definition at line 102 of file DaqLtb.cc.

                                           {
    return m_ltbReadout;
}
bool DaqLtb::addFrame ( DaqLtbFrame frame)

Adds a new DaqLtbFrame to this object.

Definition at line 106 of file DaqLtb.cc.

                                        {
    if (0 == m_framePtrs) {
        m_framePtrs = new LtbFramePtrList();
    }
    m_framePtrs->push_back(frame);
    m_ltbReadout->addFrame(frame->ltbFrame());
    return true;
}
void DaqLtb::fixTriggerTime ( const TimeStamp time)

fix the trigger time of this readout.

Definition at line 115 of file DaqLtb.cc.

{
    frames();
    LtbFramePtrList::iterator end = m_framePtrs->end();
    for ( LtbFramePtrList::iterator it = m_framePtrs->begin();
            it != end;
            ++it )
    {
        (*it)->fixTriggerTime(time);
    }
}
static void* DayaBay::DaqLtb::operator new ( size_t  size) [inline, static]

operator new

Definition at line 101 of file DaqLtb.h.

    {
      return ( sizeof(DaqLtb) == size ? 
               boost::singleton_pool<DaqLtb, sizeof(DaqLtb)>::malloc() :
               ::operator new(size) );
    }
static void* DayaBay::DaqLtb::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 DaqLtb.h.

    {
      return ::operator new (size,pObj);
    }
static void DayaBay::DaqLtb::operator delete ( void *  p) [inline, static]

operator delete

Definition at line 117 of file DaqLtb.h.

    {
      boost::singleton_pool<DaqLtb, sizeof(DaqLtb)>::is_from(p) ?
      boost::singleton_pool<DaqLtb, sizeof(DaqLtb)>::free(p) :
      ::operator delete(p);
    }
static void DayaBay::DaqLtb::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 DaqLtb.h.

    {
      ::operator delete (p, pObj);
    }

Member Data Documentation

The wrapped LtbReadout instance.

Definition at line 135 of file DaqLtb.h.

The detector with which this frame is associated.

Definition at line 136 of file DaqLtb.h.

The list containing pointers to the LTB frames in this readout.

Definition at line 137 of file DaqLtb.h.

The composite trigger type of this crate.

Definition at line 138 of file DaqLtb.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 Fri May 16 2014 10:01:06 for DaqEvent by doxygen 1.7.4