BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSCrystal.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 "BDSCrystal.hh"
19#include "BDSCrystalInfo.hh"
20
21#include "globals.hh"
22#include "G4VSolid.hh"
23
24#include <limits>
25
26BDSCrystal::BDSCrystal(const BDSCrystalInfo* recipeIn,
27 G4VSolid* containerSolidIn,
28 G4LogicalVolume* containerLVIn,
29 const BDSExtent& extentIn,
30 const G4ThreeVector& placementOffsetIn,
31 G4RotationMatrix* placementRotationIn):
32 BDSGeometryComponent(containerSolidIn, containerLVIn, extentIn, BDSExtent(), placementOffsetIn, placementRotationIn),
33 bendingRadiusHorizontal(std::numeric_limits<double>::max()),
34 recipe(nullptr)
35{
36 if (recipeIn)
37 {
38 recipe = new BDSCrystalInfo(*recipeIn);
39 bendingRadiusHorizontal = recipe->BendingRadiusHorizontal();
40 }
41}
42
43BDSCrystal::~BDSCrystal()
44{
45 delete recipe;
46}
Holder for all information required to create a crystal.
Holder for +- extents in 3 dimensions.
Definition BDSExtent.hh:38
A generic geometry component for a bdsim model.
STL namespace.