ATLAS Offline Software
UserPhotonFlux.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 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 using namespace Pythia8;
14 
15 // Photon flux from lead-ions. Integrated over impact parameters > 2*r_Pb.
16 // Suitable for photo-nuclear processes but not for photon-photon.
17 // This should be considered as an experimental setup and used with caution.
18 
19 
20 // Photon flux from leptons, corresponds to internal Lepton2gamma.
21 
22 class Lepton2gamma2 : public PDF {
23 
24 public:
25 
26  // Constructor.
27  Lepton2gamma2(int idBeamIn) : PDF(idBeamIn) {}
28 
29  // Update the photon flux.
30  void xfUpdate(int , double x, double Q2) {
31  xgamma = 0.5 * 0.007297353080 / M_PI * (1. + pow2(1. - x)) / Q2;
32  }
33 };
34 
35 class Nucleus2gamma2 : public PDF {
36 
37 public:
38 
39  // Constructor.
40  //defaults for m_Z m_min_b=2*nuclear radius are for Pb208 (Z=82, R=6.62fm)
41  Nucleus2gamma2(int idBeamIn) : PDF(idBeamIn),
42  m_Z(82.),
43  m_min_b(13.24),
44  m_min_x(-1)
45  {}
46 
47  // Update the photon flux.
48  void xfUpdate(int , double x, double ) {
49 
50 
51  if(x < m_min_x)
52  {
53  xgamma=0;
54  return;
55  }
56  double xi = x * M_NUCLEON_EFF * m_min_b / HBAR_TIMES_C;
57  double bK0 = besselK0(xi);
58  double bK1 = 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 
103  StatusCode InitializePythiaInfo(Pythia8::Pythia& ) const override;
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 shared_ptr<PDF> PDFPtr;
116  typedef shared_ptr<Nucleus2gamma2> Nucleus2gammaPtr;
117  #define PNEW(X, Y) make_shared<X>(Y);
118  #else
120  typedef PDF* PDFPtr;
121  #define PNEW(X, Y) new X(Y);
122  #endif
123 #else
125  typedef PDF* PDFPtr;
126  #define PNEW(X, Y) new X(Y);
127 #endif
128 
129 
130 #endif
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:53
Nucleus2gamma2::xfUpdate
void xfUpdate(int, double x, double)
Definition: UserPhotonFlux.h:48
Powheg_tt_mtop_common.PDF
PDF
Definition: Powheg_tt_mtop_common.py:110
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:22
initialize
void initialize()
Definition: run_EoverP.cxx:894
bTosllAli.Pythia
Pythia
Definition: bTosllAli.py:46
M_PI
#define M_PI
Definition: ActiveFraction.h:11
Nucleus2gamma2::setMinB
void setMinB(double in_min_b)
Definition: UserPhotonFlux.h:63
Lepton2gamma2::xfUpdate
void xfUpdate(int, double x, double Q2)
Definition: UserPhotonFlux.h:30
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:27
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:41
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
Nucleus2gamma2::m_Z
double m_Z
Definition: UserPhotonFlux.h:64
Nucleus2gammaPtr
Nucleus2gamma2 * Nucleus2gammaPtr
Definition: UserPhotonFlux.h:124
Nucleus2gamma2
Definition: UserPhotonFlux.h:35
PDFPtr
PDF * PDFPtr
Definition: UserPhotonFlux.h:125
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::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