MaCh3  2.2.3
Reference Guide
Functions
SmearChain.cpp File Reference
#include "Fitters/MCMCProcessor.h"
#include "Manager/Manager.h"
Include dependency graph for SmearChain.cpp:

Go to the source code of this file.

Functions

void DiagMCMC (const std::string &inputFile, const std::string &config)
 Main function creating MCMCProcessor and calling Smear Chain. More...
 
int main (int argc, char *argv[])
 

Function Documentation

◆ DiagMCMC()

void DiagMCMC ( 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 8 of file SmearChain.cpp.

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

◆ main()

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

Definition at line 27 of file SmearChain.cpp.

27  {
29  if (argc != 3)
30  {
31  MACH3LOG_ERROR("How to use: {} MCMC_Output.root config", argv[0]);
32  throw MaCh3Exception(__FILE__ , __LINE__ );
33  }
34  MACH3LOG_INFO("Producing single fit output");
35  std::string filename = argv[1];
36  std::string config = argv[2];
37  DiagMCMC(filename, config);
38 
39  return 0;
40 }
#define MACH3LOG_ERROR
Definition: MaCh3Logger.h:27
void SetMaCh3LoggerFormat()
Set messaging format of the logger.
Definition: MaCh3Logger.h:51
void DiagMCMC(const std::string &inputFile, const std::string &config)
Main function creating MCMCProcessor and calling Smear Chain.
Definition: SmearChain.cpp:8
Custom exception class for MaCh3 errors.