ATLAS Offline Software
Loading...
Searching...
No Matches
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
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
21class Lepton2gamma2 : public Pythia8::PDF {
22
23public:
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
34class Nucleus2gamma2 : public Pythia8::PDF {
35
36public:
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;};
65private:
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
79class 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
120 typedef Pythia8::PDF* PDFPtr;
121 #define PNEW(X, Y) new X(Y);
122 #endif
123#else
125 typedef Pythia8::PDF* PDFPtr;
126 #define PNEW(X, Y) new X(Y);
127#endif
128
129
130#endif
#define M_PI
static const std::map< unsigned int, unsigned int > pow2
Pythia8::PDF * PDFPtr
Nucleus2gamma2 * Nucleus2gammaPtr
#define x
void xfUpdate(int, double x, double Q2)
Lepton2gamma2(int idBeamIn)
void xfUpdate(int, double x, double)
void setMinB(double in_min_b)
static constexpr double M_NUCLEON_EFF
void setMinX(double in_min_x)
static constexpr double ALPHA_EM
void setZ(double in_Z)
static constexpr double HBAR_TIMES_C
Nucleus2gamma2(int idBeamIn)
Tool to implement Pythi8 main70 functionality.
Gaudi::Property< double > m_flux_Z
StatusCode InitializePythiaInfo(Pythia8::Pythia &) const override
Gaudi::Property< int > m_process
StatusCode ModifyPythiaEvent(Pythia8::Pythia &pythia) const override
Update the pythia event Probably not used for this application.
Gaudi::Property< double > m_flux_min_b
Gaudi::Property< double > m_flux_min_x
StatusCode finalize() override
AlgTool finalize method.
virtual double CrossSectionScaleFactor() const override
Return how much the cross section is modified.
virtual ~UserPhotonFlux()
Destructor.
StatusCode initialize() override
AlgTool initialize method.
Author: James Monk (jmonk@cern.ch)