/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
TsTriggerAlg Class Reference

#include <TsTriggerAlg.h>

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

List of all members.

Public Member Functions

 TsTriggerAlg (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~TsTriggerAlg ()
virtual StatusCode initialize ()
virtual StatusCode execute ()
virtual StatusCode finalize ()
DayaBay::SimTrigHeaderGetCurrentHeaderObject () 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::SimTrigHeaderMakeHeaderObject ()
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_trigToolNames
 Tool to do triggering.
std::vector< ITsTriggerTool * > m_trigTools
std::string m_trigName
std::string m_elecLocation
std::string m_trigFilterName
ITsTriggerToolm_triggerSorter

Detailed Description

Definition at line 20 of file TsTriggerAlg.h.


Constructor & Destructor Documentation

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

Definition at line 9 of file TsTriggerAlg.cc.

    : DybAlgorithm<DayaBay::SimTrigHeader>(name,pSvcLocator)
{
    m_trigToolNames.push_back("TsMultTriggerTool");
    m_trigToolNames.push_back("TsRpcTriggerTool");
    declareProperty("TrigTools",m_trigToolNames,
                    "Tools to generate Triggers");
    declareProperty("TriggerFilter",m_trigFilterName="TsSortTool",
                    "Tool to do final filtering / combining of triggers");
    declareProperty("TrigName", m_trigName = "TriggerAlg",
                    "Name of this Trigger Algorithm for book keeping purposes.");
    declareProperty("ElecLocation",m_elecLocation=DayaBay::ElecHeaderLocation::Default,
                    "Location in the TES where the input ElecHeader is to be put.");
}
TsTriggerAlg::~TsTriggerAlg ( ) [virtual]

Definition at line 24 of file TsTriggerAlg.cc.

{
}

Member Function Documentation

StatusCode TsTriggerAlg::initialize ( ) [virtual]

Definition at line 28 of file TsTriggerAlg.cc.

{
    for (size_t ind=0; ind < m_trigToolNames.size(); ++ind) {
        std::string tgr = m_trigToolNames[ind];
        try {
            m_trigTools.push_back(tool<ITsTriggerTool>(tgr));
        }
        catch(const GaudiException& exg) {
            fatal() << "Failed to get Trigger Tool: \"" << tgr << "\"" << endreq;
            return StatusCode::FAILURE;
        }
        info () << "Added trigger tool " << tgr << endreq;
    }
    try {
        m_triggerSorter = tool<ITsTriggerTool>(m_trigFilterName);
    }
    catch(const GaudiException& exg){
        fatal() << "Failed to get TriggerFilterTool: \"" << m_trigFilterName
                << "\"" << endreq;
        return StatusCode::FAILURE;
    }

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

Definition at line 53 of file TsTriggerAlg.cc.

{
    // Look for pre-existing header object or make new one
    DayaBay::SimTrigHeader* trigHeader = MakeHeaderObject();
    trigHeader->setCommandHeader(new DayaBay::SimTrigCommandHeader(trigHeader));

    DayaBay::ElecHeader* elecHeader = getTES<DayaBay::ElecHeader>(m_elecLocation);

    //set triggers to have same validity range as the crate it belongs to.

    trigHeader->setTimeStamp(elecHeader->timeStamp());
    TimeStamp earliest = elecHeader->earliest();
    TimeStamp latest = elecHeader->latest();

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

    // Let each tool do its thing on the event
    for (size_t ind = 0; ind< m_trigTools.size(); ++ind) {
        debug () << "Running trigger tool #" << ind << " " << m_trigToolNames[ind] << endreq;
        if (m_trigTools[ind]->mutate(trigHeader,*elecHeader).isFailure()) {
            fatal() << "Trigger Tool " << m_trigToolNames[ind]
                    << " failed" << endreq;
            return StatusCode::FAILURE;
        }
    }
    if ( m_triggerSorter->mutate(trigHeader,*elecHeader).isFailure()){
        fatal() << "Trigger Tool " << m_triggerSorter
                << " failed" << endreq;
        return StatusCode::FAILURE;
    }
    // HeaderObject base
    return StatusCode::SUCCESS;
}
StatusCode TsTriggerAlg::finalize ( ) [virtual]

Definition at line 89 of file TsTriggerAlg.cc.

{
    debug() << "finalizing TsTriggerAlg" << endreq;

    // Tools seem to be released by the base class.

    //for (size_t ind=0; ind < m_trigTools.size(); ++ind) {
        //verbose() << "Releasing " << m_trigTools[ind] << endreq;
        //m_trigTools[ind]->release();
    //}
    //m_triggerSorter->release();

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.


Member Data Documentation

std::vector<std::string> TsTriggerAlg::m_trigToolNames [private]

Tool to do triggering.

Definition at line 32 of file TsTriggerAlg.h.

std::vector<ITsTriggerTool*> TsTriggerAlg::m_trigTools [private]

Definition at line 33 of file TsTriggerAlg.h.

std::string TsTriggerAlg::m_trigName [private]

Definition at line 35 of file TsTriggerAlg.h.

std::string TsTriggerAlg::m_elecLocation [private]

Definition at line 36 of file TsTriggerAlg.h.

std::string TsTriggerAlg::m_trigFilterName [private]

Definition at line 37 of file TsTriggerAlg.h.

Definition at line 38 of file TsTriggerAlg.h.

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

std::string DybAlgorithm< DayaBay::SimTrigHeader >::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:16:52 for TrigSim by doxygen 1.7.4