/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 | Protected Member Functions | Protected Attributes | Private Attributes
ROsReadoutAlg Class Reference

#include <ROsReadoutAlg.h>

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

List of all members.

Public Member Functions

 ROsReadoutAlg (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~ROsReadoutAlg ()
virtual StatusCode initialize ()
virtual StatusCode execute ()
virtual StatusCode finalize ()
DayaBay::SimReadoutHeaderGetCurrentHeaderObject () const
virtual StatusCode sysInitialize ()
virtual StatusCode sysExecute ()
virtual StatusCode preExecute ()
virtual StatusCode postExecute ()
virtual StatusCode sysFinalize ()
IDataProviderSvc * arcSvc () const
void putTES (DataObject *obj, std::string location) const
TYPE * getTES (std::string location) const
TYPE * getAES (std::string location, int index) const
std::vector< DataObject * > getAEScollection (std::string location) const
int getExecNum ()
std::string Location () const

Protected Member Functions

DayaBay::SimReadoutHeaderMakeHeaderObject ()
void InitializeHeader (DayaBay::HeaderObject *header)
TYPE * MakeHeader ()
TYPE * MakeHeader (std::vector< const DayaBay::IHeader * > &inputHeaders)
TYPE * MakeHeader (const DayaBay::IHeader *referenceHeader)
void AppendInputHeader (const DayaBay::HeaderObject *header) const

Protected Attributes

DayaBay::HeaderObjectm_headerObject
bool m_pullMode
std::string m_location

Private Attributes

std::vector< std::string > m_roToolNames
 Tool to do triggering.
std::vector< IROsReadoutTool * > m_roTools
std::string m_roTrigPackName
 Tool to create trigger data package.
IROsTriggerDataPackerToolm_roTrigPackTool
std::string m_roName
std::string m_trigLocation
std::string m_elecLocation

Detailed Description

Definition at line 23 of file ROsReadoutAlg.h.


Constructor & Destructor Documentation

ROsReadoutAlg::ROsReadoutAlg ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 12 of file ROsReadoutAlg.cc.

    : DybAlgorithm<DayaBay::SimReadoutHeader>(name,pSvcLocator)
{
    m_roToolNames.push_back("ROsFeeReadoutTool");
    m_roToolNames.push_back("ROsFecReadoutTool");
    declareProperty("RoTools",m_roToolNames,
                    "Tools to generate Triggers");
    declareProperty("RoName", m_roName = "ReadoutAlg",
                    "Name of this Trigger Algorithm for book keeping purposes.");
    declareProperty("TrigPackagerTool",m_roTrigPackName="ROsTriggerDataPackerTool",
                    "Tool to convert trigger commands from TrigSim to TriggerDataPackage");
    declareProperty("TrigLocation",m_trigLocation=DayaBay::SimTrigHeaderLocation::Default,
                    "Location in the TES where the output SimTrigHeader is to be found.");
    declareProperty("ElecLocation",m_elecLocation=DayaBay::ElecHeaderLocation::Default,
                    "Location in the TES where the input ElecHeader is to be found.");
}
ROsReadoutAlg::~ROsReadoutAlg ( ) [virtual]

Definition at line 29 of file ROsReadoutAlg.cc.

{
}

Member Function Documentation

StatusCode ROsReadoutAlg::initialize ( ) [virtual]

Cache Handle to Data Packer Tools

Cache Handles to Readout Tools.

Definition at line 33 of file ROsReadoutAlg.cc.

{

    try{
        m_roTrigPackTool = tool<IROsTriggerDataPackerTool>(m_roTrigPackName);
    }catch(const GaudiException& exg){
        fatal() << "Failed to get Readout Trigger Package Tool: \""
                << m_roTrigPackName << "\"" << endreq;
        return StatusCode::FAILURE;
    }

    for (size_t ind=0; ind < m_roToolNames.size(); ++ind) {
        std::string rotool = m_roToolNames[ind];
        try{
                m_roTools.push_back(tool<IROsReadoutTool>(rotool));
        }catch(const GaudiException& exg) {
            fatal() << "Failed to get Readout Tool: \"" << rotool
                    << "\"" << endreq;
            return StatusCode::FAILURE;
        }
        info () << "Added readout tool " << rotool << endreq;
    }

    return StatusCode::SUCCESS;
}
StatusCode ROsReadoutAlg::execute ( ) [virtual]

Create Trigger Data Packages from trigHeader

fill roHeader With TriggerDataPackage With this way of doing it the individual readout tools theoretically no longer need to know about the trigger header.

Definition at line 61 of file ROsReadoutAlg.cc.

{
    debug() << "Entering ROsReadoutAlg.execute()" << endreq;
    // Look for pre-existing header object or make new one
    DayaBay::SimReadoutHeader* roHeader = MakeHeaderObject();

    //set readouts to have same validity range as the crate its read out from.
    // This can be refined later.
    DayaBay::ElecHeader* elecHeader = getTES<DayaBay::ElecHeader>(m_elecLocation);
    DayaBay::SimTrigHeader* trigHeader = getTES<DayaBay::SimTrigHeader>(m_trigLocation);

    //roHeader->setTimeStamp(elecHeader->timeStamp()); // this seems redundant (and duplicating) when one looks at the line 78
    TimeStamp earliest = elecHeader->earliest();
    TimeStamp latest = elecHeader->latest();

    roHeader->setEarliest(earliest);
    roHeader->setLatest(latest);
    roHeader->setContext(elecHeader->context());

    debug() << "Applying Trigger Data Packer Tool" << endreq;

    std::vector<DayaBay::ReadoutTriggerDataPkg*> trigPkgs;

    m_roTrigPackTool->fillDataPackages(trigPkgs,*trigHeader);

    // Let each tool do its thing on the event
    for (size_t ind = 0; ind< m_roTools.size(); ++ind) {
        debug () << "Running trigger tool #" << ind << " " << m_roToolNames[ind] << endreq;
        if (m_roTools[ind]->mutate(roHeader,trigPkgs,*elecHeader).isFailure()) {
            fatal() << "Readout Tool " << m_roToolNames[ind]
                    << " failed" << endreq;
            return StatusCode::FAILURE;
        }
    }

    verbose() << *roHeader << endreq;
    // HeaderObject base
    return StatusCode::SUCCESS;
}
StatusCode ROsReadoutAlg::finalize ( ) [virtual]

Definition at line 106 of file ROsReadoutAlg.cc.

{
    m_roTools.clear();

    return this->GaudiAlgorithm::finalize();
}
DayaBay::SimReadoutHeader * DybAlgorithm< DayaBay::SimReadoutHeader >::GetCurrentHeaderObject ( ) const [inherited]
virtual StatusCode DybAlgorithm< DayaBay::SimReadoutHeader >::sysInitialize ( ) [virtual, inherited]

Reimplemented from DybBaseAlg.

virtual StatusCode DybAlgorithm< DayaBay::SimReadoutHeader >::sysExecute ( ) [virtual, inherited]

Reimplemented from DybBaseAlg.

virtual StatusCode DybAlgorithm< DayaBay::SimReadoutHeader >::preExecute ( ) [virtual, inherited]

Reimplemented from DybBaseAlg.

virtual StatusCode DybAlgorithm< DayaBay::SimReadoutHeader >::postExecute ( ) [virtual, inherited]

Reimplemented from DybBaseAlg.

virtual StatusCode DybAlgorithm< DayaBay::SimReadoutHeader >::sysFinalize ( ) [virtual, inherited]

Reimplemented from DybBaseAlg.

IDataProviderSvc * DybAlgorithm< DayaBay::SimReadoutHeader >::arcSvc ( ) const [inherited]

Reimplemented from DybBaseAlg.

void DybAlgorithm< DayaBay::SimReadoutHeader >::putTES ( DataObject *  obj,
std::string  location 
) const [inherited]

Reimplemented from DybBaseAlg.

TYPE * DybAlgorithm< DayaBay::SimReadoutHeader >::getTES ( std::string  location) const [inherited]

Reimplemented from DybBaseAlg.

TYPE * DybAlgorithm< DayaBay::SimReadoutHeader >::getAES ( std::string  location,
int  index 
) const [inherited]

Reimplemented from DybBaseAlg.

std::vector< DataObject * > DybAlgorithm< DayaBay::SimReadoutHeader >::getAEScollection ( std::string  location) const [inherited]

Reimplemented from DybBaseAlg.

int DybAlgorithm< DayaBay::SimReadoutHeader >::getExecNum ( ) [inherited]

Reimplemented from DybBaseAlg.

std::string DybAlgorithm< DayaBay::SimReadoutHeader >::Location ( ) const [inherited]

Reimplemented from DybBaseAlg.

DayaBay::SimReadoutHeader * DybAlgorithm< DayaBay::SimReadoutHeader >::MakeHeaderObject ( ) [protected, inherited]
void DybAlgorithm< DayaBay::SimReadoutHeader >::InitializeHeader ( DayaBay::HeaderObject header) [protected, inherited]

Reimplemented from DybBaseAlg.

TYPE * DybAlgorithm< DayaBay::SimReadoutHeader >::MakeHeader ( ) [protected, inherited]

Reimplemented from DybBaseAlg.

TYPE * DybAlgorithm< DayaBay::SimReadoutHeader >::MakeHeader ( std::vector< const DayaBay::IHeader * > &  inputHeaders) [protected, inherited]

Reimplemented from DybBaseAlg.

TYPE * DybAlgorithm< DayaBay::SimReadoutHeader >::MakeHeader ( const DayaBay::IHeader referenceHeader) [protected, inherited]

Reimplemented from DybBaseAlg.

void DybAlgorithm< DayaBay::SimReadoutHeader >::AppendInputHeader ( const DayaBay::HeaderObject header) const [protected, inherited]

Reimplemented from DybBaseAlg.


Member Data Documentation

std::vector<std::string> ROsReadoutAlg::m_roToolNames [private]

Tool to do triggering.

Definition at line 35 of file ROsReadoutAlg.h.

std::vector<IROsReadoutTool*> ROsReadoutAlg::m_roTools [private]

Definition at line 36 of file ROsReadoutAlg.h.

std::string ROsReadoutAlg::m_roTrigPackName [private]

Tool to create trigger data package.

Definition at line 39 of file ROsReadoutAlg.h.

Definition at line 40 of file ROsReadoutAlg.h.

std::string ROsReadoutAlg::m_roName [private]

Definition at line 42 of file ROsReadoutAlg.h.

std::string ROsReadoutAlg::m_trigLocation [private]

Definition at line 43 of file ROsReadoutAlg.h.

std::string ROsReadoutAlg::m_elecLocation [private]

Definition at line 44 of file ROsReadoutAlg.h.

Reimplemented from DybBaseAlg.

bool DybAlgorithm< DayaBay::SimReadoutHeader >::m_pullMode [protected, inherited]

Reimplemented from DybBaseAlg.

std::string DybAlgorithm< DayaBay::SimReadoutHeader >::m_location [protected, inherited]

Reimplemented from DybBaseAlg.


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:17:06 for ReadoutSim by doxygen 1.7.4