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

#include <CalibAlg.h>

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

List of all members.

Classes

class  Configure

Public Member Functions

 CalibAlg (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~CalibAlg ()
virtual StatusCode initialize ()
virtual StatusCode execute ()
virtual StatusCode finalize ()
DayaBay::CalibReadoutHeaderGetCurrentHeaderObject () 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::CalibReadoutHeaderMakeHeaderObject ()
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_roLocation
 Property ReadoutLocation - location in TES where the input ReadoutHeader is to be found.
std::string m_calibRoLocation
 Property CalibReadoutLocation - location in TES where the output CalibReadoutHeader is to be found.
std::string m_calibRpcToolName
ICalibToolm_calibRpcTool
std::string m_calibPmtToolName
ICalibToolm_calibPmtTool
list __all__ = ['Configure','CalibAlgConf']

Detailed Description

Definition at line 21 of file CalibAlg.h.


Constructor & Destructor Documentation

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

Definition at line 17 of file CalibAlg.cc.

  : DybAlgorithm<DayaBay::CalibReadoutHeader>(name,pSvcLocator)
  , m_calibRpcTool(0)
  , m_calibPmtTool(0)
{
  declareProperty("ReadoutLocation", 
                  m_roLocation=DayaBay::ReadoutHeaderLocation::Default,
                  "ReadoutHeader location in the TES.");

  declareProperty("CalibReadoutLocation", 
                 m_calibRoLocation=DayaBay::CalibReadoutHeaderLocation::Default,
                 "CalibHeader location in the TES.");

  declareProperty("RpcCalibTool", m_calibRpcToolName="SimpRpcCalibTool",
                  "Tool to calibrate RPC readouts");

  declareProperty("PmtCalibTool", m_calibPmtToolName="SimpPmtCalibTool",
                  "Tool to calibrate PMT readouts");
}
CalibAlg::~CalibAlg ( ) [virtual]

Definition at line 37 of file CalibAlg.cc.

{
}

Member Function Documentation

StatusCode CalibAlg::initialize ( ) [virtual]

Definition at line 41 of file CalibAlg.cc.

{
  // Get RPC calibration Tool
  try {
    m_calibRpcTool = tool<ICalibTool>(m_calibRpcToolName);
  }
  catch(const GaudiException& exg) {
    fatal() << "Failed to get Calib Tool: \"" << m_calibRpcToolName << "\"" << endreq;
    return StatusCode::FAILURE;
  }
  info () << "Added calib tool " << m_calibRpcToolName << endreq;

  try {
    m_calibPmtTool = tool<ICalibTool>(m_calibPmtToolName);
  }
  catch(const GaudiException& exg) {
    fatal() << "Failed to get Calib Tool: \"" << m_calibPmtToolName << "\"" << endreq;
    return StatusCode::FAILURE;
  }
  info () << "Added calib tool " << m_calibPmtToolName << endreq;

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

Definition at line 65 of file CalibAlg.cc.

{
  StatusCode sc;

  // Get ReadoutHeader. If nonexistent, skip event.
  if (!exist<DayaBay::ReadoutHeader>(m_roLocation))
    return StatusCode::SUCCESS;

  DayaBay::ReadoutHeader* roHeader = getTES<DayaBay::ReadoutHeader>(m_roLocation);

  // Create output calib header
  DayaBay::CalibReadoutHeader* calibHeader = MakeHeaderObject();

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

  // Get Readout  
  const DayaBay::DaqCrate* readout = roHeader->daqCrate();
  const DayaBay::Detector& detector = readout->detector();
  unsigned int eventNumber = readout->eventNumber();
  const TimeStamp& triggerTime = readout->triggerTime();
  const DayaBay::Trigger::TriggerType_t& triggerType = readout->triggerType();

  debug() << "detector: " << detector << endreq;
  debug() << "eventNumber: " << eventNumber << endreq;
  debug() << "triggerTime: " << triggerTime << endreq;
  debug() << "triggerType: " << triggerType << "," << DayaBay::Trigger::AsString(triggerType) << endreq;

  if(detector.isAD() || detector.isWaterShield()){
    // Pmt based detectors calibration
    debug() << "create CalibReadoutPmtCrate " << endreq;
    DayaBay::CalibReadoutPmtCrate* calibReadout = 
      new DayaBay::CalibReadoutPmtCrate(detector, eventNumber, 
                                        triggerTime, triggerType);
    calibHeader->setCalibReadout(calibReadout);
    calibReadout->setHeader(calibHeader);
    debug() << "start calibration readout " << endreq;
    sc = m_calibPmtTool->calibration(readout, calibReadout);
    debug() << "finish calibration readout " << endreq;

  }else if(detector.detectorId() == DetectorId::kRPC){
    // RPC Based detectors Calibration
    DayaBay::CalibReadoutRpcCrate* calibReadout = 
      new DayaBay::CalibReadoutRpcCrate(detector,eventNumber, 
                                        triggerTime, triggerType);
    calibHeader->setCalibReadout(calibReadout);
    calibReadout->setHeader(calibHeader);
    sc = m_calibRpcTool->calibration(readout, calibReadout);

  }else {
    error() << "Unknown detector " << detector << endreq;
    return StatusCode::FAILURE;
  }

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

Definition at line 124 of file CalibAlg.cc.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.


Member Data Documentation

std::string CalibAlg::m_roLocation [private]

Property ReadoutLocation - location in TES where the input ReadoutHeader is to be found.

Default is DayaBay::ReadoutHeaderLocation::Default

Definition at line 37 of file CalibAlg.h.

std::string CalibAlg::m_calibRoLocation [private]

Property CalibReadoutLocation - location in TES where the output CalibReadoutHeader is to be found.

Default is DayaBay::CalibReadoutHeaderLocation::Default

Definition at line 43 of file CalibAlg.h.

std::string CalibAlg::m_calibRpcToolName [private]

Definition at line 46 of file CalibAlg.h.

Definition at line 49 of file CalibAlg.h.

std::string CalibAlg::m_calibPmtToolName [private]

Definition at line 52 of file CalibAlg.h.

Definition at line 55 of file CalibAlg.h.

list CalibAlg::__all__ = ['Configure','CalibAlgConf'] [private]

Definition at line 3 of file __init__.py.

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

std::string DybAlgorithm< DayaBay::CalibReadoutHeader >::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:14:11 for CalibAlg by doxygen 1.7.4