/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 Member Functions | Private Attributes
SimReadoutController Class Reference

#include <SimReadoutController.h>

Collaboration diagram for SimReadoutController:
Collaboration graph
[legend]

List of all members.

Public Member Functions

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

Private Member Functions

StatusCode decodeName ()
void membershipHandler (Property &theProp)

Private Attributes

StringProperty m_algSeqName
SimSequencerm_algSeq
IReadoutBufferSvcm_bufferSvc

Detailed Description

Definition at line 23 of file SimReadoutController.h.


Constructor & Destructor Documentation

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

Definition at line 6 of file SimReadoutController.cc.

  : GaudiAlgorithm(name,pSvcLocator)
{    
    declareProperty
      ( "algSeq" ,
        m_algSeqName="SimSequencer"  ,
        "Sequence algorithm to be turned on or off") ;

    m_algSeqName.declareUpdateHandler(& SimReadoutController::membershipHandler
                                     , this );
}
SimReadoutController::~SimReadoutController ( ) [virtual]

Definition at line 19 of file SimReadoutController.cc.

{
}

Member Function Documentation

StatusCode SimReadoutController::initialize ( ) [virtual]

Definition at line 23 of file SimReadoutController.cc.

{
   debug() << "Initializing: " << this->name() << endreq;

   m_bufferSvc = svc<IReadoutBufferSvc>("ReadoutBufferSvc",true);   
   
   return this->GaudiAlgorithm::initialize();
}
StatusCode SimReadoutController::execute ( ) [virtual]

Definition at line 32 of file SimReadoutController.cc.

{
    debug() << "executing: " << this->name() << endreq;
    
    // If the buffer has readouts waiting in it don't produce more
    // i.e. dont run the simulation sequence, skip right to readout stage.
    
    if( m_bufferSvc->hasMoreReadouts() )
    {
        verbose() << "Buffer Service has readout in buffer " 
                  << " so simulation subSequence will NOT execute" << endreq;    
        if(m_algSeq) m_algSeq->setExecuteThisEvent(false);
    }else{
        verbose() << "Buffer Service has empty buffer "
                << " so simulation subSequence WILL execute" << endreq; 
    }
       
    return StatusCode::SUCCESS;
}
StatusCode SimReadoutController::finalize ( ) [virtual]

Definition at line 52 of file SimReadoutController.cc.

{
    debug() << "Finalizing: " << this->name() << endreq;
    return this->GaudiAlgorithm::finalize();;
}
StatusCode SimReadoutController::decodeName ( ) [private]

Definition at line 61 of file SimReadoutController.cc.

                                              {

  //= Get the Application manager, to see if algorithm exist
  IAlgManager* appMgr = svc<IAlgManager>("ApplicationMgr");
  
 
  std::string theName( m_algSeqName.value() );
  std::string theType( m_algSeqName.value() );
  std::string::size_type slash = m_algSeqName.value().find_first_of( '/' );
  if ( slash != std::string::npos ) {
    theType = m_algSeqName.value().substr( 0, slash );
    theName = m_algSeqName.value().substr( slash+1 );
  }

  //== Check wether the specified algorithm already exists.
  
  IAlgorithm* myIAlg;
  StatusCode result = appMgr->getAlgorithm( theName, myIAlg );
  
  if ( result.isSuccess() )
  {
    m_algSeq = dynamic_cast<SimSequencer*>( myIAlg );

    if (m_algSeq != 0) 
    {
      m_algSeq->addRef();
      debug () << "Watching algorithm " << theName << endreq;
    }
    else 
    {
      fatal() << theName << " is not a SimSeq - failed dynamic_cast" << endreq;
      result = StatusCode::FAILURE;
    }
  }
  else 
  {
      fatal() << theName << " does not exist" << endreq;        
  }
  
  release(appMgr).ignore();
  
  return result;

}
void SimReadoutController::membershipHandler ( Property &  theProp) [private]

Definition at line 109 of file SimReadoutController.cc.

                                                         {
  decodeName().ignore();
}

Member Data Documentation

StringProperty SimReadoutController::m_algSeqName [private]

Definition at line 37 of file SimReadoutController.h.

Definition at line 38 of file SimReadoutController.h.

Definition at line 39 of file SimReadoutController.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:14:31 for SimSequencer by doxygen 1.7.4