Public Member Functions | List of all members
arttest::ToyFileReader Class Referencefinal
Inheritance diagram for arttest::ToyFileReader:
arttest::ToySource

Public Member Functions

 ToyFileReader (fhicl::ParameterSet const &ps, art::ProductRegistryHelper &help, art::SourceHelper const &sHelper)
 
void readFile (std::string const &name, art::FileBlock *&fb) override
 
- Public Member Functions inherited from arttest::ToySource
 ToySource (fhicl::ParameterSet const &ps, art::ProductRegistryHelper &help, art::SourceHelper const &sHelper)
 
virtual ~ToySource ()=default
 
void closeCurrentFile ()
 
bool readNext (art::RunPrincipal const *const inR, art::SubRunPrincipal const *const inSR, art::RunPrincipal *&outR, art::SubRunPrincipal *&outSR, art::EventPrincipal *&outE)
 

Additional Inherited Members

- Protected Types inherited from arttest::ToySource
using vv_t = std::vector< std::tuple< int, int, int >>
 
using iter = vv_t::const_iterator
 
- Static Protected Member Functions inherited from arttest::ToySource
static void throw_exception_from (const char *funcname)
 
- Protected Attributes inherited from arttest::ToySource
iter current_ {}
 
iter end_ {}
 
fhicl::ParameterSet data_
 
vv_t fileData_ {}
 
art::SourceHelper const & sHelper_
 
std::string currentFilename_ {}
 
bool const throw_on_construction_
 
bool const throw_on_closeCurrentFile_
 
bool const throw_on_readNext_
 
bool const throw_on_readFile_
 
art::TypeLabel vtl_
 

Detailed Description

Definition at line 29 of file ToyRawFileInput_source.cc.

Constructor & Destructor Documentation

arttest::ToyFileReader::ToyFileReader ( fhicl::ParameterSet const &  ps,
art::ProductRegistryHelper help,
art::SourceHelper const &  sHelper 
)

Definition at line 38 of file ToyRawFileInput_source.cc.

41  : ToySource(ps, help, sHelper)
42 {}
static const double ps
Definition: Units.h:103
ToySource(fhicl::ParameterSet const &ps, art::ProductRegistryHelper &help, art::SourceHelper const &sHelper)
Definition: ToySource.cc:12

Member Function Documentation

void arttest::ToyFileReader::readFile ( std::string const &  name,
art::FileBlock *&  fb 
)
overridevirtual

Implements arttest::ToySource.

Definition at line 45 of file ToyRawFileInput_source.cc.

46 {
48  throw_exception_from("readFile");
49  fhicl::intermediate_table raw_config;
50  cet::filepath_lookup_after1 lookupPolicy(".:");
51  fhicl::parse_document(name, lookupPolicy, raw_config);
52  fhicl::ParameterSet file_pset;
53  make_ParameterSet(raw_config, file_pset);
54 
55  if (!file_pset.get_if_present("data", fileData_)) {
57  << "ToyFileReader expects to find a parameter \"data\" representing a "
58  "file's\n"
59  << "contents in file " << name << "\n";
60  }
62  current_ = fileData_.begin();
63  end_ = fileData_.end();
64  fb = new art::FileBlock(art::FileFormatVersion(1, "ToyFileReader 2011a"),
66 }
std::string currentFilename_
Definition: ToySource.h:53
static void throw_exception_from(const char *funcname)
Definition: ToySource.cc:121
void make_ParameterSet(intermediate_table const &tbl, ParameterSet &ps)
bool get_if_present(std::string const &key, T &value) const
Definition: ParameterSet.h:208
bool const throw_on_readFile_
Definition: ToySource.h:57
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
void parse_document(std::string const &filename, cet::filepath_maker &maker, intermediate_table &result)
Definition: parse.cc:856

The documentation for this class was generated from the following file: