BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
BDSTunnelBuilder.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2022.
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#ifndef BDSTUNNELBUILDER_H
20#define BDSTUNNELBUILDER_H
21
22#include "globals.hh" // geant4 types / globals
23
24#include "BDSBeamline.hh"
25
36{
37public:
38 explicit BDSTunnelBuilder(G4double tunnelMaxSegmentLengthIn = 50*CLHEP::m);
40
45 BDSBeamline* BuildTunnelSections(const BDSBeamline* flatBeamLine) const;
46
47private:
50 G4bool BreakTunnel(BDSBeamline::const_iterator proposedStart,
52 const G4double& halfWidth) const;
53
57
59 G4double maxItems;
60
62 G4double maxLength;
63
65 G4double maxAngle;
66
68 G4double minLength;
69};
70
71
72#endif
A vector of BDSBeamlineElement instances - a beamline.
Definition: BDSBeamline.hh:61
BeamlineVector::const_iterator const_iterator
Iterator mechanics.
Definition: BDSBeamline.hh:164
A class that constructs tunnel segments around a beamline.
BDSBeamline * BuildTunnelSections(const BDSBeamline *flatBeamLine) const
G4double maxAngle
Maximum angle before split.
G4double maxItems
Maximum number of items before split.
G4bool BreakTunnel(BDSBeamline::const_iterator proposedStart, BDSBeamline::const_iterator proposedEnd, const G4double &halfWidth) const
G4double minLength
Minimum length to angle ratio to allow a split.
G4double maxLength
Maximum length before split.
G4double displacementTolerance