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

#include <ReadoutProcessorAlg.h>

List of all members.

Public Member Functions

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

Private Attributes

std::vector< std::string > m_toolNames
std::vector< IReadoutProcessor * > m_tools

Detailed Description

Definition at line 19 of file ReadoutProcessorAlg.h.


Constructor & Destructor Documentation

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

Definition at line 6 of file ReadoutProcessorAlg.cc.

  : GaudiAlgorithm(name,pSvcLocator),
    m_tools()
{
  declareProperty("Tools", m_toolNames,
                  "List of tool names to apply to the readout");
}
ReadoutProcessorAlg::~ReadoutProcessorAlg ( ) [virtual]

Definition at line 15 of file ReadoutProcessorAlg.cc.

{
}

Member Function Documentation

StatusCode ReadoutProcessorAlg::initialize ( ) [virtual]

Definition at line 19 of file ReadoutProcessorAlg.cc.

{
  // Initialize the tools you want to use to process the readout
  std::vector<std::string>::iterator toolNameIter, 
    toolNameEnd=m_toolNames.end();
  for(toolNameIter=m_toolNames.begin(); toolNameIter!=toolNameEnd; 
      toolNameIter++){
    IReadoutProcessor* currentTool = 0;
    try {
      currentTool = tool<IReadoutProcessor>(*toolNameIter);
    }
    catch(const GaudiException& exg) {
      fatal() << "Failed to get tool: \"" << *toolNameIter << "\"" << endreq;
      return StatusCode::FAILURE;
    }
    m_tools.push_back(currentTool);
    info() << "Added tool " << *toolNameIter << endreq;
  }
  return StatusCode::SUCCESS;
}
StatusCode ReadoutProcessorAlg::execute ( ) [virtual]

Definition at line 40 of file ReadoutProcessorAlg.cc.

{
  // Add the current event into histograms
  DayaBay::ReadoutHeader* readoutHeader = 
    get<DayaBay::ReadoutHeader>("/Event/Readout/ReadoutHeader");
  if(!readoutHeader){
    error() << "Failed to get readout header." << endreq;
    return StatusCode::FAILURE;
  }

  // Process readouts using the list of tools 
  StatusCode sc;
  std::vector<IReadoutProcessor*>::iterator toolIter, toolEnd=m_tools.end();
  for(toolIter=m_tools.begin(); toolIter!=toolEnd; toolIter++){
    IReadoutProcessor* readoutTool = *toolIter;
    sc = readoutTool->process( readoutHeader );
    if( !sc.isSuccess() ) return sc;
  }

  return StatusCode::SUCCESS;
}
StatusCode ReadoutProcessorAlg::finalize ( ) [virtual]

Definition at line 62 of file ReadoutProcessorAlg.cc.

{
  // Clean up tools
  std::vector<IReadoutProcessor*>::iterator toolIter, toolEnd=m_tools.end();
  for(toolIter=m_tools.begin(); toolIter!=toolEnd; toolIter++){
    IReadoutProcessor* readoutTool = *toolIter;
    if(readoutTool) readoutTool->release();
  }
  return StatusCode::SUCCESS;
}

Member Data Documentation

std::vector<std::string> ReadoutProcessorAlg::m_toolNames [private]

Definition at line 32 of file ReadoutProcessorAlg.h.

Definition at line 35 of file ReadoutProcessorAlg.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:01:37 for ProcessTools by doxygen 1.7.4