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

#include <MiniReconInputSvc.h>

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

List of all members.

Public Member Functions

 MiniReconInputSvc (const std::string &name)
virtual ~MiniReconInputSvc ()
virtual bool initialize ()
virtual bool finalize ()
virtual EvtObjectnext (int nth=1)
const std::string & fname (int num)
const std::string & name ()
bool setOption (const std::string &option, Type &var)

Protected Attributes

std::string m_name

Private Member Functions

void parse_files ()

Private Attributes

long m_entry
PerPhyEventm_evt
std::vector< std::string > m_files
std::string m_preferredRecTree
std::string m_preferredEnergy
RidxHandlerm_ridxHandler

Detailed Description

Definition at line 11 of file MiniReconInputSvc.h.


Constructor & Destructor Documentation

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

Definition at line 10 of file MiniReconInputSvc.cc.

    : SvcBase(name),
      m_entry(-1),
      m_evt(0),
      m_ridxHandler(0)
{
    m_name = "MiniReconInputSvc";  //to avoid naming confusion
    setOption("InputFiles",       m_files);
    setOption("PreferredRecTree", m_preferredRecTree = "Event/Rec/AdScaled");
    setOption("PreferredEnergy",  m_preferredEnergy  = "enrec");
    parse_files();
}
MiniReconInputSvc::~MiniReconInputSvc ( ) [virtual]

Definition at line 23 of file MiniReconInputSvc.cc.

{
}

Member Function Documentation

bool MiniReconInputSvc::initialize ( ) [virtual]

Implements SvcBase.

Definition at line 27 of file MiniReconInputSvc.cc.

bool MiniReconInputSvc::finalize ( ) [virtual]

Implements SvcBase.

Definition at line 34 of file MiniReconInputSvc.cc.

{
    delete m_evt;
    if ( m_ridxHandler != 0 ) delete m_ridxHandler;
    return true;
}
EvtObject * MiniReconInputSvc::next ( int  nth = 1) [virtual]

Implements ICycler.

Definition at line 41 of file MiniReconInputSvc.cc.

{
    PhyEvent* res = 0;
    m_entry += nth;
    if ( m_ridxHandler == 0 ) {
        res = m_evt->makePhyEvent(m_entry);
    }
    else {
        if ( m_ridxHandler->seek(m_entry) ) {
            res = m_evt->makePhyEvent(m_ridxHandler->fIndex(), m_ridxHandler->eIndex());
        }
    }
    return res;
}
const std::string & MiniReconInputSvc::fname ( int  num)

Definition at line 56 of file MiniReconInputSvc.cc.

{
    return m_files.at(num);
}
void MiniReconInputSvc::parse_files ( ) [private]

Definition at line 61 of file MiniReconInputSvc.cc.

{
    std::string first = m_files[0];
    if ( first.substr(first.length()-5) == ".list" ) {
        std::vector<std::string> infiles;
        for(std::vector<std::string>::iterator it=m_files.begin(); it!=m_files.end(); ++it){
            std::ifstream  fs((*it).c_str());
            std::string fname;
            while ( (fs>>fname).good() ) {
                //std::cout << fname << std::endl;
                infiles.push_back(fname);
            }
        }
        m_files = infiles;
    }

    first = m_files[0];
    if ( first.substr(first.length()-5) == ".ridx" ) {
        m_ridxHandler = new RidxHandler(m_files);
        m_files = m_ridxHandler->rootFiles();
    }

    first = m_files[0];
    if ( first.substr(first.length()-5) != ".root" ) {
        LogFatal << "Only .list/ridx/root input files are permitted !" << std::endl;
    }
}

Member Data Documentation

Definition at line 31 of file MiniReconInputSvc.h.

Definition at line 32 of file MiniReconInputSvc.h.

std::vector<std::string> MiniReconInputSvc::m_files [private]

Definition at line 34 of file MiniReconInputSvc.h.

Definition at line 35 of file MiniReconInputSvc.h.

std::string MiniReconInputSvc::m_preferredEnergy [private]

Definition at line 36 of file MiniReconInputSvc.h.

Definition at line 38 of file MiniReconInputSvc.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:03 for MiniReconInputSvc by doxygen 1.7.4