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

Trigger Data Package. More...

#include <ReadoutTriggerDataPkg.h>

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

List of all members.

Public Types

typedef std::vector
< DayaBay::ReadoutTriggerDataFrame * > 
TriggerFrameCollection
 Vector of Trigger Data Frames.

Public Member Functions

 ReadoutTriggerDataPkg (const DayaBay::ReadoutTriggerDataPkg &rhs)
 copy constructor
 ReadoutTriggerDataPkg ()
 Default Constructor.
 ~ReadoutTriggerDataPkg ()
 destructor
void addFrame (DayaBay::ReadoutTriggerDataFrame *tdf)
 Add trigger data frame to this data package.
DaqLtbdaqLtb () const
 Creates a DaqLtb instance from this object's contents.
DaqRtmdaqRtm () const
 Creates a DaqRtm instance from this object's contents, returns 0 if this is not RPC trigger.
ReadoutTriggerDataPkgoperator= (const DayaBay::ReadoutTriggerDataPkg &rhs)
 assignment operator
std::ostream & fillStream (std::ostream &s) const
 Print the trigger data package data.
const TriggerFrameCollectionframes () const
 Retrieve const Collection of trigger frames.
void setFrames (const TriggerFrameCollection &value)
 Update Collection of trigger frames.
const DayaBay::Readoutreadout () const
 Retrieve const Readout in which this lives.
void setReadout (DayaBay::Readout *value)
 Update Readout in which this lives.
const DayaBay::Detectordetector () const
 Retrieve const The detector associated with this data pacakge.
void setDetector (const DayaBay::Detector &value)
 Update The detector associated with this data pacakge.
int trigNumber () const
 Retrieve const Internal Local Trigger Number.
void setTrigNumber (int value)
 Update Internal Local Trigger Number.
int numSubTriggers () const
 Retrieve const Number of sub triggers.
void setNumSubTriggers (int value)
 Update Number of sub triggers.
int boardStatus () const
 Retrieve const Board Status.
void setBoardStatus (int value)
 Update Board Status.
int localSN () const
 Retrieve const Local Trigger Sequence Number.
void setLocalSN (int value)
 Update Local Trigger Sequence Number.

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

TriggerFrameCollection m_frames
 Collection of trigger frames.
DayaBay::Readoutm_readout
 Readout in which this lives.
DayaBay::Detector m_detector
 The detector associated with this data pacakge.
int m_trigNumber
 Internal Local Trigger Number.
int m_numSubTriggers
 Number of sub triggers.
int m_boardStatus
 Board Status.
int m_localSN
 Local Trigger Sequence Number.

Detailed Description

Trigger Data Package.

Author:
bseilhan@iit.edu created Thu Dec 5 17:52:29 2013

Definition at line 45 of file ReadoutTriggerDataPkg.h.


Member Typedef Documentation

Vector of Trigger Data Frames.

Definition at line 50 of file ReadoutTriggerDataPkg.h.


Constructor & Destructor Documentation

DayaBay::ReadoutTriggerDataPkg::ReadoutTriggerDataPkg ( const DayaBay::ReadoutTriggerDataPkg rhs)

copy constructor

m_readout will be reset by readout

m_frames is set by adding frames

Should be properly set by adding frames, if no try: m_numSubTriggers=rh.numSubTriggers();

Definition at line 38 of file ReadoutTriggerDataPkg.cc.

{
    m_readout=0;
    m_frames.clear();

    std::vector<DayaBay::ReadoutTriggerDataFrame*> frames = rh.frames();
    std::vector<DayaBay::ReadoutTriggerDataFrame*>::iterator it, done=frames.end();

    if ( !rh.detector().isRPC() ) { // PMT frames
        for (it = frames.begin(); it != done; ++it) {
            DayaBay::ReadoutTriggerDataFrame *nf = new DayaBay::ReadoutTriggerDataFrame(**it);
            nf->setPackage(this);
            this->addFrame(nf);
        }
    } else { // need to deal with RPC frames separately
        for (it = frames.begin(); it != done; ++it) {
            DayaBay::ReadoutRpcTriggerDataFrame* rpcframe =
                dynamic_cast<DayaBay::ReadoutRpcTriggerDataFrame*>(*it);
            // FIXME: should put some check on whether we realy get RPC frame
            // and handle propery the situation when we don't
            DayaBay::ReadoutTriggerDataFrame *nf = new DayaBay::ReadoutRpcTriggerDataFrame(*rpcframe);
            nf->setPackage(this);
            this->addFrame(nf);
        }
    }

    m_detector=rh.detector();
    m_trigNumber=rh.trigNumber();
    m_boardStatus=rh.boardStatus();
    m_localSN=rh.localSN();

}
DayaBay::ReadoutTriggerDataPkg::ReadoutTriggerDataPkg ( ) [inline]

Default Constructor.

Definition at line 56 of file ReadoutTriggerDataPkg.h.

DayaBay::ReadoutTriggerDataPkg::~ReadoutTriggerDataPkg ( )

destructor

Definition at line 5 of file ReadoutTriggerDataPkg.cc.

                                                    {
    TriggerFrameCollection::iterator it=m_frames.begin();
    for ( ; it!=m_frames.end(); it++ ) {
        if (*it && (*it)->package()==this ) delete *it;
    }
    m_frames.clear();
}

Member Function Documentation

void DayaBay::ReadoutTriggerDataPkg::addFrame ( DayaBay::ReadoutTriggerDataFrame tdf)

Add trigger data frame to this data package.

Definition at line 31 of file ReadoutTriggerDataPkg.cc.

{
    tdf->setPackage(this);
    m_frames.push_back(tdf);
    m_numSubTriggers=m_frames.size();
}
DayaBay::DaqLtb * DayaBay::ReadoutTriggerDataPkg::daqLtb ( ) const

Creates a DaqLtb instance from this object's contents.

Definition at line 104 of file ReadoutTriggerDataPkg.cc.

                                                          {
    DaqLtb* result = new DaqLtb(m_trigNumber,
                                // TODO: Fix this!
                                0, //int rawTriggerTotal,
                                m_boardStatus,
                                m_detector);
    const TriggerFrameCollection::const_iterator finished = m_frames.end();
    for (TriggerFrameCollection::const_iterator frame = m_frames.begin();
         finished != frame;
         ++frame) {
        result->addFrame((*frame)->daqLtbFrame(m_detector));
    }
    return result;
}
DayaBay::DaqRtm * DayaBay::ReadoutTriggerDataPkg::daqRtm ( ) const

Creates a DaqRtm instance from this object's contents, returns 0 if this is not RPC trigger.

Definition at line 120 of file ReadoutTriggerDataPkg.cc.

                                                          {
    if (!m_detector.isRPC()) {
        std::cerr<<"ERROR: ReadoutTriggerDataPkg::daqRtm(): Called for non-RPC detector."<<std::endl;
        return 0;
    }
    if (m_frames.size() == 0) {
        std::cerr<<"ERROR: ReadoutTriggerDataPkg::daqRtm(): Data package contains no frames, expected exactly 1."<<std::endl;
        return 0;
    }
    if (m_frames.size() != 1) {
        std::cerr<<"ERROR: ReadoutTriggerDataPkg::daqRtm(): Data package contains more than 1 frame, which is not expected for RPCs."<<std::endl;
        return 0;
    }

    const DayaBay::ReadoutTriggerDataFrame* trgframe = *(m_frames.begin());
    if (!trgframe) {
        std::cerr<<"ERROR: ReadoutTriggerDataPkg::daqRtm(): Zero pointer to frame found in the package."<<std::endl;
        return 0;
    }
    const DayaBay::ReadoutRpcTriggerDataFrame* rpctrgframe = trgframe->asRpcFrame();
    if (!rpctrgframe) {
        std::cerr<<"ERROR: ReadoutTriggerDataPkg::daqRtm(): The frame found in the package cannot be retrieved as an RPC trigger frame."<<std::endl;
        return 0;
    }
    return rpctrgframe->daqRtm(m_detector);
}
DayaBay::ReadoutTriggerDataPkg & DayaBay::ReadoutTriggerDataPkg::operator= ( const DayaBay::ReadoutTriggerDataPkg rhs)

assignment operator

m_frames is set by adding frames m_readout will be reset by readout

Should be properly set by adding frames, if no try: m_numSubTriggers=rh.numSubTriggers();

Definition at line 75 of file ReadoutTriggerDataPkg.cc.

{
    if (this == &rh) return *this;

    std::vector<DayaBay::ReadoutTriggerDataFrame*> frames = rh.frames();
    std::vector<DayaBay::ReadoutTriggerDataFrame*> newframes;

    std::vector<DayaBay::ReadoutTriggerDataFrame*>::iterator it, done=frames.end();

    for (it = frames.begin(); it != done; ++it) {
        DayaBay::ReadoutTriggerDataFrame *nf = new DayaBay::ReadoutTriggerDataFrame(**it);
        nf->setPackage(this);
        this->addFrame(nf);
    }
    //this->setFrames(newframes);
    //this->setFrames(newframes);
    m_readout=0;
    m_detector=rh.detector();
    m_trigNumber=rh.trigNumber();
    m_boardStatus=rh.boardStatus();
    m_localSN=rh.localSN();

    return *this;
}
std::ostream & DayaBay::ReadoutTriggerDataPkg::fillStream ( std::ostream &  s) const

Print the trigger data package data.

Definition at line 13 of file ReadoutTriggerDataPkg.cc.

{
    s << "Begin ReadoutTriggerDataPkg\n"
      << "\tDet: " << m_detector.detName() << "\n"
      << "\tReadout: " << m_readout << "\n"
      << "\tTrigger Number: " << m_trigNumber << "\n"
      << "\tNumber Sub Triggers: " << m_numSubTriggers << "\n"
      << "\tStatus: " << m_boardStatus << "\n"
      << "\tLocal SN: " << m_localSN << "\n"
      << "\tFrames"<< std::endl;
    TriggerFrameCollection::const_iterator it, done = m_frames.end();
    for (it=m_frames.begin(); it != done; ++it) {
      s << **it << std::endl;
    }
    s << "End ReadoutTriggerDataPkg" << std::endl;
    return s;
}
const DayaBay::ReadoutTriggerDataPkg::TriggerFrameCollection & DayaBay::ReadoutTriggerDataPkg::frames ( ) const [inline]

Retrieve const Collection of trigger frames.

Definition at line 201 of file ReadoutTriggerDataPkg.h.

{
  return m_frames;
}
void DayaBay::ReadoutTriggerDataPkg::setFrames ( const TriggerFrameCollection value) [inline]

Update Collection of trigger frames.

Definition at line 206 of file ReadoutTriggerDataPkg.h.

{
  m_frames = value;
}
const DayaBay::Readout * DayaBay::ReadoutTriggerDataPkg::readout ( ) const [inline]

Retrieve const Readout in which this lives.

Definition at line 211 of file ReadoutTriggerDataPkg.h.

{
  return m_readout;
}
void DayaBay::ReadoutTriggerDataPkg::setReadout ( DayaBay::Readout value) [inline]

Update Readout in which this lives.

Definition at line 216 of file ReadoutTriggerDataPkg.h.

{
  m_readout = value;
}
const DayaBay::Detector & DayaBay::ReadoutTriggerDataPkg::detector ( ) const [inline]

Retrieve const The detector associated with this data pacakge.

Definition at line 221 of file ReadoutTriggerDataPkg.h.

{
  return m_detector;
}
void DayaBay::ReadoutTriggerDataPkg::setDetector ( const DayaBay::Detector value) [inline]

Update The detector associated with this data pacakge.

Definition at line 226 of file ReadoutTriggerDataPkg.h.

{
  m_detector = value;
}
int DayaBay::ReadoutTriggerDataPkg::trigNumber ( ) const [inline]

Retrieve const Internal Local Trigger Number.

Definition at line 231 of file ReadoutTriggerDataPkg.h.

{
  return m_trigNumber;
}
void DayaBay::ReadoutTriggerDataPkg::setTrigNumber ( int  value) [inline]

Update Internal Local Trigger Number.

Definition at line 236 of file ReadoutTriggerDataPkg.h.

{
  m_trigNumber = value;
}
int DayaBay::ReadoutTriggerDataPkg::numSubTriggers ( ) const [inline]

Retrieve const Number of sub triggers.

Definition at line 241 of file ReadoutTriggerDataPkg.h.

{
  return m_numSubTriggers;
}
void DayaBay::ReadoutTriggerDataPkg::setNumSubTriggers ( int  value) [inline]

Update Number of sub triggers.

Definition at line 246 of file ReadoutTriggerDataPkg.h.

{
  m_numSubTriggers = value;
}
int DayaBay::ReadoutTriggerDataPkg::boardStatus ( ) const [inline]

Retrieve const Board Status.

Definition at line 251 of file ReadoutTriggerDataPkg.h.

{
  return m_boardStatus;
}
void DayaBay::ReadoutTriggerDataPkg::setBoardStatus ( int  value) [inline]

Update Board Status.

Definition at line 256 of file ReadoutTriggerDataPkg.h.

{
  m_boardStatus = value;
}
int DayaBay::ReadoutTriggerDataPkg::localSN ( ) const [inline]

Retrieve const Local Trigger Sequence Number.

Definition at line 261 of file ReadoutTriggerDataPkg.h.

{
  return m_localSN;
}
void DayaBay::ReadoutTriggerDataPkg::setLocalSN ( int  value) [inline]

Update Local Trigger Sequence Number.

Definition at line 266 of file ReadoutTriggerDataPkg.h.

{
  m_localSN = value;
}
static void* DayaBay::ReadoutTriggerDataPkg::operator new ( size_t  size) [inline, static]

operator new

Definition at line 141 of file ReadoutTriggerDataPkg.h.

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

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

operator delete

Definition at line 157 of file ReadoutTriggerDataPkg.h.

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

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

Definition at line 166 of file ReadoutTriggerDataPkg.h.

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

Member Data Documentation

Collection of trigger frames.

Definition at line 175 of file ReadoutTriggerDataPkg.h.

Readout in which this lives.

Definition at line 176 of file ReadoutTriggerDataPkg.h.

The detector associated with this data pacakge.

Definition at line 177 of file ReadoutTriggerDataPkg.h.

Internal Local Trigger Number.

Definition at line 178 of file ReadoutTriggerDataPkg.h.

Number of sub triggers.

Definition at line 179 of file ReadoutTriggerDataPkg.h.

Board Status.

Definition at line 180 of file ReadoutTriggerDataPkg.h.

Local Trigger Sequence Number.

Definition at line 181 of file ReadoutTriggerDataPkg.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:16 for ReadoutEvent by doxygen 1.7.4