1 #ifndef art_Framework_IO_ProductMix_MixHelper_h 2 #define art_Framework_IO_ProductMix_MixHelper_h 213 #include "CLHEP/Random/RandFlat.h" 223 #include "canvas/Persistency/Provenance/Compatibility/BranchIDList.h" 227 #include "cetlib/exempt_ptr.h" 228 #include "cetlib/value_ptr.h" 231 #include <functional> 269 void produces(std::string
const& instanceName = {});
272 template <
class P, BranchType B>
273 void produces(std::string
const& instanceName = {});
276 template <art::BranchType B = art::InEvent,
typename PROD,
typename OPROD>
279 bool outputProduct =
true);
282 template <art::BranchType B = art::InEvent,
typename PROD,
typename OPROD>
284 std::string
const& outputInstanceLabel,
286 bool outputProduct =
true);
294 bool (T::*mixfunc)(std::vector<PROD const*>
const&,
298 bool outputProduct =
true);
306 std::string
const& outputInstanceLabel,
307 bool (T::*mixfunc)(std::vector<PROD const*>
const&,
311 bool outputProduct =
true);
319 bool (T::*mixfunc)(std::vector<PROD const*>
const&,
323 bool outputProduct =
true);
331 std::string
const& outputInstanceLabel,
332 bool (T::*mixfunc)(std::vector<PROD const*>
const&,
336 bool outputProduct =
true);
355 using MixOpList = std::vector<std::unique_ptr<MixOpBase>>;
381 std::unique_ptr<CLHEP::RandFlat>
dist_;
393 std::array<RootBranchInfoList, art::BranchType::NumBranchTypes>
dataBranches_{
413 template <
class P, art::BranchType B>
421 template <art::BranchType B,
typename PROD,
typename OPROD>
427 declareMixOp<B>(inputTag, inputTag.
instance(), mixFunc, outputProduct);
431 template <art::BranchType B,
typename PROD,
typename OPROD>
434 std::string
const& outputInstanceLabel,
439 produces<OPROD>(outputInstanceLabel);
455 template <art::BranchType B,
typename PROD,
typename OPROD,
typename T>
458 bool (T::*mixFunc)(std::vector<PROD const*>
const&,
465 inputTag, inputTag.
instance(), mixFunc, t, outputProduct);
469 template <art::BranchType B,
typename PROD,
typename OPROD,
typename T>
472 std::string
const& outputInstanceLabel,
473 bool (T::*mixFunc)(std::vector<PROD const*>
const&,
479 using std::placeholders::_1;
480 using std::placeholders::_2;
481 using std::placeholders::_3;
490 template <art::BranchType B,
typename PROD,
typename OPROD,
typename T>
493 bool (T::*mixFunc)(std::vector<PROD const*>
const&,
500 inputTag, inputTag.
instance(), mixFunc, t, outputProduct);
504 template <art::BranchType B,
typename PROD,
typename OPROD,
typename T>
507 std::string
const& outputInstanceLabel,
508 bool (T::*mixFunc)(std::vector<PROD const*>
const&,
514 using std::placeholders::_1;
515 using std::placeholders::_2;
516 using std::placeholders::_3;
void registerSecondaryFileNameProvider(ProviderFunc_ func)
std::vector< std::string >::const_iterator fileIter_
std::vector< EventAuxiliary > EventAuxiliarySequence
std::function< size_t()> eventsToSkip_
ProducerBase & producesProvider_
std::vector< EventID > EventIDSequence
cet::value_ptr< TFile > currentFile_
ProviderFunc_ providerFunc_
Mode initReadMode_(std::string const &mode) const
void mixAndPut(EntryNumberSequence const &enSeq, EventIDSequence const &eIDseq, Event &e)
void setEventsToSkipFunction(std::function< size_t()> eventsToSkip)
MixHelper(fhicl::ParameterSet const &pset, ProducerBase &producesProvider)
std::array< cet::exempt_ptr< TTree >, art::BranchType::NumBranchTypes > currentDataTrees_
std::map< ProductID, ProductID > ProductIDTransMap
FileFormatVersion ffVersion_
std::vector< std::unique_ptr< MixOpBase >> MixOpList
void produces(std::string const &instanceName={}, Persistable const persistable=Persistable::Yes)
EntryNumberSequence shuffledSequence_
std::unique_ptr< art::BranchIDLists > branchIDLists_
std::vector< std::string > const filenames_
void produces(std::string const &instanceName={})
std::unique_ptr< CLHEP::RandFlat > dist_
double const coverageFraction_
std::array< RootBranchInfoList, art::BranchType::NumBranchTypes > dataBranches_
Long64_t nEventsReadThisFile_
bool generateEventSequence(size_t nSecondaries, EntryNumberSequence &enSeq, EventIDSequence &eIDseq)
FileIndex currentFileIndex_
void declareMixOp(InputTag const &inputTag, MixFunc< PROD, OPROD > mixFunc, bool outputProduct=true)
cet::exempt_ptr< TTree > currentMetaDataTree_
bool compactMissingProducts_
void generateEventAuxiliarySequence(EntryNumberSequence const &, EventAuxiliarySequence &)
std::function< bool(std::vector< PROD const * > const &, OPROD &, PtrRemapper const &)> MixFunc
std::vector< FileIndex::EntryNumber_t > EntryNumberSequence
void buildProductIDTransMap_(ProdToProdMapBuilder::ProductIDTransMap &transMap)
void openAndReadMetaData_(std::string fileName)
std::map< FileIndex::EntryNumber_t, EventID > EventIDIndex
std::function< std::string()> ProviderFunc_
MixHelper & operator=(MixHelper const &)=delete
EventIDIndex eventIDIndex_
ProdToProdMapBuilder ptpBuilder_
Long64_t totalEventsRead_