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) 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#ifndef BDSARRAYREFLECTIONTYPE_H
20#define BDSARRAYREFLECTIONTYPE_H
21#include "BDSTypeSafeEnum.hh"
22#include "G4String.hh"
23
24#include <ostream>
25#include <set>
26
34{
35 enum type {flipsimple, // for internal use
36 flipx, flipy, flipz, flipt,
37 reflectsimple, // for internal use
38 reflectx, reflecty, reflectz, reflectt,
39 reflectadvanced, // for internal use
40 reflectxydipole,
41 reflectxzdipole,
42 reflectyzdipole,
43 reflectzsolenoid,
44 reflectxyquadrupole};
45};
46
48
49// We will commonly use a set of possible reflections, so we provide a convenient typedef.
50typedef std::set<BDSArrayReflectionType> BDSArrayReflectionTypeSet;
51
52namespace BDS
53{
55 BDSArrayReflectionType DetermineArrayReflectionType(G4String arrayReflectionType);
56
58 BDSArrayReflectionTypeSet DetermineArrayReflectionTypeSet(const G4String& arrayReflectionType);
59
61 G4bool ProblemWithArrayReflectionCombination(const BDSArrayReflectionTypeSet& setIn, G4String* details=nullptr);
62}
63
64std::ostream& operator<< (std::ostream &out, BDSArrayReflectionTypeSet const& t);
65
66#endif
67
68
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.