| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

DayaBay::ReadoutPmtCrate Class Reference

PMT Crate Readout. More...

#include <ReadoutPmtCrate.h>

Inheritance diagram for DayaBay::ReadoutPmtCrate:

[legend]
Collaboration diagram for DayaBay::ReadoutPmtCrate:
[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::FeeChannelIdchannels ()
 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::ReadoutTriggerDataPkgtriggerDataPkg () 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_ttriggerType () 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 DayaBay::RawEventrawEvent () const
 Retrieve const The raw data block for this readout.
DayaBay::RawEventrawEvent ()
 Retrieve The raw data block for this readout.
void setRawEvent (DayaBay::RawEvent *value)
 Update The raw data block for 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 Mon Apr 11 03:45:44 2011

Definition at line 44 of file ReadoutPmtCrate.h.


Member Typedef Documentation

typedef std::map<DayaBay::FeeChannelId,DayaBay::ReadoutPmtChannel> DayaBay::ReadoutPmtCrate::PmtChannelReadouts

Map of FEE channel data by channel ID.

Definition at line 49 of file ReadoutPmtCrate.h.

typedef std::map<DayaBay::FadcChannelId,DayaBay::DigitalSignal> DayaBay::ReadoutPmtCrate::FadcReadouts

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.

00057                                                                     : Readout(detector,
00058                                                                          triggerNumber,
00059                                                                          triggerTime,
00060                                                                          triggerType),
00061                                                                                       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.

00031     : Readout(rh)
00032 {
00033     DayaBay::ReadoutPmtCrate::PmtChannelReadouts channels = rh.channelReadout();
00034     DayaBay::ReadoutPmtCrate::PmtChannelReadouts::iterator it, done = channels.end();
00035     for (it = channels.begin(); it != done; ++it) {
00036         it->second.setReadout(this);
00037     }
00038     this->setChannelReadout(channels);
00039     
00041     DayaBay::ReadoutTriggerDataPkg *trigDatPkg = new DayaBay::ReadoutTriggerDataPkg(*(rh.triggerDataPkg()));
00042     trigDatPkg->setReadout(this);
00043     this->setTriggerDataPkg(trigDatPkg);
00044     this->setFadcReadout(rh.fadcReadout());
00045 }

DayaBay::ReadoutPmtCrate::ReadoutPmtCrate (  )  [inline]

Default Constructor.

Definition at line 67 of file ReadoutPmtCrate.h.

00067                       : m_channelReadout(),
00068                         m_fadcReadout(),
00069                         m_triggerDataPkg(0) {}

DayaBay::ReadoutPmtCrate::~ReadoutPmtCrate (  ) 

destructor

Definition at line 3 of file ReadoutPmtCrate.cc.

00003                                         {
00004     delete m_triggerDataPkg;
00005 }


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.

00048 {
00049     if (this == &rh) return *this;
00050 
00051     (Readout&)(*this) = (Readout&)(rh);
00052 
00053     DayaBay::ReadoutPmtCrate::PmtChannelReadouts channels = rh.channelReadout();
00054     DayaBay::ReadoutPmtCrate::PmtChannelReadouts::iterator it, done = channels.end();
00055     for (it = channels.begin(); it != done; ++it) {
00056         it->second.setReadout(this);
00057     }
00058     this->setChannelReadout(channels);
00059     
00061     DayaBay::ReadoutTriggerDataPkg *trigDatPkg = new DayaBay::ReadoutTriggerDataPkg(*(rh.triggerDataPkg()));
00062     trigDatPkg->setReadout(this);
00063     this->setTriggerDataPkg(trigDatPkg);
00064     this->setFadcReadout(rh.fadcReadout());
00065     return *this;
00066 }

void DayaBay::ReadoutPmtCrate::addChannel ( const DayaBay::FeeChannelId channelId  )  [inline]

Adds a channel to this readout.

Definition at line 218 of file ReadoutPmtCrate.h.

00219 {
00220 
00221           m_channelReadout[channelId] = DayaBay::ReadoutPmtChannel(channelId,
00222                                                                    this);
00223         
00224 }

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.

00227 {
00228 return m_channelReadout[channelId];
00229 }

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.

00232 {
00233 
00234           DayaBay::ReadoutPmtCrate::PmtChannelReadouts::iterator crIter = m_channelReadout.begin();
00235           std::vector<DayaBay::FeeChannelId> channels;
00236           for(;crIter != m_channelReadout.end(); crIter++) 
00237             channels.push_back(crIter->first);
00238           return channels;
00239         
00240 }

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.

00070                                                                                               {
00071     DaqPmtCrate* result = new DaqPmtCrate(detector(),
00072                                           run,
00073                                           event);
00074     if (0 == m_triggerDataPkg) {
00075         result->addLtb(dummyLtb(),
00076                        ltbSlot);
00077     } else {
00078         result->addLtb(m_triggerDataPkg->daqLtb(),
00079                        ltbSlot);
00080     }
00081 
00082     const PmtChannelReadouts::const_iterator finished = m_channelReadout.end();
00083     for (PmtChannelReadouts::const_iterator channel = m_channelReadout.begin();
00084          finished != channel;
00085          ++channel) {
00086         const DayaBay::FeeChannelId& id = channel->first;
00087         DayaBay::DaqPmtChannel& daqChannel = result->channel(id);
00088         const DayaBay::ReadoutPmtChannel& content = channel->second;
00089         const unsigned int endHits = content.size();
00090         for (unsigned int hit = 0;
00091              endHits != hit;
00092              ++hit) {
00093             daqChannel.addHit(hit + 1,
00094                               content.adcCycle(hit),
00095                               content.adcRange(hit) == DayaBay::FeeGain::kHigh,
00096                               content.pedestal(hit),
00097                               content.adc(hit),
00098                               content.tdc(hit));
00099         }
00100     }
00101     return result;
00102 }

const DayaBay::DaqLtb * DayaBay::ReadoutPmtCrate::dummyLtb (  )  const

Create a dummy DaqLtb based on the Readout information.

Definition at line 104 of file ReadoutPmtCrate.cc.

00104                                                             {
00105     DaqLtb* result = new DaqLtb(triggerNumber(),
00106                                 1,
00107                                 0,
00108                                 detector());
00109     DaqLtbFrame* frame = new DaqLtbFrame(0,
00110                                          triggerType(),
00111                                          triggerTime(),
00112                                          0,
00113                                          0,
00114                                          false,
00115                                          false,
00116                                          false,
00117                                          0,
00118                                          detector());
00119     result->addFrame(frame);
00120     return result;
00121 }

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.

00008 {
00009     size_t siz = m_channelReadout.size();
00010 
00011     s << "{ " 
00012       << siz << " readouts : " << std::endl;
00013     s << "TriggerDataPackage: ";
00014     if (m_triggerDataPkg){ s << *m_triggerDataPkg << std::endl;}
00015     else{ s << "NOT SET!" << std::endl;}
00016     s << std::endl;
00017     PmtChannelReadouts::const_iterator it, done = m_channelReadout.end();
00018     for (it=m_channelReadout.begin(); it != done; ++it) {
00019       s << (it->first) << (it->second) << std::endl;
00020     }
00021     s << "FADC Readouts:" << &m_fadcReadout << std::endl;
00022     FadcReadouts::const_iterator fadcIt, facd_done = m_fadcReadout.end();
00023     for (fadcIt=m_fadcReadout.begin();fadcIt!=facd_done;++fadcIt){
00024         s << "\t" << (fadcIt->first) << (fadcIt->second) << std::endl;
00025     }
00026     s << "}";
00027     return s;
00028 }

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.

00184 {
00185   return m_channelReadout;
00186 }

void DayaBay::ReadoutPmtCrate::setChannelReadout ( const PmtChannelReadouts value  )  [inline]

Update The set of channels in this readout.

Definition at line 188 of file ReadoutPmtCrate.h.

00189 {
00190   m_channelReadout = value;
00191 }

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.

00194 {
00195   return m_fadcReadout;
00196 }

DayaBay::ReadoutPmtCrate::FadcReadouts & DayaBay::ReadoutPmtCrate::fadcReadout (  )  [inline]

Retrieve The set of fadcReadouts in this readout.

Definition at line 198 of file ReadoutPmtCrate.h.

00199 {
00200   return m_fadcReadout;
00201 }

void DayaBay::ReadoutPmtCrate::setFadcReadout ( const FadcReadouts value  )  [inline]

Update The set of fadcReadouts in this readout.

Definition at line 203 of file ReadoutPmtCrate.h.

00204 {
00205   m_fadcReadout = value;
00206 }

const DayaBay::ReadoutTriggerDataPkg * DayaBay::ReadoutPmtCrate::triggerDataPkg (  )  const [inline]

Retrieve const Trigger Data Package.

Definition at line 208 of file ReadoutPmtCrate.h.

00209 {
00210   return m_triggerDataPkg;
00211 }

void DayaBay::ReadoutPmtCrate::setTriggerDataPkg ( DayaBay::ReadoutTriggerDataPkg value  )  [inline]

Update Trigger Data Package.

Definition at line 213 of file ReadoutPmtCrate.h.

00214 {
00215   m_triggerDataPkg = value;
00216 }

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.

00129     {
00130       return ( sizeof(ReadoutPmtCrate) == size ? 
00131                boost::singleton_pool<ReadoutPmtCrate, sizeof(ReadoutPmtCrate)>::malloc() :
00132                ::operator new(size) );
00133     }

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.

00139     {
00140       return ::operator new (size,pObj);
00141     }

static void DayaBay::ReadoutPmtCrate::operator delete ( void *  p  )  [inline, static]

operator delete

Reimplemented from DayaBay::Readout.

Definition at line 144 of file ReadoutPmtCrate.h.

00145     {
00146       boost::singleton_pool<ReadoutPmtCrate, sizeof(ReadoutPmtCrate)>::is_from(p) ?
00147       boost::singleton_pool<ReadoutPmtCrate, sizeof(ReadoutPmtCrate)>::free(p) :
00148       ::operator delete(p);
00149     }

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.

00154     {
00155       ::operator delete (p, pObj);
00156     }

const DayaBay::Detector & DayaBay::Readout::detector (  )  const [inline, inherited]

Retrieve const The detector associated with this readout.

Definition at line 247 of file Readout.h.

00248 {
00249   return m_detector;
00250 }

void DayaBay::Readout::setDetector ( const DayaBay::Detector value  )  [inline, inherited]

Update The detector associated with this readout.

Definition at line 252 of file Readout.h.

00253 {
00254   m_detector = value;
00255 }

unsigned int DayaBay::Readout::triggerNumber (  )  const [inline, inherited]

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

Definition at line 257 of file Readout.h.

00258 {
00259   return m_triggerNumber;
00260 }

void DayaBay::Readout::setTriggerNumber ( unsigned int  value  )  [inline, inherited]

Update The count of the trigger command from this detector.

Definition at line 262 of file Readout.h.

00263 {
00264   m_triggerNumber = value;
00265 }

const TimeStamp & DayaBay::Readout::triggerTime (  )  const [inline, inherited]

Retrieve const The absolute time of the trigger command.

Definition at line 267 of file Readout.h.

00268 {
00269   return m_triggerTime;
00270 }

void DayaBay::Readout::setTriggerTime ( const TimeStamp value  )  [inline, inherited]

Update The absolute time of the trigger command.

Definition at line 272 of file Readout.h.

00273 {
00274   m_triggerTime = value;
00275 }

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 277 of file Readout.h.

00278 {
00279   return m_triggerType;
00280 }

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 282 of file Readout.h.

00283 {
00284   m_triggerType = value;
00285 }

const DayaBay::RawEvent * DayaBay::Readout::rawEvent (  )  const [inline, inherited]

Retrieve const The raw data block for this readout.

Definition at line 287 of file Readout.h.

00288 {
00289   return m_rawEvent;
00290 }

DayaBay::RawEvent * DayaBay::Readout::rawEvent (  )  [inline, inherited]

Retrieve The raw data block for this readout.

Definition at line 292 of file Readout.h.

00293 {
00294   return m_rawEvent;
00295 }

void DayaBay::Readout::setRawEvent ( DayaBay::RawEvent value  )  [inline, inherited]

Update The raw data block for this readout.

Definition at line 297 of file Readout.h.

00298 {
00299   m_rawEvent = value;
00300 }

const DybDaq::EventReadout * DayaBay::Readout::eventReadout (  )  const [inline, inherited]

Retrieve const The raw data block for this readout.

Definition at line 302 of file Readout.h.

00303 {
00304   return m_eventReadout;
00305 }

void DayaBay::Readout::setEventReadout ( DybDaq::EventReadout value  )  [inline, inherited]

Update The raw data block for this readout.

Definition at line 307 of file Readout.h.

00308 {
00309   m_eventReadout = value;
00310 }

const DayaBay::ReadoutHeader * DayaBay::Readout::header (  )  const [inline, inherited]

Retrieve const The readout header associated with this readout.

Definition at line 312 of file Readout.h.

00313 {
00314   return m_header;
00315 }

void DayaBay::Readout::setHeader ( DayaBay::ReadoutHeader value  )  [inline, inherited]

Update The readout header associated with this readout.

Definition at line 317 of file Readout.h.

00318 {
00319   m_header = value;
00320 }


Member Data Documentation

PmtChannelReadouts DayaBay::ReadoutPmtCrate::m_channelReadout [private]

The set of channels in this readout.

Definition at line 162 of file ReadoutPmtCrate.h.

FadcReadouts DayaBay::ReadoutPmtCrate::m_fadcReadout [private]

The set of fadcReadouts in this readout.

Definition at line 163 of file ReadoutPmtCrate.h.

DayaBay::ReadoutTriggerDataPkg* DayaBay::ReadoutPmtCrate::m_triggerDataPkg [private]

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 Mon Apr 11 20:24:50 2011 for ReadoutEvent by doxygen 1.4.7