21 #include "cetlib_except/exception.h" 68 Comment(
"label of the data product to be checked")
73 Comment(
"number of expected entries in the data product")
78 Comment(
"label of a data product with the same size as the input")
129 auto collectionHandle =
event.getValidHandle<std::vector<Data_t>>(
inputLabel);
134 <<
"Data product '" <<
inputLabel.encode() <<
"' has " 135 << collectionHandle->size() <<
" elements, " <<
expectedSize 136 <<
" were expected!\n";
141 auto otherCollectionHandle
142 =
event.getValidHandle<std::vector<OtherData_t>>(
sameSizeAs);
143 if (collectionHandle->size() != otherCollectionHandle->size()) {
145 <<
"Data product '" <<
inputLabel.encode() <<
"' has " 146 << collectionHandle->size() <<
" elements, " <<
expectedSize 147 <<
" were expected as in '" <<
sameSizeAs.encode() <<
"'!\n";
art::InputTag sameSizeAs
label of the data product with same size
art::InputTag inputLabel
label of the input data product
ChannelGroupService::Name Name
virtual void analyze(art::Event const &event) override
EDAnalyzer(fhicl::ParameterSet const &pset)
fhicl::OptionalAtom< size_t > expectedSize
bool doCheckSameSize
check that size is the same as another product
#define DEFINE_ART_MODULE(klass)
CheckDataProductSize(Parameters const &config)
Constructor; see the class documentation for the configuration.
Checks the size of the specified collection.
bool doCheckExpectedSize
check that the size is the specified one
LArSoft-specific namespace.
fhicl::Atom< art::InputTag > inputLabel
fhicl::OptionalAtom< art::InputTag > sameSizeAs
size_t expectedSize
expected size of the data product collection
cet::coded_exception< error, detail::translate > exception
Event finding and building.