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

#include <ReconRpcAlg.h>

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

List of all members.

Public Member Functions

 ReconRpcAlg (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~ReconRpcAlg ()
virtual StatusCode initialize ()
virtual StatusCode execute ()
virtual StatusCode finalize ()
DayaBay::RecRpcHeaderGetCurrentHeaderObject () 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::RecRpcHeaderMakeHeaderObject ()
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::string m_calibLocation
 Property CalibLocation - location in TES where the input CalibReadoutHeader is to be found.
std::string m_calibStatsLocation
 Property calibStatsLocation - location in TES where the input CalibStats is to be found.
std::vector< std::string > m_reconToolNames
std::vector< IReconRpcTool * > m_reconTools
bool m_recSkimData

Detailed Description

Definition at line 25 of file ReconRpcAlg.h.


Constructor & Destructor Documentation

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

Definition at line 18 of file ReconRpcAlg.cc.

  : DybAlgorithm<DayaBay::RecRpcHeader>(name,pSvcLocator)
{
  declareProperty("calibLocation", 
                  m_calibLocation=DayaBay::CalibReadoutHeaderLocation::Default,
                  "CalibReadoutHeader location in the TES.");

  declareProperty("calibStatsLocation", 
                  m_calibStatsLocation="/Event/Data/CalibStats",
                  "CalibStats location in the TES.");

  declareProperty("ReconTools", m_reconToolNames,
                  "List of Reconstruction tools");

  declareProperty("RecSkimData", m_recSkimData = false,
                  "Handle skimmed data");
}
ReconRpcAlg::~ReconRpcAlg ( ) [virtual]

Definition at line 36 of file ReconRpcAlg.cc.

{
}

Member Function Documentation

StatusCode ReconRpcAlg::initialize ( ) [virtual]

Definition at line 40 of file ReconRpcAlg.cc.

{
  // Setup reconstruction styles and get tools
  for(unsigned int toolIdx = 0; toolIdx < m_reconToolNames.size(); toolIdx++){
    std::string toolName = m_reconToolNames[toolIdx];
    IReconRpcTool* currentTool = 0;
    try {
      currentTool = tool<IReconRpcTool>(toolName);
    }
    catch(const GaudiException& exg) {
      fatal() << "Failed to get Recon tool: \"" << toolName << "\"" << endreq;
      return StatusCode::FAILURE;
    }
    m_reconTools.push_back(currentTool);
    info() << "Added recon tool " << toolName << " to path " 
           << this->Location() << endreq;
  }

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

Definition at line 61 of file ReconRpcAlg.cc.

{
  StatusCode sc;

  // If an input file is a skimmed data file, needs to skip events without CalibReadoutHeader
  if(m_recSkimData) {
    if(!exist<DayaBay::HeaderObject>(m_calibLocation)) {
      return StatusCode::SUCCESS;
    }
  }

  // Create output rec Rpc header
  DayaBay::RecRpcHeader* recRpcHeader = MakeHeaderObject();

  // Get CalibHeader from TES
  DayaBay::CalibReadoutHeader* calibHeader = 
    getTES<DayaBay::CalibReadoutHeader>(m_calibLocation);
  if(!calibHeader) {
    error() << "Get no CalibHeader from TES!!" << endreq;
    return StatusCode::FAILURE;
  }

  // Get CalibStats from TES, if available
  DayaBay::UserDataHeader* calibStats = 0;
  if( exist<DayaBay::UserDataHeader>(m_calibStatsLocation) ){
    calibStats = getTES<DayaBay::UserDataHeader>(m_calibStatsLocation);
    if(!calibStats) {
      error() << "Get no CalibStats from TES!!" << endreq;
      return StatusCode::FAILURE;
    }
  }

  Context context = calibHeader->context();
  recRpcHeader->setContext(context);
  recRpcHeader->setEarliest(calibHeader->earliest());
  recRpcHeader->setLatest(calibHeader->latest());

  DayaBay::RecRpcTrigger& recRpcTrigger = recRpcHeader->recTrigger();

  // Get Calibrated Readout
  const DayaBay::CalibReadout* calibReadout = calibHeader->calibReadout();
  if(!calibReadout) {
    //info() << "No CalibReadout retrieved this cycle." << endreq;
    //recRpcTrigger.setEnergyStatus(ReconStatus::kUnknown);
    //recRpcTrigger.setPositionStatus(ReconStatus::kUnknown);
    //recRpcTrigger.setDirectionStatus(ReconStatus::kUnknown);
    return StatusCode::SUCCESS;
  }
  
  // Get detector / trigger information 
  DayaBay::Detector det = calibReadout->detector();
  unsigned int triggerNumber = calibReadout->triggerNumber();
  const TimeStamp triggerTime = calibReadout->triggerTime();
  const DayaBay::Trigger::TriggerType_t triggerType 
    = calibReadout->triggerType();
  
  recRpcTrigger.setDetector(det);
  recRpcTrigger.setTriggerNumber(triggerNumber);
  recRpcTrigger.setTriggerTime(triggerTime);
  recRpcTrigger.setTriggerType(triggerType);
  
  // Run the recon tools for this style
  for(unsigned int toolIdx = 0; toolIdx < m_reconTools.size(); toolIdx++){
    sc = m_reconTools[toolIdx]->reconstruct(*calibReadout, recRpcTrigger);
    if(sc != StatusCode::SUCCESS) return sc;
  }

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

Definition at line 131 of file ReconRpcAlg.cc.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.


Member Data Documentation

std::string ReconRpcAlg::m_calibLocation [private]

Property CalibLocation - location in TES where the input CalibReadoutHeader is to be found.

Default is DayaBay::CalibReadoutHeaderLocation::Default

Definition at line 41 of file ReconRpcAlg.h.

std::string ReconRpcAlg::m_calibStatsLocation [private]

Property calibStatsLocation - location in TES where the input CalibStats is to be found.

Default is "/Event/Data/CalibStats"

Definition at line 47 of file ReconRpcAlg.h.

std::vector<std::string> ReconRpcAlg::m_reconToolNames [private]

Definition at line 51 of file ReconRpcAlg.h.

std::vector<IReconRpcTool*> ReconRpcAlg::m_reconTools [private]

Definition at line 54 of file ReconRpcAlg.h.

Definition at line 57 of file ReconRpcAlg.h.

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

std::string DybAlgorithm< DayaBay::RecRpcHeader >::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:11:26 for ReconAlg by doxygen 1.7.4