CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 18 of file InputSource.h.

Constructor & Destructor Documentation

fwlite::InputSource::InputSource ( )
inline

empty constructor

Definition at line 22 of file InputSource.h.

References Exception.

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

default constructor from parameter set

Definition at line 26 of file InputSource.h.

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

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

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_.

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

return maxEvetns_

Definition at line 42 of file InputSource.h.

References maxEvents_.

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

return reportAfter_

Definition at line 44 of file InputSource.h.

References reportAfter_.

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

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().

int fwlite::InputSource::maxEvents_
protected

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().