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

Trigger Data Frame for RPCs. More...

#include <ReadoutRpcTriggerDataFrame.h>

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

List of all members.

Public Member Functions

 ReadoutRpcTriggerDataFrame ()
 Default Constructor.
 ReadoutRpcTriggerDataFrame (const ReadoutRpcTriggerDataFrame &rh)
 Copy Constructor.
ReadoutRpcTriggerDataFrameoperator= (const ReadoutRpcTriggerDataFrame &rh)
 Assignment operator.
virtual ~ReadoutRpcTriggerDataFrame ()
 Default Destructor.
virtual std::ostream & fillStream (std::ostream &s) const
 Fill the ASCII output stream.
void addInChannel (const DayaBay::FecChannelId &boardId, const DayaBay::Trigger::TriggerType_t &trigType)
 Add FEC board to input/local trigger map.
void addOutChannel (const DayaBay::FecChannelId &boardId, const DayaBay::Trigger::TriggerType_t &trigType)
 Add FEC board to output/readout trigger map.
DaqRtmdaqRtm (const DayaBay::Detector &detector) const
 Create DaqEvent version of this object.
const std::map
< DayaBay::FecChannelId,
DayaBay::Trigger::TriggerType_t > & 
inTriggers () const
 Retrieve const.
void setInTriggers (const std::map< DayaBay::FecChannelId, DayaBay::Trigger::TriggerType_t > &value)
 Update.
const std::map
< DayaBay::FecChannelId,
DayaBay::Trigger::TriggerType_t > & 
outTriggers () const
 Retrieve const.
void setOutTriggers (const std::map< DayaBay::FecChannelId, DayaBay::Trigger::TriggerType_t > &value)
 Update.
DaqLtbFramedaqLtbFrame (const DayaBay::Detector &detector) const
 Create DaqEvent version of this object.
const
DayaBay::ReadoutRpcTriggerDataFrame
asRpcFrame () const
 Return this object as ReadoutRpcTriggerDataFrame.
const
DayaBay::ReadoutTriggerDataPkg
package () const
 Retrieve const Trigger Data Package that this frame lives in.
void setPackage (DayaBay::ReadoutTriggerDataPkg *value)
 Update Trigger Data Package that this frame lives in.
int seqNumber () const
 Retrieve const Internal Local Trigger Sequence Number.
void setSeqNumber (int value)
 Update Internal Local Trigger Sequence Number.
int readoutType () const
 Retrieve const Read Out Type.
void setReadoutType (int value)
 Update Read Out Type.
const
DayaBay::Trigger::TriggerType_t
triggerType () const
 Retrieve const Trigger Type.
void setTriggerType (const DayaBay::Trigger::TriggerType_t &value)
 Update Trigger Type.
const TimeStamptriggerTime () const
 Retrieve const Time in seconds since epoch.
void setTriggerTime (const TimeStamp &value)
 Update Time in seconds since epoch.
unsigned int cycle () const
 Retrieve const Clock Cycle Number (12.5ns) since previous second (m_triggerTime)
void setCycle (unsigned int value)
 Update Clock Cycle Number (12.5ns) since previous second (m_triggerTime)
int nhit () const
 Retrieve const NHit.
void setNhit (int value)
 Update NHit.
int esumAdc () const
 Retrieve const ESum adc data.
void setEsumAdc (int value)
 Update ESum adc data.
int esumComp () const
 Retrieve const ESum comp data.
void setEsumComp (int value)
 Update ESum comp data.
int crossSource () const
 Retrieve const Cross Trigger Source.
void setCrossSource (int value)
 Update Cross Trigger Source.
bool isRpc () const
 Retrieve const Is it an RPC trigger frame?
void setIsRpc (bool value)
 Update Is it an RPC trigger frame?

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

std::map
< DayaBay::FecChannelId,
DayaBay::Trigger::TriggerType_t
m_inTriggers
std::map
< DayaBay::FecChannelId,
DayaBay::Trigger::TriggerType_t
m_outTriggers

Detailed Description

Trigger Data Frame for RPCs.

Author:
viktor created Thu Dec 5 17:52:29 2013

Definition at line 43 of file ReadoutRpcTriggerDataFrame.h.


Constructor & Destructor Documentation

DayaBay::ReadoutRpcTriggerDataFrame::ReadoutRpcTriggerDataFrame ( ) [inline]

Default Constructor.

Definition at line 48 of file ReadoutRpcTriggerDataFrame.h.

DayaBay::ReadoutRpcTriggerDataFrame::ReadoutRpcTriggerDataFrame ( const ReadoutRpcTriggerDataFrame rh) [inline]

Copy Constructor.

Definition at line 145 of file ReadoutRpcTriggerDataFrame.h.

                                                                                                                 : 
   ReadoutTriggerDataFrame(rh),
   m_inTriggers( rh.m_inTriggers ),
   m_outTriggers( rh.m_outTriggers )
   {}
virtual DayaBay::ReadoutRpcTriggerDataFrame::~ReadoutRpcTriggerDataFrame ( ) [inline, virtual]

Default Destructor.

Definition at line 58 of file ReadoutRpcTriggerDataFrame.h.

{}

Member Function Documentation

DayaBay::ReadoutRpcTriggerDataFrame & DayaBay::ReadoutRpcTriggerDataFrame::operator= ( const ReadoutRpcTriggerDataFrame rh) [inline]

Assignment operator.

Definition at line 151 of file ReadoutRpcTriggerDataFrame.h.

                                                                                                                                    {
  if ( this != &rh ) {
    m_inTriggers  = rh.m_inTriggers;
    m_outTriggers = rh.m_outTriggers;
  }
  return *this;
}
std::ostream & DayaBay::ReadoutRpcTriggerDataFrame::fillStream ( std::ostream &  s) const [inline, virtual]

Fill the ASCII output stream.

Reimplemented from DayaBay::ReadoutTriggerDataFrame.

Definition at line 159 of file ReadoutRpcTriggerDataFrame.h.

{
  ReadoutTriggerDataFrame::fillStream(s);
  s << "{ " << "inTriggers :    " << m_inTriggers << std::endl
            << "outTriggers :   " << m_outTriggers << std::endl << " }";
  return s;
}
void DayaBay::ReadoutRpcTriggerDataFrame::addInChannel ( const DayaBay::FecChannelId boardId,
const DayaBay::Trigger::TriggerType_t trigType 
) [inline]

Add FEC board to input/local trigger map.

Definition at line 188 of file ReadoutRpcTriggerDataFrame.h.

{

            m_inTriggers[boardId] = trigType;
        
}
void DayaBay::ReadoutRpcTriggerDataFrame::addOutChannel ( const DayaBay::FecChannelId boardId,
const DayaBay::Trigger::TriggerType_t trigType 
) [inline]

Add FEC board to output/readout trigger map.

Definition at line 196 of file ReadoutRpcTriggerDataFrame.h.

{

            m_outTriggers[boardId] = trigType;
        
}
DayaBay::DaqRtm * DayaBay::ReadoutRpcTriggerDataFrame::daqRtm ( const DayaBay::Detector detector) const

Create DaqEvent version of this object.

!! This is hardcoded convention - Daq format of RTM data. We should find better way how to write the data. !!!

Definition at line 9 of file ReadoutRpcTriggerDataFrame.cc.

{
    /*
     * CFID in RTM = (CFID in ROM) / 2
     * ROTID in RTM's CF = (CFID in ROM) % 2
     */

    DaqRtm* result = new DaqRtm(detector);

    TimeStamp tt = triggerTime();
    unsigned int inTrig[2] = {0,0};
    unsigned int outTrig[2] = {0,0};


    std::map< DayaBay::FecChannelId,
        DayaBay::Trigger::TriggerType_t >::const_iterator trigIt, trigDone;

    FecChannelId id;
    unsigned int CFId;
    unsigned int fecId;
    unsigned int RotId;

    trigDone = m_inTriggers.end();
    for (trigIt = m_inTriggers.begin(); trigIt != trigDone; trigIt++) {
        id = trigIt->first;
        CFId = id.rtmCfId();
        fecId = id.fecId();
        RotId = id.rtmRotId();
        // FIXME: check if the ids are in range
        unsigned int bit = 1 << fecId; // set the bit for corresponding FEC
        bit <<= RotId*16; // move the bit to the correct ROT
        inTrig[CFId] |= bit; // store the bit to the corresponding RTM CF
        if (trigIt->second == Trigger::kRPC3of4)
            inTrig[CFId] |= (0x8000 << RotId*16); // set the 3of4 flag bit
    }

    trigDone = m_outTriggers.end();
    for (trigIt = m_outTriggers.begin(); trigIt != trigDone; trigIt++) {
        id = trigIt->first;
        CFId = id.rtmCfId();
        fecId = id.fecId();
        RotId = id.rtmRotId();
        // FIXME: check if the ids are in range
        unsigned int bit = 1 << fecId; // set the bit for corresponding FEC
        bit <<= RotId*16; // move the bit to the correct ROT
        outTrig[CFId] |= bit; // store the bit to the corresponding RTM CF
        if (trigIt->second == Trigger::kRPC3of4)
            outTrig[CFId] |= (0x8000 << RotId*16); // set the 3of4 flag bit
    }

    DaqRtmData* first = new DaqRtmData (0, // RPC CF ID - in RTM
                                        true, // valid GPS
                                        true, // valid Clk
                                        false, // using UTC - UTC times in DaqRtm are not implemented yet (2/3/12).
                                        tt.GetSec(), // Trigger time - s
                                        tt.GetNanoSec()*2, // Trigger time - 0.5 * ns
                                        0, // accumulation
                                        inTrig[0], // triggers from ROT
                                        outTrig[0], // trigger map
                                        detector); // detector specifier
    DaqRtmData* second = new DaqRtmData (1,
                                        true,
                                        true,
                                        false,
                                        tt.GetSec(),
                                        tt.GetNanoSec() * 2,
                                        0,
                                        inTrig[1],
                                        outTrig[1],
                                        detector);
    result->addRtmData(first);
    result->addRtmData(second);

    result->setTriggerType( Trigger::TriggerType_t(first->triggerType()|second->triggerType()) );
    result->setEvtType(first->location()|second->location());

    return result;
}
const std::map< DayaBay::FecChannelId, DayaBay::Trigger::TriggerType_t > & DayaBay::ReadoutRpcTriggerDataFrame::inTriggers ( ) const [inline]

Retrieve const.

Definition at line 168 of file ReadoutRpcTriggerDataFrame.h.

{
  return m_inTriggers;
}
void DayaBay::ReadoutRpcTriggerDataFrame::setInTriggers ( const std::map< DayaBay::FecChannelId, DayaBay::Trigger::TriggerType_t > &  value) [inline]

Update.

Definition at line 173 of file ReadoutRpcTriggerDataFrame.h.

{
  m_inTriggers = value;
}
const std::map< DayaBay::FecChannelId, DayaBay::Trigger::TriggerType_t > & DayaBay::ReadoutRpcTriggerDataFrame::outTriggers ( ) const [inline]

Retrieve const.

Definition at line 178 of file ReadoutRpcTriggerDataFrame.h.

{
  return m_outTriggers;
}
void DayaBay::ReadoutRpcTriggerDataFrame::setOutTriggers ( const std::map< DayaBay::FecChannelId, DayaBay::Trigger::TriggerType_t > &  value) [inline]

Update.

Definition at line 183 of file ReadoutRpcTriggerDataFrame.h.

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

operator new

Reimplemented from DayaBay::ReadoutTriggerDataFrame.

Definition at line 93 of file ReadoutRpcTriggerDataFrame.h.

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

Definition at line 103 of file ReadoutRpcTriggerDataFrame.h.

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

operator delete

Reimplemented from DayaBay::ReadoutTriggerDataFrame.

Definition at line 109 of file ReadoutRpcTriggerDataFrame.h.

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

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

Reimplemented from DayaBay::ReadoutTriggerDataFrame.

Definition at line 118 of file ReadoutRpcTriggerDataFrame.h.

    {
      ::operator delete (p, pObj);
    }
DayaBay::DaqLtbFrame * DayaBay::ReadoutTriggerDataFrame::daqLtbFrame ( const DayaBay::Detector detector) const [inherited]

Create DaqEvent version of this object.

Definition at line 18 of file ReadoutTriggerDataFrame.cc.

                                                                                                     {
    DaqLtbFrame* result = new DaqLtbFrame(m_readoutType,
                                          m_triggerType,
                                          TimeStamp(m_triggerTime),
                                          m_nhit,
                                          m_esumAdc,
                                          0 != (m_esumComp & 0x04),
                                          0 != (m_esumComp & 0x02),
                                          0 != (m_esumComp & 0x01),
                                          m_crossSource,
                                          detector);
    return result;
}
const DayaBay::ReadoutRpcTriggerDataFrame * DayaBay::ReadoutTriggerDataFrame::asRpcFrame ( ) const [inherited]

Return this object as ReadoutRpcTriggerDataFrame.

Definition at line 32 of file ReadoutTriggerDataFrame.cc.

{
    return dynamic_cast<const ReadoutRpcTriggerDataFrame*>(this);
}
const DayaBay::ReadoutTriggerDataPkg * DayaBay::ReadoutTriggerDataFrame::package ( ) const [inline, inherited]

Retrieve const Trigger Data Package that this frame lives in.

Definition at line 234 of file ReadoutTriggerDataFrame.h.

{
  return m_package;
}
void DayaBay::ReadoutTriggerDataFrame::setPackage ( DayaBay::ReadoutTriggerDataPkg value) [inline, inherited]

Update Trigger Data Package that this frame lives in.

Definition at line 239 of file ReadoutTriggerDataFrame.h.

{
  m_package = value;
}
int DayaBay::ReadoutTriggerDataFrame::seqNumber ( ) const [inline, inherited]

Retrieve const Internal Local Trigger Sequence Number.

Definition at line 244 of file ReadoutTriggerDataFrame.h.

{
  return m_seqNumber;
}
void DayaBay::ReadoutTriggerDataFrame::setSeqNumber ( int  value) [inline, inherited]

Update Internal Local Trigger Sequence Number.

Definition at line 249 of file ReadoutTriggerDataFrame.h.

{
  m_seqNumber = value;
}
int DayaBay::ReadoutTriggerDataFrame::readoutType ( ) const [inline, inherited]

Retrieve const Read Out Type.

Definition at line 254 of file ReadoutTriggerDataFrame.h.

{
  return m_readoutType;
}
void DayaBay::ReadoutTriggerDataFrame::setReadoutType ( int  value) [inline, inherited]

Update Read Out Type.

Definition at line 259 of file ReadoutTriggerDataFrame.h.

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

Retrieve const Trigger Type.

Definition at line 264 of file ReadoutTriggerDataFrame.h.

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

Update Trigger Type.

Definition at line 269 of file ReadoutTriggerDataFrame.h.

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

Retrieve const Time in seconds since epoch.

Definition at line 274 of file ReadoutTriggerDataFrame.h.

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

Update Time in seconds since epoch.

Definition at line 279 of file ReadoutTriggerDataFrame.h.

{
  m_triggerTime = value;
}
unsigned int DayaBay::ReadoutTriggerDataFrame::cycle ( ) const [inline, inherited]

Retrieve const Clock Cycle Number (12.5ns) since previous second (m_triggerTime)

Definition at line 284 of file ReadoutTriggerDataFrame.h.

{
  return m_cycle;
}
void DayaBay::ReadoutTriggerDataFrame::setCycle ( unsigned int  value) [inline, inherited]

Update Clock Cycle Number (12.5ns) since previous second (m_triggerTime)

Definition at line 289 of file ReadoutTriggerDataFrame.h.

{
  m_cycle = value;
}
int DayaBay::ReadoutTriggerDataFrame::nhit ( ) const [inline, inherited]

Retrieve const NHit.

Definition at line 294 of file ReadoutTriggerDataFrame.h.

{
  return m_nhit;
}
void DayaBay::ReadoutTriggerDataFrame::setNhit ( int  value) [inline, inherited]

Update NHit.

Definition at line 299 of file ReadoutTriggerDataFrame.h.

{
  m_nhit = value;
}
int DayaBay::ReadoutTriggerDataFrame::esumAdc ( ) const [inline, inherited]

Retrieve const ESum adc data.

Definition at line 304 of file ReadoutTriggerDataFrame.h.

{
  return m_esumAdc;
}
void DayaBay::ReadoutTriggerDataFrame::setEsumAdc ( int  value) [inline, inherited]

Update ESum adc data.

Definition at line 309 of file ReadoutTriggerDataFrame.h.

{
  m_esumAdc = value;
}
int DayaBay::ReadoutTriggerDataFrame::esumComp ( ) const [inline, inherited]

Retrieve const ESum comp data.

Definition at line 314 of file ReadoutTriggerDataFrame.h.

{
  return m_esumComp;
}
void DayaBay::ReadoutTriggerDataFrame::setEsumComp ( int  value) [inline, inherited]

Update ESum comp data.

Definition at line 319 of file ReadoutTriggerDataFrame.h.

{
  m_esumComp = value;
}
int DayaBay::ReadoutTriggerDataFrame::crossSource ( ) const [inline, inherited]

Retrieve const Cross Trigger Source.

Definition at line 324 of file ReadoutTriggerDataFrame.h.

{
  return m_crossSource;
}
void DayaBay::ReadoutTriggerDataFrame::setCrossSource ( int  value) [inline, inherited]

Update Cross Trigger Source.

Definition at line 329 of file ReadoutTriggerDataFrame.h.

{
  m_crossSource = value;
}
bool DayaBay::ReadoutTriggerDataFrame::isRpc ( ) const [inline, inherited]

Retrieve const Is it an RPC trigger frame?

Definition at line 334 of file ReadoutTriggerDataFrame.h.

{
  return m_isRpc;
}
void DayaBay::ReadoutTriggerDataFrame::setIsRpc ( bool  value) [inline, inherited]

Update Is it an RPC trigger frame?

Definition at line 339 of file ReadoutTriggerDataFrame.h.

{
  m_isRpc = value;
}

Member Data Documentation

Definition at line 127 of file ReadoutRpcTriggerDataFrame.h.

Definition at line 128 of file ReadoutRpcTriggerDataFrame.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