Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
arttest::TestFilter Class Reference
Inheritance diagram for arttest::TestFilter:
art::EDFilter art::detail::Filter art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Public Types

using Parameters = Table< Config >
 
- 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

 TestFilter (Parameters const &)
 
- Public Member Functions inherited from art::EDFilter
 EDFilter ()=default
 
 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 ()
 
 Filter (fhicl::ParameterSet const &)
 
 Filter (Filter const &)=delete
 
 Filter (Filter &&)=delete
 
Filteroperator= (Filter const &)=delete
 
Filteroperator= (Filter &&)=delete
 
void doBeginJob ()
 
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
virtual ~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 &)
 
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 ()
 
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

bool filter (art::Event &e) override
 

Private Attributes

unsigned count_ {}
 
unsigned const acceptRate_
 
bool const onlyOne_
 

Additional Inherited Members

- Static Public Attributes inherited from art::detail::Filter
static constexpr bool Pass {true}
 
static constexpr bool Fail {false}
 

Detailed Description

Definition at line 20 of file TestFilter_module.cc.

Member Typedef Documentation

Definition at line 22 of file TestFilter_module.cc.

Constructor & Destructor Documentation

arttest::TestFilter::TestFilter ( Parameters const &  ps)
explicit

Definition at line 37 of file TestFilter_module.cc.

38  : EDFilter{ps}, acceptRate_{ps().acceptValue()}, onlyOne_{ps().onlyOne()}
39 {}
static const double ps
Definition: Units.h:103
unsigned const acceptRate_
EDFilter()=default

Member Function Documentation

bool arttest::TestFilter::filter ( art::Event e)
overrideprivatevirtual

Implements art::EDFilter.

Definition at line 42 of file TestFilter_module.cc.

43 {
44  ++count_;
45  if (onlyOne_)
46  return count_ % acceptRate_ == 0;
47  else
48  return count_ % 100 <= acceptRate_;
49 }
unsigned const acceptRate_

Member Data Documentation

unsigned const arttest::TestFilter::acceptRate_
private

Definition at line 29 of file TestFilter_module.cc.

unsigned arttest::TestFilter::count_ {}
private

Definition at line 28 of file TestFilter_module.cc.

bool const arttest::TestFilter::onlyOne_
private

Definition at line 30 of file TestFilter_module.cc.


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