1 #ifndef art_Framework_IO_ProductMix_MixHelper_h 2 #define art_Framework_IO_ProductMix_MixHelper_h 222 #include "CLHEP/Random/RandFlat.h" 232 #include "cetlib/exempt_ptr.h" 237 #include <functional> 270 std::string
const& moduleLabel,
272 std::unique_ptr<MixIOPolicy> ioHandle);
274 std::string
const& moduleLabel,
276 std::unique_ptr<MixIOPolicy> ioHandle);
288 void produces(std::string
const& instanceName = {});
291 template <
class P, BranchType B>
292 void produces(std::string
const& instanceName = {});
295 template <art::BranchType B = art::InEvent,
typename PROD,
typename OPROD>
298 bool outputProduct =
true);
301 template <art::BranchType B = art::InEvent,
typename PROD,
typename OPROD>
303 std::string
const& outputInstanceLabel,
305 bool outputProduct =
true);
313 bool (T::*mixfunc)(std::vector<PROD const*>
const&,
317 bool outputProduct =
true);
325 std::string
const& outputInstanceLabel,
326 bool (T::*mixfunc)(std::vector<PROD const*>
const&,
330 bool outputProduct =
true);
338 bool (T::*mixfunc)(std::vector<PROD const*>
const&,
342 bool outputProduct =
true);
350 std::string
const& outputInstanceLabel,
351 bool (T::*mixfunc)(std::vector<PROD const*>
const&,
355 bool outputProduct =
true);
360 std::string
const& kind_of_engine_to_make);
362 std::string
const& kind_of_engine_to_make,
382 using MixOpList = std::vector<std::unique_ptr<MixOpBase>>;
385 std::unique_ptr<CLHEP::RandFlat>
initDist_(
386 cet::exempt_ptr<base_engine_t> engine)
const;
388 label_t const& engine_label)
const;
411 std::unique_ptr<CLHEP::RandFlat>
dist_;
439 template <
class P, art::BranchType B>
447 template <art::BranchType B,
typename PROD,
typename OPROD>
453 declareMixOp<B>(inputTag, inputTag.
instance(), mixFunc, outputProduct);
457 template <art::BranchType B,
typename PROD,
typename OPROD>
460 std::string
const& outputInstanceLabel,
465 produces<OPROD>(outputInstanceLabel);
482 template <art::BranchType B,
typename PROD,
typename OPROD,
typename T>
485 bool (T::*mixFunc)(std::vector<PROD const*>
const&,
491 declareMixOp<B>(inputTag,
499 template <art::BranchType B,
typename PROD,
typename OPROD,
typename T>
502 std::string
const& outputInstanceLabel,
503 bool (T::*mixFunc)(std::vector<PROD const*>
const&,
509 using std::placeholders::_1;
510 using std::placeholders::_2;
511 using std::placeholders::_3;
520 template <art::BranchType B,
typename PROD,
typename OPROD,
typename T>
523 bool (T::*mixFunc)(std::vector<PROD const*>
const&,
529 declareMixOp<B>(inputTag,
537 template <art::BranchType B,
typename PROD,
typename OPROD,
typename T>
540 std::string
const& outputInstanceLabel,
541 bool (T::*mixFunc)(std::vector<PROD const*>
const&,
547 using std::placeholders::_1;
548 using std::placeholders::_2;
549 using std::placeholders::_3;
void registerSecondaryFileNameProvider(ProviderFunc_ func)
std::vector< std::string >::const_iterator fileIter_
std::vector< EventAuxiliary > EventAuxiliarySequence
std::function< size_t()> eventsToSkip_
std::vector< EventID > EventIDSequence
ProviderFunc_ providerFunc_
Mode initReadMode_(std::string const &mode) const
cet::exempt_ptr< base_engine_t > initEngine_(seed_t seed, Mode readMode)
void mixAndPut(EntryNumberSequence const &enSeq, EventIDSequence const &eIDseq, Event &e)
void setEventsToSkipFunction(std::function< size_t()> eventsToSkip)
bool consistentRequest_(std::string const &kind_of_engine_to_make, label_t const &engine_label) const
std::size_t totalEventsRead_
RNGsnapshot::label_t label_t
std::map< ProductID, ProductID > ProductIDTransMap
std::vector< std::unique_ptr< MixOpBase >> MixOpList
unsigned nOpensOverThreshold_
EntryNumberSequence shuffledSequence_
std::vector< std::string > const filenames_
void produces(std::string const &instanceName={})
base_engine_t & createEngine(seed_t seed)
std::unique_ptr< CLHEP::RandFlat > dist_
double const coverageFraction_
bool generateEventSequence(size_t nSecondaries, EntryNumberSequence &enSeq, EventIDSequence &eIDseq)
std::ostream & operator<<(std::ostream &os, const GroupSelector &gs)
void produces(std::string const &instanceName={}, Persistable const persistable=Persistable::Yes)
void declareMixOp(InputTag const &inputTag, MixFunc< PROD, OPROD > mixFunc, bool outputProduct=true)
ProducesCollector & collector_
bool compactMissingProducts_
std::unique_ptr< MixIOPolicy > ioHandle_
std::function< bool(std::vector< PROD const * > const &, OPROD &, PtrRemapper const &)> MixFunc
MixHelper(Config const &config, std::string const &moduleLabel, ProducesCollector &collector, std::unique_ptr< MixIOPolicy > ioHandle)
CLHEP::HepRandomEngine base_engine_t
std::string const moduleLabel_
std::vector< FileIndex::EntryNumber_t > EntryNumberSequence
cet::exempt_ptr< base_engine_t > engine_
std::size_t nEventsReadThisFile_
std::function< std::string()> ProviderFunc_
std::map< FileIndex::EntryNumber_t, EventID > EventIDIndex
MixHelper & operator=(MixHelper const &)=delete
EventAuxiliarySequence generateEventAuxiliarySequence(EntryNumberSequence const &)
EventIDIndex eventIDIndex_
ProdToProdMapBuilder::ProductIDTransMap buildProductIDTransMap_(MixOpList &mixOps)
std::unique_ptr< CLHEP::RandFlat > initDist_(cet::exempt_ptr< base_engine_t > engine) const
ProdToProdMapBuilder ptpBuilder_