Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
art::MixFilter< T, IOPolicy > Class Template Reference

#include <MixFilter.h>

Inheritance diagram for art::MixFilter< T, IOPolicy >:
art::EDFilter art::detail::Filter art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Public Types

using MixDetail = T
 
using Parameters = typename detail::maybe_has_Parameters< T >::Parameters
 
- Public Types inherited from art::EDFilter
using ModuleType = EDFilter
 
using WorkerType = WorkerT< EDFilter >
 
- Public Types inherited from art::detail::Filter
template<typename UserConfig >
using Table = Modifier::Table< UserConfig >
 
- Public Types inherited from art::Modifier
template<typename UserConfig , typename UserKeysToIgnore = void>
using Table = ProducerTable< UserConfig, detail::ModuleConfig, UserKeysToIgnore >
 

Public Member Functions

template<typename U = Parameters>
 MixFilter (std::enable_if_t< std::is_same_v< U, fhicl::ParameterSet >, fhicl::ParameterSet > const &p)
 
template<typename U = Parameters>
 MixFilter (std::enable_if_t<!std::is_same_v< U, fhicl::ParameterSet >, U > const &p)
 
- Public Member Functions inherited from art::EDFilter
 EDFilter (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDFilter (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Filter
virtual ~Filter () noexcept
 
 Filter (fhicl::ParameterSet const &)
 
 Filter (Filter const &)=delete
 
 Filter (Filter &&)=delete
 
Filteroperator= (Filter const &)=delete
 
Filteroperator= (Filter &&)=delete
 
void doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
- Public Member Functions inherited from art::Modifier
 ~Modifier () noexcept
 
 Modifier ()
 
 Modifier (Modifier const &)=delete
 
 Modifier (Modifier &&)=delete
 
Modifieroperator= (Modifier const &)=delete
 
Modifieroperator= (Modifier &&)=delete
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Private Member Functions

void respondToOpenInputFile (FileBlock const &fb) override
 
void respondToCloseInputFile (FileBlock const &fb) override
 
void respondToOpenOutputFiles (FileBlock const &fb) override
 
void respondToCloseOutputFiles (FileBlock const &fb) override
 
bool filter (Event &e) override
 
bool beginSubRun (SubRun &sr) override
 
bool endSubRun (SubRun &sr) override
 
bool beginRun (Run &r) override
 
bool endRun (Run &r) override
 

Private Attributes

MixHelper helper_
 
MixDetail detail_
 

Additional Inherited Members

- Static Public Attributes inherited from art::detail::Filter
static constexpr bool Pass {true}
 
static constexpr bool Fail {false}
 
- Protected Member Functions inherited from art::ModuleBase
ConsumesCollectorconsumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Detailed Description

template<typename T, typename IOPolicy>
class art::MixFilter< T, IOPolicy >

Definition at line 155 of file MixFilter.h.

Member Typedef Documentation

template<typename T , typename IOPolicy >
using art::MixFilter< T, IOPolicy >::MixDetail = T

Definition at line 384 of file MixFilter.h.

template<typename T , typename IOPolicy >
using art::MixFilter< T, IOPolicy >::Parameters = typename detail::maybe_has_Parameters<T>::Parameters

Definition at line 386 of file MixFilter.h.

Constructor & Destructor Documentation

template<typename T , typename IOPolicy >
template<typename U >
art::MixFilter< T, IOPolicy >::MixFilter ( std::enable_if_t< std::is_same_v< U, fhicl::ParameterSet >, fhicl::ParameterSet > const &  p)
explicit

Definition at line 412 of file MixFilter.h.

415  : EDFilter{p}
416  , helper_{p,
417  p.template get<std::string>("module_label"),
419  std::make_unique<IOPolicy>()}
420  , detail_{p, helper_}
421 {
422  if constexpr (detail::has_eventsToSkip<T>::value) {
423  helper_.setEventsToSkipFunction([this] { return detail_.eventsToSkip(); });
424  }
425 }
void setEventsToSkipFunction(std::function< size_t()> eventsToSkip)
Definition: MixHelper.cc:351
p
Definition: test.py:223
MixHelper helper_
Definition: MixFilter.h:406
ProducesCollector & producesCollector() noexcept
EDFilter(fhicl::ParameterSet const &pset)
Definition: EDFilter.h:21
MixDetail detail_
Definition: MixFilter.h:407
template<typename T , typename IOPolicy >
template<typename U >
art::MixFilter< T, IOPolicy >::MixFilter ( std::enable_if_t<!std::is_same_v< U, fhicl::ParameterSet >, U > const &  p)
explicit

Definition at line 429 of file MixFilter.h.

431  : EDFilter{p}
432  , helper_{p().mixHelper(),
433  p.get_PSet().template get<std::string>("module_label"),
435  std::make_unique<IOPolicy>()}
436  , detail_{p().userConfig, helper_}
437 {
438  if constexpr (detail::has_eventsToSkip<T>::value) {
439  helper_.setEventsToSkipFunction([this] { return detail_.eventsToSkip(); });
440  }
441 }
void setEventsToSkipFunction(std::function< size_t()> eventsToSkip)
Definition: MixHelper.cc:351
p
Definition: test.py:223
MixHelper helper_
Definition: MixFilter.h:406
ProducesCollector & producesCollector() noexcept
EDFilter(fhicl::ParameterSet const &pset)
Definition: EDFilter.h:21
MixDetail detail_
Definition: MixFilter.h:407

Member Function Documentation

template<typename T , typename IOPolicy >
bool art::MixFilter< T, IOPolicy >::beginRun ( Run r)
overrideprivatevirtual

Reimplemented from art::EDFilter.

Definition at line 546 of file MixFilter.h.

547 {
548  if constexpr (detail::has_beginRun<T>::value) {
549  detail_.beginRun(r);
550  }
551  return true;
552 }
MixDetail detail_
Definition: MixFilter.h:407
template<typename T , typename IOPolicy >
bool art::MixFilter< T, IOPolicy >::beginSubRun ( SubRun sr)
overrideprivatevirtual

Reimplemented from art::EDFilter.

Definition at line 526 of file MixFilter.h.

527 {
528  if constexpr (detail::has_beginSubRun<T>::value) {
529  detail_.beginSubRun(sr);
530  }
531  return true;
532 }
static constexpr double sr
Definition: Units.h:166
MixDetail detail_
Definition: MixFilter.h:407
template<typename T , typename IOPolicy >
bool art::MixFilter< T, IOPolicy >::endRun ( Run r)
overrideprivatevirtual

Reimplemented from art::EDFilter.

Definition at line 556 of file MixFilter.h.

557 {
558  if constexpr (detail::has_endRun<T>::value) {
559  detail_.endRun(r);
560  }
561  return true;
562 }
MixDetail detail_
Definition: MixFilter.h:407
template<typename T , typename IOPolicy >
bool art::MixFilter< T, IOPolicy >::endSubRun ( SubRun sr)
overrideprivatevirtual

Reimplemented from art::EDFilter.

Definition at line 536 of file MixFilter.h.

537 {
538  if constexpr (detail::has_endSubRun<T>::value) {
539  detail_.endSubRun(sr);
540  }
541  return true;
542 }
static constexpr double sr
Definition: Units.h:166
MixDetail detail_
Definition: MixFilter.h:407
template<typename T , typename IOPolicy >
bool art::MixFilter< T, IOPolicy >::filter ( Event e)
overrideprivatevirtual

Implements art::EDFilter.

Definition at line 481 of file MixFilter.h.

482 {
483  // 1. Call detail object's startEvent() if it exists.
484  if constexpr (detail::has_startEvent<T>::value) {
485  detail_.startEvent(e);
486  }
487 
488  // 2. Ask detail object how many events to read.
489  size_t const nSecondaries = detail_.nSecondaries();
490 
491  // 3. Decide which events we're reading and prime the event tree
492  // cache.
493  EntryNumberSequence enSeq;
494  EventIDSequence eIDseq;
495  enSeq.reserve(nSecondaries);
496  eIDseq.reserve(nSecondaries);
497  if (!helper_.generateEventSequence(nSecondaries, enSeq, eIDseq)) {
499  << "Insufficient secondary events available to mix.\n";
500  }
501 
502  // 4. Give the event ID sequence to the detail object.
504  detail_.processEventIDs(eIDseq);
505  }
506 
507  // 5. Give the event auxiliary sequence to the detail object.
509  auto const auxseq = helper_.generateEventAuxiliarySequence(enSeq);
510  detail_.processEventAuxiliaries(auxseq);
511  }
512 
513  // 6. Make the MixHelper read info into all the products, invoke the
514  // mix functions and put the products into the event.
515  helper_.mixAndPut(enSeq, eIDseq, e);
516 
517  // 7. Call detail object's finalizeEvent() if it exists.
518  if constexpr (detail::has_finalizeEvent<T>::value) {
519  detail_.finalizeEvent(e);
520  }
521  return true;
522 }
std::vector< EventID > EventIDSequence
Definition: MixTypes.h:26
void mixAndPut(EntryNumberSequence const &enSeq, EventIDSequence const &eIDseq, Event &e)
Definition: MixHelper.cc:278
bool generateEventSequence(size_t nSecondaries, EntryNumberSequence &enSeq, EventIDSequence &eIDseq)
Definition: MixHelper.cc:182
const double e
std::vector< FileIndex::EntryNumber_t > EntryNumberSequence
Definition: MixTypes.h:27
MixHelper helper_
Definition: MixFilter.h:406
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
EventAuxiliarySequence generateEventAuxiliarySequence(EntryNumberSequence const &)
Definition: MixHelper.cc:268
MixDetail detail_
Definition: MixFilter.h:407
template<typename T , typename IOPolicy >
void art::MixFilter< T, IOPolicy >::respondToCloseInputFile ( FileBlock const &  fb)
overrideprivatevirtual

Reimplemented from art::EDFilter.

Definition at line 454 of file MixFilter.h.

455 {
457  detail_.respondToCloseInputFile(fb);
458  }
459 }
MixDetail detail_
Definition: MixFilter.h:407
template<typename T , typename IOPolicy >
void art::MixFilter< T, IOPolicy >::respondToCloseOutputFiles ( FileBlock const &  fb)
overrideprivatevirtual

Reimplemented from art::EDFilter.

Definition at line 472 of file MixFilter.h.

473 {
475  detail_.respondToCloseOutputFiles(fb);
476  }
477 }
MixDetail detail_
Definition: MixFilter.h:407
template<typename T , typename IOPolicy >
void art::MixFilter< T, IOPolicy >::respondToOpenInputFile ( FileBlock const &  fb)
overrideprivatevirtual

Reimplemented from art::EDFilter.

Definition at line 445 of file MixFilter.h.

446 {
448  detail_.respondToOpenInputFile(fb);
449  }
450 }
MixDetail detail_
Definition: MixFilter.h:407
template<typename T , typename IOPolicy >
void art::MixFilter< T, IOPolicy >::respondToOpenOutputFiles ( FileBlock const &  fb)
overrideprivatevirtual

Reimplemented from art::EDFilter.

Definition at line 463 of file MixFilter.h.

464 {
466  detail_.respondToOpenOutputFiles(fb);
467  }
468 }
MixDetail detail_
Definition: MixFilter.h:407

Member Data Documentation

template<typename T , typename IOPolicy >
MixDetail art::MixFilter< T, IOPolicy >::detail_
private

Definition at line 407 of file MixFilter.h.

template<typename T , typename IOPolicy >
MixHelper art::MixFilter< T, IOPolicy >::helper_
private

Definition at line 406 of file MixFilter.h.


The documentation for this class was generated from the following file: