19#include "BDSApertureInfo.hh"
20#include "BDSApertureType.hh"
22#include "BDSException.hh"
23#include "BDSExtent.hh"
24#include "BDSUtilities.hh"
35 G4String nameForError):
36 apertureType(apertureTypeIn),
50 G4String nameForError):
61 G4String apertureTypeIn,
66 G4String nameForError)
68 if (apertureTypeIn.empty())
99 case BDSApertureType::circular:
101 case BDSApertureType::elliptical:
103 case BDSApertureType::rectangular:
105 case BDSApertureType::lhc:
107 case BDSApertureType::lhcdetailed:
109 case BDSApertureType::rectellipse:
111 case BDSApertureType::racetrack:
113 case BDSApertureType::octagonal:
115 case BDSApertureType::clicpcl:
123 exception.
SetName(nameForError);
134 case BDSApertureType::circular:
135 case BDSApertureType::circularvacuum:
141 case BDSApertureType::elliptical:
142 case BDSApertureType::rectangular:
143 case BDSApertureType::octagonal:
149 case BDSApertureType::lhc:
150 case BDSApertureType::lhcdetailed:
151 case BDSApertureType::rectellipse:
157 case BDSApertureType::racetrack:
163 case BDSApertureType::clicpcl:
165 G4double extentX =
aper1;
166 G4double extentYLow = -std::abs(
aper3);
169 extentYLow, extentYHigh,
192 G4cout << __METHOD_NAME__ << G4endl;
193 G4cout <<
"aper1: " <<
aper1 <<
" check it? " << setAper1 << G4endl;
194 G4cout <<
"aper2: " <<
aper2 <<
" check it? " << setAper2 << G4endl;
195 G4cout <<
"aper3: " <<
aper3 <<
" check it? " << setAper3 << G4endl;
196 G4cout <<
"aper4: " <<
aper4 <<
" check it? " << setAper4 << G4endl;
199 {
throw BDSException(
"",
"\"aper1\" not set, but required to be.");}
201 {
throw BDSException(
"",
"\"aper2\" not set, but required to be.");}
203 {
throw BDSException(
"",
"\"aper3\" not set, but required to be.");}
205 {
throw BDSException(
"",
"\"aper4\" not set, but required to be.");}
228 {
throw BDSException(
"\"aper3\" > \"aper1\" (or \"beamPipeRadius\") for lhc aperture model - will not produce desired shape");}
231 {
throw BDSException(
"\"aper3\" > \"aper2\" (or \"beamPipeRadius\") for lhc aperture model - will not produce desired shape");}
272 {
throw BDSException(
"aper3 is >= aper1 - invalid for an octagonal aperture");}
274 {
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())