MaCh3 2.2.1
Reference Guide
Loading...
Searching...
No Matches
Public Member Functions | List of all members
PySampleHandlerBase Class Reference

EW: As SampleHandlerBase is an abstract base class we have to do some gymnastics to get it to get it into python. More...

Inheritance diagram for PySampleHandlerBase:
[legend]
Collaboration diagram for PySampleHandlerBase:
[legend]

Public Member Functions

std::string GetSampleName (int iSample) const override
 
void Reweight () override
 
void CleanMemoryBeforeFit () override
 Allow to clean not used memory before fit starts.
 
double GetLikelihood () override
 
 SampleHandlerBase ()
 The main constructor.
 
- Public Member Functions inherited from SampleHandlerBase
 SampleHandlerBase ()
 The main constructor.
 
virtual ~SampleHandlerBase ()
 destructor
 
virtual M3::int_t GetNsamples ()
 
virtual std::string GetTitle () const
 
virtual std::string GetSampleName (int Sample) const =0
 
virtual double GetSampleLikelihood (const int isample)
 
virtual void CleanMemoryBeforeFit ()=0
 Allow to clean not used memory before fit starts.
 
virtual void SaveAdditionalInfo (TDirectory *Dir)
 Store additional info in a chan.
 
MaCh3ModesGetMaCh3Modes () const
 Return pointer to MaCh3 modes.
 
virtual void Reweight ()=0
 
virtual double GetLikelihood ()=0
 
unsigned int GetNEvents () const
 
virtual int GetNMCSamples ()
 
virtual int GetNOscChannels ()
 
virtual void SetupBinning (const M3::int_t Selection, std::vector< double > &BinningX, std::vector< double > &BinningY)
 
virtual TH1 * GetData (const int Selection)
 
virtual TH2Poly * GetW2 (const int Selection)
 
virtual TH1 * GetPDF (const int Selection)
 
virtual TH1 * GetPDFMode (const int Selection, const int Mode)
 
virtual std::string GetKinVarLabel (const int sample, const int Dimension)
 
double GetTestStatLLH (double data, double mc) const
 Calculate test statistic for a single bin using Poisson.
 
double GetTestStatLLH (const double data, const double mc, const double w2) const
 Calculate test statistic for a single bin. Calculation depends on setting of fTestStatistic. Data and mc -> 0 cut-offs are defined in M3::LOW_MC_BOUND.
 
void SetTestStatistic (TestStatistic testStat)
 Set the test statistic to be used when calculating the binned likelihoods.
 

Additional Inherited Members

- Protected Member Functions inherited from SampleHandlerBase
void QuietPlease ()
 CW: Redirect std::cout to silence some experiment specific libraries.
 
void NowTalk ()
 CW: Redirect std::cout to silence some experiment specific libraries.
 
template<typename T >
bool MatchCondition (const std::vector< T > &allowedValues, const T &value)
 check if event is affected by following conditions, for example pdg, or modes etc
 
- Protected Attributes inherited from SampleHandlerBase
TestStatistic fTestStatistic
 Test statistic tells what kind of likelihood sample is using.
 
std::streambuf * buf
 Keep the cout buffer.
 
std::streambuf * errbuf
 Keep the cerr buffer.
 
M3::int_t nSamples
 Contains how many samples we've got.
 
unsigned int nEvents
 Number of MC events are there.
 
std::unique_ptr< MaCh3ModesModes
 Holds information about used Generator and MaCh3 modes.
 

Detailed Description

EW: As SampleHandlerBase is an abstract base class we have to do some gymnastics to get it to get it into python.

Definition at line 10 of file samples.cpp.

Member Function Documentation

◆ CleanMemoryBeforeFit()

void PySampleHandlerBase::CleanMemoryBeforeFit ( )
inlineoverridevirtual

Allow to clean not used memory before fit starts.

Implements SampleHandlerBase.

Definition at line 35 of file samples.cpp.

35 {
36 PYBIND11_OVERRIDE_PURE(
37 void, /* Return type */
38 SampleHandlerBase, /* Parent class */
39 CleanMemoryBeforeFit /* Name of function in C++ (must match Python name) */
40 );
41 }
void CleanMemoryBeforeFit() override
Allow to clean not used memory before fit starts.
Definition: samples.cpp:35
Class responsible for handling implementation of samples used in analysis, reweighting and returning ...

◆ GetLikelihood()

double PySampleHandlerBase::GetLikelihood ( )
inlineoverridevirtual

Implements SampleHandlerBase.

Definition at line 43 of file samples.cpp.

43 {
44 PYBIND11_OVERRIDE_PURE_NAME(
45 double, /* Return type */
46 SampleHandlerBase, /* Parent class */
47 "get_likelihood", /* Python name*/
48 GetLikelihood /* Name of function in C++ (must match Python name) */
49 /* Argument(s) */
50 );
51 }
double GetLikelihood() override
Definition: samples.cpp:43

◆ GetSampleName()

std::string PySampleHandlerBase::GetSampleName ( int  iSample) const
inlineoverridevirtual

Implements SampleHandlerBase.

Definition at line 16 of file samples.cpp.

16 {
17 PYBIND11_OVERRIDE_PURE(
18 std::string, /* Return type */
19 SampleHandlerBase, /* Parent class */
20 GetSampleName, /* Name of function in C++ (must match Python name) */
21 iSample /* Argument(s) */
22 );
23 }
std::string GetSampleName(int iSample) const override
Definition: samples.cpp:16

◆ Reweight()

void PySampleHandlerBase::Reweight ( )
inlineoverridevirtual

Implements SampleHandlerBase.

Definition at line 26 of file samples.cpp.

26 {
27 PYBIND11_OVERRIDE_PURE(
28 void, /* Return type */
29 SampleHandlerBase, /* Parent class */
30 Reweight /* Name of function in C++ (must match Python name) */
31 );
32 }
void Reweight() override
Definition: samples.cpp:26

◆ SampleHandlerBase()

SampleHandlerBase::SampleHandlerBase ( )

The main constructor.

Definition at line 29 of file SampleHandlerBase.cpp.

4 {
5// ***************************************************************************
6 nEvents = 0;
7 nSamples = 0;
8}
M3::int_t nSamples
Contains how many samples we've got.
unsigned int nEvents
Number of MC events are there.

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