1 #ifndef FWCore_Sources_VectorInputSource_h 2 #define FWCore_Sources_VectorInputSource_h 19 class HepRandomEngine;
24 struct VectorInputSourceDescription;
33 size_t loopOverEvents(
EventPrincipal&
cache,
size_t& fileNameHash,
size_t number,
T eventOperator, CLHEP::HepRandomEngine* =
nullptr,
EventID const*
id =
nullptr,
bool recycleFiles =
true);
35 template<
typename T,
typename Iterator>
38 void dropUnwantedBranches(std::vector<std::string>
const& wantedBranches);
57 virtual bool readOneEvent(
EventPrincipal& cache,
size_t& fileNameHash, CLHEP::HepRandomEngine*,
EventID const*
id,
bool recycleFiles) = 0;
61 readOneSpecified(cache, fileNameHash, info);
64 virtual void dropUnwantedBranches_(std::vector<std::string>
const& wantedBranches) = 0;
66 virtual void endJob() = 0;
73 size_t VectorInputSource::loopOverEvents(
EventPrincipal&
cache,
size_t& fileNameHash,
size_t number,
T eventOperator, CLHEP::HepRandomEngine* engine,
EventID const*
id,
bool recycleFiles) {
75 for(; i < number; ++
i) {
76 clearEventPrincipal(cache);
77 bool found = readOneEvent(cache, fileNameHash, engine,
id, recycleFiles);
79 eventOperator(cache, fileNameHash);
84 template<
typename T,
typename Iterator>
88 clearEventPrincipal(cache);
89 readOneSpecified(cache, fileNameHash, *iter);
90 eventOperator(cache, fileNameHash);
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)