42 virtual inline std::string
GetTitle()
const {
return "SampleHandler";};
67 virtual void SetupBinning(
const M3::int_t Selection, std::vector<double> &BinningX, std::vector<double> &BinningY){
68 (void) Selection; (void) BinningX; (void) BinningY;
throw MaCh3Exception(__FILE__ , __LINE__ ,
"Not implemented");}
69 virtual TH1*
GetData(
const int Selection) { (void) Selection;
throw MaCh3Exception(__FILE__ , __LINE__ ,
"Not implemented"); }
70 virtual TH2Poly*
GetW2(
const int Selection){ (void) Selection;
throw MaCh3Exception(__FILE__ , __LINE__ ,
"Not implemented");}
71 virtual TH1*
GetPDF(
const int Selection){ (void) Selection;
throw MaCh3Exception(__FILE__ , __LINE__ ,
"Not implemented");}
72 virtual inline TH1*
GetPDFMode(
const int Selection,
const int Mode) {
73 (void) Selection; (void) Mode;
throw MaCh3Exception(__FILE__ , __LINE__ ,
"Not implemented"); }
74 virtual inline std::string
GetKinVarLabel(
const int sample,
const int Dimension) {
75 (void) sample; (void) Dimension;
throw MaCh3Exception(__FILE__ , __LINE__ ,
"Not implemented"); };
95 double GetTestStatLLH(
const double data,
const double mc,
const double w2)
const;
108 template <
typename T>
110 if (allowedValues.empty()) {
113 return std::find(allowedValues.begin(), allowedValues.end(), value) != allowedValues.end();
#define _MaCh3_Safe_Include_Start_
KS: Avoiding warning checking for headers.
#define _MaCh3_Safe_Include_End_
KS: Restore warning checking after including external headers.
TestStatistic
Make an enum of the test statistic that we're using.
Custom exception class for MaCh3 errors.
KS: Class describing MaCh3 modes used in the analysis, it is being initialised from config.
Class responsible for handling implementation of samples used in analysis, reweighting and returning ...
virtual ~SampleHandlerBase()
destructor
virtual void SetupBinning(const M3::int_t Selection, std::vector< double > &BinningX, std::vector< double > &BinningY)
void NowTalk()
CW: Redirect std::cout to silence some experiment specific libraries.
std::unique_ptr< MaCh3Modes > Modes
Holds information about used Generator and MaCh3 modes.
virtual void Reweight()=0
virtual TH1 * GetPDFMode(const int Selection, const int Mode)
std::streambuf * buf
Keep the cout buffer.
virtual TH1 * GetPDF(const int Selection)
SampleHandlerBase()
The main constructor.
std::streambuf * errbuf
Keep the cerr buffer.
virtual TH2Poly * GetW2(const int Selection)
TestStatistic fTestStatistic
Test statistic tells what kind of likelihood sample is using.
virtual std::string GetKinVarLabel(const int sample, const int Dimension)
virtual TH1 * GetData(const int Selection)
M3::int_t nSamples
Contains how many samples we've got.
unsigned int nEvents
Number of MC events are there.
virtual void CleanMemoryBeforeFit()=0
Allow to clean not used memory before fit starts.
virtual void SaveAdditionalInfo(TDirectory *Dir)
Store additional info in a chan.
bool MatchCondition(const std::vector< T > &allowedValues, const T &value)
check if event is affected by following conditions, for example pdg, or modes etc
void QuietPlease()
CW: Redirect std::cout to silence some experiment specific libraries.
virtual std::string GetSampleName(int Sample) const =0
void SetTestStatistic(TestStatistic testStat)
Set the test statistic to be used when calculating the binned likelihoods.
virtual double GetSampleLikelihood(const int isample)
virtual int GetNMCSamples()
virtual double GetLikelihood()=0
unsigned int GetNEvents() const
virtual std::string GetTitle() const
MaCh3Modes * GetMaCh3Modes() const
Return pointer to MaCh3 modes.
double GetTestStatLLH(double data, double mc) const
Calculate test statistic for a single bin using Poisson.
virtual M3::int_t GetNsamples()
virtual int GetNOscChannels()