6#include <unordered_map>
16#include "TObjString.h"
22#include "Constants/OscillatorConstants.h"
36constexpr unsigned int str2int(
const char* str,
const int h = 0) {
38 return !str[h] ? 5381 : (
str2int(str, h+1) * 33) ^ str[h];
92 name =
"TargetMat_Undefined";
125 std::string name =
"";
132 name =
"Barlow-Beeston";
141 name =
"Dembinski-Abdelmotteleb";
148 MACH3LOG_ERROR(
"You gave test-statistic {}",
static_cast<int>(i));
190 int FindXBin(
const double XVar,
const int NomXBin)
const {
231 case 11:
return 0.00051099895;
232 case 13:
return 0.1056583755;
233 case 15:
return 1.77693;
242 case 211:
return 0.13957039;
243 case 111:
return 0.1349768;
244 case 221:
return 0.547862;
249 case 321:
return 0.493677;
251 case 2112:
return 0.939565;
252 case 2212:
return 0.938272;
253 case 3122:
return 1.115683;
254 case 3222:
return 1.118937;
255 case 3112:
return 1.197449;
256 case 3212:
return 1.192642;
258 case 1000050110:
return 10.255103;
259 case 1000060120:
return 11.177929;
260 case 1000070140:
return 13.043781;
261 case 1000080160:
return 14.899169;
262 case 1000090190:
return 17.696901;
263 case 1000110230:
return 21.414835;
264 case 1000130270:
return 25.133144;
265 case 1000140280:
return 26.060342;
266 case 1000190390:
return 36.294463;
267 case 1000180400:
return 37.224724;
268 case 1000220480:
return 44.663224;
269 case 1000300640:
return 59.549619;
286 switch(std::abs(NuPdg)){
288 NuOscillatorFlavour = NuOscillator::kElectron;
291 NuOscillatorFlavour = NuOscillator::kMuon;
294 NuOscillatorFlavour = NuOscillator::kTau;
297 MACH3LOG_ERROR(
"Unknown Neutrino PDG {}, cannot convert to NuOscillator type", NuPdg);
304 if(NuPdg < 0){NuOscillatorFlavour *= -1;}
306 return NuOscillatorFlavour;
312 inline std::string
FormatDouble(
const double value,
const int precision) {
314 std::ostringstream oss;
315 oss << std::fixed << std::setprecision(precision) << value;
#define _MaCh3_Safe_Include_Start_
KS: Avoiding warning checking for headers.
#define _MaCh3_Safe_Include_End_
KS: Restore warning checking after including external headers.
KS: Based on this https://github.com/gabime/spdlog/blob/a2b4262090fd3f005c2315dcb5be2f0f1774a005/incl...
NuPDG
Enum to track the incoming neutrino species.
std::string TargetMat_ToString(const TargetMat i)
Converted the Target Mat to a string.
TargetMat
Enum to track the target material.
@ kTarget_Fe
Iron (Atomic number 26)
@ kTarget_C
Carbon 12 (Atomic number 6)
@ kTarget_Al
Aluminum (Atomic number 13)
@ kTarget_H
Hydrogen (Atomic number 1)
@ kTarget_Ti
Titanium (Atomic number 22)
@ kTarget_Ar
Argon (Atomic number 18)
@ kTarget_N
Nitrogen (Atomic number 7)
@ kTarget_Pb
Lead (Atomic number 82)
@ kTarget_O
Oxygen 16 (Atomic number 8)
TestStatistic
Make an enum of the test statistic that we're using.
@ kNTestStatistics
Number of test statistics.
@ kPearson
Standard Pearson likelihood .
@ kBarlowBeeston
Barlow-Beeston () following Conway approximation ()
@ kDembinskiAbdelmotteleb
Based on .
@ kPoisson
Standard Poisson likelihood .
constexpr unsigned int str2int(const char *str, const int h=0)
KS: This is mad way of converting string to int. Why? To be able to use string with switch.
std::string TestStatistic_ToString(TestStatistic i)
Convert a LLH type to a string.
Custom exception class for MaCh3 errors.
static constexpr const double _BAD_DOUBLE_
Default value used for double initialisation.
static constexpr const int _BAD_INT_
Default value used for int initialisation.
double GetMassFromPDG(const int PDG)
Return mass for given PDG.
std::string FormatDouble(const double value, const int precision)
Convert double into string for precision, useful for playing with yaml if you don't want to have in c...
int PDGToNuOscillatorFlavour(int NuPdg)
Convert from PDG flavour to NuOscillator type beware that in the case of anti-neutrinos the NuOscilla...
KS: Small struct used for applying kinematic cuts.
double UpperBound
Upper bound on which we apply cut.
double LowerBound
Lower bound on which we apply cut.
int ParamToCutOnIt
Index or enum value identifying the kinematic variable to cut on.
KS: Small struct storying info about used binning.
std::vector< double > YBinEdges
Vector to hold y-axis bin-edges.
std::vector< double > rw_upper_xbinedge
upper to check if Eb has moved the erec bin
size_t nXBins
Number of X axis bins in the histogram used for likelihood calculation.
std::vector< double > rw_lower_lower_xbinedge
lower to check if Eb has moved the erec bin
size_t nYBins
Number of Y axis bins in the histogram used for likelihood calculation.
std::vector< double > rw_lower_xbinedge
lower to check if Eb has moved the erec bin
std::vector< double > rw_upper_upper_xbinedge
upper to check if Eb has moved the erec bin
std::vector< double > XBinEdges
Vector to hold x-axis bin-edges.
int FindXBin(const double XVar, const int NomXBin) const
DB Find the relevant bin in the PDF for each event.