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

RPC Crate Readout. More...

#include <ReadoutRpcCrate.h>

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

List of all members.

Public Types

typedef std::map
< DayaBay::FecChannelId,
DayaBay::ReadoutFecBoard
FecReadouts
 Map of FEC boards by channel ID.

Public Member Functions

 ReadoutRpcCrate (const DayaBay::Detector &detector, unsigned int triggerNumber, const TimeStamp &triggerTime, const DayaBay::Trigger::TriggerType_t &triggerType)
 standard constructor
 ReadoutRpcCrate (const DayaBay::ReadoutRpcCrate &rhs)
 copy constructor
 ReadoutRpcCrate ()
 Default Constructor.
virtual ~ReadoutRpcCrate ()
 Default Destructor.
ReadoutRpcCrateoperator= (const DayaBay::ReadoutRpcCrate &rhs)
 assignment operator
void addReadout (const DayaBay::FecChannelId &boardId)
 Adds a FEC board to this readout.
ReadoutFecBoardboard (const DayaBay::FecChannelId &boardId)
 Returns the specified board from this readout.
const DayaBay::DaqCratedaqCrate (const unsigned int run, const unsigned int event, const unsigned int ltbSlot) const
 Create DaqCrate version of this object.
const DayaBay::DaqRtmdummyRtm () const
 Create a dummy DaqRtm based on the Readout information.
std::ostream & fillStream (std::ostream &s) const
 Print the crate data.
const FecReadoutsfecReadouts () const
 Retrieve const The set of FEC boards in this readout.
void setFecReadouts (const FecReadouts &value)
 Update The set of FEC boards in this readout.
const
DayaBay::ReadoutTriggerDataPkg
triggerDataPkg () const
 Retrieve const Trigger Data Package.
void setTriggerDataPkg (DayaBay::ReadoutTriggerDataPkg *value)
 Update Trigger Data Package.
const DayaBay::Detectordetector () const
 Retrieve const The detector associated with this readout.
void setDetector (const DayaBay::Detector &value)
 Update The detector associated with this readout.
unsigned int triggerNumber () const
 Retrieve const The count of the trigger command from this detector.
void setTriggerNumber (unsigned int value)
 Update The count of the trigger command from this detector.
const TimeStamptriggerTime () const
 Retrieve const The absolute time of the trigger command.
void setTriggerTime (const TimeStamp &value)
 Update The absolute time of the trigger command.
const
DayaBay::Trigger::TriggerType_t
triggerType () const
 Retrieve const The type of trigger conditions which produced this readout.
void setTriggerType (const DayaBay::Trigger::TriggerType_t &value)
 Update The type of trigger conditions which produced this readout.
const DybDaq::EventReadouteventReadout () const
 Retrieve const The raw data block for this readout.
void setEventReadout (DybDaq::EventReadout *value)
 Update The raw data block for this readout.
const DayaBay::ReadoutHeaderheader () const
 Retrieve const The readout header associated with this readout.
void setHeader (DayaBay::ReadoutHeader *value)
 Update The readout header associated with 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

FecReadouts m_fecReadouts
 The set of FEC boards in this readout.
DayaBay::ReadoutTriggerDataPkgm_triggerDataPkg
 Trigger Data Package.

Detailed Description

RPC Crate Readout.

Author:
dandwyer@caltech.edu created Thu Dec 5 17:52:30 2013

Definition at line 45 of file ReadoutRpcCrate.h.


Member Typedef Documentation

Map of FEC boards by channel ID.

Definition at line 50 of file ReadoutRpcCrate.h.


Constructor & Destructor Documentation

DayaBay::ReadoutRpcCrate::ReadoutRpcCrate ( const DayaBay::Detector detector,
unsigned int  triggerNumber,
const TimeStamp triggerTime,
const DayaBay::Trigger::TriggerType_t triggerType 
) [inline]

standard constructor

Definition at line 53 of file ReadoutRpcCrate.h.

                                                                    : Readout(detector,
                                                                         triggerNumber,
                                                                         triggerTime,
                                                                         triggerType),
                                                                                          m_triggerDataPkg(0) {}
DayaBay::ReadoutRpcCrate::ReadoutRpcCrate ( const DayaBay::ReadoutRpcCrate rhs)

copy constructor

Definition at line 21 of file ReadoutRpcCrate.cc.

    : Readout(rh)
{
    DayaBay::ReadoutRpcCrate::FecReadouts boards = rh.fecReadouts();
    DayaBay::ReadoutRpcCrate::FecReadouts::iterator it, done = boards.end();
    for (it = boards.begin(); it != done; ++it) {
        it->second.setReadout(this);
    }
    this->setFecReadouts(boards);

    // copy trigger data package!
    m_triggerDataPkg = new DayaBay::ReadoutTriggerDataPkg( *(rh.triggerDataPkg()) );
    m_triggerDataPkg->setReadout(this);
}
DayaBay::ReadoutRpcCrate::ReadoutRpcCrate ( ) [inline]

Default Constructor.

Definition at line 66 of file ReadoutRpcCrate.h.

virtual DayaBay::ReadoutRpcCrate::~ReadoutRpcCrate ( ) [inline, virtual]

Default Destructor.

Definition at line 70 of file ReadoutRpcCrate.h.

{}

Member Function Documentation

DayaBay::ReadoutRpcCrate & DayaBay::ReadoutRpcCrate::operator= ( const DayaBay::ReadoutRpcCrate rhs)

assignment operator

Definition at line 36 of file ReadoutRpcCrate.cc.

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

    (Readout&)(*this) = (Readout&)(rh);

    DayaBay::ReadoutRpcCrate::FecReadouts boards = rh.fecReadouts();
    DayaBay::ReadoutRpcCrate::FecReadouts::iterator it, done = boards.end();
    for (it = boards.begin(); it != done; ++it) {
        it->second.setReadout(this);
    }
    this->setFecReadouts(boards);

    return *this;
}
void DayaBay::ReadoutRpcCrate::addReadout ( const DayaBay::FecChannelId boardId) [inline]

Adds a FEC board to this readout.

Definition at line 185 of file ReadoutRpcCrate.h.

{

            m_fecReadouts[boardId] = DayaBay::ReadoutFecBoard(boardId,
                                                                   this);
        
}
DayaBay::ReadoutFecBoard & DayaBay::ReadoutRpcCrate::board ( const DayaBay::FecChannelId boardId) [inline]

Returns the specified board from this readout.

Definition at line 193 of file ReadoutRpcCrate.h.

{
return m_fecReadouts[boardId];
}
const DayaBay::DaqCrate * DayaBay::ReadoutRpcCrate::daqCrate ( const unsigned int  run,
const unsigned int  event,
const unsigned int  ltbSlot 
) const

Create DaqCrate version of this object.

Definition at line 52 of file ReadoutRpcCrate.cc.

                                                                                              {
    DaqRpcCrate* result = new DaqRpcCrate(detector(),
                                          run,
                                          event);
    if (0 == m_triggerDataPkg) {
        result->addRtm(dummyRtm(),
                       ltbSlot);
    } else {
        DayaBay::DaqRtm* daqRtm = m_triggerDataPkg->daqRtm();
        if (!daqRtm) {
            std::cerr<<"ERROR: ReadoutRpcCrate::daqCrate(): Could not retrieve DaqRtm."<<std::endl;
            return 0;
        }
        result->addRtm(daqRtm,
                       ltbSlot);
    }

    FecReadouts::const_iterator fecIt, fecDone = m_fecReadouts.end();
    for (fecIt = m_fecReadouts.begin(); fecIt != fecDone; ++fecIt) {
        const DayaBay::FecChannelId& id = fecIt->first;
        DayaBay::DaqRpcPanel& daqPanel = result->panel(id);
        const DayaBay::ReadoutFecBoard& content = fecIt->second;
        unsigned int trigType = (content.flag3of4()*Trigger::kRPC3of4) | (content.flag2of4()*Trigger::kRPC2of4);
        TimeStamp time = content.readout()->triggerTime();
        daqPanel.addFecData(trigType, time.GetSec(), time.GetNanoSec(), content.hitMap());
    }

    return result;
}
const DayaBay::DaqRtm * DayaBay::ReadoutRpcCrate::dummyRtm ( ) const

Create a dummy DaqRtm based on the Readout information.

Definition at line 84 of file ReadoutRpcCrate.cc.

                                                            {
    DybDaq::RtmReadout* rr = new DybDaq::RtmReadout(DybDaq::RtmTraits::defaultTraits());
    DaqRtm* result = new DaqRtm(*rr, detector());

    return result;
}
std::ostream & DayaBay::ReadoutRpcCrate::fillStream ( std::ostream &  s) const [virtual]

Print the crate data.

Reimplemented from DayaBay::Readout.

Definition at line 5 of file ReadoutRpcCrate.cc.

{
    size_t siz = m_fecReadouts.size();

    s << "{ "
      << siz << " readout boards : " << std::endl;

    FecReadouts::const_iterator it, done = m_fecReadouts.end();
    for (it=m_fecReadouts.begin(); it != done; ++it) {
      s << (it->first) << (it->second) << std::endl;
    }
    s << "}";
    return s;
}
const DayaBay::ReadoutRpcCrate::FecReadouts & DayaBay::ReadoutRpcCrate::fecReadouts ( ) const [inline]

Retrieve const The set of FEC boards in this readout.

Definition at line 165 of file ReadoutRpcCrate.h.

{
  return m_fecReadouts;
}
void DayaBay::ReadoutRpcCrate::setFecReadouts ( const FecReadouts value) [inline]

Update The set of FEC boards in this readout.

Definition at line 170 of file ReadoutRpcCrate.h.

{
  m_fecReadouts = value;
}
const DayaBay::ReadoutTriggerDataPkg * DayaBay::ReadoutRpcCrate::triggerDataPkg ( ) const [inline]

Retrieve const Trigger Data Package.

Definition at line 175 of file ReadoutRpcCrate.h.

{
  return m_triggerDataPkg;
}
void DayaBay::ReadoutRpcCrate::setTriggerDataPkg ( DayaBay::ReadoutTriggerDataPkg value) [inline]

Update Trigger Data Package.

Definition at line 180 of file ReadoutRpcCrate.h.

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

operator new

Reimplemented from DayaBay::Readout.

Definition at line 111 of file ReadoutRpcCrate.h.

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

Definition at line 121 of file ReadoutRpcCrate.h.

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

operator delete

Reimplemented from DayaBay::Readout.

Definition at line 127 of file ReadoutRpcCrate.h.

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

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

Reimplemented from DayaBay::Readout.

Definition at line 136 of file ReadoutRpcCrate.h.

    {
      ::operator delete (p, pObj);
    }
const DayaBay::Detector & DayaBay::Readout::detector ( ) const [inline, inherited]

Retrieve const The detector associated with this readout.

Definition at line 226 of file Readout.h.

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

Update The detector associated with this readout.

Definition at line 231 of file Readout.h.

{
  m_detector = value;
}
unsigned int DayaBay::Readout::triggerNumber ( ) const [inline, inherited]

Retrieve const The count of the trigger command from this detector.

Definition at line 236 of file Readout.h.

{
  return m_triggerNumber;
}
void DayaBay::Readout::setTriggerNumber ( unsigned int  value) [inline, inherited]

Update The count of the trigger command from this detector.

Definition at line 241 of file Readout.h.

{
  m_triggerNumber = value;
}
const TimeStamp & DayaBay::Readout::triggerTime ( ) const [inline, inherited]

Retrieve const The absolute time of the trigger command.

Definition at line 246 of file Readout.h.

{
  return m_triggerTime;
}
void DayaBay::Readout::setTriggerTime ( const TimeStamp value) [inline, inherited]

Update The absolute time of the trigger command.

Definition at line 251 of file Readout.h.

{
  m_triggerTime = value;
}
const DayaBay::Trigger::TriggerType_t & DayaBay::Readout::triggerType ( ) const [inline, inherited]

Retrieve const The type of trigger conditions which produced this readout.

Definition at line 256 of file Readout.h.

{
  return m_triggerType;
}
void DayaBay::Readout::setTriggerType ( const DayaBay::Trigger::TriggerType_t value) [inline, inherited]

Update The type of trigger conditions which produced this readout.

Definition at line 261 of file Readout.h.

{
  m_triggerType = value;
}
const DybDaq::EventReadout * DayaBay::Readout::eventReadout ( ) const [inline, inherited]

Retrieve const The raw data block for this readout.

Definition at line 266 of file Readout.h.

{
  return m_eventReadout;
}
void DayaBay::Readout::setEventReadout ( DybDaq::EventReadout value) [inline, inherited]

Update The raw data block for this readout.

Definition at line 271 of file Readout.h.

{
  m_eventReadout = value;
}
const DayaBay::ReadoutHeader * DayaBay::Readout::header ( ) const [inline, inherited]

Retrieve const The readout header associated with this readout.

Definition at line 276 of file Readout.h.

{
  return m_header;
}
void DayaBay::Readout::setHeader ( DayaBay::ReadoutHeader value) [inline, inherited]

Update The readout header associated with this readout.

Definition at line 281 of file Readout.h.

{
  m_header = value;
}

Member Data Documentation

The set of FEC boards in this readout.

Definition at line 145 of file ReadoutRpcCrate.h.

Trigger Data Package.

Definition at line 146 of file ReadoutRpcCrate.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