44 for (
auto const ¶m :
_fYAMLDoc[
"Systematics"])
46 _ParameterGroup[i] = Get<std::string>(param[
"Systematic"][
"ParameterGroup"], __FILE__ , __LINE__);
49 auto ParamType = Get<std::string>(param[
"Systematic"][
"Type"], __FILE__ , __LINE__);
58 if (param[
"Systematic"][
"SplineInformation"][
"SplineName"]) {
59 _fSplineNames.push_back(param[
"Systematic"][
"SplineInformation"][
"SplineName"].as<std::string>());
82 MACH3LOG_ERROR(
"Given unrecognised systematic type: {}", param[
"Systematic"][
"Type"].as<std::string>());
83 std::string expectedTypes =
"Expecting ";
85 if (s > 0) expectedTypes +=
", ";
117 std::vector<std::string> returnVec;
119 auto &SplineIndex = pair.first;
120 auto &SystIndex = pair.second;
131 std::vector<SplineInterpolation> returnVec;
133 auto &SplineIndex = pair.first;
134 auto &SystIndex = pair.second;
137 returnVec.push_back(
SplineParams.at(SplineIndex)._SplineInterpolationType);
147 std::vector< std::vector<int> > returnVec;
151 auto &SplineIndex = pair.first;
152 auto &SystIndex = pair.second;
154 returnVec.push_back(
SplineParams.at(SplineIndex)._fSplineModes);
170 norm.
modes = GetFromManager<std::vector<int>>(param[
"Mode"], {}, __FILE__ , __LINE__);
171 norm.
pdgs = GetFromManager<std::vector<int>>(param[
"NeutrinoFlavour"], {}, __FILE__ , __LINE__);
172 norm.
preoscpdgs = GetFromManager<std::vector<int>>(param[
"NeutrinoFlavourUnosc"], {}, __FILE__ , __LINE__);
173 norm.
targets = GetFromManager<std::vector<int>>(param[
"TargetNuclei"], {}, __FILE__ , __LINE__);
176 MACH3LOG_ERROR(
"Normalisation Parameter {} ({}), has lower parameters bound which can go below 0 and is equal {}",
178 MACH3LOG_ERROR(
"Normalisation parameters can't go bellow 0 as this is unphysical");
181 int NumKinematicCuts = 0;
182 if(param[
"KinematicCuts"]) {
183 NumKinematicCuts = int(param[
"KinematicCuts"].size());
185 std::vector<std::string> TempKinematicStrings;
186 std::vector<std::vector<std::vector<double>>> TempKinematicBounds;
188 for(
int KinVar_i = 0 ; KinVar_i < NumKinematicCuts ; ++KinVar_i) {
190 for (YAML::const_iterator it = param[
"KinematicCuts"][KinVar_i].begin();it!=param[
"KinematicCuts"][KinVar_i].end();++it) {
191 TempKinematicStrings.push_back(it->first.as<std::string>());
192 TempKinematicBounds.push_back(
Get2DBounds(it->second));
194 if(TempKinematicStrings.size() == 0) {
195 MACH3LOG_ERROR(
"Received a KinematicCuts node but couldn't read the contents (it's a list of single-element dictionaries (python) = map of pairs (C++))");
206 bool HasKinBounds =
false;
226 Parameter.
index = Index;
235 std::vector<int> returnVec;
237 auto &SystIndex = pair.second;
239 returnVec.push_back(SystIndex);
250 std::vector<int> returnVec;
252 auto &SplineIndex = pair.first;
253 auto &systIndex = pair.second;
255 returnVec.push_back(SplineIndex);
269 if (param[
"SplineInformation"][
"InterpolationType"]){
281 MACH3LOG_WARN(
"Spline knot capping enabled with bounds [{}, {}]. For reliable fits, consider modifying the input generation instead.",
297 func.
pdgs = GetFromManager<std::vector<int>>(param[
"NeutrinoFlavour"], std::vector<int>(), __FILE__ , __LINE__);
298 func.
targets = GetFromManager<std::vector<int>>(param[
"TargetNuclei"], std::vector<int>(), __FILE__ , __LINE__);
299 func.
modes = GetFromManager<std::vector<int>>(param[
"Mode"], std::vector<int>(), __FILE__ , __LINE__);
300 func.
preoscpdgs = GetFromManager<std::vector<int>>(param[
"NeutrinoFlavourUnosc"], std::vector<int>(), __FILE__ , __LINE__);
303 int NumKinematicCuts = 0;
304 if(param[
"KinematicCuts"]) {
305 NumKinematicCuts = int(param[
"KinematicCuts"].size());
307 std::vector<std::string> TempKinematicStrings;
308 std::vector<std::vector<std::vector<double>>> TempKinematicBounds;
310 for(
int KinVar_i = 0 ; KinVar_i < NumKinematicCuts ; ++KinVar_i){
312 for (YAML::const_iterator it = param[
"KinematicCuts"][KinVar_i].begin();it!=param[
"KinematicCuts"][KinVar_i].end();++it) {
313 TempKinematicStrings.push_back(it->first.as<std::string>());
314 TempKinematicBounds.push_back(
Get2DBounds(it->second));
316 if(TempKinematicStrings.size() == 0) {
317 MACH3LOG_ERROR(
"Received a KinematicCuts node but couldn't read the contents (it's a list of single-element dictionaries (python) = map of pairs (C++))");
361 template<
typename ParamT>
364 std::vector<ParamT> returnVec;
365 for (
const auto& pair : indexMap) {
366 const auto& localIndex = pair.first;
367 const auto& globalIndex = pair.second;
369 returnVec.push_back(params[localIndex]);
382 [&](int) { returnVal += 1; }
391 std::vector<std::string> returnVec;
403 std::vector<int> returnVec;
406 [&](
int i) { returnVec.push_back(i); }
412 template <
typename FilterFunc,
typename ActionFunc>
415 for (
int i = 0; i <
_fNumPar; ++i) {
425 for (
int i = 0; i <
_fNumPar; ++i) {
427 _fNames[i] =
"param_"+std::to_string(i);
446 PCAObj->SetInitialParameters();
454 MACH3LOG_INFO(
"#################################################");
470 MACH3LOG_INFO(
"#################################################");
478 MACH3LOG_INFO(
"============================================================================================================================================================");
479 MACH3LOG_INFO(
"{:<5} {:2} {:<40} {:2} {:<10} {:2} {:<10} {:2} {:<10} {:2} {:<10} {:2} {:<10} {:2} {:<20} {:2} {:<10}",
"#",
"|",
"Name",
"|",
"Prior",
"|",
"Error",
"|",
"Lower",
"|",
"Upper",
"|",
"StepScale",
"|",
"SampleNames",
"|",
"Type");
480 MACH3LOG_INFO(
"------------------------------------------------------------------------------------------------------------------------------------------------------------");
482 std::string ErrString = fmt::format(
"{:.2f}",
_fError[i]);
483 std::string SampleNameString =
"";
485 if (!SampleNameString.empty()) {
486 SampleNameString +=
", ";
488 SampleNameString += SampleName;
490 MACH3LOG_INFO(
"{:<5} {:2} {:<40} {:2} {:<10} {:2} {:<10} {:2} {:<10} {:2} {:<10} {:2} {:<10} {:2} {:<20} {:2} {:<10}", i,
"|",
GetParFancyName(i),
"|",
_fPreFitValue[i],
"|",
"+/- " + ErrString,
"|",
_fLowBound[i],
"|",
_fUpBound[i],
"|",
_fIndivStepScale[i],
"|", SampleNameString,
"|",
SystType_ToString(
_fParamType[i]));
492 MACH3LOG_INFO(
"============================================================================================================================================================");
502 bool have_parameter_with_kin_bounds =
false;
505 MACH3LOG_INFO(
"┌────┬──────────┬────────────────────────────────────────┬────────────────────┬────────────────────┬────────────────────┐");
506 MACH3LOG_INFO(
"│{0:4}│{1:10}│{2:40}│{3:20}│{4:20}│{5:20}│",
"#",
"Global #",
"Name",
"Int. mode",
"Target",
"pdg");
507 MACH3LOG_INFO(
"├────┼──────────┼────────────────────────────────────────┼────────────────────┼────────────────────┼────────────────────┤");
509 for (
unsigned int i = 0; i <
NormParams.size(); ++i)
511 std::string intModeString;
512 for (
unsigned int j = 0; j <
NormParams[i].modes.size(); j++) {
513 intModeString += std::to_string(
NormParams[i].modes[j]);
514 intModeString +=
" ";
516 if (
NormParams[i].modes.empty()) intModeString +=
"all";
518 std::string targetString;
519 for (
unsigned int j = 0; j <
NormParams[i].targets.size(); j++) {
520 targetString += std::to_string(
NormParams[i].targets[j]);
523 if (
NormParams[i].targets.empty()) targetString +=
"all";
525 std::string pdgString;
526 for (
unsigned int j = 0; j <
NormParams[i].pdgs.size(); j++) {
527 pdgString += std::to_string(
NormParams[i].pdgs[j]);
530 if (
NormParams[i].pdgs.empty()) pdgString +=
"all";
534 if(
NormParams[i].hasKinBounds) have_parameter_with_kin_bounds =
true;
536 MACH3LOG_INFO(
"└────┴──────────┴────────────────────────────────────────┴────────────────────┴────────────────────┴────────────────────┘");
538 if(have_parameter_with_kin_bounds) {
539 MACH3LOG_INFO(
"Normalisation parameters KinematicCuts information");
540 MACH3LOG_INFO(
"┌────┬──────────┬────────────────────────────────────────┬────────────────────┬────────────────────────────────────────┐");
541 MACH3LOG_INFO(
"│{0:4}│{1:10}│{2:40}│{3:20}│{4:40}│",
"#",
"Global #",
"Name",
"KinematicCut",
"Value");
542 MACH3LOG_INFO(
"├────┼──────────┼────────────────────────────────────────┼────────────────────┼────────────────────────────────────────┤");
543 for (
unsigned int i = 0; i <
NormParams.size(); ++i)
548 const long unsigned int ncuts =
NormParams[i].KinematicVarStr.size();
549 for(
long unsigned int icut = 0; icut < ncuts; icut++) {
550 std::string kinematicCutValueString;
551 for(
const auto & value :
NormParams[i].Selection[icut]) {
552 for (
const auto& v : value) {
553 kinematicCutValueString += fmt::format(
"{:.2f} ", v);
559 MACH3LOG_INFO(
"│{: <4}│{: <10}│{: <40}│{: <20}│{: <40}│",
"",
"",
"",
NormParams[i].KinematicVarStr[icut], kinematicCutValueString);
562 MACH3LOG_INFO(
"└────┴──────────┴────────────────────────────────────────┴────────────────────┴────────────────────────────────────────┘");
565 MACH3LOG_INFO(
"No normalisation parameters have KinematicCuts defined");
573 MACH3LOG_INFO(
"=====================================================================================================================================================================");
574 MACH3LOG_INFO(
"{:<4} {:<2} {:<40} {:<2} {:<40} {:<2} {:<20} {:<2} {:<20} {:<2} {:<20} {:<2}",
"#",
"|",
"Name",
"|",
"Spline Name",
"|",
"Spline Interpolation",
"|",
"Low Knot Bound",
"|",
"Up Knot Bound",
"|");
575 MACH3LOG_INFO(
"---------------------------------------------------------------------------------------------------------------------------------------------------------------------");
577 auto &SplineIndex = pair.first;
578 auto &GlobalIndex = pair.second;
580 MACH3LOG_INFO(
"{:<4} {:<2} {:<40} {:<2} {:<40} {:<2} {:<20} {:<2} {:<20} {:<2} {:<20} {:<2}",
587 MACH3LOG_INFO(
"=====================================================================================================================================================================");
595 MACH3LOG_INFO(
"┌────┬──────────┬────────────────────────────────────────┐");
596 MACH3LOG_INFO(
"│{0:4}│{1:10}│{2:40}│",
"#",
"Global #",
"Name");
597 MACH3LOG_INFO(
"├────┼──────────┼────────────────────────────────────────┤");
599 auto &FuncIndex = pair.first;
600 auto &GlobalIndex = pair.second;
603 MACH3LOG_INFO(
"└────┴──────────┴────────────────────────────────────────┘");
611 MACH3LOG_INFO(
"┌────┬──────────┬────────────────────────────────────────┐");
612 MACH3LOG_INFO(
"│{0:4}│{1:10}│{2:40}│",
"#",
"Global #",
"Name");
613 MACH3LOG_INFO(
"├────┼──────────┼────────────────────────────────────────┤");
615 auto &OscIndex = pair.first;
616 auto &GlobalIndex = pair.second;
619 MACH3LOG_INFO(
"└────┴──────────┴────────────────────────────────────────┘");
626 std::unordered_map<std::string, int> paramCounts;
629 [¶mCounts](
const std::string& param) {
630 paramCounts[param]++;
635 for (
const auto& pair : paramCounts) {
636 MACH3LOG_INFO(
"Found {}: {} params", pair.second, pair.first);
643 std::unordered_set<std::string> uniqueGroups;
647 uniqueGroups.insert(param);
651 std::vector<std::string> result(uniqueGroups.begin(), uniqueGroups.end());
660 auto CheckForDuplicates = [](
const std::vector<std::string>& names,
const std::string& nameType) {
661 std::unordered_map<std::string, size_t> seenStrings;
662 for (
size_t i = 0; i < names.size(); ++i) {
663 const auto& name = names[i];
664 if (seenStrings.find(name) != seenStrings.end()) {
665 size_t firstIndex = seenStrings[name];
666 MACH3LOG_CRITICAL(
"There are two systematics with the same {} '{}', first at index {}, and again at index {}", nameType, name, firstIndex, i);
669 seenStrings[name] = i;
682 for(
size_t i = 0; i < Groups.size(); i++){
693 for (
int i = 0; i <
_fNumPar; i++) {
698 if (Pars.size() != ExpectedSize) {
699 MACH3LOG_ERROR(
"Number of param in group {} is {}, while you passed {}", Group, ExpectedSize, Pars.size());
703 for (
int i = 0; i <
_fNumPar; i++) {
714 PCAObj->TransferToParam();
730 for(
size_t i = 0; i < Groups.size(); i++)
746 for(
size_t i = 0; i < Groups.size(); i++)
762 for(
size_t i = 0; i < Groups.size(); i++)
770 std::string groupLower = Group;
774 std::transform(groupLower.begin(), groupLower.end(), groupLower.begin(), ::tolower);
775 std::transform(paramGroupLower.begin(), paramGroupLower.end(), paramGroupLower.begin(), ::tolower);
777 return groupLower == paramGroupLower;
784 for (
int i = 0; i <
_fNumPar; i++) {
794 std::vector<const double*> returnVec;
796 const auto& globalIndex = pair.second;
808 TFile* outputFile =
new TFile(Name.c_str(),
"RECREATE");
810 TObjArray* param_names =
new TObjArray();
811 TObjArray* spline_interpolation =
new TObjArray();
812 TObjArray* spline_names =
new TObjArray();
814 TVectorD* param_prior =
new TVectorD(
_fNumPar);
815 TVectorD* flat_prior =
new TVectorD(
_fNumPar);
816 TVectorD* stepscale =
new TVectorD(
_fNumPar);
817 TVectorD* param_lb =
new TVectorD(
_fNumPar);
818 TVectorD* param_ub =
new TVectorD(
_fNumPar);
820 TVectorD* param_knot_weight_lb =
new TVectorD(
_fNumPar);
821 TVectorD* param_knot_weight_ub =
new TVectorD(
_fNumPar);
822 TVectorD* error =
new TVectorD(
_fNumPar);
826 TObjString* nameObj =
new TObjString(
_fFancyNames[i].c_str());
827 param_names->AddLast(nameObj);
829 TObjString* splineType =
new TObjString(
"TSpline3");
830 spline_interpolation->AddLast(splineType);
832 TObjString* splineName =
new TObjString(
"");
833 spline_names->AddLast(splineName);
844 (*param_knot_weight_lb)[i] = -9999;
845 (*param_knot_weight_ub)[i] = +9999;
849 auto &SplineIndex = pair.first;
850 auto &SystIndex = pair.second;
852 (*param_knot_weight_lb)[SystIndex] =
SplineParams.at(SplineIndex)._SplineKnotLowBound;
853 (*param_knot_weight_ub)[SystIndex] =
SplineParams.at(SplineIndex)._SplineKnotUpBound;
856 spline_interpolation->AddAt(splineType, SystIndex);
858 TObjString* splineName =
new TObjString(
_fSplineNames[SplineIndex].c_str());
859 spline_names->AddAt(splineName, SystIndex);
861 param_names->Write(
"xsec_param_names", TObject::kSingleKey);
863 spline_interpolation->Write(
"xsec_spline_interpolation", TObject::kSingleKey);
864 delete spline_interpolation;
865 spline_names->Write(
"xsec_spline_names", TObject::kSingleKey);
868 param_prior->Write(
"xsec_param_prior");
870 flat_prior->Write(
"xsec_flat_prior");
872 stepscale->Write(
"xsec_stepscale");
874 param_lb->Write(
"xsec_param_lb");
876 param_ub->Write(
"xsec_param_ub");
879 param_knot_weight_lb->Write(
"xsec_param_knot_weight_lb");
880 delete param_knot_weight_lb;
881 param_knot_weight_ub->Write(
"xsec_param_knot_weight_ub");
882 delete param_knot_weight_ub;
883 error->Write(
"xsec_error");
888 CorrMatrix->Write(
"hcov");
#define MACH3LOG_CRITICAL
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.
@ kSplineInterpolations
This only enumerates.
std::string SystType_ToString(const SystType i)
Convert a Syst type type to a string.
@ kNorm
For normalisation parameters.
@ kSpline
For splined parameters (1D)
@ kSystTypes
This only enumerates.
@ kOsc
For oscillation parameters.
@ kFunc
For functional parameters.
#define Get2DBounds(filename)
Type GetFromManager(const YAML::Node &node, const Type defval, const std::string File="", const int Line=1)
Get content of config file if node is not found take default value specified.
Custom exception class used throughout MaCh3.
Base class responsible for handling of systematic error parameters. Capable of using PCA or using ada...
int GetNumParams() const
Get total number of parameters.
void ToggleFixParameter(const int i)
Toggle fixing parameter at prior values.
const double * RetPointer(const int iParam)
DB Pointer return to param position.
bool AppliesToSample(const int SystIndex, const std::string &SampleName) const
Check if parameter is affecting given sample name.
std::vector< std::string > _fFancyNames
Fancy name for example rather than param_0 it is MAQE, useful for human reading.
std::vector< bool > _fFlatPrior
Whether to apply flat prior or not.
std::string GetParFancyName(const int i) const
Get fancy name of the Parameter.
std::vector< double > _fError
Prior error on the parameter.
TH2D * GetCorrelationMatrix()
KS: Convert covariance matrix to correlation matrix and return TH2D which can be used for fancy plott...
void SetFixParameter(const int i)
Set parameter to be fixed at prior value.
YAML::Node _fYAMLDoc
Stores config describing systematics.
std::unique_ptr< PCAHandler > PCAObj
Struct containing information about PCA.
int _fNumPar
Number of systematic parameters.
std::vector< double > _fLowBound
Lowest physical bound, parameter will not be able to go beyond it.
std::vector< double > _fCurrVal
Current value of the parameter.
TMatrixDSym * covMatrix
The covariance matrix.
std::vector< double > _fPreFitValue
Parameter value dictated by the prior model. Based on it penalty term is calculated.
void Randomize() _noexcept_
"Randomize" the parameters in the covariance class for the proposed step. Used the proposal kernel an...
std::vector< std::string > _fNames
ETA _fNames is set automatically in the covariance class to be something like param_i,...
void SetFreeParameter(const int i)
Set parameter to be treated as free.
std::vector< double > _fUpBound
Upper physical bound, parameter will not be able to go beyond it.
bool pca
perform PCA or not
std::vector< double > _fIndivStepScale
Individual step scale used by MCMC algorithm.
int PrintLength
KS: This is used when printing parameters, sometimes we have super long parameters name,...
std::vector< double > _fPropVal
Proposed value of the parameter.
std::vector< std::vector< std::string > > _fSampleNames
Tells to which samples object param should be applied.
void PrintNormParams()
Prints normalization parameters.
FunctionalParameter GetFunctionalParameters(const YAML::Node ¶m, const int Index)
Get Func params.
std::vector< SplineParameter > SplineParams
Vector containing info for normalisation systematics.
void PrintParameterGroups()
Prints groups of parameters.
SplineParameter GetSplineParameter(const YAML::Node ¶m, const int Index)
Get Spline params.
const std::vector< NormParameter > GetNormParsFromSampleName(const std::string &SampleName) const
DB Get norm/func parameters depending on given SampleName.
void Print()
Print information about the whole object once it is set.
ParameterHandlerGeneric(const std::vector< std::string > &FileNames, std::string name="xsec_cov", double threshold=-1, int FirstPCAdpar=-999, int LastPCAdpar=-999)
Constructor.
std::vector< std::string > _fSplineNames
Name of spline in TTree (TBranch),.
void PrintOscillationParams()
Prints oscillation parameters.
SystType GetParamType(const int i) const
Returns enum describing our param type.
void ToggleFixGroupOnlyParameters(const std::string &Group)
TN Method to toggle fix/free parameters within a group.
const std::vector< int > GetSystIndexFromSampleName(const std::string &SampleName, const SystType Type) const
Grab the index of the syst relative to global numbering.
void PrintSplineParams()
Prints spline parameters.
void InitParams()
Initializes the systematic parameters from the configuration file. This function loads parameters lik...
const std::vector< int > GetGlobalSystIndexFromSampleName(const std::string &SampleName, const SystType Type)
DB Get spline parameters depending on given SampleName.
std::vector< NormParameter > NormParams
Vector containing info for normalisation systematics.
double GetParSplineKnotUpperBound(const int i) const
EM: value at which we cap spline knot weight.
std::vector< std::map< int, int > > _fSystToGlobalSystIndexMap
Map between number of given parameter type with global parameter numbering. For example 2nd norm para...
void SetGroupOnlyParameters(const std::string &Group, const std::vector< double > &Pars={})
KS Function to set to prior parameters of a given group or values from vector.
std::vector< SystType > _fParamType
Type of parameter like norm, spline etc.
void PrintFunctionalParams()
Prints functional parameters.
void CheckCorrectInitialisation()
KS: Check if matrix is correctly initialised.
const std::vector< int > GetParsIndexFromSampleName(const std::string &SampleName, const SystType Type)
DB Grab the parameter indices for the relevant SampleName.
const std::vector< SplineParameter > GetSplineParsFromSampleName(const std::string &SampleName) const
KS: Grab the Spline parameters for the relevant SampleName.
void PrintGlobablInfo()
Prints general information about the ParameterHandler object.
const std::vector< FunctionalParameter > GetFunctionalParametersFromSampleName(const std::string &SampleName) const
HH Get functional parameters for the relevant SampleName.
void SetFreeGroupOnlyParameters(const std::string &Group)
TN Method to set parameters within a group to be treated as free.
NormParameter GetNormParameter(const YAML::Node ¶m, const int Index)
Get Norm params.
void InitParametersTypeFromConfig()
Parses the YAML configuration to set up cross-section parameters. The YAML file defines the types of ...
std::vector< ParamT > GetTypeParamsFromSampleName(const std::map< int, int > &indexMap, const std::vector< ParamT > ¶ms, const std::string &SampleName) const
Retrieve parameters that apply to a given sample name.
int GetNumParamsFromSampleName(const std::string &SampleName, const SystType Type)
DB Grab the number of parameters for the relevant SampleName.
const std::vector< std::string > GetParsNamesFromSampleName(const std::string &SampleName, const SystType Type)
DB Grab the parameter names for the relevant SampleName.
std::vector< FunctionalParameter > FuncParams
Vector containing info for functional systematics.
std::vector< OscillationParameter > OscParams
Vector containing info for functional systematics.
void DumpMatrixToFile(const std::string &Name)
Dump Matrix to ROOT file, useful when we need to pass matrix info to another fitting group.
SplineInterpolation GetParSplineInterpolation(const int i) const
Get interpolation type for a given parameter.
std::vector< std::string > GetUniqueParameterGroups()
KS: Get names of all unique parameter groups.
const std::vector< std::string > GetSplineParsNamesFromSampleName(const std::string &SampleName)
DB Get spline parameters depending on given SampleName.
OscillationParameter GetOscillationParameters(const YAML::Node ¶m, const int Index)
Get Osc params.
bool IsParFromGroup(const int i, const std::string &Group) const
Checks if parameter belongs to a given group.
void SetFixGroupOnlyParameters(const std::string &Group)
TN Method to set parameters within a group to be fixed to their prior values.
void IterateOverParams(const std::string &SampleName, FilterFunc filter, ActionFunc action)
Iterates over parameters and applies a filter and action function.
void GetBaseParameter(const YAML::Node ¶m, const int Index, TypeParameterBase &Parameter)
Fill base parameters.
std::vector< std::string > _ParameterGroup
KS: Allow to group parameters for example to affect only cross-section or only flux etc.
const std::vector< SplineInterpolation > GetSplineInterpolationFromSampleName(const std::string &SampleName)
Get the interpolation types for splines affecting a particular SampleName.
double GetParSplineKnotLowerBound(const int i) const
EM: value at which we cap spline knot weight.
std::vector< const double * > GetOscParsFromSampleName(const std::string &SampleName)
Get pointers to Osc params from Sample name.
const std::vector< std::vector< int > > GetSplineModeVecFromSampleName(const std::string &SampleName)
DB Grab the Spline Modes for the relevant SampleName.
int GetNumParFromGroup(const std::string &Group) const
KS: Check how many parameters are associated with given group.
~ParameterHandlerGeneric()
Destructor.
constexpr static const double DefSplineKnotUpBound
Default value for spline knot capping, default mean not capping is being applied.
constexpr static const double DefSplineKnotLowBound
Default value for spline knot capping, default mean not capping is being applied.
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.
std::vector< int > targets
Targets which parameter applies to.
std::vector< int > pdgs
PDG which parameter applies to.
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 > 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.