MaCh3  2.4.2
Reference Guide
Functions
SmearChain.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/MCMCProcessor.h"
#include "Samples/HistogramUtils.h"
#include "Manager/Manager.h"
Include dependency graph for SmearChain.cpp:

Go to the source code of this file.

Functions

void SmearChain (const std::string &inputFile, const std::string &config)
 Main function creating MCMCProcessor and calling Smear Chain. More...
 
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 SmearChain.cpp.

Function Documentation

◆ main()

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

Definition at line 32 of file SmearChain.cpp.

32  {
34  if (argc != 3)
35  {
36  MACH3LOG_ERROR("How to use: {} MCMC_Output.root config", argv[0]);
37  throw MaCh3Exception(__FILE__ , __LINE__ );
38  }
39  MACH3LOG_INFO("Producing single fit output");
40  std::string filename = argv[1];
41  std::string config = argv[2];
42  SmearChain(filename, config);
43 
44  return 0;
45 }
#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:61
std::string config
Definition: ProcessMCMC.cpp:30
void SmearChain(const std::string &inputFile, const std::string &config)
Main function creating MCMCProcessor and calling Smear Chain.
Definition: SmearChain.cpp:12
Custom exception class used throughout MaCh3.

◆ SmearChain()

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

Main function creating MCMCProcessor and calling Smear Chain.

Parameters
inputFileMCMC Chain
configConfig file with settings

Definition at line 12 of file SmearChain.cpp.

13 {
14  MACH3LOG_INFO("File for study: {}", inputFile);
15 
16  YAML::Node Settings = M3OpenConfig(config);
17 
18  // Make the processor
19  auto Processor = std::make_unique<MCMCProcessor>(inputFile);
20  Processor->SetOutputSuffix("_Smear_MCMC");
21  Processor->Initialise();
22 
23  const auto& Smear = Settings["SmearChain"];
24 
25  std::vector<std::string> Names = Get<std::vector<std::string>>(Smear["Smear"][0], __FILE__, __LINE__);
26  std::vector<double> ErrorValue = Get<std::vector<double>>(Smear["Smear"][1], __FILE__, __LINE__);
27 
28  bool SaveUnsmearedBranch = GetFromManager<bool>(Smear["SaveUnsmearedBranch"], false);
29  Processor->SmearChain(Names, ErrorValue, SaveUnsmearedBranch);
30 }
#define M3OpenConfig(filename)
Macro to simplify calling LoadYaml with file and line info.
Definition: YamlHelper.h:589