Package cnuphys.magfield
Class CompositeProbe
java.lang.Object
cnuphys.magfield.FieldProbe
cnuphys.magfield.CompositeProbe
- All Implemented Interfaces:
IField
- Direct Known Subclasses:
RotatedCompositeProbe
-
Field Summary
FieldsFields inherited from class cnuphys.magfield.FieldProbe
_field, _name, cosSect, q1Coordinate, q2Coordinate, q3Coordinate, ROOT3OVER2, sinSect, X, Y, Z
-
Constructor Summary
ConstructorsConstructorDescriptionCompositeProbe
(CompositeField field) Create a composite probe from a composite field. -
Method Summary
Modifier and TypeMethodDescriptionvoid
field
(float x, float y, float z, float[] result) Obtain the magnetic field at a given location expressed in Cartesian coordinates.void
field
(int sector, float x, float y, float z, float[] result) Obtain the magnetic field at a given location expressed in Cartesian coordinates for the sector system.void
gradient
(float x, float y, float z, float[] result) Obtain an approximation for the magnetic field gradient at a given location expressed in Cartesian coordinates.boolean
Check whether we have a solenoid fieldboolean
hasTorus()
Check whether we have a torus fieldboolean
Checks whether the field has been set to always return zero.Methods inherited from class cnuphys.magfield.FieldProbe
contains, factory, factory, fieldMagnitude, getB1, getB2, getB3, getCompositeIndex, getField, getMaxFieldMagnitude, getName, getPhiCoordinate, getPhiMax, getPhiMin, getRCoordinate, getRhoMax, getRhoMin, getSector, getZCoordinate, getZMax, getZMin
-
Field Details
-
probes
-
-
Constructor Details
-
CompositeProbe
Create a composite probe from a composite field.- Parameters:
field
- the composite field
-
-
Method Details
-
field
public void field(int sector, float x, float y, float z, float[] result) Obtain the magnetic field at a given location expressed in Cartesian coordinates for the sector system. The field is returned as a Cartesian vector in kiloGauss.- Specified by:
field
in interfaceIField
- Overrides:
field
in classFieldProbe
- Parameters:
sector
- the sector [1..6]x
- the x sector coordinate in cmy
- the y sector coordinate in cmz
- the z sector coordinate in cmresult
- the result is a float array holding the retrieved field in kiloGauss. The 0,1 and 2 indices correspond to x, y, and z components.
-
field
public void field(float x, float y, float z, float[] result) Description copied from interface:IField
Obtain the magnetic field at a given location expressed in Cartesian coordinates. The field is returned as a Cartesian vector in kiloGauss.- Parameters:
x
- the x coordinate in cmy
- the y coordinate in cmz
- the z coordinate in cmresult
- a float array holding the retrieved field in kiloGauss. The 0,1 and 2 indices correspond to x, y, and z components.
-
isZeroField
public boolean isZeroField()Checks whether the field has been set to always return zero.- Specified by:
isZeroField
in interfaceIField
- Overrides:
isZeroField
in classFieldProbe
- Returns:
true
if the field is set to return zero.
-
gradient
public void gradient(float x, float y, float z, float[] result) Obtain an approximation for the magnetic field gradient at a given location expressed in Cartesian coordinates. The field is returned as a Cartesian vector in kiloGauss/cm.- Specified by:
gradient
in interfaceIField
- Overrides:
gradient
in classFieldProbe
- Parameters:
x
- the x coordinate in cmy
- the y coordinate in cmz
- the z coordinate in cmresult
- a float array holding the retrieved field in kiloGauss. The 0,1 and 2 indices correspond to x, y, and z components.
-
hasTorus
public boolean hasTorus()Check whether we have a torus field- Returns:
true
if we have a torus
-
hasSolenoid
public boolean hasSolenoid()Check whether we have a solenoid field- Returns:
true
if we have a solenoid
-