/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 Attributes | Private Attributes
DybEvtSelector Class Reference

Daya Bay specific RootIOEvtSelector. More...

#include <DybEvtSelector.h>

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

List of all members.

Public Member Functions

 DybEvtSelector (const std::string &name, ISvcLocator *svcloc)
virtual ~DybEvtSelector ()
virtual StatusCode initialize ()
virtual StatusCode finalize ()
virtual StatusCode setEntry (RootIOEvtSelector::Context &rc, int entry) const
 This will be called from the IEvtSelector navigation methods with the context prior to navigation (old entry) and the new entry.
virtual StatusCode createContext (IEvtSelector::Context *&c) const
virtual StatusCode next (IEvtSelector::Context &c) const
virtual StatusCode next (IEvtSelector::Context &c, int jump) const
virtual StatusCode previous (IEvtSelector::Context &c) const
virtual StatusCode previous (IEvtSelector::Context &c, int jump) const
virtual StatusCode last (IEvtSelector::Context &refContext) const
virtual StatusCode rewind (IEvtSelector::Context &c) const
virtual StatusCode createAddress (const IEvtSelector::Context &c, IOpaqueAddress *&iop) const
virtual StatusCode releaseContext (IEvtSelector::Context *&c) const
virtual StatusCode resetCriteria (const std::string &cr, IEvtSelector::Context &c) const
StatusCode queryInterface (const InterfaceID &riid, void **ppif)

Protected Attributes

IRootIOSvcm_rioSvc

Private Attributes

std::string m_reqSeqName
 Property: RegSeq.
IDybIODaqSvcm_daqSvc
RootInputStreamm_controlStream

Detailed Description

Daya Bay specific RootIOEvtSelector.

Know about RegistrationSequence in order to implement Daya Bay I/O policy.

bv@bnl.gov Thu Jul 10 16:43:18 2008

Definition at line 28 of file DybEvtSelector.h.


Constructor & Destructor Documentation

DybEvtSelector::DybEvtSelector ( const std::string &  name,
ISvcLocator *  svcloc 
)

Definition at line 16 of file DybEvtSelector.cc.

    : Service(name,svcloc)
    , RootIOEvtSelector(name,svcloc)
    , m_reqSeqName("")
    , m_daqSvc(0)
    , m_controlStream(0)/*, m_regCnv(0)*/
{
    m_reqSeqName = DayaBay::RegistrationSequenceLocation::Default;
    declareProperty("ReqSeq",m_reqSeqName,
                    "TES/TFile path where to find the RegistrationSequence");

}
DybEvtSelector::~DybEvtSelector ( ) [virtual]

Definition at line 29 of file DybEvtSelector.cc.

{
}

Member Function Documentation

StatusCode DybEvtSelector::initialize ( ) [virtual]

Reimplemented from RootIOEvtSelector.

Definition at line 33 of file DybEvtSelector.cc.

{
    StatusCode sc = RootIOEvtSelector::initialize();
    if (sc.isFailure()) {
      return sc;
    }

    IService* isvc=0;
    sc = serviceLocator()->service("DybIODaqSvc","DybIODaqSvc", isvc);
    if (sc.isFailure()) {
      m_daqSvc = 0;
    } else {
      sc = isvc->queryInterface(IDybIODaqSvc::interfaceID(), (void**)&m_daqSvc);
      if (sc.isFailure()) {
        m_daqSvc = 0;
      }
    }
    return StatusCode::SUCCESS;
}
StatusCode DybEvtSelector::finalize ( ) [virtual]

Reimplemented from RootIOEvtSelector.

Definition at line 53 of file DybEvtSelector.cc.

{
    if (0 != m_daqSvc) {
        m_daqSvc->release();
    }
    return RootIOEvtSelector::finalize();
}
StatusCode DybEvtSelector::setEntry ( RootIOEvtSelector::Context rc,
int  entry 
) const [virtual]

This will be called from the IEvtSelector navigation methods with the context prior to navigation (old entry) and the new entry.

By default this sets the context to the new entry and then loads all possible input streams to that entry.

Subclasses may override this method to enforce some other input policy.

Reimplemented from RootIOEvtSelector.

Definition at line 61 of file DybEvtSelector.cc.

{
    MsgStream log(msgSvc(), "DybEvtSelector");

    if (!m_controlStream) {
        IRootIOSvc::InputStreamMap& ism = m_rioSvc->inputStreams();
        m_controlStream = ism[m_reqSeqName];
        if (!m_controlStream) {
            log << MSG::WARNING << "failed to get control stream at " 
                << m_reqSeqName << endreq;
            return StatusCode::FAILURE;
        }
    }

    log << MSG::DEBUG << "Loading control stream (RegistrationSequence) entry " << entry << endreq;

    // Set entry to the RegistrationSequence
    if (0 != m_daqSvc) {
        StatusCode sc = m_daqSvc->setEventEntry(entry);
        if (sc.isFailure()) {
            log << MSG::INFO
                << "No more DAQ blocks are available"
                << endreq;
        }
    }

    bool okay = m_controlStream->setEntry(entry,false); // false == do not read TObject
    if (!okay) {
        log << MSG::WARNING << "Failed to set entry " << 
            entry << " for control input stream " << m_reqSeqName << endreq;
        log << MSG::WARNING << "End of the input stream?" << endreq;
        return StatusCode::FAILURE;
    }

    //IRootIOSvc::InputStreamMap& ism = m_rioSvc->inputStreams();

    rc.m_entry = entry;
    return StatusCode::SUCCESS;
}

Member Data Documentation

std::string DybEvtSelector::m_reqSeqName [private]

Property: RegSeq.

Name of TES/TFile path where the RegistrationSequence is to be found.

Definition at line 51 of file DybEvtSelector.h.

Definition at line 53 of file DybEvtSelector.h.

Definition at line 54 of file DybEvtSelector.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:15:57 for DybIO by doxygen 1.7.4