/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
ContCycler Class Reference

#include <ContCycler.h>

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

List of all members.

Public Types

typedef std::deque< Data * >
::iterator 
Iterator

Public Member Functions

 ContCycler (const std::string &name)
virtual ~ContCycler ()
virtual bool initialize ()
virtual bool finalize ()
virtual PhyEventnext (int)
const std::string & name ()
bool setOption (const std::string &option, Type &var)
Iterator begin ()
Iterator current ()
Iterator end ()
Iterator find (const Data *data)
Iterator seek (int pos)
Data * curEvt ()
Data * seekEvt (int pos)
int totalSize ()
int forwardSize ()
int backwardSize ()
void clear ()
void clear ()
void clear ()

Protected Member Functions

PhyEventnextAD ()

Protected Attributes

int m_shift
NormCyclerm_is
std::string m_isName
std::string m_name
unsigned int m_iCur
std::deque< Data * > m_dBuf

Detailed Description

Definition at line 10 of file ContCycler.h.


Constructor & Destructor Documentation

ContCycler::ContCycler ( const std::string &  name)

Definition at line 8 of file ContCycler.cc.

    : SvcBase(name),
      m_shift(1)
{
    m_name = "ContCycler";  //to avoid naming confusion
    m_iCur = 0;
    setOption("Input", m_isName = "SelCycler");
}
ContCycler::~ContCycler ( ) [virtual]

Definition at line 17 of file ContCycler.cc.

{
}

Member Function Documentation

bool ContCycler::initialize ( ) [virtual]

Implements SvcBase.

Definition at line 21 of file ContCycler.cc.

{
    m_is = SvcMgr::get<NormCycler>(m_isName, true);
    if ( m_is != 0 ) {
        LogDebug << "Set the InputSvc: " << m_isName << " = " << m_is << std::endl;
        return true;
    }
    return false;
}
bool ContCycler::finalize ( ) [virtual]

Implements SvcBase.

Definition at line 31 of file ContCycler.cc.

{
    PhyEventBuf::clear();
    return true;
}
PhyEvent * ContCycler::next ( int  ) [virtual]

Implements ICycler.

Definition at line 37 of file ContCycler.cc.

{
    PhyEventBuf::clear();
    PhyEvent* first = (PhyEvent*)(m_is->next(m_shift));
    while ( first != 0 && !first->isAD() ) first = (PhyEvent*)(m_is->next());
    m_shift = 0;

    while ( first != 0 ) {
        PhyEvent* aAD = first;
        PhyEvent* bAD = nextAD();
        while ( bAD != 0 && (bAD->m_trigTime-aAD->m_trigTime) < 2e-4 ) {
            m_dBuf.push_back(bAD->GrabInstance());
            aAD = bAD;
            bAD = nextAD();
        }
        if ( m_dBuf.size() != 0 ) {
            m_dBuf.push_front(first->GrabInstance());
            break;
        }
        first = (PhyEvent*)(m_is->next(m_shift));
        m_shift = 0;
    }

    return first;
}
PhyEvent * ContCycler::nextAD ( ) [protected]

Definition at line 63 of file ContCycler.cc.

{
    PhyEventBuf::Iterator end = m_is->end();
    for ( PhyEventBuf::Iterator it = m_is->current()+m_shift+1; it != end; ++it ) {
        ++m_shift;
        if ( (*it)->isAD() ) return (*it);
    }

    PhyEvent* nAD = 0;
    do {
        nAD = m_is->expand();
        ++m_shift;
    } while ( nAD != 0 && !nAD->isAD() );

    return nAD;
}

Member Data Documentation

int ContCycler::m_shift [protected]

Definition at line 29 of file ContCycler.h.

Definition at line 30 of file ContCycler.h.

std::string ContCycler::m_isName [protected]

Definition at line 31 of file ContCycler.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 09:51:00 for ContCycler by doxygen 1.7.4