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

Class that wraps the DAQ data read from a single RPC module. More...

#include <DaqRpcPanel.h>

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

List of all members.

Public Types

typedef std::vector
< DayaBay::DaqRpcStrip * > 
RpcStripPtrList
 A list containing pointers to the RpcStrips.

Public Member Functions

 DaqRpcPanel (const DybDaq::FecData &fecData, const DayaBay::FecChannelId &channelId)
 Constructor for read-only instance.
 DaqRpcPanel (const DayaBay::FecChannelId &channelId, DybDaq::FecReadout &fecReadout)
 Constructor for read-write instance.
 DaqRpcPanel ()
 Default Constructor.
virtual ~DaqRpcPanel ()
 Destroys this instance of the class.
virtual std::ostream & fillStream (std::ostream &s) const
 Fill the ASCII output stream.
int location () const
 From array(1), firstTelescope(2) or secondTelescope(4)
const RpcStripPtrListdaqRpcStripList () const
 Get the list containing pointers to the RpcStrips.
unsigned int hitMap () const
 Get the HitMap of this module.
unsigned int rpcCFId () const
 Get the CFId of this module.
unsigned int rpcFecId () const
 Get the FecIDof this module.
virtual bool forceTrigger () const
 Get the force trigger flag of this module.
virtual int row () const
 Get the row NO. this module.
virtual int col () const
 Get the column NO. this module.
int firedLayerNum () const
 Get the number of fired layers.
void addFecData (const unsigned int trigType, const unsigned int second, const unsigned int nanoSecond, const unsigned int hitMap)
 Adds the supplied information as new FecData of this RPC module.
const DayaBay::FecChannelIdchannelId () const
 Retrieve const The identity of this panel.
bool fromRot () const
 Retrieve const Whether the module is from ROT.
void setFromRot (bool value)
 Update Whether the module is from ROT.

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

const DybDaq::FecDatam_fecData
 The pointer to the FEC datum of this panel.
DybDaq::FecReadoutm_fecReadout
 The FecReadout to which this added to this object should be added.
RpcStripPtrListm_daqRpcStripList
 The list containing pointers to the RpcStrips.
DayaBay::FecChannelId m_channelId
 The identity of this panel.
int m_firedLayerNum
 The number of fired layers.
bool m_fromRot
 Whether the module is from ROT.

Detailed Description

Class that wraps the DAQ data read from a single RPC module.

Author:
sjpatton@lbl.gov created Thu Dec 5 17:51:48 2013

Definition at line 42 of file DaqRpcPanel.h.


Member Typedef Documentation

A list containing pointers to the RpcStrips.

Definition at line 47 of file DaqRpcPanel.h.


Constructor & Destructor Documentation

DaqRpcPanel::DaqRpcPanel ( const DybDaq::FecData fecData,
const DayaBay::FecChannelId channelId 
)

Constructor for read-only instance.

Definition at line 30 of file DaqRpcPanel.cc.

                                                               :
    m_fecData(&fecData),
    m_fecReadout(0),
    m_daqRpcStripList(0),
    m_channelId(channelId),
    m_firedLayerNum(0),
    m_fromRot(false)
{
}
DaqRpcPanel::DaqRpcPanel ( const DayaBay::FecChannelId channelId,
DybDaq::FecReadout fecReadout 
)

Constructor for read-write instance.

Definition at line 19 of file DaqRpcPanel.cc.

                                                 :
    m_fecData(0),
    m_fecReadout(&fecReadout),
    m_daqRpcStripList(0),
    m_channelId(channelId),
    m_firedLayerNum(0),
    m_fromRot(false)
{
}
DayaBay::DaqRpcPanel::DaqRpcPanel ( ) [inline]

Default Constructor.

Definition at line 58 of file DaqRpcPanel.h.

DaqRpcPanel::~DaqRpcPanel ( ) [virtual]

Destroys this instance of the class.

Definition at line 41 of file DaqRpcPanel.cc.

                          {
    if ( m_daqRpcStripList != 0 ) {
        RpcStripPtrList::iterator it = m_daqRpcStripList->begin();
        RpcStripPtrList::iterator finished = m_daqRpcStripList->end();
        while ( it != finished ) {
            delete *it;
            ++it;
        }
        delete m_daqRpcStripList;
    }
}

Member Function Documentation

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

Fill the ASCII output stream.

Definition at line 175 of file DaqRpcPanel.h.

{
  char l_fromRot = (m_fromRot) ? 'T' : 'F';
  s << "{ " << "fecData :       " << m_fecData << std::endl
            << "fecReadout :    " << m_fecReadout << std::endl
            << "daqRpcStripList :       " << m_daqRpcStripList << std::endl
            << "channelId :     " << m_channelId << std::endl
            << "firedLayerNum : " << m_firedLayerNum << std::endl
            << "fromRot :       " << l_fromRot << std::endl << " }";
  return s;
}
int DaqRpcPanel::location ( ) const

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

Definition at line 53 of file DaqRpcPanel.cc.

{
    if ( m_fecData->rpcFecId() == 14 ) {
        unsigned int cfId = m_fecData->rpcCFId();
        if ( (cfId&1) != 0 ) {
            return ( cfId == 1 ) ? 2 : 4;
        }
    }
    return 1;
}
const DaqRpcPanel::RpcStripPtrList & DaqRpcPanel::daqRpcStripList ( ) const

Get the list containing pointers to the RpcStrips.

Definition at line 64 of file DaqRpcPanel.cc.

{
    if ( m_daqRpcStripList == 0 ) {
        RpcStripPtrList** dataPtrs = const_cast<RpcStripPtrList**>(&m_daqRpcStripList);
        (*dataPtrs) = new RpcStripPtrList();
        unsigned int hitMap = m_fecData->hitMap();
        for ( int iLayer = 0; iLayer < 4; ++iLayer ) {
            int shift = iLayer*8;
            if ( (hitMap & (0xFF<<shift)) == 0 ) continue;
            for ( int iStrip = 0; iStrip <8; ++iStrip ) {
                int connector = shift + iStrip;
                if ( (hitMap & (1<<connector)) != 0 ) {
                    (*dataPtrs)->push_back(new DaqRpcStrip(
                                FecChannelId(rpcCFId(),rpcFecId(), connector, m_channelId.site(), m_channelId.detectorId()),
                                    this));
                }
            }
            ++m_firedLayerNum;
        }
    }
    return *m_daqRpcStripList;
}
unsigned int DaqRpcPanel::hitMap ( ) const

Get the HitMap of this module.

Definition at line 87 of file DaqRpcPanel.cc.

{
    return m_fecData->hitMap();
}
unsigned int DaqRpcPanel::rpcCFId ( ) const

Get the CFId of this module.

Definition at line 92 of file DaqRpcPanel.cc.

{
    return m_fecData->rpcCFId();
}
unsigned int DaqRpcPanel::rpcFecId ( ) const

Get the FecIDof this module.

Definition at line 97 of file DaqRpcPanel.cc.

{
    return m_fecData->rpcFecId();
}
bool DaqRpcPanel::forceTrigger ( ) const [virtual]

Get the force trigger flag of this module.

Definition at line 102 of file DaqRpcPanel.cc.

{
    return m_fecData->forceTrigger();
}
int DaqRpcPanel::row ( ) const [virtual]

Get the row NO. this module.

Definition at line 107 of file DaqRpcPanel.cc.

{
    unsigned int cfId  = m_fecData->rpcCFId();
    unsigned int fecId = m_fecData->rpcFecId();
    //FIXME: different for far site here
    if ( fecId != 14 || (cfId&1) == 0 ) {  //array
        int row = (cfId/2)*3 + fecId/(5-cfId%2);
        return (6 - row);
    }
    //telescope
    return (cfId == 1) ? 7 : 0;
}
int DaqRpcPanel::col ( ) const [virtual]

Get the column NO. this module.

Definition at line 120 of file DaqRpcPanel.cc.

{
    unsigned int cfId  = m_fecData->rpcCFId();
    unsigned int fecId = m_fecData->rpcFecId();
    //FIXME: different for far site here
    if ( fecId != 14 || (cfId&1) == 0 ) {  //array
        int col = 5*(cfId%2) + fecId%(5-cfId%2);
        return (col+1);
    }
    //telescope
    return 5;
}
int DaqRpcPanel::firedLayerNum ( ) const

Get the number of fired layers.

Definition at line 133 of file DaqRpcPanel.cc.

void DaqRpcPanel::addFecData ( const unsigned int  trigType,
const unsigned int  second,
const unsigned int  nanoSecond,
const unsigned int  hitMap 
)

Adds the supplied information as new FecData of this RPC module.

Definition at line 139 of file DaqRpcPanel.cc.

{
    unsigned int board = m_channelId.board();
    unsigned int rpcCFId = (0x70&board) >> 4;
    unsigned int rpcFecId = (board & 0x0f);
    const FecData& fecData = m_fecReadout->addFecData(rpcCFId, rpcFecId, trigType, second, nanoSecond, hitMap);
    m_fecData = &fecData;
}
const DayaBay::FecChannelId & DayaBay::DaqRpcPanel::channelId ( ) const [inline]

Retrieve const The identity of this panel.

Definition at line 188 of file DaqRpcPanel.h.

{
  return m_channelId;
}
bool DayaBay::DaqRpcPanel::fromRot ( ) const [inline]

Retrieve const Whether the module is from ROT.

Definition at line 193 of file DaqRpcPanel.h.

{
  return m_fromRot;
}
void DayaBay::DaqRpcPanel::setFromRot ( bool  value) [inline]

Update Whether the module is from ROT.

Definition at line 198 of file DaqRpcPanel.h.

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

operator new

Definition at line 119 of file DaqRpcPanel.h.

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

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

operator delete

Definition at line 135 of file DaqRpcPanel.h.

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

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

Definition at line 144 of file DaqRpcPanel.h.

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

Member Data Documentation

The pointer to the FEC datum of this panel.

Definition at line 153 of file DaqRpcPanel.h.

The FecReadout to which this added to this object should be added.

Definition at line 154 of file DaqRpcPanel.h.

The list containing pointers to the RpcStrips.

Definition at line 155 of file DaqRpcPanel.h.

The identity of this panel.

Definition at line 156 of file DaqRpcPanel.h.

int DayaBay::DaqRpcPanel::m_firedLayerNum [mutable, private]

The number of fired layers.

Definition at line 157 of file DaqRpcPanel.h.

Whether the module is from ROT.

Definition at line 158 of file DaqRpcPanel.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