18#ifndef BDSMUONCOOLERBUILDER_H
19#define BDSMUONCOOLERBUILDER_H
33 struct MuonCoolerCoilInfo;
34 struct MuonCoolerDipoleInfo;
35 struct MuonCoolerCavityInfo;
36 struct MuonCoolerAbsorberInfo;
45 G4double horizontalWidth,
48 G4double designRigidity);
59 const G4String& elementName,
60 const std::vector<BDS::SquareCheck>& coilSquares,
61 G4double elementChordLength,
62 G4double elementRadius);
64 std::vector<BDS::MuonCoolerDipoleInfo> BuildMuonCoolerDipoleInfos(
const GMAD::CoolingChannel& definition);
68 void CheckMuonCoolerAbsorberInfoForOverlaps(
const G4String& definitionName,
69 const G4String& elementName,
70 const std::vector<BDS::MuonCoolerAbsorberInfo>& absorberInfos,
71 const std::vector<BDS::SquareCheck>& cavitySquares,
72 const std::vector<BDS::SquareCheck>& coilSquares,
73 G4double elementChordLength,
74 G4double elementRadius);
76 std::vector<BDS::MuonCoolerCavityInfo> BuildMuonCoolerCavityInfos(
const GMAD::CoolingChannel& definition);
77 void CheckMuonCoolerCavityInfosForOverlaps(
const G4String& definitionName,
78 const G4String& elementName,
79 const std::vector<BDS::SquareCheck>& cavitySquares,
80 const std::vector<BDS::SquareCheck>& coilSquares,
81 G4double elementChordLength,
82 G4double elementRadius);
97 G4bool zOK = (o.z1 > z2 || o.z1 < z1) && (o.z2 > z2 || o.z2 < z1) && (o.z2 > o.z1);
98 G4bool rOK = (o.r1 > r2 || o.r1 < r1) && (o.r2 > r2 || o.r2 < r1) && (o.r2 > o.r1);
101 G4String Str()
const {
return "z1: " + std::to_string(z1) +
", z2: " + std::to_string(z2) +
", r1: " + std::to_string(r1) +
", r2: " + std::to_string(r2) +
" (mm)";}
111 const std::vector<
const std::list<double>*>& params,
112 const std::vector<std::string>& paramNames,
113 G4int nExpectedParams,
114 std::vector<std::vector<double>>& paramsV);
120 const G4String& variableName,
121 const std::list<std::string>& materialNames,
122 G4int nExpectedParams,
123 std::vector<G4Material*>& materials);
125 BDSFieldInfo* BuildMuonCoolerFieldRecipe(
const G4String& definitionName,
126 G4double designRigidity,
127 const G4String& integrator,
128 const G4String& magneticFieldModel,
129 const G4String& electricFieldModel,
130 const G4String& dipoleFieldModel,
131 const std::vector<BDS::MuonCoolerCoilInfo>& coilInfos,
132 const std::vector<BDS::MuonCoolerDipoleInfo>& dipoleInfos,
133 const std::vector<BDS::MuonCoolerCavityInfo>& cavityInfos);
Holder class for all information required to describe a beam pipe model.
All info required to build complete field of any type.
Cooling channel parameters.
Return either G4Tubs or G4CutTubs depending on flat face.
void MuonParamsToMaterials(const G4String &definitionName, const G4String &variableName, const std::list< std::string > &materialNames, G4int nExpectedParams, std::vector< G4Material * > &materials)
BDSMuonCooler * BuildMuonCooler(const G4String &elementName, G4double chordLength, G4double horizontalWidth, const GMAD::CoolingChannel &definition, BDSBeamPipeInfo *beamPipeInfo, G4double designRigidity)
void CheckMuonCoolerCoilInfosForOverlaps(const G4String &definitionName, const G4String &elementName, const std::vector< BDS::SquareCheck > &coilSquares, G4double elementChordLength, G4double elementRadius)
std::vector< BDS::MuonCoolerCoilInfo > BuildMuonCoolerCoilInfos(const GMAD::CoolingChannel &definition)
void MuonParamsToVector(const G4String &definitionName, const std::vector< const std::list< double > * > ¶ms, const std::vector< std::string > ¶mNames, G4int nExpectedParams, std::vector< std::vector< double > > ¶msV)
std::vector< BDS::SquareCheck > MuonCoolerSquaresFromCoils(const std::vector< BDS::MuonCoolerCoilInfo > &coilInfos)
Utility function to make SquareCheck instances from coil info.
std::vector< BDS::MuonCoolerAbsorberInfo > BuildMuonCoolerAbsorberInfo(const GMAD::CoolingChannel &definition)
No checks for overlaps for dipoles as we don't physically build them yet.
std::vector< BDS::SquareCheck > MuonCoolerSquaresFromCavities(const std::vector< BDS::MuonCoolerCavityInfo > &cavityInfos)
Utility function to make SquareCheck instances from cavity info.
Parser namespace for GMAD language. Combination of Geant4 and MAD.
A very simple struct to permit checking un-rotated (i.e. axis-aligned) square overlaps.