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