/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::DaqRtmData Class Reference

Class that wraps the DAQ data read from a RTM block. More...

#include <DaqRtmData.h>

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

List of all members.

Public Member Functions

 DaqRtmData (const DybDaq::RtmData &ltbFrame, const DayaBay::Detector &detector)
 Constructor for read-only instance.
 DaqRtmData (const unsigned int rpcCFId, const TimeStamp &triggerTime, const unsigned int triggerRot, const unsigned int triggerMap, const DayaBay::Detector &detector)
 Constructor for read-write instance.
 DaqRtmData (const unsigned int rpcCFId, const bool validGPS, const bool validCLK, const bool usingUTC, const unsigned int second, const unsigned int nanoSecond, const int accumulation, const unsigned int triggerRot, const unsigned int triggerMap, const DayaBay::Detector &detector)
 Constructor for read-write instance.
 DaqRtmData ()
 Default Constructor.
virtual ~DaqRtmData ()
 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 block.
Trigger::TriggerType_t triggerType () const
 Returns the trigger type of this block.
unsigned int rpcCFId () const
 Returns the RPC CF ID of this block.
bool transErr () const
 Returns the transfer error flag of this block.
bool romAlmostFull () const
 Returns the ROM almost full flag of this block.
bool rtmAlmostFull () const
 Returns the RTM almost full flag of this block.
bool fullFlag () const
 Returns the full flag of this block.
bool validGPS () const
 Returns the GPS valid flag of this block.
bool validCLK () const
 Returns the clock system valid flag of this block.
bool usingUTC () const
 Returns the using UTC flag of this block.
unsigned int triggerRot () const
 Returns the trigger from ROT of this block.
unsigned int trigRot1Type () const
 Returns the trigger type from 1st ROT of this block.
unsigned int trigRot1 () const
 Returns the trigger from 1st ROT of this block.
unsigned int trigRot2Type () const
 Returns the trigger type from 2nd ROT of this block.
unsigned int trigRot2 () const
 Returns the trigger from 2nd ROT of this block.
unsigned int triggerMap () const
 Returns the full trigger map of this block.
unsigned int trigMap1Type () const
 Returns the full trigger type from 1st ROT of this block.
unsigned int trigMap1 () const
 Returns the full trigger from 1st ROT of this block.
unsigned int trigMap2Type () const
 Returns the full trigger type from 2nd ROT of this block.
unsigned int trigMap2 () const
 Returns the full trigger from 2nd ROT of this block.
DybDaq::RtmDatartmData ()
 Returns the RtmData wrapped by this block.
void fixTriggerTime (const TimeStamp &time)
 fix the trigger time of this readout.
int location () const
 From array(1), firstTelescope(2) or secondTelescope(4)

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::RtmDatam_rtmData
 The wrapped RtmData instance.
const DayaBay::Detectorm_detector
 The detector with which this block is associated.
TimeStampm_triggerTime
 The TimeStamp of this block.
DayaBay::Trigger::TriggerType_tm_triggerType
 The Trigger type of this block.

Detailed Description

Class that wraps the DAQ data read from a RTM block.

Author:
zoujh@ihep.ac.cn created Thu Dec 5 17:51:50 2013

Definition at line 42 of file DaqRtmData.h.


Constructor & Destructor Documentation

DaqRtmData::DaqRtmData ( const DybDaq::RtmData ltbFrame,
const DayaBay::Detector detector 
)

Constructor for read-only instance.

Definition at line 17 of file DaqRtmData.cc.

  : m_rtmData(const_cast<RtmData*>(&rtmData)),
    m_detector(&detector),
    m_triggerTime(0),
    m_triggerType(0)
{
}
DaqRtmData::DaqRtmData ( const unsigned int  rpcCFId,
const TimeStamp triggerTime,
const unsigned int  triggerRot,
const unsigned int  triggerMap,
const DayaBay::Detector detector 
)

Constructor for read-write instance.

Definition at line 26 of file DaqRtmData.cc.

  : m_rtmData(0),
    m_detector(&detector),
    m_triggerTime(0),
    m_triggerType(0)
{
    const RtmTraits& traits = RtmTraits::defaultTraits();
    m_rtmData = new RtmData(rpcCFId,
                            false,
                            false,
                            false,
                            false,
                            true,
                            true,
                            false,
                            triggerTime.GetSec(),
                            triggerTime.GetNanoSec(),
                            0,
                            triggerRot,
                            triggerMap,
                            traits);
}
DaqRtmData::DaqRtmData ( const unsigned int  rpcCFId,
const bool  validGPS,
const bool  validCLK,
const bool  usingUTC,
const unsigned int  second,
const unsigned int  nanoSecond,
const int  accumulation,
const unsigned int  triggerRot,
const unsigned int  triggerMap,
const DayaBay::Detector detector 
)

Constructor for read-write instance.

Definition at line 53 of file DaqRtmData.cc.

  : m_rtmData(0),
    m_detector(&detector),
    m_triggerTime(0),
    m_triggerType(0)
{
    const RtmTraits& traits = RtmTraits::defaultTraits();
    m_rtmData = new RtmData(rpcCFId,
                            false,
                            false,
                            false,
                            false,
                            validGPS,
                            validCLK,
                            usingUTC,
                            second,
                            nanoSecond,
                            accumulation,
                            triggerRot,
                            triggerMap,
                            traits);
}
DayaBay::DaqRtmData::DaqRtmData ( ) [inline]

Default Constructor.

Definition at line 70 of file DaqRtmData.h.

DaqRtmData::~DaqRtmData ( ) [virtual]

Destroys this instance of the class.

Definition at line 85 of file DaqRtmData.cc.

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

Member Function Documentation

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

Fill the ASCII output stream.

Definition at line 207 of file DaqRtmData.h.

{
  s << "{ " << "rtmData :       " << m_rtmData << std::endl
            << "detector :      " << m_detector << std::endl
            << "triggerTime :   " << m_triggerTime << std::endl
            << "triggerType :   " << m_triggerType << std::endl << " }";
  return s;
}
const TimeStamp & DaqRtmData::triggerTime ( ) const

Returns the TimeStamp of this block.

Definition at line 127 of file DaqRtmData.cc.

{
    if ( m_triggerTime == 0 ) {
        TimeStamp** triggerTime = const_cast<TimeStamp**>(&m_triggerTime);
        if ( ! m_rtmData->usingUTC() ) {
            (*triggerTime) = new TimeStamp(m_rtmData->second(),
                                           (long(m_rtmData->nanoSecond())+long(m_rtmData->accumulation()))/2);
        }
        else {
            // TODO: Write this
            (*triggerTime) = new TimeStamp(0, 0);
        }
    }
    return *m_triggerTime;
}
DayaBay::Trigger::TriggerType_t DaqRtmData::triggerType ( ) const

Returns the trigger type of this block.

Definition at line 95 of file DaqRtmData.cc.

{
    using DayaBay::Trigger::TriggerType_t;
    if ( m_triggerType == 0 ) {
        unsigned int triggerType = DayaBay::Trigger::kNone;
        if ( m_rtmData->forceTrigger() ) {
            triggerType |= DayaBay::Trigger::kRandom;
        }
        
        /* These codes are not compatible with the latest RPC data format.
         * Please retrieve the real trigger type from FEC data blocks!
        if ( m_rtmData->trigRot1Type() != 0 ) {
            triggerType |= DayaBay::Trigger::kRPC3of4;
        }
        if ( m_rtmData->trigRot1() != 0 ) {
            triggerType |= DayaBay::Trigger::kRPC2of4;
        }

        if ( m_rtmData->trigRot2Type() != 0 ) {
            triggerType |= DayaBay::Trigger::kRPC3of4;
        }
        if ( m_rtmData->trigRot2() != 0 ) {
            triggerType |= DayaBay::Trigger::kRPC2of4;
        }
        */

        TriggerType_t** type = const_cast<TriggerType_t**>(&m_triggerType);
        (*type) = new TriggerType_t(static_cast<TriggerType_t>(triggerType));
    }
    return *m_triggerType;
}
unsigned int DaqRtmData::rpcCFId ( ) const

Returns the RPC CF ID of this block.

Definition at line 148 of file DaqRtmData.cc.

{
    return m_rtmData->rpcCFId();
}
bool DaqRtmData::transErr ( ) const

Returns the transfer error flag of this block.

Definition at line 153 of file DaqRtmData.cc.

{
    return m_rtmData->transErr();
}
bool DaqRtmData::romAlmostFull ( ) const

Returns the ROM almost full flag of this block.

Definition at line 158 of file DaqRtmData.cc.

{
    return m_rtmData->romAlmostFull();
}
bool DaqRtmData::rtmAlmostFull ( ) const

Returns the RTM almost full flag of this block.

Definition at line 163 of file DaqRtmData.cc.

{
    return m_rtmData->rtmAlmostFull();
}
bool DaqRtmData::fullFlag ( ) const

Returns the full flag of this block.

Definition at line 168 of file DaqRtmData.cc.

{
    return m_rtmData->fullFlag();
}
bool DaqRtmData::validGPS ( ) const

Returns the GPS valid flag of this block.

Definition at line 173 of file DaqRtmData.cc.

{
    return m_rtmData->validGPS();
}
bool DaqRtmData::validCLK ( ) const

Returns the clock system valid flag of this block.

Definition at line 178 of file DaqRtmData.cc.

{
    return m_rtmData->validCLK();
}
bool DaqRtmData::usingUTC ( ) const

Returns the using UTC flag of this block.

Definition at line 183 of file DaqRtmData.cc.

{
    return m_rtmData->usingUTC();
}
unsigned int DaqRtmData::triggerRot ( ) const

Returns the trigger from ROT of this block.

Definition at line 188 of file DaqRtmData.cc.

{
    return m_rtmData->triggerRot();
}
unsigned int DaqRtmData::trigRot1Type ( ) const

Returns the trigger type from 1st ROT of this block.

Definition at line 193 of file DaqRtmData.cc.

{
    return m_rtmData->trigRot1Type();
}
unsigned int DaqRtmData::trigRot1 ( ) const

Returns the trigger from 1st ROT of this block.

Definition at line 198 of file DaqRtmData.cc.

{
    return m_rtmData->trigRot1();
}
unsigned int DaqRtmData::trigRot2Type ( ) const

Returns the trigger type from 2nd ROT of this block.

Definition at line 203 of file DaqRtmData.cc.

{
    return m_rtmData->trigRot2Type();
}
unsigned int DaqRtmData::trigRot2 ( ) const

Returns the trigger from 2nd ROT of this block.

Definition at line 208 of file DaqRtmData.cc.

{
    return m_rtmData->trigRot2();
}
unsigned int DaqRtmData::triggerMap ( ) const

Returns the full trigger map of this block.

Definition at line 213 of file DaqRtmData.cc.

{
    return m_rtmData->triggerMap();
}
unsigned int DaqRtmData::trigMap1Type ( ) const

Returns the full trigger type from 1st ROT of this block.

Definition at line 218 of file DaqRtmData.cc.

{
    return m_rtmData->trigMap1Type();
}
unsigned int DaqRtmData::trigMap1 ( ) const

Returns the full trigger from 1st ROT of this block.

Definition at line 223 of file DaqRtmData.cc.

{
    return m_rtmData->trigMap1();
}
unsigned int DaqRtmData::trigMap2Type ( ) const

Returns the full trigger type from 2nd ROT of this block.

Definition at line 228 of file DaqRtmData.cc.

{
    return m_rtmData->trigMap2Type();
}
unsigned int DaqRtmData::trigMap2 ( ) const

Returns the full trigger from 2nd ROT of this block.

Definition at line 233 of file DaqRtmData.cc.

{
    return m_rtmData->trigMap2();
}
RtmData * DaqRtmData::rtmData ( )

Returns the RtmData wrapped by this block.

Definition at line 143 of file DaqRtmData.cc.

{
    return m_rtmData;
}
void DaqRtmData::fixTriggerTime ( const TimeStamp time)

fix the trigger time of this readout.

Definition at line 238 of file DaqRtmData.cc.

int DaqRtmData::location ( ) const

From array(1), firstTelescope(2) or secondTelescope(4)

Definition at line 250 of file DaqRtmData.cc.

{
    int result = 0;
    unsigned int rot = m_rtmData->triggerRot();
    if ( (rot&0x0FFF7FFF) != 0 ) result |= 1;
    if ( (rot&0x40000000) != 0 ) {
        if ( m_rtmData->rpcCFId() == 0 ) {
            result |= 2;
        }
        else {
            result |= 4;
        }
    }
    return result;
}
static void* DayaBay::DaqRtmData::operator new ( size_t  size) [inline, static]

operator new

Definition at line 153 of file DaqRtmData.h.

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

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

operator delete

Definition at line 169 of file DaqRtmData.h.

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

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

Definition at line 178 of file DaqRtmData.h.

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

Member Data Documentation

The wrapped RtmData instance.

Definition at line 187 of file DaqRtmData.h.

The detector with which this block is associated.

Definition at line 188 of file DaqRtmData.h.

The TimeStamp of this block.

Definition at line 189 of file DaqRtmData.h.

The Trigger type of this block.

Definition at line 190 of file DaqRtmData.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