MaCh3  2.2.3
Reference Guide
SmearChain.cpp
Go to the documentation of this file.
2 
3 #include "Manager/Manager.h"
4 
8 void DiagMCMC(const std::string& inputFile, const std::string& config)
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 }
26 
27 int main(int argc, char *argv[]) {
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
#define MACH3LOG_INFO
Definition: MaCh3Logger.h:25
void SetMaCh3LoggerFormat()
Set messaging format of the logger.
Definition: MaCh3Logger.h:51
std::string config
Definition: ProcessMCMC.cpp:29
int main(int argc, char *argv[])
Definition: SmearChain.cpp:27
void DiagMCMC(const std::string &inputFile, const std::string &config)
Main function creating MCMCProcessor and calling Smear Chain.
Definition: SmearChain.cpp:8
#define M3OpenConfig(filename)
Macro to simplify calling LoadYaml with file and line info.
Definition: YamlHelper.h:561
Custom exception class for MaCh3 errors.