/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes
ReconAlg Class Reference

#include <ReconAlg.h>

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

List of all members.

Classes

class  Configure

Public Member Functions

 ReconAlg (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~ReconAlg ()
virtual StatusCode initialize ()
virtual StatusCode execute ()
virtual StatusCode finalize ()
DayaBay::RecHeaderGetCurrentHeaderObject () 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::RecHeaderMakeHeaderObject ()
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::string m_prefitLocation
 Property prefitLocation - location in TES where the input Prefit Location is to be found.
std::vector< std::string > m_reconToolNames
std::vector< IReconTool * > m_reconTools
bool m_recSkimData
list __all__ = ['Configure','ReconAlgConf']

Detailed Description

Definition at line 22 of file ReconAlg.h.


Constructor & Destructor Documentation

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

Definition at line 13 of file ReconAlg.cc.

  : DybAlgorithm<DayaBay::RecHeader>(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("PrefitLocation", 
                  m_prefitLocation="",
                  "Set location of prefit for start of reconstruction");

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

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

Definition at line 35 of file ReconAlg.cc.

{
}

Member Function Documentation

StatusCode ReconAlg::initialize ( ) [virtual]

Definition at line 39 of file ReconAlg.cc.

{
  // Setup reconstruction styles and get tools
  for(unsigned int toolIdx = 0; toolIdx < m_reconToolNames.size(); toolIdx++){
    std::string toolName = m_reconToolNames[toolIdx];
    IReconTool* currentTool = 0;
    try {
      currentTool = tool<IReconTool>(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 ReconAlg::execute ( ) [virtual]

Definition at line 60 of file ReconAlg.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 header
  DayaBay::RecHeader* recHeader = 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();
  recHeader->setContext(context);
  recHeader->setEarliest(calibHeader->earliest());
  recHeader->setLatest(calibHeader->latest());

  DayaBay::RecTrigger& recTrigger = recHeader->recTrigger();

  // Get Calibrated Readout
  const DayaBay::CalibReadout* calibReadout = calibHeader->calibReadout();
  if(!calibReadout) {
    //info() << "No CalibReadout retrieved this cycle." << endreq;
    recTrigger.setEnergyStatus(ReconStatus::kUnknown);
    recTrigger.setPositionStatus(ReconStatus::kUnknown);
    recTrigger.setDirectionStatus(ReconStatus::kUnknown);
    return StatusCode::SUCCESS;
  }

  if(m_prefitLocation.size()>0){
    // Get prefitHeader from TES using m_prefitLocation
    DayaBay::RecHeader* prefitHeader = 
      getTES<DayaBay::RecHeader>(m_prefitLocation);
    if(!prefitHeader) {
      error() << "Get no Prefit RecHeader from TES: " << m_prefitLocation << endreq;
      return StatusCode::FAILURE;
    }
    // Copy prefit (prefitHeader recTrigger) into current reconstruction (recHeader recTrigger)
    DayaBay::RecTrigger& prefitTrigger = prefitHeader->recTrigger();
    recTrigger.setPositionStatus(prefitTrigger.positionStatus());
    recTrigger.setPositionQuality(prefitTrigger.positionQuality());
    recTrigger.setPosition(prefitTrigger.position());

    recTrigger.setEnergyStatus(prefitTrigger.energyStatus());
    recTrigger.setRawEvis(prefitTrigger.rawEvis());
    recTrigger.setEnergy(prefitTrigger.energy());
    recTrigger.setEnergyQuality(prefitTrigger.energyQuality());
  }

  // 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();
  
  recTrigger.setDetector(det);
  recTrigger.setTriggerNumber(triggerNumber);
  recTrigger.setTriggerTime(triggerTime);
  recTrigger.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, recTrigger);
    if(sc != StatusCode::SUCCESS) return sc;
  }

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

Definition at line 150 of file ReconAlg.cc.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.


Member Data Documentation

std::string ReconAlg::m_calibLocation [private]

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

Default is DayaBay::CalibReadoutHeaderLocation::Default

Definition at line 38 of file ReconAlg.h.

std::string ReconAlg::m_calibStatsLocation [private]

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

Default is "/Event/Data/CalibStats"

Definition at line 44 of file ReconAlg.h.

std::string ReconAlg::m_prefitLocation [private]

Property prefitLocation - location in TES where the input Prefit Location is to be found.

Default is "" (i.e. no prefit)

Definition at line 50 of file ReconAlg.h.

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

Definition at line 54 of file ReconAlg.h.

std::vector<IReconTool*> ReconAlg::m_reconTools [private]

Definition at line 57 of file ReconAlg.h.

bool ReconAlg::m_recSkimData [private]

Definition at line 60 of file ReconAlg.h.

list ReconAlg::__all__ = ['Configure','ReconAlgConf'] [private]

Definition at line 3 of file __init__.py.

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

std::string DybAlgorithm< DayaBay::RecHeader >::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