1 #ifndef art_test_Integration_GenericOneSimpleProductAnalyzer_h 2 #define art_test_Integration_GenericOneSimpleProductAnalyzer_h 11 #include "cetlib_except/exception.h" 16 #include <type_traits> 19 template <
typename V,
typename P>
26 template <
typename V,
typename P, V P::*>
28 template <
typename V,
typename P>
30 template <
typename V,
typename P>
33 template <
typename V,
typename P>
35 static bool constexpr
value{
sizeof(has_value_helper<V, P>(
nullptr)) ==
39 template <
typename V,
typename P>
48 template <
typename V,
typename P>
60 template <
typename V,
typename P>
70 "If 'require_presence' is true, then the product\n" 71 "must be successfully retrievable. If false, then\n" 72 "the product must NOT be successfully " 74 "a call to 'getByLabel' must return false."},
78 fhicl::Comment{
"The value of the following parameter is retrieved\n" 79 "only if require_presence is 'true'."},
80 [
this] {
return require_presence(); }}
92 , input_label_{
ps().input_label()}
94 , require_presence_{
ps().require_presence()}
96 switch (branch_type_) {
98 consumes<P>(input_label_);
101 consumes<P, art::InSubRun>(input_label_);
104 consumes<P, art::InRun>(input_label_);
108 <<
"Branch type: " << branch_type_
109 <<
"not supported for this module.";
111 if (require_presence_) {
112 value_ =
ps().expected_value();
123 if (get_value(h) != value_) {
125 <<
"The value for \"" << input_label_ <<
"\", branchType \"" << bt
126 <<
"\" is " << get_value(h) <<
" but was supposed to be " << value_
138 assert(handle.
isValid() == require_presence_);
139 if (require_presence_) {
151 assert(handle.
isValid() == require_presence_);
152 if (require_presence_) {
164 assert(handle.
isValid() == require_presence_);
165 if (require_presence_) {
V const & operator()(art::Handle< P > const &h)
EDAnalyzer::Table< Config > Parameters
void analyze(art::Event const &e) override
fhicl::Atom< bool > require_presence
void verify_value(art::BranchType const bt, art::Handle< P > const &h) const
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
static bool constexpr value
fhicl::Atom< V > expected_value
GenericOneSimpleProductAnalyzer(Parameters const &ps)
art::BranchType branch_type_
void endSubRun(art::SubRun const &sr) override
fhicl::Atom< unsigned > branch_type
V const & operator()(art::Handle< P > const &h)
void endRun(art::Run const &r) override
cet::no_tag has_value_helper(...)
cet::coded_exception< error, detail::translate > exception
h
training ###############################
fhicl::Atom< std::string > input_label