cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
Handler.h
Go to the documentation of this file.
1/*
2 * CepGen: a central exclusive processes event generator
3 * Copyright (C) 2013-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#ifndef CepGen_Cards_Handler_h
20#define CepGen_Cards_Handler_h
21
22#include <memory>
23
25
26namespace cepgen {
27 class RunParameters;
29 namespace card {
31 class Handler : public NamedModule<Handler> {
32 public:
33 explicit Handler(const ParametersList&);
34 virtual ~Handler() = default;
35
37
39 inline virtual Handler& parseCommands(const std::vector<std::string>&) { return *this; }
41 inline virtual Handler& parseFile(const std::string&) { return *this; }
42 inline virtual void write(const std::string&) const {}
43
44 virtual Handler& setRunParameters(const RunParameters*);
45 inline const RunParameters* runParameters() const { return rt_params_.get(); }
46 inline std::unique_ptr<RunParameters>& runParameters() { return rt_params_; }
47
48 protected:
49 const std::string filename_;
50
51 private:
52 std::unique_ptr<RunParameters> rt_params_{nullptr};
53 };
54 } // namespace card
55} // namespace cepgen
56
57#endif
Base runtime module object.
Definition NamedModule.h:28
A description object for parameters collection.
List of parameters used to start and run the simulation job.
Base steering card module.
Definition Handler.h:31
virtual Handler & setRunParameters(const RunParameters *)
Specify runtime parameters.
Definition Handler.cpp:31
const RunParameters * runParameters() const
Parsed runtime parameters.
Definition Handler.h:45
const std::string filename_
Input filename.
Definition Handler.h:49
std::unique_ptr< RunParameters > & runParameters()
Parsed runtime parameters.
Definition Handler.h:46
virtual ~Handler()=default
virtual Handler & parseFile(const std::string &)
Read configuration from steering card.
Definition Handler.h:41
static ParametersDescription description()
Definition Handler.cpp:36
virtual Handler & parseCommands(const std::vector< std::string > &)
Read configuration from command strings.
Definition Handler.h:39
virtual void write(const std::string &) const
Write steering card from configuration.
Definition Handler.h:42
Common namespace for this Monte Carlo generator.