cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
cepgenPrintSteeringCard.cc
Go to the documentation of this file.
1/*
2 * CepGen: a central exclusive processes event generator
3 * Copyright (C) 2021-2024 Laurent Forthomme
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#include <string>
20
24#include "CepGen/Generator.h"
27
28using namespace std;
29
30int main(int argc, char* argv[]) {
31 string card;
32
34
35 cepgen::ArgumentsParser(argc, argv).addArgument("card,i", "input card", &card, "Cards/lpair_cfg.py").parse();
36
37 try {
38 CG_LOG << "Parsing configuration from '" << card << ".";
40 in_card->parseFile(card);
41 CG_LOG << "Configuration parsed from '" << card << "':\n" << *in_card->runParameters();
42 } catch (const cepgen::Exception& e) {
43 e.dump();
44 return -1;
45 }
46 return 0;
47}
#define CG_LOG
Definition Message.h:212
A generic command line arguments parser.
ArgumentsParser & addArgument(Args &&... args)
Add a parameter required for the parser.
ArgumentsParser & parse()
Associate command-line arguments to parameters.
void dump(std::ostream *os=nullptr) const noexcept override
Human-readable dump of the exception.
Definition Exception.cpp:41
void initialise(bool safe_mode)
int main()
std::unique_ptr< card::Handler > buildFromFilename(const std::string &filename) const
Build one instance of a cards handler.
static CardsHandlerFactory & get()