17 #include "boost/noncopyable.hpp" 22 #include <unordered_set> 25 class MixFilterTestDetail;
26 #if ART_TEST_EVENTS_TO_SKIP_CONST 27 #define ART_MFT MixFilterTestETSc 28 #define ART_TEST_EVENTS_TO_SKIP_CONST_TXT const 29 #elif defined ART_TEST_EVENTS_TO_SKIP_CONST 30 #define ART_MFT MixFilterTestETS 31 #define ART_TEST_EVENTS_TO_SKIP_CONST_TXT 32 #elif defined ART_TEST_OLD_STARTEVENT 33 #define ART_MT MixFilterTestOldStartEvent 34 #elif defined ART_TEST_NO_STARTEVENT 35 #define ART_MT MixFilterTestNoStartEvent 38 #define ART_MFT MixFilterTest 44 class SecondaryFileNameProvider {
46 SecondaryFileNameProvider(std::vector<std::string>&& fileNames)
47 : fileNames_(std::move(fileNames)), fileNameIter_(fileNames_.cbegin())
49 SecondaryFileNameProvider(SecondaryFileNameProvider&&) =
default;
51 SecondaryFileNameProvider&
operator=(SecondaryFileNameProvider&&) =
default;
53 SecondaryFileNameProvider(SecondaryFileNameProvider
const&
other)
54 : fileNames_(other.fileNames_)
55 , fileNameIter_(fileNames_.cbegin() +
56 (other.fileNameIter_ - other.fileNames_.cbegin()))
59 SecondaryFileNameProvider&
60 operator=(SecondaryFileNameProvider
const& other)
62 SecondaryFileNameProvider tmp(other);
67 ~SecondaryFileNameProvider() noexcept =
default;
72 if (fileNameIter_ == fileNames_.end()) {
75 return *(fileNameIter_++);
80 std::vector<std::string> fileNames_;
81 decltype(fileNames_.cbegin()) fileNameIter_;
101 #ifdef ART_TEST_OLD_STARTEVENT 104 #elif !defined ART_TEST_NO_STARTEVENT 115 #ifdef ART_TEST_EVENTS_TO_SKIP_CONST 117 eventsToSkip() ART_TEST_EVENTS_TO_SKIP_CONST_TXT
145 template <
typename T>
150 std::vector<double>& out,
161 #ifndef ART_NO_MIX_PTRVECTOR 168 std::vector<arttest::ProductWithPtrs const*>
const& in,
178 template <
typename COLL>
185 std::unique_ptr<art::EventIDSequence>
eIDs_;
203 template <
typename COLL>
232 std::vector<std::string> fnToProvide;
234 std::cerr <<
"Calling registerSecondaryFileNameProvider.\n";
237 std::ostream_iterator<std::string>(std::cerr,
", "));
240 SecondaryFileNameProvider(std::move(fnToProvide)));
248 &MixFilterTestDetail::mixByAddition<double>,
251 &MixFilterTestDetail::mixByAddition<arttest::IntProduct>,
254 &MixFilterTestDetail::mixByAddition<std::string>,
262 #ifndef ART_NO_MIX_PTRVECTOR 276 std::function<bool(std::vector<IntProduct const*>
const&,
279 mixfunc([
this](std::vector<IntProduct const*>
const& in,
282 auto const sz = in.size();
287 return (eID.event() % 100) == 0;
290 for (
auto i = 0ul;
i < sz; ++
i) {
303 art::InputTag(mixProducerLabel,
"SpottyProductLabel"), mixfunc,
false);
319 #ifndef ART_TEST_NO_STARTEVENT 322 #ifdef ART_TEST_OLD_STARTEVENT 344 #ifdef ART_TEST_NO_STARTEVENT 356 for (
auto const& eid : seq) {
357 BOOST_REQUIRE_EQUAL(eid.event(),
363 std::unordered_set<int>
s;
364 std::transform(seq.cbegin(),
366 std::inserter(s, s.begin()),
368 BOOST_CHECK_GT(seq.size(), s.size());
373 std::unordered_set<int>
s;
374 std::transform(seq.cbegin(),
376 std::inserter(s, s.begin()),
378 BOOST_CHECK_EQUAL(seq.size(), s.size());
381 std::transform(seq.cbegin(),
392 std::transform(seq.cbegin(),
406 e.
put(std::unique_ptr<std::string>(
new std::string(
"BlahBlahBlah")));
408 #ifndef ART_TEST_NO_STARTEVENT 440 template <
typename T>
447 for (
auto const* prod : in) {
448 if (prod !=
nullptr) {
458 std::vector<double>& out,
468 std::vector<mv_t const*>
const& in,
491 #ifndef ART_NO_MIX_PTRVECTOR 506 std::vector<arttest::ProductWithPtrs const*>
const& in,
511 #ifndef ART_NO_MIX_PTRVECTOR
void startEvent(art::Event const &)
void registerSecondaryFileNameProvider(ProviderFunc_ func)
bool const testNoLimEventDupes_
void respondToCloseInputFile(art::FileBlock const &fb)
std::vector< EventID > EventIDSequence
art::PtrVector< double > const & ptrVectorDouble() const
std::vector< art::Ptr< double > > const & vectorPtrDouble() const
bool mixPtrs(std::vector< std::vector< art::Ptr< double >> const * > const &in, std::vector< art::Ptr< double >> &out, art::PtrRemapper const &remap)
size_t const nSecondaries_
void respondToCloseOutputFiles(art::FileBlock const &fb)
bool mixByAddition(std::vector< PROD const * > const &, OPROD &, art::PtrRemapper const &)
std::pair< key_type, mapped_type > value_type
std::vector< int > allEvents_
MixFilterTestDetail(Parameters const &p, art::MixHelper &helper)
size_t respondFunctionsSeen_
bool const testPtrFailure_
bool mixPtrVectors(std::vector< art::PtrVector< double > const * > const &in, art::PtrVector< double > &out, art::PtrRemapper const &remap)
bool processEventIDs_called_
bool mixmap_vectorPtrs(std::vector< std::vector< art::Ptr< cet::map_vector< unsigned int >::value_type >> const * > const &in, std::vector< art::Ptr< cet::map_vector< unsigned int >::value_type >> &out, art::PtrRemapper const &remap)
bool const compactMissingProducts_
void produces(std::string const &instanceName={})
bool aggregateDoubleCollection(std::vector< std::vector< double > const * > const &in, std::vector< double > &out, art::PtrRemapper const &)
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
void flattenCollections(std::vector< COLLECTION const * > const &in, COLLECTION &out)
#define DEFINE_ART_MODULE(klass)
void declareMixOp(InputTag const &inputTag, MixFunc< PROD, OPROD > mixFunc, bool outputProduct=true)
void swap(Handle< T > &a, Handle< T > &b)
void verifyInSize(COLL const &in) const
T get(std::string const &key) const
std::vector< size_t > map_vectorOffsets_
size_t nSecondaries() const
bool get_if_present(std::string const &key, T &value) const
art::MixFilter< MixFilterTestDetail > ART_MFT
value_type const & front() const
art::MixHelper::Mode const readMode_
MixFilterTestDetail & operator=(MixFilterTestDetail const &)=delete
std::unique_ptr< art::EventIDSequence > eIDs_
std::vector< art::Ptr< double > > vpd_
std::unordered_set< int > uniqueEvents_
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
bool aggregate_map_vector(std::vector< mv_t const * > const &in, mv_t &out, art::PtrRemapper const &)
void respondToOpenInputFile(art::FileBlock const &fb)
std::vector< size_t > doubleVectorOffsets_
void finalizeEvent(art::Event &t)
bool const testEventOrdering_
void respondToOpenOutputFiles(art::FileBlock const &fb)
EventNumber_t event() const
bool const testZeroSecondaries_
auto const & get(AssnsNode< L, R, D > const &r)
bool mixProductWithPtrs(std::vector< arttest::ProductWithPtrs const * > const &in, arttest::ProductWithPtrs &out, art::PtrRemapper const &remap)
ProductID put(std::unique_ptr< PROD > &&edp, FullSemantic< Level::Run > const semantic)
void processEventIDs(art::EventIDSequence const &seq)