19#include "BDSException.hh"
20#include "BDSFieldEMMuonCooler.hh"
21#include "BDSFieldInfoExtra.hh"
22#include "BDSFieldMagSolenoidBlock.hh"
23#include "BDSFieldMagSolenoidSheet.hh"
24#include "BDSFieldMagSolenoidLoop.hh"
25#include "BDSFieldMagDipoleEnge.hh"
26#include "BDSFieldMagDipoleHardEdgeMuonCooler.hh"
27#include "BDSFieldMagVectorSum.hh"
28#include "BDSFieldMag.hh"
29#include "BDSFieldEMVectorSum.hh"
30#include "BDSFieldEMRFCavity.hh"
31#include "BDSFieldType.hh"
33#include "G4ThreeVector.hh"
53 case BDSFieldType::solenoidblock:
55 const auto& coilInfos = info->coilInfos;
56 std::vector<BDSFieldMag*> fields;
57 std::vector<G4ThreeVector> fieldOffsets;
58 for (
const auto& ci : coilInfos)
67 fieldOffsets.emplace_back(0,0,ci.offsetZ);
72 case BDSFieldType::solenoidsheet:
74 const auto& coilInfos = info->coilInfos;
75 std::vector<BDSFieldMag*> fields;
76 std::vector<G4ThreeVector> fieldOffsets;
77 for (
const auto& ci : coilInfos)
81 ci.innerRadius + 0.5*ci.radialThickness,
84 fieldOffsets.emplace_back(0,0,ci.offsetZ);
89 case BDSFieldType::solenoidloop:
91 const auto& coilInfos = info->coilInfos;
92 std::vector<BDSFieldMag*> fields;
93 std::vector<G4ThreeVector> fieldOffsets;
94 for (
const auto& ci : coilInfos)
98 ci.innerRadius + 0.5*ci.radialThickness));
99 fieldOffsets.emplace_back(0,0,ci.offsetZ);
107 msg +=
"\" is not a valid field model for a muon cooler B field";
118 case BDSFieldType::dipole:
120 const auto& dipoleInfos = info->dipoleInfos;
121 std::vector<BDSFieldMag*> fields;
122 std::vector<G4ThreeVector> fieldOffsets;
123 for (
const auto& di : dipoleInfos)
128 fieldOffsets.emplace_back(0,0,di.offsetZ);
133 case BDSFieldType::dipoleenge:
135 const auto& dipoleInfos = info->dipoleInfos;
136 std::vector<BDSFieldMag*> fields;
137 std::vector<G4ThreeVector> fieldOffsets;
138 for (
const auto& di : dipoleInfos)
143 di.engeCoefficient));
144 fieldOffsets.emplace_back(0,0,di.offsetZ);
152 msg +=
"\" is not a valid dipole field model for a muon cooler B field";
161 const auto& cavityInfos = info->cavityInfos;
162 std::vector<G4ThreeVector> fieldOffsets;
164 for (
const auto& ci : cavityInfos)
173 double lengthZ = ci.lengthZ;
174 G4ThreeVector posOffset(0.0, 0.0, ci.offsetZ);
175 double tOffset = ci.globalTimeOffset;
176 emSum->PushBackField(posOffset, tOffset, lengthZ, rfCav);
181BDSFieldEMMuonCooler::~BDSFieldEMMuonCooler()
189 const G4double t)
const
191 auto result = rfField->
GetField(position, t);
192 G4ThreeVector solfieldOut = coilField->
GetField(position, t);
193 G4ThreeVector dipolefieldOut = dipoleField->
GetField(position, t);
194 result.first += solfieldOut;
195 result.first += dipolefieldOut;
General exception with possible name of object and message.
virtual std::pair< G4ThreeVector, G4ThreeVector > GetField(const G4ThreeVector &position, const G4double t) const
Function to get B and E field.
Pill box cavity electromagnetic field.
A vector sum of multiple displaced EM fields.
virtual std::pair< G4ThreeVector, G4ThreeVector > GetField(const G4ThreeVector &position, const G4double t=0) const =0
A dipole field with Enge-type fringes. This follows the model and parameterisation described in: http...
This class represents a hard-edge dipole field. The field is calculated in cartesian coordinates.
Class that provides the magnetic field due to a square annulus of current.
Class that provides the magnetic field due to a cylinder of current.
Class that provides the magnetic field due to a cylinder of current.
A vector sum of multiple displaced magnetic fields.
virtual G4ThreeVector GetField(const G4ThreeVector &position, const G4double t=0) const =0
type underlying() const
return underlying value (can be used in switch statement)