DAS  3.0
Das Analysis System
ContextApplier

Description

Applier class with context. Use unique_ptr to check that we don't inadvertently copy (since unique_ptr cannot be copied).

+ Inheritance diagram for ContextApplier:
+ Collaboration diagram for ContextApplier:

Public Member Functions

 ContextApplier (const fs::path &filePath, bool correction, bool uncertainties)
 
bool passes (const SimpleObject &, const unique_ptr< int > &ctx) const override
 
int binIndex (const SimpleObject &obj, const unique_ptr< int > &ctx, const unique_ptr< TH1 > &hist) const override
 
- Public Member Functions inherited from GenericSFApplier< SimpleObject, unique_ptr< int > >
 GenericSFApplier (const std::filesystem::path &filePath, bool correction, bool uncertainties)
 
virtual ~GenericSFApplier () noexcept=default
 
void operator() (SimpleObject &object, const Context &... ctx) const
 
void operator() (std::vector< SimpleObject > &objects, const Context &... ctx) const
 
std::vector< std::string > weightNames () const
 

Public Attributes

unique_ptr< int > expectedContext = make_unique<int>(42)
 

Additional Inherited Members

- Protected Types inherited from GenericSFApplier< SimpleObject, unique_ptr< int > >
enum  Interpretation
 
- Protected Member Functions inherited from GenericSFApplier< SimpleObject, unique_ptr< int > >
void loadNominal (const std::string &histPath)
 
void loadBinWiseUnc (const std::string &name, const std::string &histPath, Interpretation intp=UseBinContent)
 
void loadGlobalUnc (const std::string &name, const std::string &histPath, Interpretation intp=UseBinContent)
 
virtual bool passes (const SimpleObject &obj, const Context &... ctx) const=0
 
virtual int binIndex (const SimpleObject &obj, const Context &... ctx, const std::unique_ptr< TH1 > &hist) const=0
 

Constructor & Destructor Documentation

◆ ContextApplier()

ContextApplier ( const fs::path &  filePath,
bool  correction,
bool  uncertainties 
)
inline
115  : GenericSFApplier(filePath, correction, uncertainties)
116  {
118  }

Member Function Documentation

◆ binIndex()

int binIndex ( const SimpleObject obj,
const unique_ptr< int > &  ctx,
const unique_ptr< TH1 > &  hist 
) const
inlineoverride
129  {
130  BOOST_TEST( ctx.get() == expectedContext.get() );
131  return hist->FindBin(obj.bin);
132  }

◆ passes()

bool passes ( const SimpleObject ,
const unique_ptr< int > &  ctx 
) const
inlineoverride
121  {
122  BOOST_TEST( ctx.get() == expectedContext.get() );
123  return true;
124  }

Member Data Documentation

◆ expectedContext

unique_ptr<int> expectedContext = make_unique<int>(42)

The test passes this pointer and we check that we receive it correctly.


The documentation for this struct was generated from the following file:
DAS::GenericSFApplier< SimpleObject, unique_ptr< int > >::GenericSFApplier
GenericSFApplier(const std::filesystem::path &filePath, bool correction, bool uncertainties)
Constructor.
Definition: GenericSFApplier.h:153
DAS::GenericSFApplier< SimpleObject, unique_ptr< int > >::loadNominal
void loadNominal(const std::string &histPath)
Loads the histogram with the nominal scale factor. Has no effect when not applying the correction.
Definition: GenericSFApplier.h:259
BOOST_TEST
BOOST_TEST(gendijet.Rapidity()==1.3573785791881385)
ContextApplier::expectedContext
unique_ptr< int > expectedContext
The test passes this pointer and we check that we receive it correctly.
Definition: testGenericSFApplier.cc:112
HIST_PREFIX
#define HIST_PREFIX
Definition: testGenericSFApplier.cc:21
SimpleObject::bin
int bin
Definition: testGenericSFApplier.cc:80