Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:38:59

0001 #ifndef DataFormats_FWLite_interface_OutputFiles_h
0002 #define DataFormats_FWLite_interface_OutputFiles_h
0003 
0004 #include <vector>
0005 #include <string>
0006 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0007 #include "FWCore/Utilities/interface/Exception.h"
0008 
0009 /**
0010   \class    OutputFiles OutputFiles.h "DataFormats/FWLite/interface/OutputFiles.h"
0011   \brief    Helper class to handle FWLite file output names
0012 
0013   This is a very simple class to handle the appropriate python configuration of 
0014   output files in FWLite. 
0015 */
0016 
0017 namespace fwlite {
0018 
0019   class OutputFiles {
0020   public:
0021     /// empty constructor
0022     OutputFiles() { throw cms::Exception("InvalidInput") << "Must specify a string fileName" << std::endl; }
0023     /// default constructor from parameter set
0024     OutputFiles(const edm::ParameterSet& cfg)
0025         : file_(cfg.getParameterSet("fwliteOutput").getParameter<std::string>("fileName")){};
0026     /// return output fuke name
0027     std::string const& file() const { return file_; }
0028 
0029   protected:
0030     /// output file name
0031     std::string file_;
0032   };
0033 }  // namespace fwlite
0034 
0035 #endif