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
21
#include "
CepGen/Cards/Handler.h
"
22
#include "
CepGen/Core/Exception.h
"
23
#include "
CepGen/Core/RunParameters.h
"
24
#include "
CepGen/Generator.h
"
25
#include "
CepGen/Modules/CardsHandlerFactory.h
"
26
#include "
CepGen/Utils/ArgumentsParser.h
"
27
28
using namespace
std;
29
30
int
main
(
int
argc,
char
* argv[]) {
31
string
card;
32
33
cepgen::initialise
();
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 <<
"."
;
39
auto
in_card =
cepgen::CardsHandlerFactory::get
().
buildFromFilename
(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
}
ArgumentsParser.h
CardsHandlerFactory.h
Exception.h
Generator.h
Handler.h
CG_LOG
#define CG_LOG
Definition
Message.h:212
RunParameters.h
cepgen::ArgumentsParser
A generic command line arguments parser.
Definition
ArgumentsParser.h:31
cepgen::ArgumentsParser::addArgument
ArgumentsParser & addArgument(Args &&... args)
Add a parameter required for the parser.
Definition
ArgumentsParser.h:39
cepgen::ArgumentsParser::parse
ArgumentsParser & parse()
Associate command-line arguments to parameters.
Definition
ArgumentsParser.cpp:106
cepgen::Exception
Definition
Exception.h:25
cepgen::Exception::dump
void dump(std::ostream *os=nullptr) const noexcept override
Human-readable dump of the exception.
Definition
Exception.cpp:41
cepgen::initialise
void initialise(bool safe_mode)
Definition
GlobalFunctions.cpp:91
main
int main()
Definition
pythia6_decay.cc:9
cepgen::CardsHandlerFactory::buildFromFilename
std::unique_ptr< card::Handler > buildFromFilename(const std::string &filename) const
Build one instance of a cards handler.
Definition
CardsHandlerFactory.cpp:30
cepgen::CardsHandlerFactory::get
static CardsHandlerFactory & get()
Definition
CardsHandlerFactory.cpp:25
src
utils
cepgenPrintSteeringCard.cc
Generated on Mon Jul 29 2024 for CepGen by
1.9.7