MaCh3  2.8.0
Reference Guide
Namespaces | Functions
SmearModule.cpp File Reference

Allows you to smear contour. For example after performing sets of study one finds out that used sets of uncertainty doesn't fully cover analysis need. Then one can smear additionally contour. More...

#include "Fitters/Processing/MCMCProcessor.h"
#include "Manager/Manager.h"
#include "CLI/Modules/SmearModule.hpp"
Include dependency graph for SmearModule.cpp:

Go to the source code of this file.

Namespaces

 M3
 Main namespace for MaCh3 software.
 

Functions

void SmearChain (const std::string &inputFile, const std::string &config)
 
int main (int argc, char *argv[])
 

Detailed Description

Allows you to smear contour. For example after performing sets of study one finds out that used sets of uncertainty doesn't fully cover analysis need. Then one can smear additionally contour.

Definition in file SmearModule.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 93 of file SmearModule.cpp.

93  {
95  if (argc != 3)
96  {
97  MACH3LOG_ERROR("How to use: {} MCMC_Output.root config", argv[0]);
98  throw MaCh3Exception(__FILE__ , __LINE__ );
99  }
100  MACH3LOG_INFO("Producing single fit output");
101  std::string filename = argv[1];
102  std::string config = argv[2];
103  SmearChain(filename, config);
104 
105  return 0;
106 }
#define MACH3LOG_ERROR
Definition: MaCh3Logger.h:37
#define MACH3LOG_INFO
Definition: MaCh3Logger.h:35
void SetMaCh3LoggerFormat()
Set messaging format of the logger.
Definition: MaCh3Logger.h:60
void SmearChain(const std::string &inputFile, const std::string &config)
Definition: SmearModule.cpp:73
Custom exception class used throughout MaCh3.

◆ SmearChain()

void SmearChain ( const std::string &  inputFile,
const std::string &  config 
)

Definition at line 73 of file SmearModule.cpp.

74 {
75  MACH3LOG_INFO("File for study: {}", inputFile);
76 
77  YAML::Node Settings = M3OpenConfig(config);
78 
79  // Make the processor
80  auto Processor = std::make_unique<MCMCProcessor>(inputFile);
81  Processor->SetOutputSuffix("_Smear_MCMC");
82  Processor->Initialise();
83 
84  const auto& Smear = Settings["SmearChain"];
85 
86  std::vector<std::string> Names = Get<std::vector<std::string>>(Smear["Smear"][0], __FILE__, __LINE__);
87  std::vector<double> ErrorValue = Get<std::vector<double>>(Smear["Smear"][1], __FILE__, __LINE__);
88 
89  bool SaveUnsmearedBranch = GetFromManager<bool>(Smear["SaveUnsmearedBranch"], false, __FILE__ , __LINE__);
90  Processor->SmearChain(Names, ErrorValue, SaveUnsmearedBranch);
91 }
#define M3OpenConfig(filename)
Macro to simplify calling LoadYaml with file and line info.
Definition: YamlHelper.h:589