Belle II Software development
Sloppy< AFilter > Class Template Reference

A filter that accepts every "sloppinessFactor"th candidate on average (random selection) More...

#include <SloppyFilter.dcl.h>

Inheritance diagram for Sloppy< AFilter >:

Public Member Functions

void exposeParameters (ModuleParamList *moduleParamList, const std::string &prefix) override
 Expose the set of parameters of the filter to the module parameter list.
 
Weight operator() (const typename Super::Object &object) override
 Reject an item if the truth variable is 0 or in some fractions of the events, else accept it.
 

Private Types

using Super = AFilter
 The parent class.
 

Private Attributes

unsigned int m_param_sloppinessFactor = 10
 Parameter : The prescaling of the false items returning true.
 

Detailed Description

template<class AFilter>
class Belle2::TrackFindingCDC::Sloppy< AFilter >

A filter that accepts every "sloppinessFactor"th candidate on average (random selection)

Definition at line 24 of file SloppyFilter.dcl.h.

Member Typedef Documentation

◆ Super

using Super = AFilter
private

The parent class.

Definition at line 28 of file SloppyFilter.dcl.h.

Member Function Documentation

◆ exposeParameters()

void exposeParameters ( ModuleParamList moduleParamList,
const std::string &  prefix 
)
override

Expose the set of parameters of the filter to the module parameter list.

Definition at line 24 of file SloppyFilter.icc.h.

25 {
26 Super::exposeParameters(moduleParamList, prefix);
27 moduleParamList->addParameter("sloppinessFactor",
29 "Only accept every <sloppinessFactor>th instance "
30 "that would normally pass the filter.",
32 }
unsigned int m_param_sloppinessFactor
Parameter : The prescaling of the false items returning true.

◆ operator()()

Weight operator() ( const typename Super::Object &  object)
override

Reject an item if the truth variable is 0 or in some fractions of the events, else accept it.

Definition at line 35 of file SloppyFilter.icc.h.

36 {
37 Weight response = Super::operator()(object);
38
39 if (std::isnan(response)) {
40 const unsigned int randomNumber = gRandom->Integer(m_param_sloppinessFactor);
41 if (randomNumber != 0) {
42 return NAN;
43 }
44 }
45 return response;
46 }

Member Data Documentation

◆ m_param_sloppinessFactor

unsigned int m_param_sloppinessFactor = 10
private

Parameter : The prescaling of the false items returning true.

Definition at line 43 of file SloppyFilter.dcl.h.


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