67 Comment(
"Input tag of the data product to be checked")
72 Comment(
"whether the data product must exist or must not exist"),
79 (
"Number of expected entries (not checked if not specified).")
86 Comment(
"list of hit collections and number of expected entries")
117 : name(config.name())
118 , bExists(config.
exists())
120 bCheckEntries = config.
expected(expectedEntries);
142 template <
typename DATA>
175 checkDataProducts<std::vector<recob::Hit>>(
event, targetInfo,
"hits");
181 template <
typename DATA>
185 using Product_t = DATA;
190 bool found =
event.getByLabel<Product_t>(tag,
data);
191 if (found && !targetInfo.
bExists) {
193 <<
"Data product '" << tag <<
"' (" << desc
194 <<
") was expected not to exist, and there it is instead! (with " 195 << data->size() <<
" elements)";
197 if (!found && targetInfo.
bExists) {
199 <<
"Data product '" << tag <<
"' (" << desc
200 <<
") was expected, but there is none.";
206 <<
"Data product '" << tag <<
"' (" << desc
208 <<
" entires, but it has " << data->size() <<
"!";
bool bExists
Whether data product must exist or must not exist.
fhicl::Atom< art::InputTag > name
unsigned int expectedEntries
Number of expected entries.
Reconstruction base classes.
bool bCheckEntries
Whether to check the number of entries.
ChannelGroupService::Name Name
EDAnalyzer(fhicl::ParameterSet const &pset)
void checkDataProducts(art::Event const &event, TargetInfo_t const &targetInfo, std::string desc)
Checks the specified data product.
fhicl::Atom< bool > exists
#define DEFINE_ART_MODULE(klass)
virtual void analyze(const art::Event &event) override
fhicl::OptionalAtom< unsigned int > expected
art::InputTag name
Data product name.
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Declaration of signal hit object.
TargetInfo_t(Config::TargetInfo const &config)
fhicl::Sequence< fhicl::Table< TargetInfo > > hits
std::vector< TargetInfo_t > fHitTargets
Configuration of all checks on hit collections.
Module verifying the presence of data products.
Configuration for a single data product check.
HitDataProductChecker(Parameters const &config)
Event finding and building.