/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 | Private Attributes
StagePuller Class Reference

An algorithm that pulls data from a stage. More...

#include <StagePuller.h>

Collaboration diagram for StagePuller:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 StagePuller (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~StagePuller ()
virtual StatusCode initialize ()
virtual StatusCode execute ()
virtual StatusCode finalize ()

Private Attributes

ToolHandle< IStagem_stage
 Property: "Stage". Name of the stage to pull from.
int m_runTimeSeconds
 Property: "RunTimeSeconds".
TimeStamp m_startTime

Detailed Description

An algorithm that pulls data from a stage.

bv@bnl.gov Mon Oct 27 14:35:36 2008

Definition at line 25 of file StagePuller.h.


Constructor & Destructor Documentation

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

Definition at line 6 of file StagePuller.cc.

    : GaudiAlgorithm(name,pSvcLocator)
    , m_stage("Stage")
    , m_startTime(TimeStamp::GetBOT())
{
    declareProperty("Stage",m_stage, "Stage to pull from.");
    declareProperty("RunTimeSeconds",m_runTimeSeconds=0,
                    "Period of time, in seconds, that the job should run, if non-zero.");
}
StagePuller::~StagePuller ( ) [virtual]

Definition at line 16 of file StagePuller.cc.

{
}

Member Function Documentation

StatusCode StagePuller::initialize ( ) [virtual]

Definition at line 20 of file StagePuller.cc.

{
    StatusCode sc = this->GaudiAlgorithm::initialize();
    if (sc.isFailure()) return sc;

    MsgStream log(msgSvc(), name());

    log << MSG::DEBUG
        << "Retrieving stage " << m_stage.typeAndName() << endreq;
    if (m_stage.retrieve().isFailure()) {
        log << MSG::ERROR
            << "Failed to retrieve " << m_stage << endreq;
        return StatusCode::FAILURE;
    }

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

Definition at line 38 of file StagePuller.cc.

{
    MsgStream log(msgSvc(), name());

    log << MSG::DEBUG
        << "===> Pulling from last stage" << endreq;

    IStageData* data = 0;
    StatusCode sc = m_stage->nextElement(data,true);
    if (!data || sc.isFailure()) {
        log << MSG::WARNING
            << "Failed to pull next element" << endreq;
        return sc;
    }

    if (m_runTimeSeconds) {
        if (m_startTime == TimeStamp::GetBOT()) {
            m_startTime = data->time();
        }
        double dt_seconds = data->time() - m_startTime;
        if (dt_seconds > m_runTimeSeconds) {
            
        }
    }

    log << MSG::DEBUG
        << "Pulled data at time: " << data->time()
        << endreq;

    IStageData* hsdb = dynamic_cast< IStageData* >(data);
    if (!hsdb) {
        debug() << "StageData not a StageData, oh well." << endreq;
        delete data;
        return StatusCode::SUCCESS;
    }

    DayaBay::HeaderObject& ho = hsdb->header();
    put(&ho,ho.defLoc());
    delete data;
    return StatusCode::SUCCESS;
}
StatusCode StagePuller::finalize ( ) [virtual]

Definition at line 80 of file StagePuller.cc.

{
    m_stage->release();
    return this->GaudiAlgorithm::finalize();
}

Member Data Documentation

ToolHandle<IStage> StagePuller::m_stage [private]

Property: "Stage". Name of the stage to pull from.

Definition at line 40 of file StagePuller.h.

Property: "RunTimeSeconds".

Run time in seconds. If non-zero, this algorithm will monitor the period of time that has passed from the first event to each subsequent event. When that time period has surpassed the RunTime the algorithm will indicate to the framework that the current exection cycle should be the last one.

Definition at line 48 of file StagePuller.h.

Definition at line 49 of file StagePuller.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:07:33 for Stage by doxygen 1.7.4