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

#include <ROsSequencerAlg.h>

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

List of all members.

Public Member Functions

 ROsSequencerAlg (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~ROsSequencerAlg ()
virtual StatusCode initialize ()
virtual StatusCode execute ()
virtual StatusCode finalize ()
DayaBay::ReadoutHeaderGetCurrentHeaderObject () 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::ReadoutHeaderMakeHeaderObject ()
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_simRoLocation
std::string m_roLocation

Detailed Description

Definition at line 20 of file ROsSequencerAlg.h.


Constructor & Destructor Documentation

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

Definition at line 7 of file ROsSequencerAlg.cc.

  : DybAlgorithm<DayaBay::ReadoutHeader>(name,pSvcLocator)
{
    declareProperty("SimReadoutLocation",m_simRoLocation=DayaBay::SimReadoutHeaderLocation::Default,
                    "Location in the TES where the input SimReadoutHeader is to be found.");
    declareProperty("ReadoutLocation",m_roLocation=DayaBay::ReadoutHeaderLocation::Default,
                    "Location in the TES where the output ReadoutHeader is to be put.");

}
ROsSequencerAlg::~ROsSequencerAlg ( ) [virtual]

Definition at line 18 of file ROsSequencerAlg.cc.

{
}

Member Function Documentation

StatusCode ROsSequencerAlg::initialize ( ) [virtual]

Definition at line 22 of file ROsSequencerAlg.cc.

{
  return this->GaudiAlgorithm::initialize();
}
StatusCode ROsSequencerAlg::execute ( ) [virtual]

Definition at line 27 of file ROsSequencerAlg.cc.

{
    // Look for pre-existing header object or make new one
    DayaBay::ReadoutHeader* roHeader = MakeHeaderObject();
    
    DayaBay::SimReadoutHeader* simReadoutHeader 
      = getTES<DayaBay::SimReadoutHeader>(m_simRoLocation);

    TimeStamp earliest = simReadoutHeader->earliest();
    TimeStamp latest = simReadoutHeader->latest();
    
    roHeader->setEarliest(earliest);
    roHeader->setLatest(latest);

    Context context = simReadoutHeader->context();
    
    
    
    const DayaBay::SimReadoutHeader::SimReadoutContainer& simReadouts
      = simReadoutHeader->readouts();
    DayaBay::SimReadoutHeader::SimReadoutContainer::const_iterator simReadoutIter 
      = simReadouts.begin();

    if(simReadouts.size() >= 1){
      const DayaBay::SimReadout* simReadout = *simReadoutIter;
      DayaBay::Detector det(simReadout->readout()->detector());
      context.SetSite(det.site());
      context.SetDetId(det.detectorId());

      if(det.detectorId() == DetectorId::kAD1
         || det.detectorId() == DetectorId::kAD2
         || det.detectorId() == DetectorId::kAD3
         || det.detectorId() == DetectorId::kAD4
         || det.detectorId() == DetectorId::kIWS
         || det.detectorId() == DetectorId::kOWS){
        const DayaBay::ReadoutPmtCrate* pmtReadout 
          = dynamic_cast<const DayaBay::ReadoutPmtCrate*>(simReadout->readout());
        if(!pmtReadout){
          error() << "Readout from detector " << det 
                  << " is not a PMT Crate readout." << endreq;
          return StatusCode::FAILURE;
        }
        DayaBay::ReadoutPmtCrate* readout 
          = new DayaBay::ReadoutPmtCrate(*pmtReadout);
        readout->setHeader(roHeader);
        roHeader->setReadout(readout);
      }else if(det.detectorId() == DetectorId::kRPC){
        const DayaBay::ReadoutRpcCrate* rpcReadout 
          = dynamic_cast<const DayaBay::ReadoutRpcCrate*>(simReadout->readout());
        if(!rpcReadout){
          error() << "Readout from detector " << det 
                  << " is not an RPC Crate readout." << endreq;
          return StatusCode::FAILURE;
        }
        DayaBay::ReadoutRpcCrate* readout 
          = new DayaBay::ReadoutRpcCrate(*rpcReadout);
        readout->setHeader(roHeader);
        roHeader->setReadout(readout);
      }else{
        error() << "Unknown detector " << det 
                << " for readout " << simReadout << endreq;
        return StatusCode::FAILURE;
      }
      if(simReadouts.size() > 1){
        warning() << "Simulation produced " << simReadouts.size()
                  <<" readouts, ignoring all but first."  << endreq;
      }
    }else{
      roHeader->setReadout(0);
      info() << "No Readouts produced this cycle." << endreq;
      context.SetSite(Site::kUnknown);
      context.SetDetId(DetectorId::kUnknown);
    }
    roHeader->setContext(context);
    return StatusCode::SUCCESS;
}
StatusCode ROsSequencerAlg::finalize ( ) [virtual]

Definition at line 104 of file ROsSequencerAlg.cc.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.


Member Data Documentation

std::string ROsSequencerAlg::m_simRoLocation [private]

Definition at line 31 of file ROsSequencerAlg.h.

std::string ROsSequencerAlg::m_roLocation [private]

Definition at line 32 of file ROsSequencerAlg.h.

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

std::string DybAlgorithm< DayaBay::ReadoutHeader >::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:17:06 for ReadoutSim by doxygen 1.7.4