19#ifndef BDSMUONCOOLERBUILDER_H
20#define BDSMUONCOOLERBUILDER_H
34 struct MuonCoolerCoilInfo;
35 struct MuonCoolerDipoleInfo;
36 struct MuonCoolerCavityInfo;
37 struct MuonCoolerAbsorberInfo;
46 G4double horizontalWidth,
49 G4double designRigidity);
60 const G4String& elementName,
61 const std::vector<BDS::SquareCheck>& coilSquares,
62 G4double elementChordLength,
63 G4double elementRadius);
65 std::vector<BDS::MuonCoolerDipoleInfo> BuildMuonCoolerDipoleInfos(
const GMAD::CoolingChannel& definition);
69 void CheckMuonCoolerAbsorberInfoForOverlaps(
const G4String& definitionName,
70 const G4String& elementName,
71 const std::vector<BDS::MuonCoolerAbsorberInfo>& absorberInfos,
72 const std::vector<BDS::SquareCheck>& cavitySquares,
73 const std::vector<BDS::SquareCheck>& coilSquares,
74 G4double elementChordLength,
75 G4double elementRadius);
77 std::vector<BDS::MuonCoolerCavityInfo> BuildMuonCoolerCavityInfos(
const GMAD::CoolingChannel& definition);
78 void CheckMuonCoolerCavityInfosForOverlaps(
const G4String& definitionName,
79 const G4String& elementName,
80 const std::vector<BDS::SquareCheck>& cavitySquares,
81 const std::vector<BDS::SquareCheck>& coilSquares,
82 G4double elementChordLength,
83 G4double elementRadius);
98 G4bool zOK = (o.z1 > z2 || o.z1 < z1) && (o.z2 > z2 || o.z2 < z1) && (o.z2 > o.z1);
99 G4bool rOK = (o.r1 > r2 || o.r1 < r1) && (o.r2 > r2 || o.r2 < r1) && (o.r2 > o.r1);
102 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)";}
112 const std::vector<
const std::list<double>*>& params,
113 const std::vector<std::string>& paramNames,
114 G4int nExpectedParams,
115 std::vector<std::vector<double>>& paramsV);
121 const G4String& variableName,
122 const std::list<std::string>& materialNames,
123 G4int nExpectedParams,
124 std::vector<G4Material*>& materials);
126 BDSFieldInfo* BuildMuonCoolerFieldRecipe(
const G4String& definitionName,
127 G4double designRigidity,
128 const G4String& integrator,
129 const G4String& magneticFieldModel,
130 const G4String& electricFieldModel,
131 const G4String& dipoleFieldModel,
132 const std::vector<BDS::MuonCoolerCoilInfo>& coilInfos,
133 const std::vector<BDS::MuonCoolerDipoleInfo>& dipoleInfos,
134 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.