cepgen is hosted by Hepforge, IPPP Durham
CepGen N/A
Central exclusive processes event generator
EventBrowser.h
Go to the documentation of this file.
1/*
2 * CepGen: a central exclusive processes event generator
3 * Copyright (C) 2019-2025 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_EventFilter_EventBrowser_h
20#define CepGen_EventFilter_EventBrowser_h
21
22#include <regex>
23
25
26namespace cepgen {
27 class Event;
28}
29namespace cepgen::utils {
34 public:
35 EventBrowser() = default;
36 double get(const Event& event, const std::string& variable_name) const;
37
38 private:
39 double variable(const Event&, const Particle&, const std::string&) const;
40 double variable(const Event&,
41 const Particle&,
42 const Particle&,
43 const std::string&) const;
44 static double variable(const Event&, const std::string&);
45
46 static const std::regex rgx_select_id_;
47 static const std::regex rgx_select_id2_;
48 static const std::regex rgx_select_role_;
49 static const std::regex rgx_select_role2_;
50 static constexpr double INVALID_OUTPUT = -999.;
51
52 //--- auxiliary helper maps
53 const std::unordered_map<std::string, Particle::Role> role_str_ = {{"ib1", Particle::Role::IncomingBeam1},
61 typedef double (Momentum::*pMethod)() const;
63 const std::unordered_map<std::string, pMethod> m_mom_str_ = {
64 {"px", &Momentum::px}, {"py", &Momentum::py}, {"pz", &Momentum::pz},
65 {"pt", &Momentum::pt}, {"pt2", &Momentum::pt2}, {"eta", &Momentum::eta},
66 {"phi", &Momentum::phi}, {"m", &Momentum::mass}, {"m2", &Momentum::mass2},
67 {"mt", &Momentum::massT}, {"mt2", &Momentum::massT2}, {"e", &Momentum::energy},
68 {"e2", &Momentum::energy2}, {"et", &Momentum::energyT}, {"et2", &Momentum::energyT2},
69 {"p", &Momentum::p}, {"p2", &Momentum::p2}, {"th", &Momentum::theta},
70 {"y", &Momentum::rapidity}, {"beta", &Momentum::beta}, {"gamma", &Momentum::gamma},
71 {"gamma2", &Momentum::gamma2}};
72 typedef double (Momentum::*pMethodOth)(const Momentum&) const;
73 const std::unordered_map<std::string, pMethodOth> m_two_mom_str_ = {{"deta", &Momentum::deltaEta},
74 {"dphi", &Momentum::deltaPhi},
75 {"dpt", &Momentum::deltaPt},
76 {"dr", &Momentum::deltaR}};
77 };
78} // namespace cepgen::utils
79
80#endif
Container for the information on the in- and outgoing particles' kinematics.
Definition Event.h:26
double pt2() const
Squared transverse momentum (in GeV )
double pz() const
Longitudinal momentum (in GeV)
Definition Momentum.h:99
double deltaR(const Momentum &) const
Angular distance between two momenta.
double deltaEta(const Momentum &) const
Pseudo-rapidity distance between two momenta.
double energyT2() const
Squared transverse energy component (in GeV )
double rapidity() const
Rapidity.
double deltaPt(const Momentum &) const
Transverse momentum distance between two momenta.
double gamma2() const
Squared gamma scalar value.
double deltaPhi(const Momentum &) const
Azimuthal angle opening between two momenta.
double eta() const
Pseudo-rapidity.
double px() const
Momentum along the -axis (in GeV)
Definition Momentum.h:97
double gamma() const
Gamma scalar value.
double p2() const
Squared 3-momentum norm (in GeV )
Definition Momentum.h:105
double py() const
Momentum along the -axis (in GeV)
Definition Momentum.h:98
double beta() const
Beta scalar value.
double massT2() const
Squared transverse mass (in GeV )
double energy2() const
Squared energy (in GeV )
Definition Momentum.h:108
double massT() const
Transverse mass (in GeV)
double pt() const
Transverse momentum (in GeV)
double phi() const
Azimuthal angle (angle in the transverse plane)
double p() const
3-momentum norm (in GeV)
Definition Momentum.h:104
double mass() const
double energyT() const
Transverse energy component (in GeV)
double energy() const
Energy (in GeV)
Definition Momentum.h:107
double theta() const
Polar angle (angle with respect to the longitudinal direction)
double mass2() const
Squared mass (in GeV ) as computed from its energy and momentum.
Kinematic information for one particle.
Definition Particle.h:32
@ OutgoingBeam2
outgoing beam state/particle
@ CentralSystem
Central particles system.
@ Parton2
beam incoming parton
@ OutgoingBeam1
outgoing beam state/particle
@ IncomingBeam2
incoming beam particle
@ Intermediate
Intermediate two-parton system.
@ Parton1
beam incoming parton
@ IncomingBeam1
incoming beam particle
A user-friendly browser for the Event content.
double get(const Event &event, const std::string &variable_name) const
Get/compute a variable value.
Collection of utilities.
Common namespace for this Monte Carlo generator.
Definition Handler.h:26