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) 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 "BDSCrystalInfo.hh"
19#include "BDSCrystalType.hh"
20#include "BDSUtilities.hh"
21
22#include "globals.hh"
23
24#include <limits>
25
26BDSCrystalInfo::BDSCrystalInfo(G4Material* materialIn,
27 const G4String& dataIn,
28 BDSCrystalType crystalTypeIn,
29 G4double lengthXIn,
30 G4double lengthYIn,
31 G4double lengthZIn,
32 G4double sizeAIn,
33 G4double sizeBIn,
34 G4double sizeCIn,
35 G4double alphaIn,
36 G4double betaIn,
37 G4double gammaIn,
38 G4int spaceGroupIn,
39 G4double bendingAngleYAxisIn,
40 G4double bendingAngleZAxisIn,
41 G4double miscutAngleYIn):
42 material(materialIn),
43 data(dataIn),
44 shape(crystalTypeIn),
45 lengthX(lengthXIn),
46 lengthY(lengthYIn),
47 lengthZ(lengthZIn),
48 sizeA(sizeAIn),
49 sizeB(sizeBIn),
50 sizeC(sizeCIn),
51 alpha(alphaIn),
52 beta(betaIn),
53 gamma(gammaIn),
54 spaceGroup(spaceGroupIn),
55 bendingAngleYAxis(bendingAngleYAxisIn),
56 bendingAngleZAxis(bendingAngleZAxisIn),
57 miscutAngleY(miscutAngleYIn)
58{;}
59
60G4double BDSCrystalInfo::BendingRadius(G4double length,
61 G4double angle) const
62{
63 if (BDS::IsFinite(angle))
64 {return length / angle;}
65 else
66 {return std::numeric_limits<double>::max();}
67}
BDSCrystalInfo()=delete
No default constuctor.
G4bool IsFinite(G4double value, G4double tolerance=std::numeric_limits< double >::epsilon())