1 #ifndef FWCore_Sources_VectorInputSource_h 2 #define FWCore_Sources_VectorInputSource_h 19 class HepRandomEngine;
24 struct VectorInputSourceDescription;
37 CLHEP::HepRandomEngine* =
nullptr,
39 bool recycleFiles =
true);
41 template <
typename T,
typename Iterator>
45 void dropUnwantedBranches(std::vector<std::string>
const& wantedBranches);
63 virtual bool readOneEvent(
64 EventPrincipal& cache,
size_t& fileNameHash, CLHEP::HepRandomEngine*,
EventID const*
id,
bool recycleFiles) = 0;
70 readOneSpecified(cache, fileNameHash, info);
73 virtual void dropUnwantedBranches_(std::vector<std::string>
const& wantedBranches) = 0;
75 virtual void endJob() = 0;
77 void throwIfOverLimit(
unsigned int consecutiveRejections)
const;
89 CLHEP::HepRandomEngine* engine,
93 unsigned int consecutiveRejections = 0
U;
95 clearEventPrincipal(cache);
96 bool found = readOneEvent(cache, fileNameHash, engine,
id, recycleFiles);
99 bool used = eventOperator(cache, fileNameHash);
102 consecutiveRejections = 0
U;
103 }
else if (consecutiveRejectionsLimit_ > 0) {
104 ++consecutiveRejections;
105 throwIfOverLimit(consecutiveRejections);
111 template <
typename T,
typename Iterator>
112 size_t VectorInputSource::loopSpecified(
116 clearEventPrincipal(cache);
117 readOneSpecified(cache, fileNameHash, *iter);
118 eventOperator(cache, fileNameHash);
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)