/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 | Static Public Attributes | Private Member Functions | Private Attributes
DaqReadoutSvc Class Reference

#include <DaqReadoutSvc.h>

Inheritance diagram for DaqReadoutSvc:
Inheritance graph
[legend]
Collaboration diagram for DaqReadoutSvc:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 DaqReadoutSvc (const std::string &name, ISvcLocator *svc)
 Creates an instace of this class.
 ~DaqReadoutSvc ()
 Destroys the instance of this class.
virtual StatusCode queryInterface (const InterfaceID &id, void **interface)
virtual unsigned int samplingInterval () const
 Returns the sampling interval for runnihng sparce analysis.
virtual unsigned int actionOnInvalid () const
 Returns the action to take when an invalid event is found.
virtual unsigned int actionOnRawRpc () const
 Returns the action to take when an raw RPC event is found.
virtual bool isGenerating () const
 Returns true if DaqReadout instances should be generated.
virtual unsigned int ltbSlot (const DayaBay::Detector &detector) const
 Returns the ltb slot to be used in generated DAQ format data for the supplied detector.
virtual unsigned int runNumber (const DayaBay::Detector &detector) const
 Returns the run number to be stamped in generated DAQ format data for the supplied detector.
virtual unsigned int nextEventNumber (const DayaBay::Detector &detector)
 Returns the next event number to be stamped in generated DAQ format data for the supplied detector.
virtual unsigned int nextDataBlockNumber ()
 Returns the next data block number to be used.
virtual bool hasFileStartRecord () const
 Returns true if there is a current file_start_record.
virtual const
DybDaq::FileStartRecord
fileStartRecord () const
 Returns the current file_start_record.
virtual bool hasFileNameStrings () const
 Returns true if there is a current file_name_strings.
virtual const
DybDaq::FileNameStrings
fileNameStrings () const
 Returns the current file_name_strings.
virtual bool hasMetadataStrings () const
 Returns true if there is a current metadata_strings.
virtual const
DybDaq::MetadataStrings
metadataStrings () const
 Returns the current metadata_strings.
virtual bool hasRunParametersRecord () const
 Returns true if there is a current run_parameters_record.
virtual const
DybDaq::RunParametersRecord
runParametersRecord () const
 Returns the current run_parameters_record.
virtual int calibrationParametersRecordCount () const
 Returns the number of current calibration_parameter_records.
virtual const
DybDaq::CalibrationParametersRecord
calibrationParametersRecord (const int index) const
 Returns the requested current calibration_parameters_record.
virtual bool hasFileEndRecord () const
 Returns true if there is a file_end_record from the last file and the second event for the current file has not been read.
virtual const
DybDaq::FileEndRecord
fileEndRecord () const
 Returns the file_end_record from the last file.
virtual bool repackRpcEvent () const
 Returns the flag whether to repack the RPC event.
virtual bool timeAlignment () const
 Returns the flag whether to perform time alignment of DAQ events.
virtual void setFirstDataBlockNumber (unsigned int number)
 Sets the first data block number to be use in a file.
void setNextDataBlockNumber (unsigned int number)
 Sets the next data block number to be used.
void setFileRecord (const DybDaq::FileBuffer *record)
 Sets the current record to the one supplied.
void setFileRecord (const DybDaq::FileStartRecord *record)
 Sets the current file_start_record.
void setFileRecord (const DybDaq::FileNameStrings *record)
 Sets the current file_name_strings.
void setFileRecord (const DybDaq::MetadataStrings *record)
 Sets the current metadata_strings.
void setFileRecord (const DybDaq::RunParametersRecord *record)
 Sets the current run_parameters_record.
void setFileRecord (const DybDaq::CalibrationParametersRecord *record)
 Sets the current calibration_parameters_record.
void setFileRecord (const DybDaq::FileEndRecord *record)
 Sets the current file_end_record.

Static Public Member Functions

static const InterfaceID & interfaceID ()

Static Public Attributes

static const unsigned int kExitOnInvalid
static const unsigned int kSkipInvalid
static const unsigned int kProcessInvalid
static const unsigned int kProcessRawRpc
static const unsigned int kSkipRawRpc

Private Member Functions

 DaqReadoutSvc ()
 Suppress default.
 DaqReadoutSvc (const DaqReadoutSvc &rhs)
 Suppress default.
DaqReadoutSvcoperator= (const DaqReadoutSvc &rhs)
 Suppress default.

Private Attributes

unsigned int m_runNumber
 The run number to be stamped in generated DAQ format data for the supplied detector.
unsigned int m_nextEventNumber
 The next event number to be stamped in generated DAQ format data for the supplied detector.
unsigned int m_nextDataBlockNumber
 The next data block number to be used.
bool m_generating
 True if DaqReadout instances should be generated.
const DybDaq::FileStartRecordm_fileStartRecord
 The current file_start_record, if there is one.
const DybDaq::FileNameStringsm_fileNameStrings
 The current fileNameStrings, if there is one.
const DybDaq::MetadataStringsm_metadataStrings
 The current metadata_strings, if there is one.
const DybDaq::RunParametersRecordm_runParametersRecord
 The current run_parameters_record, if there is one.
std::vector
< DybDaq::CalibrationParametersRecord * > * 
m_calibrationParametersRecords
 The vector of current calibration_parameters_records.
const DybDaq::FileEndRecordm_fileEndRecord
 The current file_end_record, if there is one.
int m_samplingInterval
 The sampling interval for runnihng spare analysis.
unsigned int m_actionOnInvalid
 The flag defining what action to take when an invalid event is found.
unsigned int m_actionOnRawRpc
 The flag defining what action to take when an raw RPC record is found.
bool m_repackRpc
 Use DaqRecordStream to repack the RPC event.
bool m_timeAlignment
 Perform time alignment while reading.

Detailed Description

Definition at line 21 of file DaqReadoutSvc.h.


Constructor & Destructor Documentation

DaqReadoutSvc::DaqReadoutSvc ( const std::string &  name,
ISvcLocator *  svc 
)

Creates an instace of this class.

Definition at line 32 of file DaqReadoutSvc.cc.

                                               :
    Service(name,
            svc),
    m_fileStartRecord(0),
    m_fileNameStrings(0),
    m_metadataStrings(0),
    m_runParametersRecord(0),
    m_calibrationParametersRecords(new vector<CalibrationParametersRecord*>()),
    m_fileEndRecord(0) 
{
  declareProperty("RunNumber",m_runNumber=0,
                  "The run number to be stamped in generated DAQ format data for the supplied detector");
  declareProperty("FirstEventNumber",m_nextEventNumber=1,
                  "The first event number to be stamped for the default detector");
  declareProperty("FirstDataBlockNumber",m_nextDataBlockNumber=1,
                  "The first dtaa block number to be used in output");
  declareProperty("Generating",m_generating=false,
                  "True if DAQ formated data  should be generated");
  declareProperty("SamplingInterval",
                  m_samplingInterval = 1,
                  "The sampling interval for running sparce analysis"); 
  declareProperty("ActionOnInvalid",
                  m_actionOnInvalid = IDaqReadoutSvc::kExitOnInvalid,
                  "The action to take when an invalid event is found"); 
  declareProperty("ActionOnRawRpc",
                  m_actionOnRawRpc = IDaqReadoutSvc::kProcessRawRpc,
                  "The action to take when an raw RPC record is found"); 
  declareProperty("RepackRpcEvent", m_repackRpc = false,
                  "Whether to repack the RPC event");
  declareProperty("TimeAlignment", m_timeAlignment = false,
                  "Whether to perform time alignment of DAQ events");
}
DaqReadoutSvc::~DaqReadoutSvc ( )

Destroys the instance of this class.

Definition at line 66 of file DaqReadoutSvc.cc.

DaqReadoutSvc::DaqReadoutSvc ( ) [private]

Suppress default.

DaqReadoutSvc::DaqReadoutSvc ( const DaqReadoutSvc rhs) [private]

Suppress default.


Member Function Documentation

StatusCode DaqReadoutSvc::queryInterface ( const InterfaceID &  id,
void **  interface 
) [virtual]

Definition at line 71 of file DaqReadoutSvc.cc.

                                                        {
    if (IDaqReadoutSvc::interfaceID().versionMatch(id)) {
        // Good enough. Return this object
        *interface = dynamic_cast<IDaqReadoutSvc*>(this);
        addRef();
        return StatusCode::SUCCESS;
    }
    // Try base class
    return Service::queryInterface(id,
                                   interface);
}
unsigned int DaqReadoutSvc::samplingInterval ( ) const [virtual]

Returns the sampling interval for runnihng sparce analysis.

Implements IDaqReadoutSvc.

Definition at line 84 of file DaqReadoutSvc.cc.

                                                   {
  return m_samplingInterval;
}
unsigned int DaqReadoutSvc::actionOnInvalid ( ) const [virtual]

Returns the action to take when an invalid event is found.

Implements IDaqReadoutSvc.

Definition at line 88 of file DaqReadoutSvc.cc.

                                                   {
  return m_actionOnInvalid;
}
unsigned int DaqReadoutSvc::actionOnRawRpc ( ) const [virtual]

Returns the action to take when an raw RPC event is found.

Implements IDaqReadoutSvc.

Definition at line 92 of file DaqReadoutSvc.cc.

                                                 {
  return m_actionOnRawRpc;
}
bool DaqReadoutSvc::isGenerating ( ) const [virtual]

Returns true if DaqReadout instances should be generated.

Implements IDaqReadoutSvc.

Definition at line 96 of file DaqReadoutSvc.cc.

                                       {
    return m_generating;
}
unsigned int DaqReadoutSvc::ltbSlot ( const DayaBay::Detector detector) const [virtual]

Returns the ltb slot to be used in generated DAQ format data for the supplied detector.

Implements IDaqReadoutSvc.

Definition at line 100 of file DaqReadoutSvc.cc.

                                                                  {
    return 3;
}
unsigned int DaqReadoutSvc::runNumber ( const DayaBay::Detector detector) const [virtual]

Returns the run number to be stamped in generated DAQ format data for the supplied detector.

Implements IDaqReadoutSvc.

Definition at line 104 of file DaqReadoutSvc.cc.

                                                                    {
    return m_runNumber;
}
unsigned int DaqReadoutSvc::nextEventNumber ( const DayaBay::Detector detector) [virtual]

Returns the next event number to be stamped in generated DAQ format data for the supplied detector.

Implements IDaqReadoutSvc.

Definition at line 108 of file DaqReadoutSvc.cc.

                                                                    {
    return m_nextEventNumber++;
}
unsigned int DaqReadoutSvc::nextDataBlockNumber ( ) [virtual]

Returns the next data block number to be used.

Implements IDaqReadoutSvc.

Definition at line 112 of file DaqReadoutSvc.cc.

                                                {
    return m_nextDataBlockNumber++;
}
bool DaqReadoutSvc::hasFileStartRecord ( ) const [virtual]

Returns true if there is a current file_start_record.

Implements IDaqReadoutSvc.

Definition at line 116 of file DaqReadoutSvc.cc.

                                             {
    return 0 != m_fileStartRecord;
}
const FileStartRecord & DaqReadoutSvc::fileStartRecord ( ) const [virtual]

Returns the current file_start_record.

Implements IDaqReadoutSvc.

Definition at line 120 of file DaqReadoutSvc.cc.

                                                            {
    return *m_fileStartRecord;
}
bool DaqReadoutSvc::hasFileNameStrings ( ) const [virtual]

Returns true if there is a current file_name_strings.

Implements IDaqReadoutSvc.

Definition at line 124 of file DaqReadoutSvc.cc.

                                             {
    return 0 != m_fileNameStrings;
}
const FileNameStrings & DaqReadoutSvc::fileNameStrings ( ) const [virtual]

Returns the current file_name_strings.

Implements IDaqReadoutSvc.

Definition at line 128 of file DaqReadoutSvc.cc.

                                                            {
    return *m_fileNameStrings;
}
bool DaqReadoutSvc::hasMetadataStrings ( ) const [virtual]

Returns true if there is a current metadata_strings.

Implements IDaqReadoutSvc.

Definition at line 132 of file DaqReadoutSvc.cc.

                                             {
    return 0 != m_metadataStrings;
}
const MetadataStrings & DaqReadoutSvc::metadataStrings ( ) const [virtual]

Returns the current metadata_strings.

Implements IDaqReadoutSvc.

Definition at line 136 of file DaqReadoutSvc.cc.

                                                            {
    return *m_metadataStrings;
}
bool DaqReadoutSvc::hasRunParametersRecord ( ) const [virtual]

Returns true if there is a current run_parameters_record.

Implements IDaqReadoutSvc.

Definition at line 140 of file DaqReadoutSvc.cc.

                                                 {
    return 0 != m_runParametersRecord;
}
const RunParametersRecord & DaqReadoutSvc::runParametersRecord ( ) const [virtual]

Returns the current run_parameters_record.

Implements IDaqReadoutSvc.

Definition at line 144 of file DaqReadoutSvc.cc.

                                                                    {
    return *m_runParametersRecord;
}
int DaqReadoutSvc::calibrationParametersRecordCount ( ) const [virtual]

Returns the number of current calibration_parameter_records.

Implements IDaqReadoutSvc.

Definition at line 148 of file DaqReadoutSvc.cc.

                                                          {
    return m_calibrationParametersRecords->size();
}
const CalibrationParametersRecord & DaqReadoutSvc::calibrationParametersRecord ( const int  index) const [virtual]

Returns the requested current calibration_parameters_record.

Implements IDaqReadoutSvc.

Definition at line 152 of file DaqReadoutSvc.cc.

                                                                                                   {
    return *((*m_calibrationParametersRecords)[index]);
}
bool DaqReadoutSvc::hasFileEndRecord ( ) const [virtual]

Returns true if there is a file_end_record from the last file and the second event for the current file has not been read.

Implements IDaqReadoutSvc.

Definition at line 156 of file DaqReadoutSvc.cc.

                                           {
    return 0 != m_fileEndRecord;
}
const FileEndRecord & DaqReadoutSvc::fileEndRecord ( ) const [virtual]

Returns the file_end_record from the last file.

Implements IDaqReadoutSvc.

Definition at line 160 of file DaqReadoutSvc.cc.

                                                        {
    return *m_fileEndRecord;
}
bool DaqReadoutSvc::repackRpcEvent ( ) const [virtual]

Returns the flag whether to repack the RPC event.

Definition at line 164 of file DaqReadoutSvc.cc.

                                         {
    return m_repackRpc;
}
bool DaqReadoutSvc::timeAlignment ( ) const [virtual]

Returns the flag whether to perform time alignment of DAQ events.

Definition at line 168 of file DaqReadoutSvc.cc.

                                        {
    return m_timeAlignment;
}
void DaqReadoutSvc::setFirstDataBlockNumber ( unsigned int  number) [virtual]

Sets the first data block number to be use in a file.

Implements IDaqReadoutSvc.

Definition at line 172 of file DaqReadoutSvc.cc.

                                                               {
  m_nextDataBlockNumber = number;
}
void DaqReadoutSvc::setNextDataBlockNumber ( unsigned int  number)

Sets the next data block number to be used.

Definition at line 176 of file DaqReadoutSvc.cc.

                                                              {
  m_nextDataBlockNumber = number;
}
void DaqReadoutSvc::setFileRecord ( const DybDaq::FileBuffer record)

Sets the current record to the one supplied.

Definition at line 180 of file DaqReadoutSvc.cc.

                                                          {
    if (record->isMarked(FileTraits::kFileStartRecord)) {
        const FileStartRecord* fileRecord = dynamic_cast<const FileStartRecord*>(record);
        setFileRecord(fileRecord);
    } else if (record->isMarked(FileTraits::kFileNameStrings)) {
        const FileNameStrings* fileRecord = dynamic_cast<const FileNameStrings*>(record);
        setFileRecord(fileRecord);
    } else if (record->isMarked(FileTraits::kMetadataStrings)) {
        const MetadataStrings* fileRecord = dynamic_cast<const MetadataStrings*>(record);
        setFileRecord(fileRecord);
    } else if (record->isMarked(FileTraits::kRunParametersRecord)) {
        const RunParametersRecord* fileRecord = dynamic_cast<const RunParametersRecord*>(record);
        setFileRecord(fileRecord);
    } else if (record->isMarked(FileTraits::kCalibrationParametersRecord)) {
        const CalibrationParametersRecord* fileRecord = dynamic_cast<const CalibrationParametersRecord*>(record);
        setFileRecord(fileRecord);
    } else if (record->isMarked(FileTraits::kFileEndRecord)) {
        const FileEndRecord* fileRecord = dynamic_cast<const FileEndRecord*>(record);
        setFileRecord(fileRecord);
    }
}
void DaqReadoutSvc::setFileRecord ( const DybDaq::FileStartRecord record)

Sets the current file_start_record.

Definition at line 202 of file DaqReadoutSvc.cc.

                                                               {
    const vector<CalibrationParametersRecord*>::const_iterator finished = m_calibrationParametersRecords->end();
    for (vector<CalibrationParametersRecord*>::const_iterator calib = m_calibrationParametersRecords->begin();
         finished != calib;
         ++calib) {
        delete *calib;
    }
    m_calibrationParametersRecords->clear();

    if (0 != m_runParametersRecord) {
        delete m_runParametersRecord;
        m_runParametersRecord = 0;
    }
    if (0 != m_metadataStrings) {
        delete m_metadataStrings;
        m_metadataStrings = 0;
    }
    if (0 != m_fileNameStrings) {
        delete m_fileNameStrings;
        m_fileNameStrings = 0;
    }
    if (0 != m_fileStartRecord) {
        delete m_fileStartRecord;
    }
    m_fileStartRecord = record;
}
void DaqReadoutSvc::setFileRecord ( const DybDaq::FileNameStrings record)

Sets the current file_name_strings.

Definition at line 229 of file DaqReadoutSvc.cc.

                                                               {
    if (0 != m_fileNameStrings) {
        delete m_fileNameStrings;
    }
    m_fileNameStrings = record;
}
void DaqReadoutSvc::setFileRecord ( const DybDaq::MetadataStrings record)

Sets the current metadata_strings.

Definition at line 236 of file DaqReadoutSvc.cc.

                                                               {
    if (0 != m_metadataStrings) {
        delete m_metadataStrings;
    }
    m_metadataStrings = record;
}
void DaqReadoutSvc::setFileRecord ( const DybDaq::RunParametersRecord record)

Sets the current run_parameters_record.

Definition at line 243 of file DaqReadoutSvc.cc.

void DaqReadoutSvc::setFileRecord ( const DybDaq::CalibrationParametersRecord record)

Sets the current calibration_parameters_record.

Definition at line 250 of file DaqReadoutSvc.cc.

                                                                           {
    CalibrationParametersRecord* calib = const_cast<CalibrationParametersRecord*>(record);
    if (0 != calib) {
        m_calibrationParametersRecords->push_back(calib);
    }
}
void DaqReadoutSvc::setFileRecord ( const DybDaq::FileEndRecord record)

Sets the current file_end_record.

Definition at line 257 of file DaqReadoutSvc.cc.

                                                             {
    if (0 != m_fileEndRecord) {
        delete m_fileEndRecord;
    }
    m_fileEndRecord = record;
}
DaqReadoutSvc& DaqReadoutSvc::operator= ( const DaqReadoutSvc rhs) [private]

Suppress default.


Member Data Documentation

unsigned int DaqReadoutSvc::m_runNumber [private]

The run number to be stamped in generated DAQ format data for the supplied detector.

Definition at line 220 of file DaqReadoutSvc.h.

unsigned int DaqReadoutSvc::m_nextEventNumber [private]

The next event number to be stamped in generated DAQ format data for the supplied detector.

Definition at line 225 of file DaqReadoutSvc.h.

unsigned int DaqReadoutSvc::m_nextDataBlockNumber [private]

The next data block number to be used.

Definition at line 230 of file DaqReadoutSvc.h.

True if DaqReadout instances should be generated.

Definition at line 235 of file DaqReadoutSvc.h.

The current file_start_record, if there is one.

Definition at line 240 of file DaqReadoutSvc.h.

The current fileNameStrings, if there is one.

Definition at line 245 of file DaqReadoutSvc.h.

The current metadata_strings, if there is one.

Definition at line 250 of file DaqReadoutSvc.h.

The current run_parameters_record, if there is one.

Definition at line 255 of file DaqReadoutSvc.h.

The vector of current calibration_parameters_records.

Definition at line 260 of file DaqReadoutSvc.h.

The current file_end_record, if there is one.

Definition at line 265 of file DaqReadoutSvc.h.

The sampling interval for runnihng spare analysis.

Definition at line 270 of file DaqReadoutSvc.h.

unsigned int DaqReadoutSvc::m_actionOnInvalid [private]

The flag defining what action to take when an invalid event is found.

Definition at line 275 of file DaqReadoutSvc.h.

unsigned int DaqReadoutSvc::m_actionOnRawRpc [private]

The flag defining what action to take when an raw RPC record is found.

Definition at line 280 of file DaqReadoutSvc.h.

Use DaqRecordStream to repack the RPC event.

Definition at line 285 of file DaqReadoutSvc.h.

Perform time alignment while reading.

Definition at line 290 of file DaqReadoutSvc.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:15:32 for DaqFormatModules by doxygen 1.7.4