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

#include <MixRootEvtSelector.h>

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

List of all members.

Public Member Functions

 MixRootEvtSelector (const std::string &name, ISvcLocator *svcloc)
virtual ~MixRootEvtSelector ()
virtual StatusCode initialize ()
StatusCode setEntry (RootIOEvtSelector::Context &rc, int entry) const
StatusCode createAddress (const IEvtSelector::Context &c, IOpaqueAddress *&iop) const
virtual StatusCode finalize ()
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 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
RootInputStreamm_controlStream
IMixingSvcm_mixSvc

Detailed Description

Definition at line 22 of file MixRootEvtSelector.h.


Constructor & Destructor Documentation

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

Definition at line 13 of file MixRootEvtSelector.cc.

                   :Service(name,svcloc)
                   ,RootIOEvtSelector(name,svcloc)
                   ,m_reqSeqName(""), m_controlStream(0)
{
  m_reqSeqName = DayaBay::RegistrationSequenceLocation::Default;
  declareProperty("ReqSeq",m_reqSeqName,
                  "TES/TFile path where to find the RegistrationSequence");
}
MixRootEvtSelector::~MixRootEvtSelector ( ) [virtual]

Definition at line 23 of file MixRootEvtSelector.cc.

{
  MsgStream log(msgSvc(), "MixRootEvtSelector");
  log << MSG::INFO << "MixRootEvtSelector::~MixIOEvtSelector()" << endreq;
}

Member Function Documentation

StatusCode MixRootEvtSelector::initialize ( ) [virtual]

Reimplemented from RootIOEvtSelector.

Definition at line 29 of file MixRootEvtSelector.cc.

{
  MsgStream log(msgSvc(), "MixRootEvtSelector");
  log << MSG::INFO << "initializing @" << (void*)this << endreq;
  log << MSG::DEBUG << "called " << this->name() << endreq;
  StatusCode sc = this->Service::initialize();
  if(sc.isFailure()) return sc;

  IService* isvc=0;
  sc = serviceLocator()->service("MixRootIOCnvSvc", "RootIOCnvSvc", isvc, false);
  if(sc.isFailure()) 
  {
    log << MSG::ERROR << "Conversion service MixRootIOCnvSvc"
        << " could not be retrieved" << endreq;
    return sc;
  }
  isvc->addRef();

  sc = isvc->queryInterface(IRootIOSvc::interfaceID(), (void**)&m_rioSvc);
  if(sc.isFailure()) 
  {
    log << MSG::ERROR << "Conversion service RootIOCnvSvc"
        << " does not implement IRootIOCnvSvc" << endreq;
    return sc;
  }

  log << MSG::INFO << "initialized @" << (void*)this
      << " got RootIOCnvSvc @" << (void*)m_rioSvc
      << endreq;

  sc = isvc->queryInterface(IMixingSvc::interfaceID(), (void**)&m_mixSvc);
  if(sc.isFailure()) 
  {
    log << MSG::ERROR << "Conversion service RootIOCnvSvc"
        << " does not implement IMixingSvc" << endreq;
    return sc;
  }

  log << MSG::INFO << "initialized @" << (void*)this
      << " got RootIOCnvSvc @" << (void*)m_mixSvc
      << endreq;

  return StatusCode::SUCCESS;
}
StatusCode MixRootEvtSelector::setEntry ( RootIOEvtSelector::Context rc,
int  entry 
) const [virtual]

Reimplemented from RootIOEvtSelector.

Definition at line 74 of file MixRootEvtSelector.cc.

{
  MsgStream log(msgSvc(), "MixRootEvtSelector");
  log << MSG::DEBUG << "SetEntry(" << entry << ")" << endreq;
  log << MSG::DEBUG << "Mix Context: "<< rc.m_entry << endreq;

  StatusCode sc = m_mixSvc->buildStream();
  if(sc.isFailure())
  {
    log<< MSG::DEBUG<< "Now the entry is: "<< entry<< endreq;
    return StatusCode::FAILURE;
  }

  log << MSG::DEBUG << "Now ,read in other headers" << endreq;
  IRootIOSvc::InputStreamMap& ism = m_rioSvc->inputStreams();
  m_controlStream = ism[m_reqSeqName];
  if(!m_controlStream) 
  {
    log << MSG::ERROR << "failed to get control stream at " << m_reqSeqName << endreq;
    return StatusCode::FAILURE;
  }
  rc.m_entry = entry;
  return StatusCode::SUCCESS;
}
StatusCode MixRootEvtSelector::createAddress ( const IEvtSelector::Context &  c,
IOpaqueAddress *&  iop 
) const [virtual]

Reimplemented from RootIOEvtSelector.

Definition at line 99 of file MixRootEvtSelector.cc.

{
  MsgStream log(msgSvc(), "MixRootEvtSelector");
  log << MSG::DEBUG << "createAddress" << endreq;
  const MixRootEvtSelector::Context* rc = dynamic_cast<const MixRootEvtSelector::Context*>(&c);
  if(!rc) 
  {
    log << MSG::ERROR << "Failed to get MixRootIOEvtSelector::Context" << endreq;
    return StatusCode::FAILURE;
  }

  RootInputAddress* ria = new RootInputAddress(DataObject::classID(),"/Event");
  MixHeader mh = m_mixSvc->fetchMixHeader();
  ria->setEntry(mh.entry);
  iop = ria;
  log << MSG::DEBUG << "createAddress for /Event" << endreq;
  return StatusCode::SUCCESS;
}

Member Data Documentation

std::string MixRootEvtSelector::m_reqSeqName [private]

Definition at line 33 of file MixRootEvtSelector.h.

Definition at line 34 of file MixRootEvtSelector.h.

Definition at line 35 of file MixRootEvtSelector.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:21 for Mixing by doxygen 1.7.4