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

Helper class to handle FWLite file input sources. More...

#include <InputSource.h>

Public Member Functions

std::vector< std::string > const & files () const
 
 InputSource ()
 
 InputSource (edm::ParameterSet const &pset)
 
int maxEvents () const
 
unsigned int reportAfter () const
 

Protected Attributes

std::vector< std::string > files_
 
int maxEvents_
 
unsigned int reportAfter_
 

Detailed Description

Helper class to handle FWLite file input sources.

This is a very simple class to handle the appropriate python configuration of input files in FWLite.

Author
Salvatore Rappoccio

Definition at line 20 of file InputSource.h.

Constructor & Destructor Documentation

fwlite::InputSource::InputSource ( )
inline

Definition at line 22 of file InputSource.h.

References edm::hlt::Exception.

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

Definition at line 25 of file InputSource.h.

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

25  :
26  files_( pset.getParameter<edm::ParameterSet>("fwliteInput").getParameter<std::vector<std::string> >("fileNames") )
27  {
28  if(pset.getParameter<edm::ParameterSet>("fwliteInput").exists("maxEvents")){
29  maxEvents_=pset.getParameter<edm::ParameterSet>("fwliteInput").getParameter<int>("maxEvents");
30  }
31  if(pset.getParameter<edm::ParameterSet>("fwliteInput").exists("outputEvery")){
32  reportAfter_=pset.getParameter<edm::ParameterSet>("fwliteInput").getParameter<unsigned int>("outputEvery");
33  }
34  }
T getParameter(std::string const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
std::vector< std::string > files_
Definition: InputSource.h:42
unsigned int reportAfter_
Definition: InputSource.h:44
tuple pset
Definition: CrabTask.py:85

Member Function Documentation

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

Definition at line 36 of file InputSource.h.

References files_.

36 { return files_; }
std::vector< std::string > files_
Definition: InputSource.h:42
int fwlite::InputSource::maxEvents ( ) const
inline

Definition at line 38 of file InputSource.h.

References maxEvents_.

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

Definition at line 39 of file InputSource.h.

References reportAfter_.

39 { return reportAfter_;}
unsigned int reportAfter_
Definition: InputSource.h:44

Member Data Documentation

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

Definition at line 42 of file InputSource.h.

Referenced by files().

int fwlite::InputSource::maxEvents_
protected

Definition at line 43 of file InputSource.h.

Referenced by InputSource(), and maxEvents().

unsigned int fwlite::InputSource::reportAfter_
protected

Definition at line 44 of file InputSource.h.

Referenced by InputSource(), and reportAfter().