20#include "BDSException.hh"
21#include "BDSFieldEMMuonCooler.hh"
22#include "BDSFieldInfoExtra.hh"
23#include "BDSFieldMagSolenoidBlock.hh"
24#include "BDSFieldMagSolenoidSheet.hh"
25#include "BDSFieldMagSolenoidLoop.hh"
26#include "BDSFieldMagDipoleEnge.hh"
27#include "BDSFieldMagDipoleHardEdgeMuonCooler.hh"
28#include "BDSFieldMagVectorSum.hh"
29#include "BDSFieldMag.hh"
30#include "BDSFieldEMVectorSum.hh"
31#include "BDSFieldEMRFCavity.hh"
32#include "BDSFieldType.hh"
34#include "G4ThreeVector.hh"
54 case BDSFieldType::solenoidblock:
56 const auto& coilInfos = info->coilInfos;
57 std::vector<BDSFieldMag*> fields;
58 std::vector<G4ThreeVector> fieldOffsets;
59 for (
const auto& ci : coilInfos)
68 fieldOffsets.emplace_back(0,0,ci.offsetZ);
73 case BDSFieldType::solenoidsheet:
75 const auto& coilInfos = info->coilInfos;
76 std::vector<BDSFieldMag*> fields;
77 std::vector<G4ThreeVector> fieldOffsets;
78 for (
const auto& ci : coilInfos)
82 ci.innerRadius + 0.5*ci.radialThickness,
85 fieldOffsets.emplace_back(0,0,ci.offsetZ);
90 case BDSFieldType::solenoidloop:
92 const auto& coilInfos = info->coilInfos;
93 std::vector<BDSFieldMag*> fields;
94 std::vector<G4ThreeVector> fieldOffsets;
95 for (
const auto& ci : coilInfos)
99 ci.innerRadius + 0.5*ci.radialThickness));
100 fieldOffsets.emplace_back(0,0,ci.offsetZ);
108 msg +=
"\" is not a valid field model for a muon cooler B field";
119 case BDSFieldType::dipole:
121 const auto& dipoleInfos = info->dipoleInfos;
122 std::vector<BDSFieldMag*> fields;
123 std::vector<G4ThreeVector> fieldOffsets;
124 for (
const auto& di : dipoleInfos)
129 fieldOffsets.emplace_back(0,0,di.offsetZ);
134 case BDSFieldType::dipoleenge:
136 const auto& dipoleInfos = info->dipoleInfos;
137 std::vector<BDSFieldMag*> fields;
138 std::vector<G4ThreeVector> fieldOffsets;
139 for (
const auto& di : dipoleInfos)
144 di.engeCoefficient));
145 fieldOffsets.emplace_back(0,0,di.offsetZ);
153 msg +=
"\" is not a valid dipole field model for a muon cooler B field";
162 const auto& cavityInfos = info->cavityInfos;
163 std::vector<G4ThreeVector> fieldOffsets;
165 for (
const auto& ci : cavityInfos)
174 double lengthZ = ci.lengthZ;
175 G4ThreeVector posOffset(0.0, 0.0, ci.offsetZ);
176 double tOffset = ci.globalTimeOffset;
177 emSum->PushBackField(posOffset, tOffset, lengthZ, rfCav);
182BDSFieldEMMuonCooler::~BDSFieldEMMuonCooler()
190 const G4double t)
const
192 auto result = rfField->
GetField(position, t);
193 G4ThreeVector solfieldOut = coilField->
GetField(position, t);
194 G4ThreeVector dipolefieldOut = dipoleField->
GetField(position, t);
195 result.first += solfieldOut;
196 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)