Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 
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 AthAlgTool, virtual public IPythia8Custom {
80 
81  public:
82 
84  UserPhotonFlux(const std::string&,const std::string&,const IInterface*);
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 
104 
105  private:
106 
108  double m_flux_Z;
109  double m_flux_min_b;
110  double m_flux_min_x;
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
126  #define PNEW(X, Y) new X(Y);
127 #endif
128 
129 
130 #endif
Nucleus2gamma2::HBAR_TIMES_C
static constexpr double HBAR_TIMES_C
Definition: UserPhotonFlux.h:74
Nucleus2gamma2::xfUpdate
void xfUpdate(int, double x, double)
Definition: UserPhotonFlux.h:47
Powheg_tt_mtop_common.PDF
PDF
Definition: Powheg_tt_mtop_common.py:110
UserPhotonFlux::finalize
StatusCode finalize() override
AlgTool finalize method.
Definition: UserPhotonFlux.cxx:48
UserPhotonFlux::ModifyPythiaEvent
StatusCode ModifyPythiaEvent(Pythia8::Pythia &pythia) const override
Update the pythia event Probably not used for this application.
Definition: UserPhotonFlux.cxx:54
UserPhotonFlux::m_flux_min_x
double m_flux_min_x
Definition: UserPhotonFlux.h:110
Nucleus2gamma2::setMinX
void setMinX(double in_min_x)
Definition: UserPhotonFlux.h:64
Lepton2gamma2
Definition: UserPhotonFlux.h:21
Nucleus2gamma2::M_NUCLEON_EFF
static constexpr double M_NUCLEON_EFF
Definition: UserPhotonFlux.h:72
bTosllAli.Pythia
Pythia
Definition: bTosllAli.py:46
PDFPtr
Pythia8::PDF * PDFPtr
Definition: UserPhotonFlux.h:125
M_PI
#define M_PI
Definition: ActiveFraction.h:11
UserPhotonFlux::CrossSectionScaleFactor
virtual double CrossSectionScaleFactor() const override
Return how much the cross section is modified.
Definition: UserPhotonFlux.cxx:58
Nucleus2gamma2::setMinB
void setMinB(double in_min_b)
Definition: UserPhotonFlux.h:63
Lepton2gamma2::xfUpdate
void xfUpdate(int, double x, double Q2)
Definition: UserPhotonFlux.h:29
UserPhotonFlux::m_flux_min_b
double m_flux_min_b
Definition: UserPhotonFlux.h:109
IPythia8Custom.h
x
#define x
Lepton2gamma2::Lepton2gamma2
Lepton2gamma2(int idBeamIn)
Definition: UserPhotonFlux.h:26
Pythia8
Author: James Monk (jmonk@cern.ch)
Definition: IPythia8Custom.h:13
IPythia8Custom
Definition: IPythia8Custom.h:18
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Nucleus2gamma2::Nucleus2gamma2
Nucleus2gamma2(int idBeamIn)
Definition: UserPhotonFlux.h:40
AthAlgTool.h
Nucleus2gamma2::setZ
void setZ(double in_Z)
Definition: UserPhotonFlux.h:62
Nucleus2gamma2::m_min_x
double m_min_x
Definition: UserPhotonFlux.h:68
UserPhotonFlux::InitializePythiaInfo
StatusCode InitializePythiaInfo(Pythia8::Pythia &) const override
Definition: UserPhotonFlux.cxx:22
Nucleus2gamma2::m_Z
double m_Z
Definition: UserPhotonFlux.h:64
UserPhotonFlux::initialize
StatusCode initialize() override
AlgTool initialize method.
Definition: UserPhotonFlux.cxx:17
Nucleus2gammaPtr
Nucleus2gamma2 * Nucleus2gammaPtr
Definition: UserPhotonFlux.h:124
Nucleus2gamma2
Definition: UserPhotonFlux.h:34
Nucleus2gamma2::m_min_b
double m_min_b
Definition: UserPhotonFlux.h:67
UserPhotonFlux::~UserPhotonFlux
virtual ~UserPhotonFlux()
Destructor.
Definition: UserPhotonFlux.h:87
UserPhotonFlux::m_process
int m_process
Definition: UserPhotonFlux.h:107
UserPhotonFlux::UserPhotonFlux
UserPhotonFlux(const std::string &, const std::string &, const IInterface *)
AlgTool style constructor.
Definition: UserPhotonFlux.cxx:6
Nucleus2gamma2::ALPHA_EM
static constexpr double ALPHA_EM
Definition: UserPhotonFlux.h:73
UserPhotonFlux::m_flux_Z
double m_flux_Z
Definition: UserPhotonFlux.h:108
UserPhotonFlux
Tool to implement Pythi8 main70 functionality.
Definition: UserPhotonFlux.h:79
AthAlgTool
Definition: AthAlgTool.h:26