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

#include <CalibProcessorAlg.h>

List of all members.

Public Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 19 of file CalibProcessorAlg.h.


Constructor & Destructor Documentation

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

Definition at line 6 of file CalibProcessorAlg.cc.

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

Definition at line 15 of file CalibProcessorAlg.cc.

{
}

Member Function Documentation

StatusCode CalibProcessorAlg::initialize ( ) [virtual]

Definition at line 19 of file CalibProcessorAlg.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++){
    ICalibProcessor* currentTool = 0;
    try {
      currentTool = tool<ICalibProcessor>(*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 CalibProcessorAlg::execute ( ) [virtual]

Definition at line 40 of file CalibProcessorAlg.cc.

{
  // Process the current calibrated data
  DayaBay::CalibReadoutHeader* calibHeader = 
    get<DayaBay::CalibReadoutHeader>("/Event/CalibReadout/CalibReadoutHeader");
  if(!calibHeader){
    error() << "Failed to get calibrated data header." << endreq;
    return StatusCode::FAILURE;
  }

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

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

Definition at line 62 of file CalibProcessorAlg.cc.

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

Member Data Documentation

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

Definition at line 32 of file CalibProcessorAlg.h.

Definition at line 35 of file CalibProcessorAlg.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