1 #ifndef art_Framework_IO_ProductMix_MixHelper_h 2 #define art_Framework_IO_ProductMix_MixHelper_h 222 #include "CLHEP/Random/RandFlat.h" 237 #include <functional> 272 std::unique_ptr<MixIOPolicy> ioHandle);
276 std::unique_ptr<MixIOPolicy> ioHandle);
290 template <
class P, BranchType B>
294 template <art::BranchType B = art::InEvent,
typename PROD,
typename OPROD>
297 bool outputProduct =
true);
300 template <art::BranchType B = art::InEvent,
typename PROD,
typename OPROD>
304 bool outputProduct =
true);
312 bool (
T::*mixfunc)(std::vector<PROD const*>
const&,
316 bool outputProduct =
true);
325 bool (
T::*mixfunc)(std::vector<PROD const*>
const&,
329 bool outputProduct =
true);
337 bool (
T::*mixfunc)(std::vector<PROD const*>
const&,
341 bool outputProduct =
true);
350 bool (
T::*mixfunc)(std::vector<PROD const*>
const&,
354 bool outputProduct =
true);
381 using MixOpList = std::vector<std::unique_ptr<MixOpBase>>;
384 std::unique_ptr<CLHEP::RandFlat>
initDist_(
387 label_t const& engine_label)
const;
410 std::unique_ptr<CLHEP::RandFlat>
dist_;
438 template <
class P, art::BranchType B>
446 template <art::BranchType B,
typename PROD,
typename OPROD>
452 declareMixOp<B>(inputTag, inputTag.
instance(), mixFunc, outputProduct);
456 template <art::BranchType B,
typename PROD,
typename OPROD>
464 produces<OPROD>(outputInstanceLabel);
481 template <art::BranchType B,
typename PROD,
typename OPROD,
typename T>
484 bool (
T::*mixFunc)(std::vector<PROD const*>
const&,
490 declareMixOp<B>(inputTag,
498 template <art::BranchType B,
typename PROD,
typename OPROD,
typename T>
502 bool (
T::*mixFunc)(std::vector<PROD const*>
const&,
508 using std::placeholders::_1;
509 using std::placeholders::_2;
510 using std::placeholders::_3;
519 template <art::BranchType B,
typename PROD,
typename OPROD,
typename T>
522 bool (
T::*mixFunc)(std::vector<PROD const*>
const&,
528 declareMixOp<B>(inputTag,
536 template <art::BranchType B,
typename PROD,
typename OPROD,
typename T>
540 bool (
T::*mixFunc)(std::vector<PROD const*>
const&,
546 using std::placeholders::_1;
547 using std::placeholders::_2;
548 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
std::pair< float, std::string > P
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
void function(int client, int *resource, int parblock, int *test, int p)
ProdToProdMapBuilder ptpBuilder_