cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
EventBrowser.h
Go to the documentation of this file.
1/*
2 * CepGen: a central exclusive processes event generator
3 * Copyright (C) 2019-2023 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 namespace utils {
35 public:
36 EventBrowser() = default;
38 double get(const Event& ev, const std::string& var) const;
39
40 private:
42 double variable(const Event&, const Particle&, const std::string&) const;
44 double variable(const Event&, const Particle&, const Particle&, const std::string&) const;
46 static double variable(const Event&, const std::string&);
47
48 static const std::regex rgx_select_id_, rgx_select_id2_, rgx_select_role_, rgx_select_role2_;
49 static constexpr double INVALID_OUTPUT = -999.;
50
51 //--- auxiliary helper maps
52 const std::unordered_map<std::string, Particle::Role> role_str_ = {{"ib1", Particle::Role::IncomingBeam1},
60 typedef double (Momentum::*pMethod)() const;
62 const std::unordered_map<std::string, pMethod> m_mom_str_ = {
63 {"px", &Momentum::px}, {"py", &Momentum::py}, {"pz", &Momentum::pz},
64 {"pt", &Momentum::pt}, {"pt2", &Momentum::pt2}, {"eta", &Momentum::eta},
65 {"phi", &Momentum::phi}, {"m", &Momentum::mass}, {"m2", &Momentum::mass2},
66 {"mt", &Momentum::massT}, {"mt2", &Momentum::massT2}, {"e", &Momentum::energy},
67 {"e2", &Momentum::energy2}, {"et", &Momentum::energyT}, {"et2", &Momentum::energyT2},
68 {"p", &Momentum::p}, {"p2", &Momentum::p2}, {"th", &Momentum::theta},
69 {"y", &Momentum::rapidity}, {"beta", &Momentum::beta}, {"gamma", &Momentum::gamma},
70 {"gamma2", &Momentum::gamma2}};
71 typedef double (Momentum::*pMethodOth)(const Momentum&) const;
72 const std::unordered_map<std::string, pMethodOth> m_two_mom_str_ = {{"deta", &Momentum::deltaEta},
73 {"dphi", &Momentum::deltaPhi},
74 {"dpt", &Momentum::deltaPt},
75 {"dr", &Momentum::deltaR}};
76 };
77 } // namespace utils
78} // namespace cepgen
79
80#endif
Container for the information on the in- and outgoing particles' kinematics.
Definition Event.h:28
double pt2() const
Squared transverse momentum (in GeV )
Definition Momentum.cpp:234
double pz() const
Longitudinal momentum (in GeV)
Definition Momentum.h:120
double deltaR(const Momentum &) const
Angular distance between two momenta.
Definition Momentum.cpp:259
double deltaEta(const Momentum &) const
Pseudorapidity distance between two momenta.
Definition Momentum.cpp:251
double energyT2() const
Squared tranverse energy component (in GeV )
Definition Momentum.cpp:213
double rapidity() const
Rapidity.
Definition Momentum.cpp:246
double deltaPt(const Momentum &) const
Transverse momentum distance between two momenta.
Definition Momentum.cpp:257
double gamma2() const
Squared gamma scalar value.
Definition Momentum.cpp:280
double deltaPhi(const Momentum &) const
Azimutal angle opening between two momenta.
Definition Momentum.cpp:253
double eta() const
Pseudo-rapidity.
Definition Momentum.cpp:240
double px() const
Momentum along the -axis (in GeV)
Definition Momentum.h:112
double gamma() const
Gamma scalar value.
Definition Momentum.cpp:295
double p2() const
Squared 3-momentum norm (in GeV )
Definition Momentum.h:132
double py() const
Momentum along the -axis (in GeV)
Definition Momentum.h:116
double beta() const
Beta scalar value.
Definition Momentum.cpp:265
double massT2() const
Squared transverse mass (in GeV )
Definition Momentum.cpp:224
double energy2() const
Squared energy (in GeV )
Definition Momentum.h:138
double massT() const
Transverse mass (in GeV)
Definition Momentum.cpp:226
double pt() const
Transverse momentum (in GeV)
Definition Momentum.cpp:232
double phi() const
Azimuthal angle (angle in the transverse plane)
Definition Momentum.cpp:230
double p() const
3-momentum norm (in GeV)
Definition Momentum.h:130
double mass() const
Mass (in GeV) as computed from its energy and momentum.
Definition Momentum.cpp:222
double energyT() const
Tranverse energy component (in GeV)
Definition Momentum.cpp:218
double energy() const
Energy (in GeV)
Definition Momentum.h:136
double theta() const
Polar angle (angle with respect to the longitudinal direction)
Definition Momentum.cpp:228
double mass2() const
Squared mass (in GeV ) as computed from its energy and momentum.
Definition Momentum.cpp:220
Kinematic information for one particle.
Definition Particle.h:33
@ IncomingBeam2
incoming beam particle
Definition Particle.h:53
@ Parton2
beam incoming parton
Definition Particle.h:59
@ OutgoingBeam1
outgoing beam state/particle
Definition Particle.h:54
@ IncomingBeam1
incoming beam particle
Definition Particle.h:52
@ OutgoingBeam2
outgoing beam state/particle
Definition Particle.h:55
@ Parton1
beam incoming parton
Definition Particle.h:58
@ CentralSystem
Central particles system.
Definition Particle.h:56
@ Intermediate
Intermediate two-parton system.
Definition Particle.h:57
A user-friendly browser for the Event content.
double get(const Event &ev, const std::string &var) const
Get/compute a variable value.
Common namespace for this Monte Carlo generator.