/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 | Private Member Functions | Private Attributes
DybDaq::RecordParser Class Reference

#include <RecordParser.h>

List of all members.

Public Member Functions

 RecordParser ()
virtual ~RecordParser ()
bool ready ()
bool onlyRpc ()
bool onlyPmt ()
bool farSite ()
int site ()
int nPmtDet ()
int hasRpc ()
uint32_t mask ()
bool getRunParams (RecordBuffer *record, bool timeAlignment)
bool isPmtEvent (RecordBuffer *record)
bool isRpcEvent (RecordBuffer *record)
int recordType (RecordBuffer *record)
bool earlier (RecordBuffer *r1, RecordBuffer *r2)

Private Member Functions

void initTimeShift ()
uint32_t marker (RecordBuffer *record)

Private Attributes

int m_site
int m_nPmtDet
int m_hasRpc
uint32_t m_mask
uint32_t m_run
bool m_ready

Detailed Description

Definition at line 10 of file RecordParser.h.


Constructor & Destructor Documentation

RecordParser::RecordParser ( )

Definition at line 10 of file RecordParser.cc.

    : m_site(-1),
      m_nPmtDet(0),
      m_hasRpc(0),
      m_mask(0),
      m_ready(false)
{
}
RecordParser::~RecordParser ( ) [virtual]

Definition at line 19 of file RecordParser.cc.

{
}

Member Function Documentation

bool DybDaq::RecordParser::ready ( ) [inline]

Definition at line 17 of file RecordParser.h.

{ return m_ready; }
bool DybDaq::RecordParser::onlyRpc ( ) [inline]

Definition at line 18 of file RecordParser.h.

{ return (m_nPmtDet==0); }
bool DybDaq::RecordParser::onlyPmt ( ) [inline]

Definition at line 19 of file RecordParser.h.

{ return (m_hasRpc==0); }
bool DybDaq::RecordParser::farSite ( ) [inline]

Definition at line 20 of file RecordParser.h.

{ return (m_site==2); }
int DybDaq::RecordParser::site ( ) [inline]

Definition at line 22 of file RecordParser.h.

{ return m_site; }
int DybDaq::RecordParser::nPmtDet ( ) [inline]

Definition at line 23 of file RecordParser.h.

{ return m_nPmtDet; }
int DybDaq::RecordParser::hasRpc ( ) [inline]

Definition at line 24 of file RecordParser.h.

{ return m_hasRpc; }
uint32_t DybDaq::RecordParser::mask ( ) [inline]

Definition at line 25 of file RecordParser.h.

{ return m_mask; }
bool RecordParser::getRunParams ( RecordBuffer record,
bool  timeAlignment 
)

Definition at line 23 of file RecordParser.cc.

{
    if ( record != 0 &&
         marker(record) == DybDaq::RawRecordPoolUtil::RunParametersMarker ) {

        m_run = ((uint32_t*)record->data())[2];

        uint32_t detMask = ((uint32_t*)record->data())[5];

        for ( m_site = 0; m_site < 3; ++m_site ) {
            m_mask = ((detMask>>(8*m_site)) & 0xFF);
            if ( m_mask != 0 ) {
                for ( int i = 1; i < 7; ++i ) {
                    if ( (m_mask & (1<<i)) != 0 ) ++m_nPmtDet;
                }

                if ( (m_mask&0x80) != 0 ) m_hasRpc = 1;
                break;
            }
        }

        if ( timeAlignment ) initTimeShift();

        m_ready = true;

        return true;
    }
    return false;
}
bool RecordParser::isPmtEvent ( RecordBuffer record)

Definition at line 53 of file RecordParser.cc.

{
    if ( record != 0 &&
         marker(record) == DybDaq::RawRecordPoolUtil::DataSeparatorMarker ) {

        uint32_t* event = (uint32_t*)(record->data() + 16);
        uint32_t  srcId = event[3];

        if ( (srcId&0xF0000) != 0x70000 ) {
            return true;
        }
    }
    return false;
}
bool RecordParser::isRpcEvent ( RecordBuffer record)

Definition at line 68 of file RecordParser.cc.

{
    if ( record != 0 &&
         marker(record) == DybDaq::RawRecordPoolUtil::DataSeparatorMarker ) {

        uint32_t* event = (uint32_t*)(record->data() + 16);
        uint32_t  srcId = event[3];

        if ( (srcId&0xF0000) == 0x70000 ) {
            return true;
        }
    }
    return false;
}
int RecordParser::recordType ( RecordBuffer record)

Definition at line 83 of file RecordParser.cc.

{
    // 0: not a DAQ event, 1:AD1,2:AD2,3:AD3,4:AD4,5:IWP,6:OWP,7:RPC
    int result = 0;
    if ( record != 0 &&
         marker(record) == DybDaq::RawRecordPoolUtil::DataSeparatorMarker ) {

        uint32_t* event = (uint32_t*)(record->data() + 16);
        uint32_t  srcId = event[3];

        // 0: not a DAQ event, 1: PMT event, 2: RPC event
        //result = ( (srcId&0xF0000) != 0x70000 ) ? 1 : 2;
        result = ((srcId>>16)&0xF);
    }
    return result;
}
bool RecordParser::earlier ( RecordBuffer r1,
RecordBuffer r2 
)

Definition at line 100 of file RecordParser.cc.

{
    bool result = false;

    DaqRawEvent* evt1 = ( r1 != 0 ) ? r1->timeRevisedEvent() : 0;
    DaqRawEvent* evt2 = ( r2 != 0 ) ? r2->timeRevisedEvent() : 0;

    if ( r1 != 0 && r2 != 0 ) {
        if ( evt1->second() == evt2->second() ) {
            result = evt1->nanoSecond() < evt2->nanoSecond();
        }
        else {
            result = evt1->second() < evt2->second();
        }
    }
    else if ( r2 == 0 ) {
        result = true;
    }

    return result;
}
void RecordParser::initTimeShift ( ) [private]

Definition at line 127 of file RecordParser.cc.

{
    TShiftProxy  tProxy(m_run, m_site);

    for ( int detId = 0; detId < 7; ++detId ) {
        DybDaq::RawRecordPoolUtil::EVENT_TIME_REVISE[m_site][detId] = tProxy.time_shift(detId);
    }
}
uint32_t RecordParser::marker ( RecordBuffer record) [private]

Definition at line 122 of file RecordParser.cc.

{
    return ((uint32_t*)record->data())[0];
}

Member Data Documentation

Definition at line 42 of file RecordParser.h.

Definition at line 43 of file RecordParser.h.

Definition at line 44 of file RecordParser.h.

uint32_t DybDaq::RecordParser::m_mask [private]

Definition at line 45 of file RecordParser.h.

uint32_t DybDaq::RecordParser::m_run [private]

Definition at line 46 of file RecordParser.h.

Definition at line 47 of file RecordParser.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 09:52:46 for RawRecordPool by doxygen 1.7.4