Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
2HDMC.cpp
Go to the documentation of this file.
1#include "2HDMC.h"
2
3#include <filesystem>
4#include <stdexcept>
5
6#include "THDM.h"
7
8namespace fs = std::filesystem;
9
10void TwoHDMCalculator::calculateSpectrum(const std::string& inputFilePath, const std::string& outputFilePath)
11{
12 const fs::path input(inputFilePath);
13 const fs::path output(outputFilePath);
14
15 if (!fs::exists(input)) {
16 throw std::runtime_error("2HDMC input LHA file does not exist: " + input.string());
17 }
18
19 std::error_code ec;
20 if (output.has_parent_path()) {
21 fs::create_directories(output.parent_path(), ec);
22 if (ec) {
23 throw std::runtime_error("Cannot create 2HDMC output directory '" + output.parent_path().string() + "': " + ec.message());
24 }
25 }
26
27 THDM model;
28 model.read_LesHouches(input.string().c_str());
29 model.write_LesHouches(output.string().c_str(), true, true, true);
30}
const Prototype THDM
void calculateSpectrum(const std::string &inputFilePath, const std::string &outputFilePath) override
Performs the spectrum calculation.
Definition 2HDMC.cpp:10