6#include <unordered_map>
16#include "TObjString.h"
33template<
typename T,
size_t N >
36 return std::vector<T>(data, data+N);
53 for (
auto& innerVec : vec) {
55 innerVec.shrink_to_fit();
64void CleanVector(std::vector<std::vector<std::vector<T>>>& vec) {
66 for (
auto& inner2DVec : vec) {
67 for (
auto& innerVec : inner2DVec) {
69 innerVec.shrink_to_fit();
72 inner2DVec.shrink_to_fit();
82void CleanVector(std::vector<std::vector<std::vector<std::vector<std::vector<std::vector<std::vector<T>>>>>>> &vec) {
84 for (
auto& v6 : vec) {
117 for (T* ptr : container) {
122 container.shrink_to_fit();
130 for (
auto& container2D : container) {
131 for (
auto& container1D : container2D) {
132 for (T* ptr : container1D) {
136 container1D.shrink_to_fit();
139 container2D.shrink_to_fit();
142 container.shrink_to_fit();
174 std::vector< std::vector< std::vector<double> > >
Selection;
204 std::vector< std::vector< std::vector<double> > >
Selection;
241 std::string Func =
"";
244 Func =
"([1]+[0]*x)";
251 MACH3LOG_ERROR(
"Interpolation type {} not supported for TF1!",
static_cast<int>(i));
278 MACH3LOG_ERROR(
"kSplineInterpolations is not a valid interpolation type!");
292 std::string name =
"";
312 MACH3LOG_ERROR(
"kSplineInterpolations is not a valid interpolation type!");
352 std::string name =
"";
364 name =
"Oscillation";
#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...
std::string SplineInterpolation_ToString(const SplineInterpolation i)
Convert a LLH type to a string.
SplineInterpolation
Make an enum of the spline interpolation type.
@ kTSpline3
Default TSpline3 interpolation.
@ kMonotonic
EM: DOES NOT make the entire spline monotonic, only the segments.
@ kSplineInterpolations
This only enumerates.
@ kLinear
Linear interpolation between knots.
@ kLinearFunc
Liner interpolation using TF1 not spline.
@ kAkima
EM: Akima spline iis allowed to be discontinuous in 2nd derivative and coefficients in any segment.
RespFuncType
Make an enum of the spline interpolation type.
@ kTF1_red
Uses TF1_red for interpolation.
@ kTSpline3_red
Uses TSpline3_red for interpolation.
@ kRespFuncTypes
This only enumerates.
std::vector< T > MakeVector(const T(&data)[N])
Template to make vector out of an array of any length.
void CleanVector(std::vector< T > &vec)
Generic cleanup function.
std::string GetTF1(const SplineInterpolation i)
Get function for TF1_red.
std::function< void(const double *, std::size_t)> FuncParFuncType
std::string SystType_ToString(const SystType i)
Convert a Syst type type to a string.
void CleanContainer(std::vector< T * > &container)
Generic cleanup function.
RespFuncType SplineInterpolation_ToRespFuncType(const SplineInterpolation i)
Convert a RespFuncType type to a SplineInterpolation.
@ kNorm
For normalisation parameters.
@ kSpline
For splined parameters (1D)
@ kSystTypes
This only enumerates.
@ kOsc
For oscillation parameters.
@ kFunc
For functional parameters.
Custom exception class for MaCh3 errors.
static constexpr const int _BAD_INT_
Default value used for int initialisation.
HH - Functional parameters Carrier for whether you want to apply a systematic to an event or not.
std::vector< int > modes
Mode which parameter applies to.
std::vector< std::string > KinematicVarStr
const double * valuePtr
Parameter value pointer.
bool hasKinBounds
Does this parameter have kinematic bounds.
std::vector< int > targets
Targets which parameter applies to.
std::vector< int > horncurrents
Horn currents which parameter applies to.
std::vector< int > pdgs
PDG which parameter applies to.
FuncParFuncType * funcPtr
Function pointer.
std::vector< std::vector< std::vector< double > > > Selection
std::vector< int > preoscpdgs
Preosc PDG which parameter applies to.
ETA - Normalisations for cross-section parameters Carrier for whether you want to apply a systematic ...
std::vector< int > preoscpdgs
Preosc PDG which parameter applies to.
bool hasKinBounds
Does this parameter have kinematic bounds.
std::vector< std::vector< std::vector< double > > > Selection
std::vector< int > modes
Mode which parameter applies to.
std::vector< int > horncurrents
Horn currents which parameter applies to.
std::vector< int > pdgs
PDG which parameter applies to.
std::vector< std::string > KinematicVarStr
std::vector< int > targets
Targets which parameter applies to.
KS: Struct holding info about oscillation Systematics.
KS: Struct holding info about Spline Systematics.
SplineInterpolation _SplineInterpolationType
Spline interpolation vector.
double _SplineKnotUpBound
EM: Cap spline knot higher value.
double _SplineKnotLowBound
EM: Cap spline knot lower value.
std::vector< int > _fSplineModes
Modes to which spline applies (valid only for binned splines)
Base class storing info for parameters types, helping unify codebase.
int index
Parameter number of this normalisation in current systematic model.
std::string name
Name of parameters.