BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSCrystalInfo.cc
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2023.
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 "BDSCrystalInfo.hh"
20#include "BDSCrystalType.hh"
21#include "BDSUtilities.hh"
22
23#include "globals.hh"
24
25#include <limits>
26
27BDSCrystalInfo::BDSCrystalInfo(G4Material* materialIn,
28 const G4String& dataIn,
29 BDSCrystalType crystalTypeIn,
30 G4double lengthXIn,
31 G4double lengthYIn,
32 G4double lengthZIn,
33 G4double sizeAIn,
34 G4double sizeBIn,
35 G4double sizeCIn,
36 G4double alphaIn,
37 G4double betaIn,
38 G4double gammaIn,
39 G4int spaceGroupIn,
40 G4double bendingAngleYAxisIn,
41 G4double bendingAngleZAxisIn,
42 G4double miscutAngleYIn):
43 material(materialIn),
44 data(dataIn),
45 shape(crystalTypeIn),
46 lengthX(lengthXIn),
47 lengthY(lengthYIn),
48 lengthZ(lengthZIn),
49 sizeA(sizeAIn),
50 sizeB(sizeBIn),
51 sizeC(sizeCIn),
52 alpha(alphaIn),
53 beta(betaIn),
54 gamma(gammaIn),
55 spaceGroup(spaceGroupIn),
56 bendingAngleYAxis(bendingAngleYAxisIn),
57 bendingAngleZAxis(bendingAngleZAxisIn),
58 miscutAngleY(miscutAngleYIn)
59{;}
60
61G4double BDSCrystalInfo::BendingRadius(G4double length,
62 G4double angle) const
63{
64 if (BDS::IsFinite(angle))
65 {return length / angle;}
66 else
67 {return std::numeric_limits<double>::max();}
68}
BDSCrystalInfo()=delete
No default constuctor.
G4bool IsFinite(G4double value, G4double tolerance=std::numeric_limits< double >::epsilon())