CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
magfieldparam::BCycl< T > Class Template Reference

#include <BCyl.h>

Public Member Functions

 BCycl (BCylParam< T > const &ipar)
 
void compute (T r2, T z, T &Br, T &Bz) const
 
void operator() (T r2, T z, T &Br, T &Bz) const
 

Private Attributes

BCylParam< Tpars
 

Detailed Description

template<typename T>
class magfieldparam::BCycl< T >

Definition at line 69 of file BCyl.h.

Constructor & Destructor Documentation

template<typename T>
magfieldparam::BCycl< T >::BCycl ( BCylParam< T > const &  ipar)
inline

Definition at line 71 of file BCyl.h.

71 : pars(ipar) {}
BCylParam< T > pars
Definition: BCyl.h:105

Member Function Documentation

template<typename T>
void magfieldparam::BCycl< T >::compute ( T  r2,
T  z,
T Br,
T Bz 
) const
inline

Definition at line 79 of file BCyl.h.

79  {
80  using namespace bcylDetails;
81  // if (r<1.15&&fabs(z)<2.8) // NOTE: check omitted, is done already by the wrapper! (NA)
82  z-=pars.prm[3]; // max Bz point is shifted in z
83  T az=std::abs(z);
84  T zainv=z*pars.ainv;
85  T u=pars.hlova-zainv;
86  T v=pars.hlova+zainv;
87  T fu[4],gv[4];
88  ffunkti(u,fu);
89  ffunkti(v,gv);
90  T rat=T(0.5)*pars.ainv;
91  T rat2=rat*rat*r2;
92  Br=pars.hb0*rat*(fu[1]-gv[1]-(fu[3]-gv[3])*rat2*T(0.5));
93  Bz=pars.hb0*(fu[0]+gv[0]-(fu[2]+gv[2])*rat2);
94 
95  T corBr= pars.prm[4]*z*(az-pars.prm[5])*(az-pars.prm[5]);
96  T corBz=-pars.prm[6]*(
97  myExp(-(z-pars.prm[7])*(z-pars.prm[7])*pars.coeff) +
98  myExp(-(z+pars.prm[7])*(z+pars.prm[7])*pars.coeff)
99  ); // double Gaussian
100  Br+=corBr;
101  Bz+=corBz;
102  }
float myExp(float x)
Definition: BCyl.h:63
BCylParam< T > pars
Definition: BCyl.h:105
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void ffunkti(T u, T *__restrict__ ff) __attribute__((always_inline))
Definition: BCyl.h:49
long double T
template<typename T>
void magfieldparam::BCycl< T >::operator() ( T  r2,
T  z,
T Br,
T Bz 
) const
inline

Definition at line 73 of file BCyl.h.

73  {
74  compute(r2,z,Br,Bz);
75  }
void compute(T r2, T z, T &Br, T &Bz) const
Definition: BCyl.h:79

Member Data Documentation

template<typename T>
BCylParam<T> magfieldparam::BCycl< T >::pars
private

Definition at line 105 of file BCyl.h.