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

#include <SelCycler.h>

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

List of all members.

Public Types

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

Public Member Functions

 SelCycler (const std::string &name)
virtual ~SelCycler ()
virtual bool initialize ()
virtual bool finalize ()
virtual EvtObjectnext (int nth=1)
virtual PhyEventexpand ()
PhyEventBufdataBuffer ()
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

virtual void pushBack (PhyEvent *evt)
virtual void trimDated ()
virtual void fillFresh ()

Protected Attributes

ICyclerm_is
PhyEventm_cur
PhyEventm_theBeyond
UserBufMgrm_userBufMgr
std::vector< double > m_window
std::string m_name
unsigned int m_iCur
std::deque< Data * > m_dBuf

Private Member Functions

virtual PhyEventtheNext ()

Private Attributes

bool m_keepFirstEvtEachFile
HallsTimeSyncm_hallsSync
std::vector< ITagBase * > m_tags

Detailed Description

Definition at line 9 of file SelCycler.h.


Constructor & Destructor Documentation

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

Definition at line 10 of file SelCycler.cc.

    : NormCycler(name)
{
    m_name = "SelCycler";  //to avoid naming confusion
    // Keep the first event of each file for livetime calculation
    setOption("KeepFirstEvtEachFile", m_keepFirstEvtEachFile = false);

    bool fromMuon, hallsSync;
    setOption("StartFromFirstMuon",   fromMuon = false);
    setOption("HallsTimeSync",        hallsSync = false);

    m_hallsSync = hallsSync ? new HallsTimeSync : 0;

    std::vector<std::string> tags;
    setOption("Tags", tags);

    if ( fromMuon ) tags.push_back("FirstMuonTag");

    for(std::vector<std::string>::iterator it = tags.begin(); it != tags.end(); ++it) {
        ITagBase* tag = static_cast<ITagBase*>(ToolMgr::get(*it, true));
        if ( tag != 0 ) {
            m_tags.push_back(tag);
        }
        else {
            std::string msg = std::string("@ SelCycler constructor: invalid tool ") + *it;
            throw LafException(msg);
        }
    }
}
SelCycler::~SelCycler ( ) [virtual]

Definition at line 40 of file SelCycler.cc.

{
}

Member Function Documentation

PhyEvent * SelCycler::theNext ( ) [private, virtual]

Reimplemented from NormCycler.

Definition at line 44 of file SelCycler.cc.

{
    int nTag = m_tags.size();
    PhyEvent* _next = 0;
    while ( (_next=(PhyEvent*)(m_is->next())) != 0 ) {
        if ( m_hallsSync && ! m_hallsSync->validate(_next) ) {
            _next->ReleaseInstance();
            continue;
        }
        for ( int i = 0; i < nTag; ++i ) {
            if ( m_tags[i]->tag(_next) ) {
                if ( m_keepFirstEvtEachFile && _next->m_localEntry == 0 ) continue;
                _next->ReleaseInstance();  //delete _next;
                _next = 0;
                break;
            }
        }
        if ( _next != 0 ) break;
    }
    return _next;
}

Member Data Documentation

Definition at line 20 of file SelCycler.h.

Definition at line 22 of file SelCycler.h.

std::vector<ITagBase*> SelCycler::m_tags [private]

Definition at line 24 of file SelCycler.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:50:56 for SelCycler by doxygen 1.7.4