cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
EventHarvester.h
Go to the documentation of this file.
1/*
2 * CepGen: a central exclusive processes event generator
3 * Copyright (C) 2019-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 <fstream>
20
23
24namespace cepgen {
25 class Event;
26 namespace utils {
27 class Drawer;
28 class EventBrowser;
29 } // namespace utils
34 public:
35 explicit EventHarvester(const ParametersList&);
36 virtual ~EventHarvester();
37
39
40 inline void setCrossSection(const Value& cross_section) override { cross_section_ = cross_section; }
41 bool operator<<(const Event&) override;
42
43 private:
44 void initialise() override;
45 const std::unique_ptr<utils::EventBrowser> browser_;
46 //--- variables definition
47 const bool show_hists_, save_hists_;
48 const std::string filename_;
49
50 std::ofstream file_;
51 std::unique_ptr<utils::Drawer> drawer_;
52
53 Value cross_section_{1., 0.};
54 unsigned long num_evts_{0ul};
55 std::string proc_name_;
56
58 struct Hist1DInfo {
59 std::string var;
60 utils::Hist1D hist;
61 bool log;
62 };
63 std::vector<Hist1DInfo> hists_;
65 struct Hist2DInfo {
66 std::string var1, var2;
67 utils::Hist2D hist;
68 bool log;
69 };
70 std::vector<Hist2DInfo> hists2d_;
71 };
72} // namespace cepgen
Output format handler for events export.
Generic text file output handler.
bool operator<<(const Event &) override
Writer operator.
void setCrossSection(const Value &cross_section) override
Specify the cross section value, in pb.
static ParametersDescription description()
Container for the information on the in- and outgoing particles' kinematics.
Definition Event.h:28
A description object for parameters collection.
A scalar value with its uncertainty.
Definition Value.h:26
Common namespace for this Monte Carlo generator.