CMS 3D CMS Logo

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 23 of file InputSource.h.

References Exception.

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

default constructor from parameter set

Definition at line 27 of file InputSource.h.

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

27  :
28  maxEvents_(-1), reportAfter_(10),
29  files_( cfg.getParameterSet("fwliteInput").getParameter<std::vector<std::string> >("fileNames") )
30  {
31  // optional parameter
32  if( cfg.getParameterSet("fwliteInput").existsAs<int>("maxEvents")){
33  maxEvents_ = cfg.getParameterSet("fwliteInput").getParameter<int>("maxEvents");
34  }
35  // optional parameter
36  if( cfg.getParameterSet("fwliteInput").existsAs<unsigned int>("outputEvery")){
37  reportAfter_ = cfg.getParameterSet("fwliteInput").getParameter<unsigned int>("outputEvery");
38  }
39  }
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:161
std::vector< std::string > files_
vector of input files
Definition: InputSource.h:53
unsigned int reportAfter_
report after N events
Definition: InputSource.h:51
int maxEvents_
maximal number of events to loop
Definition: InputSource.h:49
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 41 of file InputSource.h.

References files_.

Referenced by fwlite::AnalyzerWrapper< T >::analyze().

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

return maxEvetns_

Definition at line 43 of file InputSource.h.

References maxEvents_.

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

return reportAfter_

Definition at line 45 of file InputSource.h.

References reportAfter_.

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

Member Data Documentation

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

vector of input files

Definition at line 53 of file InputSource.h.

Referenced by files().

int fwlite::InputSource::maxEvents_
protected

maximal number of events to loop

Definition at line 49 of file InputSource.h.

Referenced by InputSource(), and maxEvents().

unsigned int fwlite::InputSource::reportAfter_
protected

report after N events

Definition at line 51 of file InputSource.h.

Referenced by InputSource(), and reportAfter().