CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Attributes
fwlite::InputSource Class Reference

#include <InputSource.h>

Public Member Functions

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

Protected Attributes

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

Detailed Description

Definition at line 19 of file InputSource.h.

Constructor & Destructor Documentation

fwlite::InputSource::InputSource ( )
inline

empty constructor

Definition at line 22 of file InputSource.h.

References Exception.

22 { 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 24 of file InputSource.h.

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

25  : maxEvents_(-1),
26  reportAfter_(10),
27  files_(cfg.getParameterSet("fwliteInput").getParameter<std::vector<std::string> >("fileNames")) {
28  // optional parameter
29  if (cfg.getParameterSet("fwliteInput").existsAs<int>("maxEvents")) {
30  maxEvents_ = cfg.getParameterSet("fwliteInput").getParameter<int>("maxEvents");
31  }
32  // optional parameter
33  if (cfg.getParameterSet("fwliteInput").existsAs<unsigned int>("outputEvery")) {
34  reportAfter_ = cfg.getParameterSet("fwliteInput").getParameter<unsigned int>("outputEvery");
35  }
36  }
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:171
std::vector< std::string > files_
vector of input files
Definition: InputSource.h:50
unsigned int reportAfter_
report after N events
Definition: InputSource.h:48
int maxEvents_
maximal number of events to loop
Definition: InputSource.h:46
ParameterSet const & getParameterSet(std::string const &) const
T getParameter(std::string const &) const
Definition: ParameterSet.h:303

Member Function Documentation

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

return vector of files_

Definition at line 38 of file InputSource.h.

References files_.

38 { return files_; }
std::vector< std::string > files_
vector of input files
Definition: InputSource.h:50
int fwlite::InputSource::maxEvents ( ) const
inline

return maxEvetns_

Definition at line 40 of file InputSource.h.

References maxEvents_.

40 { return maxEvents_; }
int maxEvents_
maximal number of events to loop
Definition: InputSource.h:46
unsigned int fwlite::InputSource::reportAfter ( ) const
inline

return reportAfter_

Definition at line 42 of file InputSource.h.

References reportAfter_.

42 { return reportAfter_; }
unsigned int reportAfter_
report after N events
Definition: InputSource.h:48

Member Data Documentation

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

vector of input files

Definition at line 50 of file InputSource.h.

Referenced by files().

int fwlite::InputSource::maxEvents_
protected

maximal number of events to loop

Definition at line 46 of file InputSource.h.

Referenced by InputSource(), and maxEvents().

unsigned int fwlite::InputSource::reportAfter_
protected

report after N events

Definition at line 48 of file InputSource.h.

Referenced by InputSource(), and reportAfter().