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

#include <ReconProcessorAlg.h>

List of all members.

Public Member Functions

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

Private Attributes

std::string m_location
std::vector< std::string > m_toolNames
std::vector< IReconProcessor * > m_tools

Detailed Description

Definition at line 19 of file ReconProcessorAlg.h.


Constructor & Destructor Documentation

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

Definition at line 6 of file ReconProcessorAlg.cc.

  : GaudiAlgorithm(name,pSvcLocator),
    m_tools()
{
  declareProperty("Location", m_location="/Event/Rec/AdSimple",
                  "Location of reconstructed data");
  declareProperty("Tools", m_toolNames,
                  "List of tool names to apply to the recon data");
}
ReconProcessorAlg::~ReconProcessorAlg ( ) [virtual]

Definition at line 17 of file ReconProcessorAlg.cc.

{
}

Member Function Documentation

StatusCode ReconProcessorAlg::initialize ( ) [virtual]

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

Definition at line 42 of file ReconProcessorAlg.cc.

{
  // Add the current event into histograms
  DayaBay::RecHeader* reconHeader = 
    get<DayaBay::RecHeader>(m_location);
  if(!reconHeader){
    error() << "Failed to get reconstructed data header." << endreq;
    return StatusCode::FAILURE;
  }

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

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

Definition at line 64 of file ReconProcessorAlg.cc.

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

Member Data Documentation

std::string ReconProcessorAlg::m_location [private]

Definition at line 32 of file ReconProcessorAlg.h.

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

Definition at line 33 of file ReconProcessorAlg.h.

Definition at line 36 of file ReconProcessorAlg.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