LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
fhicl Namespace Reference

parameter set interface More...

Namespaces

 comment_detail
 
 detail
 
 sequence_detail
 
 tuple_detail
 

Classes

struct  ass_parser
 
class  Atom
 
struct  bin_parser
 
struct  binding_parser
 
struct  Comment
 
class  ConfigurationTable
 
struct  dbid_parser
 
class  DelegatedParameter
 
struct  dss_parser
 
class  extended_value
 
struct  hex_parser
 
class  intermediate_table
 
struct  KeysToIgnore
 
struct  MaybeUseFunction
 
struct  Name
 
class  NameStackRegistry
 
class  OptionalAtom
 
class  OptionalDelegatedParameter
 
class  OptionalSequence
 
class  OptionalSequence< T,-1ull >
 
class  OptionalTable
 
class  OptionalTableAs
 
class  OptionalTuple
 
class  OptionalTupleAs
 
class  OptionalTupleAs< T(ARGS...)>
 
class  ParameterSet
 
class  ParameterSetID
 
class  ParameterSetRegistry
 
class  ParameterSetWalker
 
class  Printer
 
class  PrinterFor
 
class  PrinterForTypes
 
struct  real_parser
 
class  Sequence
 
class  Sequence< T,-1ull >
 
class  Table
 
class  TableAs
 
class  TableFragment
 
class  Tuple
 
class  TupleAs
 
class  TupleAs< T(ARGS...)>
 
struct  uint_parser
 
class  WrappedTable
 

Typedefs

using exception = cet::coded_exception< error, detail::translate >
 
template<typename T >
using NullaryConfigPredicate_t = bool(T::*)() const
 

Enumerations

enum  error {
  cant_find, cant_happen, cant_insert, number_is_too_large,
  parse_error, type_mismatch, protection_violation, cant_open_db,
  sql_error, unimplemented, other
}
 
enum  value_tag {
  UNKNOWN, NIL, BOOL, NUMBER,
  COMPLEX, STRING, SEQUENCE, TABLE,
  TABLEID
}
 
enum  Protection : unsigned char { Protection::NONE, Protection::PROTECT_IGNORE, Protection::PROTECT_ERROR }
 
enum  par_type {
  par_type::ATOM, par_type::TABLE, par_type::SEQ_VECTOR, par_type::SEQ_ARRAY,
  par_type::TUPLE, par_type::DELEGATE, par_type::NTYPES
}
 
enum  par_style {
  par_style::REQUIRED, par_style::REQUIRED_CONDITIONAL, par_style::DEFAULT, par_style::DEFAULT_CONDITIONAL,
  par_style::OPTIONAL, par_style::OPTIONAL_CONDITIONAL, par_style::NTYPES
}
 

Functions

void decompose_parameterset (fhicl::ParameterSet const &top, std::vector< std::string > &records, std::vector< std::string > &hashes)
 
void decompose_fhicl (std::string const &filename, std::vector< std::string > &records, std::vector< std::string > &hashes)
 
void parse_file_and_fill_db (std::string const &filename, sqlite3 *db)
 
void make_ParameterSet (intermediate_table const &tbl, ParameterSet &ps)
 
void make_ParameterSet (extended_value const &xval, ParameterSet &ps)
 
void make_ParameterSet (std::string const &str, ParameterSet &ps)
 
void make_ParameterSet (std::string const &filename, cet::filepath_maker &maker, ParameterSet &ps)
 
std::ostream & operator<< (std::ostream &, ParameterSetID const &)
 
bool parse_value_string (std::string const &s, extended_value &v, std::string &unparsed)
 
intermediate_table parse_document (std::string const &filename, cet::filepath_maker &maker)
 
intermediate_table parse_document (std::istream &is, cet::filepath_maker &maker)
 
intermediate_table parse_document (std::string const &s)
 
std::string to_string (Protection p)
 
bool maximally_munched (char const ch)
 
bool maximally_munched_number (char const ch)
 
bool maximally_munched_ass (char const ch)
 
bool maximally_munched_dss (char const ch)
 
template<typename T >
std::function< bool()> use_if (T *p, NullaryConfigPredicate_t< T > f)
 
template<typename T >
std::function< bool()> use_unless (T *p, NullaryConfigPredicate_t< T > f)
 
bool is_table (par_type const pt)
 
bool is_sequence (par_type const pt)
 
bool is_atom (par_type const pt)
 
std::string get_regex_replace_str (std::string const &str)
 

Detailed Description

parameter set interface

Title: Beam Flash<–>Track Match Algorithim Class Author: Wes Ketchum (wketc.nosp@m.hum@.nosp@m.lanl..nosp@m.gov), based on code from Ben Jones

Description: Algorithm that compares all tracks to the flash during the beam gate, and determines if that track is consistent with having produced that flash. Input: recob::OpFlash, recob::Track Output: anab::CosmicTag (and Assn<anab::CosmicTag,recob::Track>)

Title: Hit <–> Cosmic Tag Associator Alg Author: Wes Ketchum (wketc.nosp@m.hum@.nosp@m.lanl..nosp@m.gov)

Description: Algorithm that will provide associations of Hits to cosmic tags, where both of those are associated to some intermediate object (like a track or cluster) Input: Assn<recob::Hit,???> and Assn<???,anab::CosmicTag> Output: Assn<recob::Hit,anab::CosmicTag>

Title: FlashHypothesisAnaAlg Class Author: Wes Ketchum (wketc.nosp@m.hum@.nosp@m.lanl..nosp@m.gov)

Description: Alg that compares the flash hypotheses with truth photons and stores the results in a TTree.

Title: PIDA Algorithim Class Author: Wes Ketchum (wketc.nosp@m.hum@.nosp@m.lanl..nosp@m.gov), based on ideas/code from Bruce Baller

Description: Algorithm that calculates the PIDA from a calorimetry object Input: anab::Calorimetry Output: PIDA information

Title: RFFHitFinderAlg Class Author: Wes Ketchum (wketc.nosp@m.hum@.nosp@m.lanl..nosp@m.gov)

Description: Class that runs the RFF HitFinder. Implements an RFFHitFitter, and takes the result and stores it in recob::Hit objects.

Input: recob::Wire Output: recob::Hit

This class encapsulates the calculations associated with computing the LArVoxelID, and provides access to the any LArVoxel parameters from the input file(s). It is to be called using art::ServiceHandle<sim::LArVoxelCalculator const> lvx; The service makes it act like a singleton, but it knows about the Parameters defined in the input file. Definition: "Voxels" are three-dimensional "pixels"; basically they divide the energy deposition in the LAr into (x,y,z) cubes. Well, hyper-cubes actually, since we have to potentially include divisions in time as well.

Typedef Documentation

using fhicl::exception = typedef cet::coded_exception<error, detail::translate>

Definition at line 33 of file exception.h.

template<typename T >
using fhicl::NullaryConfigPredicate_t = typedef bool (T::*)() const

Definition at line 17 of file ConfigPredicate.h.

Enumeration Type Documentation

Enumerator
cant_find 
cant_happen 
cant_insert 
number_is_too_large 
parse_error 
type_mismatch 
protection_violation 
cant_open_db 
sql_error 
unimplemented 
other 

Definition at line 15 of file exception.h.

enum fhicl::par_style
strong
Enumerator
REQUIRED 
REQUIRED_CONDITIONAL 
DEFAULT 
DEFAULT_CONDITIONAL 
OPTIONAL 
OPTIONAL_CONDITIONAL 
NTYPES 

Definition at line 37 of file ParameterArgumentTypes.h.

enum fhicl::par_type
strong
Enumerator
ATOM 
TABLE 
SEQ_VECTOR 
SEQ_ARRAY 
TUPLE 
DELEGATE 
NTYPES 

Definition at line 8 of file ParameterArgumentTypes.h.

enum fhicl::Protection : unsigned char
strong
Enumerator
UNKNOWN 
NIL 
BOOL 
NUMBER 
COMPLEX 
STRING 
SEQUENCE 
TABLE 
TABLEID 

Definition at line 22 of file extended_value.h.

Function Documentation

void fhicl::decompose_fhicl ( std::string const &  filename,
std::vector< std::string > &  records,
std::vector< std::string > &  hashes 
)

Definition at line 8 of file DatabaseSupport.cc.

References decompose_parameterset(), and art::InputSourceFactory::make().

11 {
12  // Parse file into a ParameterSet.
13  cet::filepath_maker fpm;
14  auto const top = ParameterSet::make(filename, fpm);
15  decompose_parameterset(top, records, hashes);
16 }
std::unique_ptr< InputSource > make(fhicl::ParameterSet const &conf, InputSourceDescription &desc)
void decompose_parameterset(fhicl::ParameterSet const &top, std::vector< std::string > &records, std::vector< std::string > &hashes)
void fhicl::decompose_parameterset ( fhicl::ParameterSet const &  top,
std::vector< std::string > &  records,
std::vector< std::string > &  hashes 
)

Definition at line 19 of file DatabaseSupport.cc.

References fhicl::ParameterSet::get(), fhicl::ParameterSet::get_names(), fhicl::ParameterSet::id(), fhicl::ParameterSet::is_key_to_sequence(), fhicl::ParameterSet::is_key_to_table(), fhicl::ParameterSet::to_compact_string(), and fhicl::ParameterSetID::to_string().

Referenced by decompose_fhicl().

22 {
23  assert(records.size() == hashes.size());
24 
25  // First handle the top-level ParameterSet
26  records.push_back(top.to_compact_string());
27  hashes.push_back(top.id().to_string());
28 
29  // Recurse through all parameters, dealing with ParameterSets and
30  // vectors thereof.
31  std::vector<std::string> keys = top.get_names();
32  for (auto const& key : keys) {
33  if (top.is_key_to_table(key))
34  decompose_parameterset(top.get<ParameterSet>(key), records, hashes);
35  else if (top.is_key_to_sequence(key)) {
36  try {
37  auto nestlings = top.get<std::vector<ParameterSet>>(key);
38  for (auto const& ps : nestlings)
39  decompose_parameterset(ps, records, hashes);
40  }
41  catch (fhicl::exception const&) {
42  // The vector didn't contain ParameterSets, keep going; no
43  // corrective action is needed.
44  }
45  }
46  }
47 }
void decompose_parameterset(fhicl::ParameterSet const &top, std::vector< std::string > &records, std::vector< std::string > &hashes)
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
std::string fhicl::get_regex_replace_str ( std::string const &  str)

Definition at line 11 of file Name.cc.

Referenced by fhicl::Name::regex_safe().

12  {
13  return std::regex_replace(str, re, "\\$&");
14  }
bool fhicl::is_atom ( par_type const  pt)
inline

Definition at line 32 of file ParameterArgumentTypes.h.

References ATOM.

Referenced by fhicl::detail::ParameterWalker< C >::walk_over().

33  {
34  return pt == par_type::ATOM;
35  }
TMarker * pt
Definition: egs.C:25
bool fhicl::is_sequence ( par_type const  pt)
inline

Definition at line 25 of file ParameterArgumentTypes.h.

References SEQ_ARRAY, SEQ_VECTOR, and TUPLE.

26  {
27  return pt == par_type::SEQ_VECTOR || pt == par_type::SEQ_ARRAY ||
28  pt == par_type::TUPLE;
29  }
TMarker * pt
Definition: egs.C:25
bool fhicl::is_table ( par_type const  pt)
inline

Definition at line 19 of file ParameterArgumentTypes.h.

References TABLE.

Referenced by art::detail::path_specs().

20  {
21  return pt == par_type::TABLE;
22  }
TMarker * pt
Definition: egs.C:25
void fhicl::make_ParameterSet ( intermediate_table const &  tbl,
ParameterSet ps 
)

Definition at line 16 of file make_ParameterSet.cc.

References fhicl::ParameterSet::make().

17 {
18  ps = ParameterSet::make(tbl);
19 }
std::unique_ptr< InputSource > make(fhicl::ParameterSet const &conf, InputSourceDescription &desc)
void fhicl::make_ParameterSet ( extended_value const &  xval,
ParameterSet ps 
)

Definition at line 24 of file make_ParameterSet.cc.

References fhicl::ParameterSet::make().

25 {
26  ps = ParameterSet::make(xval);
27 }
std::unique_ptr< InputSource > make(fhicl::ParameterSet const &conf, InputSourceDescription &desc)
void fhicl::make_ParameterSet ( std::string const &  str,
ParameterSet ps 
)

Definition at line 32 of file make_ParameterSet.cc.

References fhicl::ParameterSet::make().

33 {
34  ps = ParameterSet::make(str);
35 }
std::unique_ptr< InputSource > make(fhicl::ParameterSet const &conf, InputSourceDescription &desc)
void fhicl::make_ParameterSet ( std::string const &  filename,
cet::filepath_maker &  maker,
ParameterSet ps 
)

Definition at line 40 of file make_ParameterSet.cc.

References fhicl::ParameterSet::make().

43 {
44  ps = ParameterSet::make(filename, maker);
45 }
std::unique_ptr< InputSource > make(fhicl::ParameterSet const &conf, InputSourceDescription &desc)
bool fhicl::maximally_munched ( char const  ch)
inline

Definition at line 28 of file tokens.h.

Referenced by maximally_munched_ass(), maximally_munched_dss(), and maximally_munched_number().

29  {
30  return !std::isgraph(ch) || ch == '#' || ch == '/' || ch == ',' ||
31  ch == ']' || ch == '}';
32  }
bool fhicl::maximally_munched_ass ( char const  ch)
inline

Definition at line 41 of file tokens.h.

References maximally_munched().

Referenced by fhicl::ass_parser::parse().

42  {
43  return maximally_munched(ch) || ch == '.' || ch == '[' || ch == ':';
44  }
bool maximally_munched(char const ch)
Definition: tokens.h:28
bool fhicl::maximally_munched_dss ( char const  ch)
inline

Definition at line 47 of file tokens.h.

References bin, and maximally_munched().

Referenced by fhicl::dss_parser::parse().

48  {
49  return maximally_munched(ch);
50  }
bool maximally_munched(char const ch)
Definition: tokens.h:28
bool fhicl::maximally_munched_number ( char const  ch)
inline

Definition at line 35 of file tokens.h.

References maximally_munched().

Referenced by fhicl::real_parser::parse(), fhicl::uint_parser::parse(), fhicl::hex_parser::parse(), fhicl::dbid_parser::parse(), and fhicl::bin_parser::parse().

36  {
37  return maximally_munched(ch) || ch == ')';
38  }
bool maximally_munched(char const ch)
Definition: tokens.h:28
ostream & fhicl::operator<< ( std::ostream &  os,
ParameterSetID const &  psid 
)

Definition at line 139 of file ParameterSetID.cc.

References fhicl::ParameterSetID::to_string().

140 {
141  return os << psid.to_string();
142 }
fhicl::intermediate_table fhicl::parse_document ( std::string const &  filename,
cet::filepath_maker &  maker 
)

Definition at line 709 of file parse.cc.

Referenced by art::BasicOptionsHandler::doProcessOptions(), fhicl::ParameterSet::make(), parse_document(), and testing::BasicTesterEnvironment< ConfigurationClass >::ParseParameters().

710 {
711  return parse_document_(cet::includer{filename, maker});
712 }
fhicl::intermediate_table fhicl::parse_document ( std::istream &  is,
cet::filepath_maker &  maker 
)

Definition at line 715 of file parse.cc.

716 {
717  return parse_document_(cet::includer(is, maker));
718 }
fhicl::intermediate_table fhicl::parse_document ( std::string const &  s)

Definition at line 721 of file parse.cc.

References parse_document().

722 {
723  std::istringstream is{s};
724  cet::filepath_maker m;
725  return parse_document(is, m);
726 }
intermediate_table parse_document(std::string const &filename, cet::filepath_maker &maker)
Definition: parse.cc:709
void fhicl::parse_file_and_fill_db ( std::string const &  filename,
sqlite3 *  db 
)

Definition at line 50 of file DatabaseSupport.cc.

References fhicl::ParameterSetRegistry::exportTo(), art::InputSourceFactory::make(), and fhicl::ParameterSetRegistry::put().

Referenced by main().

51 {
52  cet::filepath_maker fpm;
53  auto const top = ParameterSet::make(filename, fpm);
56 }
static ParameterSetID const & put(ParameterSet const &ps)
std::unique_ptr< InputSource > make(fhicl::ParameterSet const &conf, InputSourceDescription &desc)
static void exportTo(sqlite3 *db)
bool fhicl::parse_value_string ( std::string const &  s,
extended_value v,
std::string &  unparsed 
)

Definition at line 658 of file parse.cc.

References util::begin(), e, util::end(), shims::lit(), and parse_error.

Referenced by fhicl::detail::decode(), and fhicl::detail::encode().

661 {
662  using ws_t = qi::rule<FwdIter>;
663  ws_t whitespace = space | lit('#') >> *(char_ - eol) >> eol |
664  lit("//") >> *(char_ - eol) >> eol;
665  value_parser<ws_t> p;
666  auto begin = s.begin();
667  auto const end = s.end();
668  bool const b =
669  qi::phrase_parse(begin, end, p >> *whitespace, whitespace, result) &&
670  begin == end;
671  unparsed = std::string(begin, end);
672  return b;
673 } // parse_value_string()
auto lit(char arg)
Definition: parse_shims.h:11
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:77
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:69
std::string fhicl::to_string ( Protection  p)

Definition at line 4 of file Protection.cc.

Referenced by art::TriggerNamesService::getTrigPath(), fhicl::detail::HashParameterSetID::operator()(), art::detail::path_specs(), and art::detail::prune_config_if_enabled().

5 {
6  std::string result;
7  switch (p) {
8  case Protection::NONE:
9  result = "NONE";
10  break;
11  case Protection::PROTECT_IGNORE:
12  result = "PROTECT_IGNORE";
13  break;
14  case Protection::PROTECT_ERROR:
15  result = "PROTECT_ERROR";
16  break;
17  }
18  return result;
19 }
template<typename T >
std::function<bool()> fhicl::use_if ( T *  p,
NullaryConfigPredicate_t< T >  f 
)

Definition at line 21 of file ConfigPredicate.h.

References f.

22  {
23  return [p, f]() { return (p->*f)(); };
24  }
TFile f
Definition: plotHisto.C:6
template<typename T >
std::function<bool()> fhicl::use_unless ( T *  p,
NullaryConfigPredicate_t< T >  f 
)

Definition at line 28 of file ConfigPredicate.h.

References f.

29  {
30  return [p, f]() { return !(p->*f)(); };
31  }
TFile f
Definition: plotHisto.C:6