SynAPSE  0.6.0
Synergistic Analysis of Phase Space Evolution
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
Public Member Functions | Private Member Functions | Private Attributes
FieldHandler Class Reference

Builds, stores and reads the fields present in the beam line. More...

#include <FieldHandler.hh>

Public Member Functions

 FieldHandler ()
 Default constructor, initilizes everything to 0. More...
 
 FieldHandler (const FieldHandler &fh)
 Copy constructor. More...
 
FieldHandler & operator= (const FieldHandler &fh)
 Equality operator. More...
 
 ~FieldHandler ()
 Destructor. More...
 
bool AddSolenoid (const std::string &name, const double &a, const double &L, const double &I)
 Adds a solenoid to the dictionary of fields. More...
 
TVector3 GetMagneticField (const double &x, const double &y, const double &z) const
 Gets the total magnetic field at a location x, y, z in cartesian coordinates. More...
 

Private Member Functions

TVector3 GetSolenoidField (const FieldElement &fel, const double &x, const double &y, const double &z) const
 Cartesian 3-vector of the solenoidal magnetic field in x, y, z. More...
 
double SolenoidBperp (const double &a, const double &L, const double &I, const double &rho, const double &z) const
 Perpendicular component of a solenoidal field. More...
 
double SolenoidBlong (const double &a, const double &L, const double &I, const double &rho, const double &z) const
 Longitudinal component of a solenoidal field. More...
 
double K (const double &m) const
 Elliptical integral of the first kind with parameter m. More...
 
double E (const double &m) const
 Elliptical integral of the second kind with parameter m. More...
 
double Pi (const double &n, const double &m) const
 Elliptical integral of the third kind with parameter n and m. More...
 

Private Attributes

double _mu0
 Vacuum permeability. More...
 
std::map< std::string,
FieldElement > 
_fields
 List of fields in the beam line. More...
 

Detailed Description

Builds, stores and reads the fields present in the beam line.

Builds theoretical magnetic fields based on the current in the coils, returns the x, y and z components of the field at a requested point (x, y, z)

Constructor & Destructor Documentation

FieldHandler::FieldHandler ( )

Default constructor, initilizes everything to 0.

FieldHandler::FieldHandler ( const FieldHandler &  fh)

Copy constructor.

FieldHandler::~FieldHandler ( )

Destructor.

Member Function Documentation

bool FieldHandler::AddSolenoid ( const std::string &  name,
const double &  a,
const double &  L,
const double &  I 
)

Adds a solenoid to the dictionary of fields.

Parameters
nameName of the field/magnet
aRadius of the solenoid
LLength of the solenoid
ICurrent in the solenoid
Returns
True if successful
double FieldHandler::E ( const double &  m) const
private

Elliptical integral of the second kind with parameter m.

TVector3 FieldHandler::GetMagneticField ( const double &  x,
const double &  y,
const double &  z 
) const

Gets the total magnetic field at a location x, y, z in cartesian coordinates.

Parameters
xHorizontal offset in which to evaluate the field
yVertical offset in which to evaluate the field
zPosition along the beam line in which to evaluate the field
Returns
$\vec{B}$ in cartesian coordinates
TVector3 FieldHandler::GetSolenoidField ( const FieldElement &  fel,
const double &  x,
const double &  y,
const double &  z 
) const
private

Cartesian 3-vector of the solenoidal magnetic field in x, y, z.

Parameters
felField element to get the field from
xHorizontal offset in which to evaluate the field
yVertical offset in which to evaluate the field
zPosition along the beam line in which to evaluate the field
Returns
$\vec{B}$ in cartesian coordinates
double FieldHandler::K ( const double &  m) const
private

Elliptical integral of the first kind with parameter m.

FieldHandler & FieldHandler::operator= ( const FieldHandler &  fh)

Equality operator.

double FieldHandler::Pi ( const double &  n,
const double &  m 
) const
private

Elliptical integral of the third kind with parameter n and m.

double FieldHandler::SolenoidBlong ( const double &  a,
const double &  L,
const double &  I,
const double &  rho,
const double &  z 
) const
private

Longitudinal component of a solenoidal field.

Parameters
aRadius of the solenoid
LLength of the solenoid
ICurrent in the solenoid
rhoRadius of the position in which to evaluate the field
zLongitudinal position in which to evaluate the field
Returns
$B_z(\rho, 0, z)$ (cylindrical coords)
double FieldHandler::SolenoidBperp ( const double &  a,
const double &  L,
const double &  I,
const double &  rho,
const double &  z 
) const
private

Perpendicular component of a solenoidal field.

Parameters
aRadius of the solenoid
LLength of the solenoid
ICurrent in the solenoid
rhoRadius of the position in which to evaluate the field
zLongitudinal position in which to evaluate the field
Returns
$B_\perp(\rho, 0, z)$ (cylindrical coords)

Field Documentation

std::map<std::string, FieldElement> FieldHandler::_fields
private

List of fields in the beam line.

double FieldHandler::_mu0
private

Vacuum permeability.


The documentation for this class was generated from the following files: