ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Generators
Pythia8_i
src
Pythia8Custom
UserPhotonFlux.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef PYTHIA8_I_USERPHOTONFLUX_H
6
#define PYTHIA8_I_USERPHOTONFLUX_H
7
8
#include "
Pythia8_i/IPythia8Custom.h
"
9
#include "
AthenaBaseComps/AthAlgTool.h
"
10
11
#include "Pythia8/Pythia.h"
12
13
14
// Photon flux from lead-ions. Integrated over impact parameters > 2*r_Pb.
15
// Suitable for photo-nuclear processes but not for photon-photon.
16
// This should be considered as an experimental setup and used with caution.
17
18
19
// Photon flux from leptons, corresponds to internal Lepton2gamma.
20
21
class
Lepton2gamma2
:
public
Pythia8::PDF {
22
23
public
:
24
25
// Constructor.
26
Lepton2gamma2
(
int
idBeamIn) :
Pythia8
::PDF(idBeamIn) {}
27
28
// Update the photon flux.
29
void
xfUpdate
(
int
,
double
x
,
double
Q2) {
30
xgamma = 0.5 * 0.007297353080 /
M_PI
* (1. + Pythia8::pow2(1. -
x
)) / Q2;
31
}
32
};
33
34
class
Nucleus2gamma2
:
public
Pythia8::PDF {
35
36
public
:
37
38
// Constructor.
39
//defaults for m_Z m_min_b=2*nuclear radius are for Pb208 (Z=82, R=6.62fm)
40
Nucleus2gamma2
(
int
idBeamIn) :
Pythia8
::PDF(idBeamIn),
41
m_Z
(82.),
42
m_min_b
(13.24),
43
m_min_x
(-1)
44
{}
45
46
// Update the photon flux.
47
void
xfUpdate
(
int
,
double
x
,
double
) {
48
49
50
if
(
x
<
m_min_x
)
51
{
52
xgamma=0;
53
return
;
54
}
55
using
Pythia8::pow2;
56
double
xi =
x
*
M_NUCLEON_EFF
*
m_min_b
/
HBAR_TIMES_C
;
57
double
bK0 = Pythia8::besselK0(xi);
58
double
bK1 = Pythia8::besselK1(xi);
59
double
intB = xi * bK1 * bK0 - 0.5 *
pow2
(xi) * (
pow2
(bK1) -
pow2
(bK0) );
60
xgamma = 2. *
ALPHA_EM
*
pow2
(
m_Z
) /
M_PI
* intB;
61
}
62
void
setZ
(
double
in_Z) {
m_Z
=in_Z;};
63
void
setMinB
(
double
in_min_b) {
m_min_b
=in_min_b;};
64
void
setMinX
(
double
in_min_x) {
m_min_x
=in_min_x;};
65
private
:
66
double
m_Z
;
67
double
m_min_b
;
68
double
m_min_x
;
69
70
71
//GeV equivalent of 1 amu, e.g. mass of nucleon bound in nucleus (not free) = 0.9314 GeV
72
static
constexpr
double
M_NUCLEON_EFF
=0.9315;
73
static
constexpr
double
ALPHA_EM
=7.2973525664e-3;
74
static
constexpr
double
HBAR_TIMES_C
=0.1973269788;
// in GeV x fm
75
76
};
77
79
class
UserPhotonFlux
:
public
extends<AthAlgTool, IPythia8Custom> {
80
81
public
:
82
84
using
base_class::base_class;
85
87
virtual
~UserPhotonFlux
(){};
88
90
StatusCode
initialize
()
override
;
92
StatusCode
finalize
()
override
;
93
97
StatusCode
ModifyPythiaEvent
(Pythia8::Pythia& pythia)
const override
;
98
101
virtual
double
CrossSectionScaleFactor
()
const override
;
102
103
StatusCode
InitializePythiaInfo
(Pythia8::Pythia& )
const override
;
104
105
private
:
106
107
Gaudi::Property<int>
m_process
{
this
,
"Process"
, 1};
108
Gaudi::Property<double>
m_flux_Z
{
this
,
"NuclearCharge"
, 82.};
109
Gaudi::Property<double>
m_flux_min_b
{
this
,
"MinimumB"
, 13.24};
110
Gaudi::Property<double>
m_flux_min_x
{
this
,
"MinimumX"
, -1};
//default applies no cut since sampled x's always >0.
111
};
112
113
#ifdef PYTHIA_VERSION_INTEGER
114
#if PYTHIA_VERSION_INTEGER > 8300
115
typedef
std::shared_ptr<Pythia8::PDF>
PDFPtr
;
116
typedef
std::shared_ptr<Nucleus2gamma2>
Nucleus2gammaPtr
;
117
#define PNEW(X, Y) std::make_shared<X>(Y);
118
#else
119
typedef
Nucleus2gamma2
*
Nucleus2gammaPtr
;
120
typedef
Pythia8::PDF*
PDFPtr
;
121
#define PNEW(X, Y) new X(Y);
122
#endif
123
#else
124
typedef
Nucleus2gamma2
*
Nucleus2gammaPtr
;
125
typedef
Pythia8::PDF*
PDFPtr
;
126
#define PNEW(X, Y) new X(Y);
127
#endif
128
129
130
#endif
M_PI
#define M_PI
Definition
ActiveFraction.h:14
AthAlgTool.h
IPythia8Custom.h
pow2
static const std::map< unsigned int, unsigned int > pow2
Definition
TriggerProcessor.cxx:23
PDFPtr
Pythia8::PDF * PDFPtr
Definition
UserPhotonFlux.h:125
Nucleus2gammaPtr
Nucleus2gamma2 * Nucleus2gammaPtr
Definition
UserPhotonFlux.h:124
x
#define x
Lepton2gamma2::xfUpdate
void xfUpdate(int, double x, double Q2)
Definition
UserPhotonFlux.h:29
Lepton2gamma2::Lepton2gamma2
Lepton2gamma2(int idBeamIn)
Definition
UserPhotonFlux.h:26
Nucleus2gamma2
Definition
UserPhotonFlux.h:34
Nucleus2gamma2::m_min_x
double m_min_x
Definition
UserPhotonFlux.h:68
Nucleus2gamma2::xfUpdate
void xfUpdate(int, double x, double)
Definition
UserPhotonFlux.h:47
Nucleus2gamma2::setMinB
void setMinB(double in_min_b)
Definition
UserPhotonFlux.h:63
Nucleus2gamma2::M_NUCLEON_EFF
static constexpr double M_NUCLEON_EFF
Definition
UserPhotonFlux.h:72
Nucleus2gamma2::setMinX
void setMinX(double in_min_x)
Definition
UserPhotonFlux.h:64
Nucleus2gamma2::m_min_b
double m_min_b
Definition
UserPhotonFlux.h:67
Nucleus2gamma2::ALPHA_EM
static constexpr double ALPHA_EM
Definition
UserPhotonFlux.h:73
Nucleus2gamma2::setZ
void setZ(double in_Z)
Definition
UserPhotonFlux.h:62
Nucleus2gamma2::HBAR_TIMES_C
static constexpr double HBAR_TIMES_C
Definition
UserPhotonFlux.h:74
Nucleus2gamma2::Nucleus2gamma2
Nucleus2gamma2(int idBeamIn)
Definition
UserPhotonFlux.h:40
Nucleus2gamma2::m_Z
double m_Z
Definition
UserPhotonFlux.h:66
UserPhotonFlux
Tool to implement Pythi8 main70 functionality.
Definition
UserPhotonFlux.h:79
UserPhotonFlux::m_flux_Z
Gaudi::Property< double > m_flux_Z
Definition
UserPhotonFlux.h:108
UserPhotonFlux::InitializePythiaInfo
StatusCode InitializePythiaInfo(Pythia8::Pythia &) const override
Definition
UserPhotonFlux.cxx:11
UserPhotonFlux::m_process
Gaudi::Property< int > m_process
Definition
UserPhotonFlux.h:107
UserPhotonFlux::ModifyPythiaEvent
StatusCode ModifyPythiaEvent(Pythia8::Pythia &pythia) const override
Update the pythia event Probably not used for this application.
Definition
UserPhotonFlux.cxx:43
UserPhotonFlux::m_flux_min_b
Gaudi::Property< double > m_flux_min_b
Definition
UserPhotonFlux.h:109
UserPhotonFlux::m_flux_min_x
Gaudi::Property< double > m_flux_min_x
Definition
UserPhotonFlux.h:110
UserPhotonFlux::finalize
StatusCode finalize() override
AlgTool finalize method.
Definition
UserPhotonFlux.cxx:37
UserPhotonFlux::CrossSectionScaleFactor
virtual double CrossSectionScaleFactor() const override
Return how much the cross section is modified.
Definition
UserPhotonFlux.cxx:47
UserPhotonFlux::~UserPhotonFlux
virtual ~UserPhotonFlux()
Destructor.
Definition
UserPhotonFlux.h:87
UserPhotonFlux::initialize
StatusCode initialize() override
AlgTool initialize method.
Definition
UserPhotonFlux.cxx:6
Pythia8
Author: James Monk (jmonk@cern.ch).
Definition
IPythia8Custom.h:10
Generated on
for ATLAS Offline Software by
1.17.0