BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSPhotoDetachmentEngine.cc
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2024.
4
5This file is part of BDSIM.
6
7BDSIM is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published
9by the Free Software Foundation version 3 of the License.
10
11BDSIM is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
18*/
19#include "BDSPhotoDetachmentEngine.hh"
20
21#include "CLHEP/Units/PhysicalConstants.h"
22#include "CLHEP/Units/SystemOfUnits.h"
23
24#include <cmath>
25
26BDSPhotoDetachmentEngine::BDSPhotoDetachmentEngine()
27{;}
28
29BDSPhotoDetachmentEngine::~BDSPhotoDetachmentEngine()
30{;}
31
32G4double BDSPhotoDetachmentEngine::CrossSection(G4double photonEnergyIn)
33{
34 G4double photonEnergyJoules = photonEnergyIn*(1/CLHEP::joule);
35 G4double lambdaShift = ((CLHEP::h_Planck*(1/CLHEP::joule)*(1/CLHEP::second)*CLHEP::c_light*CLHEP::ms)/(photonEnergyJoules));
36 G4double lambda_nm = lambdaShift*1.0e9;
37 G4double lambda_nm2 = std::pow(lambda_nm, 2);
38 G4double lambda_nm3 = std::pow(lambda_nm, 3);
39 G4double lambda_nm4 = std::pow(lambda_nm, 4);
40
41 G4double crossSectionFit = fitCoefficient1 * lambda_nm4
42 - fitCoefficient2 * lambda_nm3
43 + fitCoefficient3 * lambda_nm2
44 + fitCoefficient4 * lambda_nm
45 - fitCoefficient5;
46 return crossSectionFit*1.0e-17*CLHEP::centimeter*CLHEP::centimeter;
47}
48