cepgen
is hosted by
Hepforge
,
IPPP Durham
CepGen
1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
Beam.cpp
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
#include <cmath>
20
21
#include "
CepGen/Core/Exception.h
"
22
#include "
CepGen/Modules/PartonFluxFactory.h
"
23
#include "
CepGen/Physics/Beam.h
"
24
#include "
CepGen/Physics/HeavyIon.h
"
25
#include "
CepGen/Physics/PDG.h
"
26
27
namespace
cepgen
{
28
Beam::Beam
(
const
ParametersList
& params)
29
:
SteeredObject
(params),
30
pdg_id_(steerAs<int,
pdgid_t
>(
"pdgId"
)),
31
momentum_(
Momentum
::fromPxPyPzM(0., 0., steer<double>(
"pz"
),
PDG
::get().mass(pdg_id_))) {
32
(*this).add(
"formFactors"
, formfac_).add(
"partonFlux"
, flux_info_).add(
"elastic"
, elastic_);
33
}
34
35
ParametersDescription
Beam::description
() {
36
auto
desc =
ParametersDescription
();
37
desc.addAs<int,
pdgid_t
>(
"pdgId"
,
PDG::proton
);
38
desc.add<
double
>(
"pz"
, 0.);
39
return
desc;
40
}
41
42
std::ostream&
operator<<
(std::ostream& os,
const
Beam
& beam) {
43
os << (
PDG::Id
)beam.pdg_id_ <<
" ("
<< beam.momentum_.
pz
() <<
" GeV/c) "
44
<< (beam.elastic_ ?
"elastic"
:
"inelastic"
);
45
if
(
const
auto
& part_flux_name = beam.flux_info_.
name
(); !part_flux_name.empty())
46
os <<
" [parton flux: "
<< beam.flux_info_.
print
(
true
) <<
"]"
;
47
else
if
(
const
auto
& formfac_name = beam.formfac_.
name
(); !formfac_name.empty())
48
os <<
" [form factors: "
<< beam.formfac_.
print
(
true
) <<
"]"
;
49
return
os;
50
}
51
}
// namespace cepgen
Beam.h
Exception.h
HeavyIon.h
PDG.h
PartonFluxFactory.h
cepgen::Beam
Incoming beams characteristics.
Definition
Beam.h:30
cepgen::Beam::description
static ParametersDescription description()
Definition
Beam.cpp:35
cepgen::Beam::Beam
Beam(const ParametersList &)
Default constructor.
Definition
Beam.cpp:28
cepgen::Momentum
Container for a particle's 4-momentum, along with useful methods to ease the development of any matri...
Definition
Momentum.h:33
cepgen::Momentum::pz
double pz() const
Longitudinal momentum (in GeV)
Definition
Momentum.h:120
cepgen::PDG::Id
A class-in-the-middle PDG identifier for printout operations.
Definition
PDG.h:55
cepgen::PDG
A singleton holding all physics constants associated to particles.
Definition
PDG.h:28
cepgen::PDG::proton
@ proton
Definition
PDG.h:50
cepgen::ParametersDescription
A description object for parameters collection.
Definition
ParametersDescription.h:26
cepgen::ParametersList
Definition
ParametersList.h:52
cepgen::ParametersList::name
std::string name(const std::string &def="") const
Retrieve the module name if any.
Definition
ParametersList.cpp:294
cepgen::ParametersList::print
const ParametersList & print(std::ostream &) const
Debugging-like printout of a parameters container.
Definition
ParametersList.cpp:256
cepgen::SteeredObject
Base user-steerable object.
Definition
SteeredObject.h:41
cepgen
Common namespace for this Monte Carlo generator.
Definition
CommandLineHandler.cpp:36
cepgen::pdgid_t
unsigned long long pdgid_t
Alias for the integer-like particle PDG id.
Definition
ParticleProperties.h:26
cepgen::operator<<
std::ostream & operator<<(std::ostream &os, const Exception::Type &type)
Definition
Exception.cpp:59
CepGen
Physics
Beam.cpp
Generated on Mon Jul 29 2024 for CepGen by
1.9.7