/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 | Private Attributes
DayaBay::DaqLtbFrame Class Reference

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

#include <DaqLtbFrame.h>

Collaboration diagram for DayaBay::DaqLtbFrame:
Collaboration graph
[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 (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 bool accumulationStatus, const bool validGps, const bool usingUtc, const bool validClockSystem, const bool feeBufferFull, const bool ltbBufferFull, const unsigned int blockedTriggerCount, 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.
bool accumulationStatus () const
 Returns the accumulated deviation of 1/2 nanosecond from the PPS.
bool validGps () const
 Returns true if the trigger system is using GPS.
bool usingUtc () const
 Returns true if using GPS and using UTC.
bool validClockSystem () const
 Returns true if the clock is external to to the LTB.
bool feeBufferFull () const
 Returns true if the FEE buffer is full between this valid local trigger and the last valid local trigger.
bool ltbBufferFull () const
 Returns true if the LTB buffer is full between this valid local trigger and the last valid local trigger.
unsigned int blockedTriggerCount () const
 Returns the number block trigger in this object.
DybDaq::LtbFrameltbFrame ()
 Returns the LtbFrame wrapped by this frame.
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::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 Thu Dec 5 17:51:51 2013

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.

                                                          :
    m_ltbFrame(const_cast<LtbFrame*>(&ltbFrame)),
    m_detector(&detector),
    m_triggerTime(0),
    m_triggerType(0) {
}
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.

                                                          :
    m_ltbFrame(0),
    m_detector(&detector),
    m_triggerTime(0),
    m_triggerType(0) {
    const LtbTraits& traits = LtbTraits::defaultTraits();
    const LtbTraits::LtbDateTime* dateTime = traits.makeDateTime(triggerTime.GetSec());
    m_ltbFrame = new LtbFrame(readoutType,
                              0,
                              *dateTime,
                              triggerTime.GetNanoSec() * 2,
                              0,
                              hitSum,
                              totalEsum,
                              highEsum,
                              lowEsum,
                              energySum,
                              crossTriggerSource,
                              false,
                              false,
                              false,
                              true,
                              false,
                              false,
                              0,
                              traits);
    delete dateTime;
    if(0 != (triggerType & DayaBay::Trigger::kManual)) {
        m_ltbFrame->setTriggerLine(LtbTraits::kManualTrigger);
    }
    if(0 != (triggerType & DayaBay::Trigger::kCross)) {
        m_ltbFrame->setTriggerLine(LtbTraits::kCrossTrigger);
    }
    if(0 != (triggerType & DayaBay::Trigger::kPeriodic)) {
        m_ltbFrame->setTriggerLine(LtbTraits::kPeriodicTrigger);
    }
    if(0 != (triggerType & DayaBay::Trigger::kPedestal)) {
        m_ltbFrame->setTriggerLine(LtbTraits::kPedestalTrigger);
    }
    if(0 != (triggerType & DayaBay::Trigger::kCalib)) {
        m_ltbFrame->setTriggerLine(LtbTraits::kCalibTrigger);
    }
    if(0 != (triggerType & DayaBay::Trigger::kRandom)) {
        m_ltbFrame->setTriggerLine(LtbTraits::kRandomTrigger);
    }

    if(0 != (triggerType & DayaBay::Trigger::kESumADC)) {
        m_ltbFrame->setTriggerLine(LtbTraits::kEsumAdcTrg);
    }
    if(0 != (triggerType & DayaBay::Trigger::kESumHigh)) {
        m_ltbFrame->setTriggerLine(LtbTraits::kHighEsumCompTrg);
    }
    if(0 != (triggerType & DayaBay::Trigger::kESumLow)) {
        m_ltbFrame->setTriggerLine(LtbTraits::kLowEsumCompTrg);
    }
    if(0 != (triggerType & DayaBay::Trigger::kESumAll)) {
        m_ltbFrame->setTriggerLine(LtbTraits::kAllEsumCompTrg);
    }
}
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 bool  accumulationStatus,
const bool  validGps,
const bool  usingUtc,
const bool  validClockSystem,
const bool  feeBufferFull,
const bool  ltbBufferFull,
const unsigned int  blockedTriggerCount,
const DayaBay::Detector detector 
)

Constructor for read-write instance.

Definition at line 99 of file DaqLtbFrame.cc.

                                                          :
    m_ltbFrame(0),
    m_detector(&detector),
    m_triggerTime(0),
    m_triggerType(0) {
    const LtbTraits& traits = LtbTraits::defaultTraits();
    const LtbTraits::LtbDateTime* dateTime = traits.makeDateTime(triggerTime.GetSec());
    m_ltbFrame = new LtbFrame(readoutType,
                              0,
                              *dateTime,
                              triggerTime.GetNanoSec() * 2,
                              0,
                              hitSum,
                              totalEsum,
                              highEsum,
                              lowEsum,
                              energySum,
                              crossTriggerSource,
                              accumulationStatus,
                              validGps,
                              usingUtc,
                              validClockSystem,
                              feeBufferFull,
                              ltbBufferFull,
                              blockedTriggerCount,
                              traits);
    delete dateTime;
    if(0 != (triggerType & DayaBay::Trigger::kManual)) {
        m_ltbFrame->setTriggerLine(LtbTraits::kManualTrigger);
    }
    if(0 != (triggerType & DayaBay::Trigger::kCross)) {
        m_ltbFrame->setTriggerLine(LtbTraits::kCrossTrigger);
    }
    if(0 != (triggerType & DayaBay::Trigger::kPeriodic)) {
        m_ltbFrame->setTriggerLine(LtbTraits::kPeriodicTrigger);
    }
    if(0 != (triggerType & DayaBay::Trigger::kPedestal)) {
        m_ltbFrame->setTriggerLine(LtbTraits::kPedestalTrigger);
    }
    if(0 != (triggerType & DayaBay::Trigger::kCalib)) {
        m_ltbFrame->setTriggerLine(LtbTraits::kCalibTrigger);
    }
    if(0 != (triggerType & DayaBay::Trigger::kRandom)) {
        m_ltbFrame->setTriggerLine(LtbTraits::kRandomTrigger);
    }

    if(0 != (triggerType & DayaBay::Trigger::kESumADC)) {
        m_ltbFrame->setTriggerLine(LtbTraits::kEsumAdcTrg);
    }
    if(0 != (triggerType & DayaBay::Trigger::kESumHigh)) {
        m_ltbFrame->setTriggerLine(LtbTraits::kHighEsumCompTrg);
    }
    if(0 != (triggerType & DayaBay::Trigger::kESumLow)) {
        m_ltbFrame->setTriggerLine(LtbTraits::kLowEsumCompTrg);
    }
    if(0 != (triggerType & DayaBay::Trigger::kESumAll)) {
        m_ltbFrame->setTriggerLine(LtbTraits::kAllEsumCompTrg);
    }
}
DayaBay::DaqLtbFrame::DaqLtbFrame ( ) [inline]

Default Constructor.

Definition at line 82 of file DaqLtbFrame.h.

DaqLtbFrame::~DaqLtbFrame ( ) [virtual]

Destroys this instance of the class.

Definition at line 175 of file DaqLtbFrame.cc.

                          {
    if (0 != m_triggerType) {
        delete m_triggerType;
    }
    if (0 != m_triggerTime) {
        delete m_triggerTime;
    }
}

Member Function Documentation

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

Fill the ASCII output stream.

Definition at line 198 of file DaqLtbFrame.h.

{
  s << "{ " << "ltbFrame :      " << m_ltbFrame << std::endl
            << "detector :      " << m_detector << std::endl
            << "triggerTime :   " << m_triggerTime << std::endl
            << "triggerType :   " << m_triggerType << std::endl << " }";
  return s;
}
const TimeStamp & DaqLtbFrame::triggerTime ( ) const

Returns the TimeStamp of this frame.

Definition at line 229 of file DaqLtbFrame.cc.

                                                {
    if (0 == m_triggerTime) {
        TimeStamp** triggerTime = const_cast<TimeStamp**>(&m_triggerTime);
        if(m_ltbFrame->usingUtc()){
            // TODO: Write this
            *(triggerTime) = new TimeStamp(0,
                                           0);
        } else {
            *(triggerTime) = new TimeStamp(m_ltbFrame->dateTime().unixTime(),
                                           (long(m_ltbFrame->halfNanoseconds())+long(m_ltbFrame->accumulation()))/2);
        }
    }
    return *m_triggerTime;
}
DayaBay::Trigger::TriggerType_t DaqLtbFrame::triggerType ( ) const

Returns the trigger type of this frame.

Definition at line 184 of file DaqLtbFrame.cc.

                                                           {
    if (0 == m_triggerType) {
      unsigned int triggerType = DayaBay::Trigger::kNone;
        if(m_ltbFrame->isTriggerLineSet(LtbTraits::kManualTrigger)) {
            triggerType |= DayaBay::Trigger::kManual;
        }
        if(m_ltbFrame->isTriggerLineSet(LtbTraits::kCrossTrigger)) {
            triggerType |= DayaBay::Trigger::kCross;
        }
        if(m_ltbFrame->isTriggerLineSet(LtbTraits::kPeriodicTrigger)) {
            triggerType |= DayaBay::Trigger::kPeriodic;
        }
        if(m_ltbFrame->isTriggerLineSet(LtbTraits::kPedestalTrigger)) {
            triggerType |= DayaBay::Trigger::kPedestal;
        }
        if(m_ltbFrame->isTriggerLineSet(LtbTraits::kCalibTrigger)) {
            triggerType |= DayaBay::Trigger::kCalib;
        }
        if(m_ltbFrame->isTriggerLineSet(LtbTraits::kRandomTrigger)) {
            triggerType |= DayaBay::Trigger::kRandom;
        }
        if(m_ltbFrame->isTriggerLineSet(LtbTraits::kMultiplicityTrigger)) {
            triggerType |= DayaBay::Trigger::kMult;
        }

        if(m_ltbFrame->isTriggerLineSet(LtbTraits::kEsumAdcTrg)) {
            triggerType |= DayaBay::Trigger::kESumADC;
        }
        if(m_ltbFrame->isTriggerLineSet(LtbTraits::kHighEsumCompTrg)) {
            triggerType |= DayaBay::Trigger::kESumHigh;
        }
        if(m_ltbFrame->isTriggerLineSet(LtbTraits::kLowEsumCompTrg)) {
            triggerType |= DayaBay::Trigger::kESumLow;
        }
        if(m_ltbFrame->isTriggerLineSet(LtbTraits::kAllEsumCompTrg)) {
            triggerType |= DayaBay::Trigger::kESumAll;
        }
        
        DayaBay::Trigger::TriggerType_t** type = const_cast<DayaBay::Trigger::TriggerType_t**>(&m_triggerType);
        *(type) = new DayaBay::Trigger::TriggerType_t(static_cast<DayaBay::Trigger::TriggerType_t>(triggerType)); 
    }
    return *m_triggerType;
}
unsigned int DaqLtbFrame::hitSum ( ) const

Returns the total hits summation for the object.

Definition at line 248 of file DaqLtbFrame.cc.

                                       {
    return m_ltbFrame->hitSum();
}
bool DaqLtbFrame::totalEsum ( ) const

Returns true if this total energy summation threshold is passed.

Definition at line 252 of file DaqLtbFrame.cc.

                                  {
    return m_ltbFrame->totalEsum();
}
bool DaqLtbFrame::highEsum ( ) const

Returns true if this high energy summation threshold is passed.

Definition at line 256 of file DaqLtbFrame.cc.

                                 {
    return m_ltbFrame->highEsum();
}
bool DaqLtbFrame::lowEsum ( ) const

Returns true if this low energy summation threshold is passed.

Definition at line 260 of file DaqLtbFrame.cc.

                                {
    return m_ltbFrame->lowEsum();
}
unsigned int DaqLtbFrame::energySum ( ) const

Returns the total energy summation for the object.

Definition at line 264 of file DaqLtbFrame.cc.

                                          {
    return m_ltbFrame->energySum();
}
bool DaqLtbFrame::accumulationStatus ( ) const

Returns the accumulated deviation of 1/2 nanosecond from the PPS.

Definition at line 268 of file DaqLtbFrame.cc.

bool DaqLtbFrame::validGps ( ) const

Returns true if the trigger system is using GPS.

Definition at line 272 of file DaqLtbFrame.cc.

                                 {
    return m_ltbFrame->validGps();
}
bool DaqLtbFrame::usingUtc ( ) const

Returns true if using GPS and using UTC.

Definition at line 276 of file DaqLtbFrame.cc.

                                 {
    return m_ltbFrame->usingUtc();
}
bool DaqLtbFrame::validClockSystem ( ) const

Returns true if the clock is external to to the LTB.

Definition at line 280 of file DaqLtbFrame.cc.

                                         {
    return m_ltbFrame->validClockSystem();
}
bool DaqLtbFrame::feeBufferFull ( ) const

Returns true if the FEE buffer is full between this valid local trigger and the last valid local trigger.

Definition at line 284 of file DaqLtbFrame.cc.

                                      {
    return m_ltbFrame->feeBufferFull();
}
bool DaqLtbFrame::ltbBufferFull ( ) const

Returns true if the LTB buffer is full between this valid local trigger and the last valid local trigger.

Definition at line 288 of file DaqLtbFrame.cc.

                                      {
    return m_ltbFrame->ltbBufferFull();
}
unsigned int DaqLtbFrame::blockedTriggerCount ( ) const

Returns the number block trigger in this object.

Definition at line 292 of file DaqLtbFrame.cc.

LtbFrame * DaqLtbFrame::ltbFrame ( )

Returns the LtbFrame wrapped by this frame.

Definition at line 244 of file DaqLtbFrame.cc.

                                {
    return m_ltbFrame;
}
void DaqLtbFrame::fixTriggerTime ( const TimeStamp time)

fix the trigger time of this readout.

Definition at line 296 of file DaqLtbFrame.cc.

{
    if ( m_triggerTime != 0 ) {
        delete m_triggerTime;
        m_triggerTime = 0;
    }

    LtbTime& ltbTime = const_cast<LtbTime&>(m_ltbFrame->dateTime());
    ltbTime.setDateTime(time.GetSec());
    ltbTime.setHalfNanoseconds(time.GetNanoSec()*2);
    ltbTime.setAccumulation(0);
}
static void* DayaBay::DaqLtbFrame::operator new ( size_t  size) [inline, static]

operator new

Definition at line 144 of file DaqLtbFrame.h.

    {
      return ( sizeof(DaqLtbFrame) == size ? 
               boost::singleton_pool<DaqLtbFrame, sizeof(DaqLtbFrame)>::malloc() :
               ::operator new(size) );
    }
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 154 of file DaqLtbFrame.h.

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

operator delete

Definition at line 160 of file DaqLtbFrame.h.

    {
      boost::singleton_pool<DaqLtbFrame, sizeof(DaqLtbFrame)>::is_from(p) ?
      boost::singleton_pool<DaqLtbFrame, sizeof(DaqLtbFrame)>::free(p) :
      ::operator delete(p);
    }
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 169 of file DaqLtbFrame.h.

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

Member Data Documentation

The wrapped LtbFrame instance.

Definition at line 178 of file DaqLtbFrame.h.

The detector with which this frame is associated.

Definition at line 179 of file DaqLtbFrame.h.

The TimeStamp of this frame.

Definition at line 180 of file DaqLtbFrame.h.

The Trigger type of this frame.

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