BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSArrayReflectionType.hh
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#ifndef BDSARRAYREFLECTIONTYPE_H
19#define BDSARRAYREFLECTIONTYPE_H
20#include "BDSTypeSafeEnum.hh"
21#include "G4String.hh"
22
23#include <ostream>
24#include <set>
25
33{
34 enum type {flipsimple, // for internal use
35 flipx, flipy, flipz, flipt,
36 reflectsimple, // for internal use
37 reflectx, reflecty, reflectz, reflectt,
38 reflectadvanced, // for internal use
39 reflectxydipole,
40 reflectxzdipole,
41 reflectyzdipole,
42 reflectzsolenoid,
43 reflectxyquadrupole};
44};
45
47
48// We will commonly use a set of possible reflections, so we provide a convenient typedef.
49typedef std::set<BDSArrayReflectionType> BDSArrayReflectionTypeSet;
50
51namespace BDS
52{
54 BDSArrayReflectionType DetermineArrayReflectionType(G4String arrayReflectionType);
55
57 BDSArrayReflectionTypeSet DetermineArrayReflectionTypeSet(const G4String& arrayReflectionType);
58
60 G4bool ProblemWithArrayReflectionCombination(const BDSArrayReflectionTypeSet& setIn, G4String* details=nullptr);
61}
62
63std::ostream& operator<< (std::ostream &out, BDSArrayReflectionTypeSet const& t);
64
65#endif
66
67
Improve type-safety of native enum data type in C++.
Return either G4Tubs or G4CutTubs depending on flat face.
BDSArrayReflectionTypeSet DetermineArrayReflectionTypeSet(const G4String &arrayReflectionType)
Return a std::set of reflection types. Split string on white space.
BDSArrayReflectionType DetermineArrayReflectionType(G4String arrayReflectionType)
Function that gives corresponding enum value for string (case-insensitive)
G4bool ProblemWithArrayReflectionCombination(const BDSArrayReflectionTypeSet &setIn, G4String *details=nullptr)
Return true if there's a conceptual conflict with the set of field reflections requested.
Type definition for array reflections.