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

In This Package:

Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DayaBay::DaqCrate Class Reference

Class that wraps a DybDaq::EventReadout instance. More...

#include <DaqCrate.h>

Inheritance diagram for DayaBay::DaqCrate:
Inheritance graph
[legend]
Collaboration diagram for DayaBay::DaqCrate:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 DaqCrate (const DybDaq::EventReadout *eventReadout)
 Standard constructor.
 DaqCrate (const DayaBay::Detector &detector, const unsigned int run, const unsigned int event)
 Monte Carlo constructor.
 DaqCrate (const DayaBay::DaqCrate &crate)
 Copy constructor.
 DaqCrate ()
 Default Constructor.
virtual ~DaqCrate ()
 Destroys this instance of the class.
virtual std::ostream & fillStream (std::ostream &s) const
 Fill the ASCII output stream.
const DayaBay::DaqPmtCrateasPmtCrate () const
 Returns this object as a DaqPmtCrate.
const DayaBay::DaqRpcCrateasRpcCrate () const
 Returns this object as a DaqRpcCrate.
const DayaBay::Detectordetector () const
 Returns the detector associated with this readout.
unsigned int eventNumber () const
 Returns the event number assigned to this readout.
const DybDaq::EventReadouteventReadout () const
 Returns the wrapped EventReadout instance.
virtual unsigned int localTriggerNumber () const =0
 Returns the local trigger number of this readout.
unsigned int runNumber () const
 Returns the run number in which this readout was taken.
virtual bool hasTriggers () const =0
 Returns true when this readout contains triggers.
virtual const TimeStamptriggerTime () const =0
 Returns the timestamp of the first trigger frame in this readout.
virtual double triggerSpan () const =0
 Returns the span, in seconds, of trigger times in this readout.
virtual Trigger::TriggerType_t triggerType () const =0
 Returns the trigger type of this readout.
virtual void fixTriggerTime (const TimeStamp &time)=0
 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

Protected Member Functions

void assignment (const DayaBay::DaqCrate &rhs)
 Assignement operator.
DybDaq::EventReadouteventReadout ()
 Returns the wrapped EventReadout instance.

Private Member Functions

void flushCache ()
 Deletes any objects cached by this instance.

Private Attributes

DayaBay::Detectorm_detector
 The detector associated with this readout.
DybDaq::EventReadoutm_eventReadout
 The wrapped EventReadout instance.

Detailed Description

Class that wraps a DybDaq::EventReadout instance.

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

Definition at line 45 of file DaqCrate.h.


Constructor & Destructor Documentation

DaqCrate::DaqCrate ( const DybDaq::EventReadout eventReadout)

Standard constructor.

Definition at line 141 of file DaqCrate.cc.

                                                   :
    m_detector(0),
    m_eventReadout(const_cast<EventReadout*>(eventReadout)) {
}
DaqCrate::DaqCrate ( const DayaBay::Detector detector,
const unsigned int  run,
const unsigned int  event 
)

Monte Carlo constructor.

Definition at line 123 of file DaqCrate.cc.

                                             :
    m_detector(0),
    m_eventReadout(new EventReadout(convertSiteId(detector.site()),
                                    convertDetectorId(detector.detectorId()),
                                    run,
                                    event,
                                    0, // Normal data type
                                    false,
                                    false,
                                    false,
                                    false,
                                    false,
                                    CbltTraits::defaultTraits(),
                                    EventTraits::defaultTraits())) {
}
DaqCrate::DaqCrate ( const DayaBay::DaqCrate crate)

Copy constructor.

Definition at line 146 of file DaqCrate.cc.

                                       :
    m_detector(0),
    m_eventReadout(0) {
    const EventReadout& readout = crate.eventReadout();
    // WARNING: NExt line will fail to work if EventReadout is not ByteBuffer based.
    m_eventReadout = new EventReadout(readout);
}
DayaBay::DaqCrate::DaqCrate ( ) [inline]

Default Constructor.

Definition at line 61 of file DaqCrate.h.

DaqCrate::~DaqCrate ( ) [virtual]

Destroys this instance of the class.

Definition at line 154 of file DaqCrate.cc.

                    {
    flushCache();
}

Member Function Documentation

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

Fill the ASCII output stream.

Reimplemented in DayaBay::DaqPmtCrate, and DayaBay::DaqRpcCrate.

Definition at line 173 of file DaqCrate.h.

{
  s << "{ " << "detector :      " << m_detector << std::endl
            << "eventReadout :  " << m_eventReadout << std::endl << " }";
  return s;
}
const DaqPmtCrate * DaqCrate::asPmtCrate ( ) const

Returns this object as a DaqPmtCrate.

Definition at line 175 of file DaqCrate.cc.

                                              {
    return dynamic_cast<const DaqPmtCrate*>(this);
}
const DaqRpcCrate * DaqCrate::asRpcCrate ( ) const

Returns this object as a DaqRpcCrate.

Definition at line 179 of file DaqCrate.cc.

                                              {
    return dynamic_cast<const DaqRpcCrate*>(this);
}
const Detector & DaqCrate::detector ( ) const

Returns the detector associated with this readout.

Definition at line 195 of file DaqCrate.cc.

                                         {
    if (0 == m_detector) {
        const EventHeader& header = m_eventReadout->header();
        Detector** detector = const_cast<Detector**>(&m_detector);
        *(detector) = new Detector(convertSite(header.site()),
                                   convertDetector(header.detector()));

    }
    return *m_detector;
}
unsigned int DaqCrate::eventNumber ( ) const

Returns the event number assigned to this readout.

Definition at line 183 of file DaqCrate.cc.

                                         {
    return m_eventReadout->header().event();
}
const DybDaq::EventReadout & DaqCrate::eventReadout ( ) const

Returns the wrapped EventReadout instance.

Definition at line 187 of file DaqCrate.cc.

                                                       {
    return *m_eventReadout;
}
virtual unsigned int DayaBay::DaqCrate::localTriggerNumber ( ) const [pure virtual]

Returns the local trigger number of this readout.

Implemented in DayaBay::DaqPmtCrate, and DayaBay::DaqRpcCrate.

unsigned int DaqCrate::runNumber ( ) const

Returns the run number in which this readout was taken.

Definition at line 191 of file DaqCrate.cc.

                                       {
    return m_eventReadout->header().run();
}
virtual bool DayaBay::DaqCrate::hasTriggers ( ) const [pure virtual]

Returns true when this readout contains triggers.

Implemented in DayaBay::DaqPmtCrate, and DayaBay::DaqRpcCrate.

virtual const TimeStamp& DayaBay::DaqCrate::triggerTime ( ) const [pure virtual]

Returns the timestamp of the first trigger frame in this readout.

Implemented in DayaBay::DaqPmtCrate, and DayaBay::DaqRpcCrate.

virtual double DayaBay::DaqCrate::triggerSpan ( ) const [pure virtual]

Returns the span, in seconds, of trigger times in this readout.

Implemented in DayaBay::DaqPmtCrate, and DayaBay::DaqRpcCrate.

virtual Trigger::TriggerType_t DayaBay::DaqCrate::triggerType ( ) const [pure virtual]

Returns the trigger type of this readout.

Implemented in DayaBay::DaqPmtCrate, and DayaBay::DaqRpcCrate.

virtual void DayaBay::DaqCrate::fixTriggerTime ( const TimeStamp time) [pure virtual]

fix the trigger time of this readout.

Implemented in DayaBay::DaqPmtCrate, and DayaBay::DaqRpcCrate.

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

operator new

Reimplemented in DayaBay::DaqPmtCrate, and DayaBay::DaqRpcCrate.

Definition at line 109 of file DaqCrate.h.

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

Reimplemented in DayaBay::DaqPmtCrate, and DayaBay::DaqRpcCrate.

Definition at line 119 of file DaqCrate.h.

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

operator delete

Reimplemented in DayaBay::DaqPmtCrate, and DayaBay::DaqRpcCrate.

Definition at line 125 of file DaqCrate.h.

    {
      boost::singleton_pool<DaqCrate, sizeof(DaqCrate)>::is_from(p) ?
      boost::singleton_pool<DaqCrate, sizeof(DaqCrate)>::free(p) :
      ::operator delete(p);
    }
static void DayaBay::DaqCrate::operator delete ( void *  p,
void *  pObj 
) [inline, static]

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

Reimplemented in DayaBay::DaqPmtCrate, and DayaBay::DaqRpcCrate.

Definition at line 134 of file DaqCrate.h.

    {
      ::operator delete (p, pObj);
    }
void DaqCrate::assignment ( const DayaBay::DaqCrate rhs) [protected]

Assignement operator.

Definition at line 158 of file DaqCrate.cc.

                                             {
  if (this != &rhs) {
      flushCache();
      m_detector = 0;
      m_eventReadout = new EventReadout(rhs.eventReadout());
  }
}
DybDaq::EventReadout & DaqCrate::eventReadout ( ) [protected]

Returns the wrapped EventReadout instance.

Definition at line 206 of file DaqCrate.cc.

                                           {
    return *m_eventReadout;
}
void DaqCrate::flushCache ( ) [private]

Deletes any objects cached by this instance.

Reimplemented in DayaBay::DaqPmtCrate, and DayaBay::DaqRpcCrate.

Definition at line 166 of file DaqCrate.cc.

                          {
    if (0 != m_eventReadout) {
        delete m_eventReadout;
    }
    if (0 != m_detector) {
        delete m_detector;
    }
}

Member Data Documentation

The detector associated with this readout.

Definition at line 152 of file DaqCrate.h.

The wrapped EventReadout instance.

Definition at line 153 of file DaqCrate.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