18#include "BDSApertureInfo.hh"
19#include "BDSApertureType.hh"
21#include "BDSException.hh"
22#include "BDSExtent.hh"
23#include "BDSUtilities.hh"
34 G4String nameForError):
35 apertureType(apertureTypeIn),
49 G4String nameForError):
60 G4String apertureTypeIn,
65 G4String nameForError)
67 if (apertureTypeIn.empty())
98 case BDSApertureType::circular:
100 case BDSApertureType::elliptical:
102 case BDSApertureType::rectangular:
104 case BDSApertureType::lhc:
106 case BDSApertureType::lhcdetailed:
108 case BDSApertureType::rectellipse:
110 case BDSApertureType::racetrack:
112 case BDSApertureType::octagonal:
114 case BDSApertureType::clicpcl:
122 exception.
SetName(nameForError);
133 case BDSApertureType::circular:
134 case BDSApertureType::circularvacuum:
140 case BDSApertureType::elliptical:
141 case BDSApertureType::rectangular:
142 case BDSApertureType::octagonal:
148 case BDSApertureType::lhc:
149 case BDSApertureType::lhcdetailed:
150 case BDSApertureType::rectellipse:
156 case BDSApertureType::racetrack:
162 case BDSApertureType::clicpcl:
164 G4double extentX =
aper1;
165 G4double extentYLow = -std::abs(
aper3);
168 extentYLow, extentYHigh,
191 G4cout << __METHOD_NAME__ << G4endl;
192 G4cout <<
"aper1: " <<
aper1 <<
" check it? " << setAper1 << G4endl;
193 G4cout <<
"aper2: " <<
aper2 <<
" check it? " << setAper2 << G4endl;
194 G4cout <<
"aper3: " <<
aper3 <<
" check it? " << setAper3 << G4endl;
195 G4cout <<
"aper4: " <<
aper4 <<
" check it? " << setAper4 << G4endl;
198 {
throw BDSException(
"",
"\"aper1\" not set, but required to be.");}
200 {
throw BDSException(
"",
"\"aper2\" not set, but required to be.");}
202 {
throw BDSException(
"",
"\"aper3\" not set, but required to be.");}
204 {
throw BDSException(
"",
"\"aper4\" not set, but required to be.");}
227 {
throw BDSException(
"\"aper3\" > \"aper1\" (or \"beamPipeRadius\") for lhc aperture model - will not produce desired shape");}
230 {
throw BDSException(
"\"aper3\" > \"aper2\" (or \"beamPipeRadius\") for lhc aperture model - will not produce desired shape");}
271 {
throw BDSException(
"aper3 is >= aper1 - invalid for an octagonal aperture");}
273 {
throw BDSException(
"aper4 is >= aper2 - invalid for an octagonal aperture");}
Holder class for all information required to describe an aperture.
void InfoOKForRectangular()
Aperture info check for rectangular aperture.
void CheckApertureInfo(const G4String &nameForError)
void InfoOKForRectEllipse()
Aperture info check for rectellipse aperture.
void InfoOKForLHCDetailed()
Aperture info check for lhc detailed aperture.
G4double IndicativeRadius() const
Return an indicative extent of the beam pipe - typically the maximum of x or y extent.
G4double aper1
Public member for direct access.
void InfoOKForRaceTrack()
Aperture info check for racetrack aperture.
void InfoOKForElliptical()
Aperture info check for elliptical aperture.
G4double aper2
Public member for direct access.
G4double aper3
Public member for direct access.
G4double aper4
Public member for direct access.
BDSApertureInfo()=delete
Private default constructor to ensure one of supplied constructors is used.
void CheckRequiredParametersSet(G4bool setAper1, G4bool setAper2, G4bool setAper3, G4bool setAper4)
void InfoOKForClicPCL()
Aperture info check for CLIC PCL aperture.
void InfoOKForOctagonal()
Aperture info check for octagonal aperture.
void InfoOKForLHC()
Aperture info check for lhc aperture.
void InfoOKForCircular()
Aperture info check for circular aperture.
BDSApertureType apertureType
Public member for direct access.
General exception with possible name of object and message.
void SetName(const std::string &nameIn)
Allow setting of name later.
Holder for +- extents in 3 dimensions.
G4double MaximumAbsTransverse() const
Return the maximum absolute value considering only x,y.
type underlying() const
return underlying value (can be used in switch statement)
BDSApertureType DetermineApertureType(G4String apertureType)
function that gives corresponding enum value for string (case-insensitive)
G4bool IsFinite(G4double value, G4double tolerance=std::numeric_limits< double >::epsilon())