cepgen
is hosted by
Hepforge
,
IPPP Durham
CepGen
1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
EventExporter.cpp
Go to the documentation of this file.
1
/*
2
* CepGen: a central exclusive processes event generator
3
* Copyright (C) 2016-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 <iomanip>
20
#include <sstream>
21
22
#include "
CepGen/Core/ParametersList.h
"
23
#include "
CepGen/Core/RunParameters.h
"
24
#include "
CepGen/EventFilter/EventExporter.h
"
25
#include "
CepGen/EventFilter/EventModifier.h
"
26
#include "
CepGen/Utils/String.h
"
27
#include "
CepGen/Version.h
"
28
29
namespace
cepgen
{
30
EventExporter::EventExporter
(
const
ParametersList
& params) :
EventHandler
(params) {}
31
32
std::string
EventExporter::banner
(
const
std::string& prep)
const
{
33
const
size_t
len = 45 +
version::tag
.size();
34
std::ostringstream os;
35
os << prep <<
"******* Sample generated with CepGen "
<<
version::tag
<<
" *******\n"
;
36
if
(
runParameters
().hasProcess()) {
37
os << prep <<
" Process: "
<<
runParameters
().
processName
() <<
" ("
38
<<
runParameters
().
kinematics
().
incomingBeams
().
mode
() <<
")\n"
;
39
if
(
runParameters
().kinematics().incomingBeams().mode() !=
mode::Kinematics::ElasticElastic
)
40
os << prep <<
" Structure functions: "
<<
runParameters
().
kinematics
().
incomingBeams
().
structureFunctions
()
41
<<
"\n"
;
42
}
43
if
(!
runParameters
().eventModifiersSequence().empty()) {
44
os << prep <<
" "
<<
utils::s
(
"Event modifier"
,
runParameters
().eventModifiersSequence().size()) <<
": "
;
45
std::string sep;
46
for
(
const
auto
& mod :
runParameters
().
eventModifiersSequence
())
47
os << sep << mod->name(), sep =
", "
;
48
os <<
"\n"
;
49
}
50
if
(
runParameters
().
hasProcess
()) {
51
const
auto
& cuts =
runParameters
().
kinematics
().
cuts
();
52
auto
dump_cuts = [&os, &prep](
const
auto
& obj) {
53
for
(
const
auto
& lim : obj.parameters().template keysOf<Limits>()) {
54
const
auto
& limit = obj.
parameters
().template get<Limits>(lim);
55
if
(limit.valid() && obj.description().has(lim))
56
os << prep <<
" "
<< obj.description().get(lim).description() <<
": "
<< limit <<
"\n"
;
57
}
58
};
59
os << prep << std::left << std::setw(len) << std::setfill(
'*'
) <<
"*** Incoming state "
60
<<
"\n"
;
61
dump_cuts(cuts.initial);
62
os << prep << std::setw(len) << std::setfill(
'*'
) <<
"*** Central system "
63
<<
"\n"
;
64
dump_cuts(cuts.central);
65
if
(
runParameters
().kinematics().incomingBeams().mode() !=
mode::Kinematics::ElasticElastic
) {
66
os << prep << std::setw(len) << std::setfill(
'*'
) <<
"*** Remnants states "
67
<<
"\n"
;
68
dump_cuts(cuts.remnants);
69
}
70
}
71
os << prep << std::string(45 +
version::tag
.size(),
'*'
);
72
return
os.str();
73
}
74
}
// namespace cepgen
EventExporter.h
EventModifier.h
ParametersList.h
RunParameters.h
String.h
Version.h
cepgen::EventExporter::banner
std::string banner(const std::string &prep="") const
Print a banner containing runtime parameters.
Definition
EventExporter.cpp:32
cepgen::EventExporter::EventExporter
EventExporter(const ParametersList &)
Definition
EventExporter.cpp:30
cepgen::EventHandler
Class template for modules interacting with events.
Definition
EventHandler.h:30
cepgen::EventHandler::runParameters
const RunParameters & runParameters() const
List of run parameters.
Definition
EventHandler.cpp:44
cepgen::IncomingBeams::structureFunctions
const ParametersList & structureFunctions() const
Structure functions parameters.
Definition
IncomingBeams.h:43
cepgen::IncomingBeams::mode
mode::Kinematics mode() const
Type of kinematics to consider for the phase space.
Definition
IncomingBeams.cpp:204
cepgen::Kinematics::cuts
CutsList & cuts()
Phase space cuts.
Definition
Kinematics.h:41
cepgen::Kinematics::incomingBeams
IncomingBeams & incomingBeams()
Beam/primary particle kinematics.
Definition
Kinematics.h:36
cepgen::ParametersList
Definition
ParametersList.h:52
cepgen::RunParameters::kinematics
const Kinematics & kinematics() const
Events kinematics for phase space definition.
Definition
RunParameters.cpp:125
cepgen::RunParameters::processName
std::string processName() const
Name of the process considered.
Definition
RunParameters.cpp:109
cepgen::RunParameters::hasProcess
bool hasProcess() const
Is this parameters collection holding any physics process?
Definition
RunParameters.h:65
cepgen::RunParameters::eventModifiersSequence
EventModifiersSequence & eventModifiersSequence()
List of event modification algos List of event modification algos.
Definition
RunParameters.h:114
cepgen::SteeredObject::parameters
const ParametersList & parameters() const override
Module user-defined parameters.
Definition
SteeredObject.h:54
cepgen::mode::Kinematics::ElasticElastic
@ ElasticElastic
proton-proton elastic case
cepgen::utils::s
std::string s(const std::string &word, float num, bool show_number)
Add a trailing "s" when needed.
Definition
String.cpp:228
cepgen
Common namespace for this Monte Carlo generator.
Definition
CommandLineHandler.cpp:36
cepgen::version::tag
static const std::string tag
CepGen version.
Definition
Version.h:28
CepGen
EventFilter
EventExporter.cpp
Generated on Mon Jul 29 2024 for CepGen by
1.9.7