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

PMT Crate Readout. More...

#include <ReadoutPmtCrate.h>

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

List of all members.

Public Types

typedef std::map
< DayaBay::FeeChannelId,
DayaBay::ReadoutPmtChannel
PmtChannelReadouts
 Map of FEE channel data by channel ID.
typedef std::map
< DayaBay::FadcChannelId,
DayaBay::DigitalSignal
FadcReadouts
 Map of FADC channel data by Fadc channel ID.

Public Member Functions

 ReadoutPmtCrate (const DayaBay::Detector &detector, unsigned int triggerNumber, const TimeStamp &triggerTime, const DayaBay::Trigger::TriggerType_t &triggerType)
 standard constructor
 ReadoutPmtCrate (const DayaBay::ReadoutPmtCrate &rhs)
 copy constructor
 ReadoutPmtCrate ()
 Default Constructor.
 ~ReadoutPmtCrate ()
 destructor
ReadoutPmtCrateoperator= (const DayaBay::ReadoutPmtCrate &rhs)
 assignment operator
void addChannel (const DayaBay::FeeChannelId &channelId)
 Adds a channel to this readout.
ReadoutPmtChannelchannel (const DayaBay::FeeChannelId &channelId)
 Returns the specified channel from this readout.
std::vector
< DayaBay::FeeChannelId
channels ()
 Returns a list of channels included in the 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::DaqLtbdummyLtb () const
 Create a dummy DaqLtb based on the Readout information.
std::ostream & fillStream (std::ostream &s) const
 Print the crate data.
const PmtChannelReadoutschannelReadout () const
 Retrieve const The set of channels in this readout.
void setChannelReadout (const PmtChannelReadouts &value)
 Update The set of channels in this readout.
const FadcReadoutsfadcReadout () const
 Retrieve const The set of fadcReadouts in this readout.
FadcReadoutsfadcReadout ()
 Retrieve The set of fadcReadouts in this readout.
void setFadcReadout (const FadcReadouts &value)
 Update The set of fadcReadouts 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

PmtChannelReadouts m_channelReadout
 The set of channels in this readout.
FadcReadouts m_fadcReadout
 The set of fadcReadouts in this readout.
DayaBay::ReadoutTriggerDataPkgm_triggerDataPkg
 Trigger Data Package.

Detailed Description

PMT Crate Readout.

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

Definition at line 44 of file ReadoutPmtCrate.h.


Member Typedef Documentation

Map of FEE channel data by channel ID.

Definition at line 49 of file ReadoutPmtCrate.h.

Map of FADC channel data by Fadc channel ID.

Definition at line 51 of file ReadoutPmtCrate.h.


Constructor & Destructor Documentation

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

standard constructor

Definition at line 54 of file ReadoutPmtCrate.h.

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

copy constructor

copy the trigger data package

Definition at line 30 of file ReadoutPmtCrate.cc.

    : Readout(rh)
{
    DayaBay::ReadoutPmtCrate::PmtChannelReadouts channels = rh.channelReadout();
    DayaBay::ReadoutPmtCrate::PmtChannelReadouts::iterator it, done = channels.end();
    for (it = channels.begin(); it != done; ++it) {
        it->second.setReadout(this);
    }
    this->setChannelReadout(channels);
    
    DayaBay::ReadoutTriggerDataPkg *trigDatPkg = new DayaBay::ReadoutTriggerDataPkg(*(rh.triggerDataPkg()));
    trigDatPkg->setReadout(this);
    this->setTriggerDataPkg(trigDatPkg);
    this->setFadcReadout(rh.fadcReadout());
}
DayaBay::ReadoutPmtCrate::ReadoutPmtCrate ( ) [inline]

Default Constructor.

Definition at line 67 of file ReadoutPmtCrate.h.

DayaBay::ReadoutPmtCrate::~ReadoutPmtCrate ( )

destructor

Definition at line 3 of file ReadoutPmtCrate.cc.

                                        {
    delete m_triggerDataPkg;
}

Member Function Documentation

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

assignment operator

copy the trigger data package

Definition at line 47 of file ReadoutPmtCrate.cc.

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

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

    DayaBay::ReadoutPmtCrate::PmtChannelReadouts channels = rh.channelReadout();
    DayaBay::ReadoutPmtCrate::PmtChannelReadouts::iterator it, done = channels.end();
    for (it = channels.begin(); it != done; ++it) {
        it->second.setReadout(this);
    }
    this->setChannelReadout(channels);
    
    DayaBay::ReadoutTriggerDataPkg *trigDatPkg = new DayaBay::ReadoutTriggerDataPkg(*(rh.triggerDataPkg()));
    trigDatPkg->setReadout(this);
    this->setTriggerDataPkg(trigDatPkg);
    this->setFadcReadout(rh.fadcReadout());
    return *this;
}
void DayaBay::ReadoutPmtCrate::addChannel ( const DayaBay::FeeChannelId channelId) [inline]

Adds a channel to this readout.

Definition at line 218 of file ReadoutPmtCrate.h.

{

          m_channelReadout[channelId] = DayaBay::ReadoutPmtChannel(channelId,
                                                                   this);
        
}
DayaBay::ReadoutPmtChannel & DayaBay::ReadoutPmtCrate::channel ( const DayaBay::FeeChannelId channelId) [inline]

Returns the specified channel from this readout.

Definition at line 226 of file ReadoutPmtCrate.h.

{
return m_channelReadout[channelId];
}
std::vector< DayaBay::FeeChannelId > DayaBay::ReadoutPmtCrate::channels ( ) [inline]

Returns a list of channels included in the readout.

Definition at line 231 of file ReadoutPmtCrate.h.

{

          DayaBay::ReadoutPmtCrate::PmtChannelReadouts::iterator crIter = m_channelReadout.begin();
          std::vector<DayaBay::FeeChannelId> channels;
          for(;crIter != m_channelReadout.end(); crIter++) 
            channels.push_back(crIter->first);
          return channels;
        
}
const DayaBay::DaqCrate * DayaBay::ReadoutPmtCrate::daqCrate ( const unsigned int  run,
const unsigned int  event,
const unsigned int  ltbSlot 
) const

Create DaqCrate version of this object.

Definition at line 68 of file ReadoutPmtCrate.cc.

                                                                                              {
    DaqPmtCrate* result = new DaqPmtCrate(detector(),
                                          run,
                                          event);
    if (0 == m_triggerDataPkg) {
        result->addLtb(dummyLtb(),
                       ltbSlot);
    } else {
        result->addLtb(m_triggerDataPkg->daqLtb(),
                       ltbSlot);
    }

    const PmtChannelReadouts::const_iterator pmtFinished = m_channelReadout.end();
    for (PmtChannelReadouts::const_iterator channel = m_channelReadout.begin();
         pmtFinished != channel;
         ++channel) {
        const DayaBay::FeeChannelId& id = channel->first;
        DayaBay::DaqPmtChannel& daqChannel = result->channel(id);
        const DayaBay::ReadoutPmtChannel& content = channel->second;
        const unsigned int endHits = content.size();
        for (unsigned int hit = 0;
             endHits != hit;
             ++hit) {
            daqChannel.addHit(hit + 1,
                              content.adcCycle(hit),
                              content.adcRange(hit) == DayaBay::FeeGain::kHigh,
                              content.pedestal(hit),
                              content.adc(hit),
                              content.tdc(hit));
        }
    }

    /* Skip until connector mapping is understood */
    const FadcReadouts::const_iterator fadcFinished = m_fadcReadout.end();
    for (FadcReadouts::const_iterator fadc = m_fadcReadout.begin();
         fadcFinished != fadc;
         ++ fadc) {
        const DayaBay::FadcChannelId& id = fadc->first;
        DayaBay::DaqFadcChannel& daqChannel = result->channel(id);
        const DayaBay::DigitalSignal& content = fadc->second;
        const unsigned int size = content.size();
        // This stops non-started lengths from going into infinite loop
        const unsigned int endData = size - (size % 3);
        for (unsigned int data = 0;
             endData != data;
             data += 3) {
            daqChannel.addData(content[data],
                               content[data+ 1],
                               content[data + 2]);
        }
    }
    

    return result;
}
const DayaBay::DaqLtb * DayaBay::ReadoutPmtCrate::dummyLtb ( ) const

Create a dummy DaqLtb based on the Readout information.

Definition at line 126 of file ReadoutPmtCrate.cc.

                                                            {
    DaqLtb* result = new DaqLtb(triggerNumber(),
                                1,
                                0,
                                detector());
    DaqLtbFrame* frame = new DaqLtbFrame(0,
                                         triggerType(),
                                         triggerTime(),
                                         0,
                                         0,
                                         false,
                                         false,
                                         false,
                                         0,
                                         detector());
    result->addFrame(frame);
    return result;
}
std::ostream & DayaBay::ReadoutPmtCrate::fillStream ( std::ostream &  s) const [virtual]

Print the crate data.

Reimplemented from DayaBay::Readout.

Definition at line 7 of file ReadoutPmtCrate.cc.

{
    size_t siz = m_channelReadout.size();

    s << "{ " 
      << siz << " readouts : " << std::endl;
    s << "TriggerDataPackage: ";
    if (m_triggerDataPkg){ s << *m_triggerDataPkg << std::endl;}
    else{ s << "NOT SET!" << std::endl;}
    s << std::endl;
    PmtChannelReadouts::const_iterator it, done = m_channelReadout.end();
    for (it=m_channelReadout.begin(); it != done; ++it) {
      s << (it->first) << (it->second) << std::endl;
    }
    s << "FADC Readouts:" << &m_fadcReadout << std::endl;
    FadcReadouts::const_iterator fadcIt, facd_done = m_fadcReadout.end();
    for (fadcIt=m_fadcReadout.begin();fadcIt!=facd_done;++fadcIt){
        s << "\t" << (fadcIt->first) << (fadcIt->second) << std::endl;
    }
    s << "}";
    return s;
}
const DayaBay::ReadoutPmtCrate::PmtChannelReadouts & DayaBay::ReadoutPmtCrate::channelReadout ( ) const [inline]

Retrieve const The set of channels in this readout.

Definition at line 183 of file ReadoutPmtCrate.h.

{
  return m_channelReadout;
}
void DayaBay::ReadoutPmtCrate::setChannelReadout ( const PmtChannelReadouts value) [inline]

Update The set of channels in this readout.

Definition at line 188 of file ReadoutPmtCrate.h.

{
  m_channelReadout = value;
}
const DayaBay::ReadoutPmtCrate::FadcReadouts & DayaBay::ReadoutPmtCrate::fadcReadout ( ) const [inline]

Retrieve const The set of fadcReadouts in this readout.

Definition at line 193 of file ReadoutPmtCrate.h.

{
  return m_fadcReadout;
}
DayaBay::ReadoutPmtCrate::FadcReadouts & DayaBay::ReadoutPmtCrate::fadcReadout ( ) [inline]

Retrieve The set of fadcReadouts in this readout.

Definition at line 198 of file ReadoutPmtCrate.h.

{
  return m_fadcReadout;
}
void DayaBay::ReadoutPmtCrate::setFadcReadout ( const FadcReadouts value) [inline]

Update The set of fadcReadouts in this readout.

Definition at line 203 of file ReadoutPmtCrate.h.

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

Retrieve const Trigger Data Package.

Definition at line 208 of file ReadoutPmtCrate.h.

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

Update Trigger Data Package.

Definition at line 213 of file ReadoutPmtCrate.h.

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

operator new

Reimplemented from DayaBay::Readout.

Definition at line 128 of file ReadoutPmtCrate.h.

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

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

operator delete

Reimplemented from DayaBay::Readout.

Definition at line 144 of file ReadoutPmtCrate.h.

    {
      boost::singleton_pool<ReadoutPmtCrate, sizeof(ReadoutPmtCrate)>::is_from(p) ?
      boost::singleton_pool<ReadoutPmtCrate, sizeof(ReadoutPmtCrate)>::free(p) :
      ::operator delete(p);
    }
static void DayaBay::ReadoutPmtCrate::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 153 of file ReadoutPmtCrate.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 channels in this readout.

Definition at line 162 of file ReadoutPmtCrate.h.

The set of fadcReadouts in this readout.

Definition at line 163 of file ReadoutPmtCrate.h.

Trigger Data Package.

Definition at line 164 of file ReadoutPmtCrate.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