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 GenericHistSFApplier< SimpleObject, unique_ptr< int > >
 GenericHistSFApplier (const std::filesystem::path &filePath, bool correction, bool uncertainties)
 
virtual ~GenericHistSFApplier () 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 GenericHistSFApplier< SimpleObject, unique_ptr< int > >
enum  Interpretation
 
- Protected Member Functions inherited from GenericHistSFApplier< 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
114  : GenericHistSFApplier(filePath, correction, uncertainties)
115  {
117  }

Member Function Documentation

◆ binIndex()

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

◆ passes()

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

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:
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:111
HIST_PREFIX
#define HIST_PREFIX
Definition: testGenericSFApplier.cc:20
DAS::GenericHistSFApplier< SimpleObject, unique_ptr< int > >::GenericHistSFApplier
GenericHistSFApplier(const std::filesystem::path &filePath, bool correction, bool uncertainties)
Constructor.
Definition: GenericSFApplier.h:143
SimpleObject::bin
int bin
Definition: testGenericSFApplier.cc:79
DAS::GenericHistSFApplier< 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:248