CMS 3D CMS Logo

Public Member Functions | Protected Attributes

fwlite::InputSource Class Reference

#include <InputSource.h>

List of all members.

Public Member Functions

const std::vector< std::string > & files () const
 return vector of files_
 InputSource (const edm::ParameterSet &cfg)
 default constructor from parameter set
 InputSource ()
 empty constructor
int maxEvents () const
 return maxEvetns_
unsigned int reportAfter () const
 return reportAfter_

Protected Attributes

std::vector< std::string > files_
 vector of input files
int maxEvents_
 maximal number of events to loop
unsigned int reportAfter_
 report after N events

Detailed Description

Definition at line 18 of file InputSource.h.


Constructor & Destructor Documentation

fwlite::InputSource::InputSource ( ) [inline]

empty constructor

Definition at line 22 of file InputSource.h.

References Exception.

                  {
      throw cms::Exception("InvalidInput") << "Must specify a vstring fileNames" << std::endl;
    }
fwlite::InputSource::InputSource ( const edm::ParameterSet cfg) [inline]

default constructor from parameter set

Definition at line 26 of file InputSource.h.

References edm::ParameterSet::getParameterSet(), maxEvents_, and reportAfter_.

                                            :
      maxEvents_(-1), reportAfter_(10),
      files_( cfg.getParameterSet("fwliteInput").getParameter<std::vector<std::string> >("fileNames") )
      {
        // optional parameter
        if( cfg.getParameterSet("fwliteInput").existsAs<int>("maxEvents")){ 
          maxEvents_ = cfg.getParameterSet("fwliteInput").getParameter<int>("maxEvents"); 
        }
        // optional parameter
        if( cfg.getParameterSet("fwliteInput").existsAs<unsigned int>("outputEvery")){ 
          reportAfter_ = cfg.getParameterSet("fwliteInput").getParameter<unsigned int>("outputEvery"); 
        }
      }

Member Function Documentation

const std::vector<std::string>& fwlite::InputSource::files ( ) const [inline]

return vector of files_

Definition at line 40 of file InputSource.h.

References files_.

{ return files_; }
int fwlite::InputSource::maxEvents ( ) const [inline]

return maxEvetns_

Definition at line 42 of file InputSource.h.

References maxEvents_.

{ return maxEvents_; }
unsigned int fwlite::InputSource::reportAfter ( ) const [inline]

return reportAfter_

Definition at line 44 of file InputSource.h.

References reportAfter_.

{ return reportAfter_;}

Member Data Documentation

std::vector<std::string> fwlite::InputSource::files_ [protected]

vector of input files

Definition at line 52 of file InputSource.h.

Referenced by files().

maximal number of events to loop

Definition at line 48 of file InputSource.h.

Referenced by InputSource(), and maxEvents().

unsigned int fwlite::InputSource::reportAfter_ [protected]

report after N events

Definition at line 50 of file InputSource.h.

Referenced by InputSource(), and reportAfter().