40 unsigned int ParamCounter[SystType::kSystTypes] = {0};
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>());
65 ParamCounter[SystType::kSpline]++;
66 }
else if(param[
"Systematic"][
"Type"].as<std::string>() ==
SystType_ToString(SystType::kNorm)) {
70 ParamCounter[SystType::kNorm]++;
71 }
else if(param[
"Systematic"][
"Type"].as<std::string>() ==
SystType_ToString(SystType::kFunc)){
75 ParamCounter[SystType::kFunc]++;
76 }
else if(param[
"Systematic"][
"Type"].as<std::string>() ==
SystType_ToString(SystType::kOsc)){
80 ParamCounter[SystType::kOsc]++;
82 MACH3LOG_ERROR(
"Given unrecognised systematic type: {}", param[
"Systematic"][
"Type"].as<std::string>());
83 std::string expectedTypes =
"Expecting ";
84 for (
int s = 0; s < SystType::kSystTypes; ++s) {
85 if (s > 0) expectedTypes +=
", ";
97 MACH3LOG_ERROR(
"_fSplineNames is of size {} but found {} spline parameters",
_fSplineNames.size(), ParamCounter[SystType::kSpline]);
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"]){
306 NumKinematicCuts = int(param[
"KinematicCuts"].
size());
308 std::vector<std::string> TempKinematicStrings;
309 std::vector<std::vector<std::vector<double>>> TempKinematicBounds;
311 for(
int KinVar_i = 0 ; KinVar_i < NumKinematicCuts ; ++KinVar_i){
313 for (YAML::const_iterator it = param[
"KinematicCuts"][KinVar_i].begin();it!=param[
"KinematicCuts"][KinVar_i].end();++it) {
314 TempKinematicStrings.push_back(it->first.as<std::string>());
315 TempKinematicBounds.push_back(
Get2DBounds(it->second));
317 if(TempKinematicStrings.size() == 0) {
318 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++))");
362template<
typename ParamT>
365 std::vector<ParamT> returnVec;
366 for (
const auto& pair : indexMap) {
367 const auto& localIndex = pair.first;
368 const auto& globalIndex = pair.second;
370 returnVec.push_back(params[localIndex]);
383 [&](int) { returnVal += 1; }
392 std::vector<std::string> returnVec;
404 std::vector<int> returnVec;
407 [&](
int i) { returnVec.push_back(i); }
413template <
typename FilterFunc,
typename ActionFunc>
416 for (
int i = 0; i <
_fNumPar; ++i) {
426 for (
int i = 0; i <
_fNumPar; ++i) {
428 _fNames[i] =
"xsec_"+std::to_string(i);
455 MACH3LOG_INFO(
"#################################################");
471 MACH3LOG_INFO(
"#################################################");
479 MACH3LOG_INFO(
"============================================================================================================================================================");
480 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");
481 MACH3LOG_INFO(
"------------------------------------------------------------------------------------------------------------------------------------------------------------");
483 std::string ErrString = fmt::format(
"{:.2f}",
_fError[i]);
484 std::string SampleNameString =
"";
486 if (!SampleNameString.empty()) {
487 SampleNameString +=
", ";
489 SampleNameString += SampleName;
491 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]));
493 MACH3LOG_INFO(
"============================================================================================================================================================");
503 bool have_parameter_with_kin_bounds =
false;
506 MACH3LOG_INFO(
"┌────┬──────────┬────────────────────────────────────────┬────────────────────┬────────────────────┬────────────────────┐");
507 MACH3LOG_INFO(
"│{0:4}│{1:10}│{2:40}│{3:20}│{4:20}│{5:20}│",
"#",
"Global #",
"Name",
"Int. mode",
"Target",
"pdg");
508 MACH3LOG_INFO(
"├────┼──────────┼────────────────────────────────────────┼────────────────────┼────────────────────┼────────────────────┤");
510 for (
unsigned int i = 0; i <
NormParams.size(); ++i)
512 std::string intModeString;
513 for (
unsigned int j = 0; j <
NormParams[i].modes.size(); j++) {
514 intModeString += std::to_string(
NormParams[i].modes[j]);
515 intModeString +=
" ";
517 if (
NormParams[i].modes.empty()) intModeString +=
"all";
519 std::string targetString;
520 for (
unsigned int j = 0; j <
NormParams[i].targets.size(); j++) {
521 targetString += std::to_string(
NormParams[i].targets[j]);
524 if (
NormParams[i].targets.empty()) targetString +=
"all";
526 std::string pdgString;
527 for (
unsigned int j = 0; j <
NormParams[i].pdgs.size(); j++) {
528 pdgString += std::to_string(
NormParams[i].pdgs[j]);
531 if (
NormParams[i].pdgs.empty()) pdgString +=
"all";
535 if(
NormParams[i].hasKinBounds) have_parameter_with_kin_bounds =
true;
537 MACH3LOG_INFO(
"└────┴──────────┴────────────────────────────────────────┴────────────────────┴────────────────────┴────────────────────┘");
539 if(have_parameter_with_kin_bounds) {
540 MACH3LOG_INFO(
"Normalisation parameters KinematicCuts information");
541 MACH3LOG_INFO(
"┌────┬──────────┬────────────────────────────────────────┬────────────────────┬────────────────────────────────────────┐");
542 MACH3LOG_INFO(
"│{0:4}│{1:10}│{2:40}│{3:20}│{4:40}│",
"#",
"Global #",
"Name",
"KinematicCut",
"Value");
543 MACH3LOG_INFO(
"├────┼──────────┼────────────────────────────────────────┼────────────────────┼────────────────────────────────────────┤");
544 for (
unsigned int i = 0; i <
NormParams.size(); ++i)
549 const long unsigned int ncuts =
NormParams[i].KinematicVarStr.size();
550 for(
long unsigned int icut = 0; icut < ncuts; icut++) {
551 std::string kinematicCutValueString;
552 for(
const auto & value :
NormParams[i].Selection[icut]) {
553 for (
const auto& v : value) {
554 kinematicCutValueString += fmt::format(
"{:.2f} ", v);
560 MACH3LOG_INFO(
"│{: <4}│{: <10}│{: <40}│{: <20}│{: <40}│",
"",
"",
"",
NormParams[i].KinematicVarStr[icut], kinematicCutValueString);
563 MACH3LOG_INFO(
"└────┴──────────┴────────────────────────────────────────┴────────────────────┴────────────────────────────────────────┘");
566 MACH3LOG_INFO(
"No normalisation parameters have KinematicCuts defined");
574 MACH3LOG_INFO(
"=====================================================================================================================================================================");
575 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",
"|");
576 MACH3LOG_INFO(
"---------------------------------------------------------------------------------------------------------------------------------------------------------------------");
578 auto &SplineIndex = pair.first;
579 auto &GlobalIndex = pair.second;
581 MACH3LOG_INFO(
"{:<4} {:<2} {:<40} {:<2} {:<40} {:<2} {:<20} {:<2} {:<20} {:<2} {:<20} {:<2}",
588 MACH3LOG_INFO(
"=====================================================================================================================================================================");
596 MACH3LOG_INFO(
"┌────┬──────────┬────────────────────────────────────────┐");
597 MACH3LOG_INFO(
"│{0:4}│{1:10}│{2:40}│",
"#",
"Global #",
"Name");
598 MACH3LOG_INFO(
"├────┼──────────┼────────────────────────────────────────┤");
600 auto &FuncIndex = pair.first;
601 auto &GlobalIndex = pair.second;
604 MACH3LOG_INFO(
"└────┴──────────┴────────────────────────────────────────┘");
612 MACH3LOG_INFO(
"┌────┬──────────┬────────────────────────────────────────┐");
613 MACH3LOG_INFO(
"│{0:4}│{1:10}│{2:40}│",
"#",
"Global #",
"Name");
614 MACH3LOG_INFO(
"├────┼──────────┼────────────────────────────────────────┤");
616 auto &OscIndex = pair.first;
617 auto &GlobalIndex = pair.second;
620 MACH3LOG_INFO(
"└────┴──────────┴────────────────────────────────────────┘");
627 std::unordered_map<std::string, int> paramCounts;
630 [¶mCounts](
const std::string& param) {
631 paramCounts[param]++;
636 for (
const auto& pair : paramCounts) {
637 MACH3LOG_INFO(
"Found {}: {} params", pair.second, pair.first);
646 auto CheckForDuplicates = [](
const std::vector<std::string>& names,
const std::string& nameType) {
647 std::unordered_map<std::string, size_t> seenStrings;
648 for (
size_t i = 0; i < names.size(); ++i) {
649 const auto& name = names[i];
650 if (seenStrings.find(name) != seenStrings.end()) {
651 size_t firstIndex = seenStrings[name];
652 MACH3LOG_CRITICAL(
"There are two systematics with the same {} '{}', first at index {}, and again at index {}", nameType, name, firstIndex, i);
655 seenStrings[name] = i;
668 for(
size_t i = 0; i < Groups.size(); i++){
679 for (
int i = 0; i <
_fNumPar; i++) {
684 if (Pars.size() != ExpectedSize) {
685 MACH3LOG_ERROR(
"Number of param in group {} is {}, while you passed {}", Group, ExpectedSize, Pars.size());
689 for (
int i = 0; i <
_fNumPar; i++) {
700 PCAObj->TransferToParam();
708 std::string groupLower = Group;
712 std::transform(groupLower.begin(), groupLower.end(), groupLower.begin(), ::tolower);
713 std::transform(paramGroupLower.begin(), paramGroupLower.end(), paramGroupLower.begin(), ::tolower);
715 return groupLower == paramGroupLower;
722 for (
int i = 0; i <
_fNumPar; i++) {
732 std::vector<const double*> returnVec;
734 const auto& globalIndex = pair.second;
746 TFile* outputFile =
new TFile(Name.c_str(),
"RECREATE");
748 TObjArray* xsec_param_names =
new TObjArray();
749 TObjArray* xsec_spline_interpolation =
new TObjArray();
750 TObjArray* xsec_spline_names =
new TObjArray();
752 TVectorD* xsec_param_prior =
new TVectorD(
_fNumPar);
753 TVectorD* xsec_flat_prior =
new TVectorD(
_fNumPar);
754 TVectorD* xsec_stepscale =
new TVectorD(
_fNumPar);
755 TVectorD* xsec_param_lb =
new TVectorD(
_fNumPar);
756 TVectorD* xsec_param_ub =
new TVectorD(
_fNumPar);
758 TVectorD* xsec_param_knot_weight_lb =
new TVectorD(
_fNumPar);
759 TVectorD* xsec_param_knot_weight_ub =
new TVectorD(
_fNumPar);
760 TVectorD* xsec_error =
new TVectorD(
_fNumPar);
764 TObjString* nameObj =
new TObjString(
_fFancyNames[i].c_str());
765 xsec_param_names->AddLast(nameObj);
767 TObjString* splineType =
new TObjString(
"TSpline3");
768 xsec_spline_interpolation->AddLast(splineType);
770 TObjString* splineName =
new TObjString(
"");
771 xsec_spline_names->AddLast(splineName);
782 (*xsec_param_knot_weight_lb)[i] = -9999;
783 (*xsec_param_knot_weight_ub)[i] = +9999;
787 auto &SplineIndex = pair.first;
788 auto &SystIndex = pair.second;
790 (*xsec_param_knot_weight_lb)[SystIndex] =
SplineParams.at(SplineIndex)._SplineKnotLowBound;
791 (*xsec_param_knot_weight_ub)[SystIndex] =
SplineParams.at(SplineIndex)._SplineKnotUpBound;
794 xsec_spline_interpolation->AddAt(splineType, SystIndex);
796 TObjString* splineName =
new TObjString(
_fSplineNames[SplineIndex].c_str());
797 xsec_spline_names->AddAt(splineName, SystIndex);
799 xsec_param_names->Write(
"xsec_param_names", TObject::kSingleKey);
800 delete xsec_param_names;
801 xsec_spline_interpolation->Write(
"xsec_spline_interpolation", TObject::kSingleKey);
802 delete xsec_spline_interpolation;
803 xsec_spline_names->Write(
"xsec_spline_names", TObject::kSingleKey);
804 delete xsec_spline_names;
806 xsec_param_prior->Write(
"xsec_param_prior");
807 delete xsec_param_prior;
808 xsec_flat_prior->Write(
"xsec_flat_prior");
809 delete xsec_flat_prior;
810 xsec_stepscale->Write(
"xsec_stepscale");
811 delete xsec_stepscale;
812 xsec_param_lb->Write(
"xsec_param_lb");
813 delete xsec_param_lb;
814 xsec_param_ub->Write(
"xsec_param_ub");
815 delete xsec_param_ub;
817 xsec_param_knot_weight_lb->Write(
"xsec_param_knot_weight_lb");
818 delete xsec_param_knot_weight_lb;
819 xsec_param_knot_weight_ub->Write(
"xsec_param_knot_weight_ub");
820 delete xsec_param_knot_weight_ub;
821 xsec_error->Write(
"xsec_error");
826 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.
@ kOsc
For oscillation parameters.
Type GetFromManager(const YAML::Node &node, Type defval, const std::string File="", const int Line=1)
Get content of config file if node is not found take default value specified.
#define Get2DBounds(filename)
Custom exception class for MaCh3 errors.
Base class responsible for handling of systematic error parameters. Capable of using PCA or using ada...
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 xsec_0 it is MAQE, useful for human reading.
std::vector< bool > _fFlatPrior
Whether to apply flat prior or not.
std::vector< double > _fError
Prior error on the parameter.
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 xsec_i,...
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.
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.
void PrintSplineParams()
Prints spline parameters.
void InitParams()
Initializes the systematic parameters from the configuration file. This function loads parameters lik...
std::vector< NormParameter > NormParams
Vector containing info for normalisation systematics.
std::vector< std::map< int, int > > _fSystToGlobalSystIndexMap
Map between number of given parameter type with global parameter numbering. For example 2nd norm para...
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.
void PrintGlobablInfo()
Prints general information about the ParameterHandler object.
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.
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.
OscillationParameter GetOscillationParameters(const YAML::Node ¶m, const int Index)
Get Osc params.
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.
~ParameterHandlerGeneric()
Destructor.
int GetNumParams() const
Get total number of parameters.
const std::vector< NormParameter > GetNormParsFromSampleName(const std::string &SampleName) const
DB Get norm/func parameters depending on given SampleName.
SystType GetParamType(const int i) const
Returns enum describing our param type.
const std::vector< int > GetSystIndexFromSampleName(const std::string &SampleName, const SystType Type) const
Grab the index of the syst relative to global numbering.
const std::vector< int > GetGlobalSystIndexFromSampleName(const std::string &SampleName, const SystType Type)
DB Get spline parameters depending on given SampleName.
double GetParSplineKnotUpperBound(const int i) const
EM: value at which we cap spline knot weight.
std::string GetParFancyName(const int i) const
Get fancy name of the Parameter.
TH2D * GetCorrelationMatrix()
KS: Convert covariance matrix to correlation matrix and return TH2D which can be used for fancy plott...
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.
const std::vector< FunctionalParameter > GetFunctionalParametersFromSampleName(const std::string &SampleName) const
HH Get functional parameters for the relevant SampleName.
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.
const std::vector< std::string > GetSplineParsNamesFromSampleName(const std::string &SampleName)
DB Get spline parameters depending on given SampleName.
bool IsParFromGroup(const int i, const std::string &Group) const
Checks if parameter belongs to a given group.
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.
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.
static constexpr const double DefSplineKnotUpBound
Default value for spline knot capping, default mean not capping is being applied.
static constexpr 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.