CMS 3D CMS Logo

Public Member Functions | Private Attributes

magfieldparam::BCycl< T > Class Template Reference

#include <BCyl.h>

List of all members.

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.

: pars(ipar) {} 

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.

                                                {
      using namespace  bcylDetails;
      //  if (r<1.15&&fabs(z)<2.8) // NOTE: check omitted, is done already by the wrapper! (NA)
      z-=pars.prm[3];                    // max Bz point is shifted in z
      T az=std::abs(z);
      T zainv=z*pars.ainv;
      T u=pars.hlova-zainv;
      T v=pars.hlova+zainv;
      T fu[4],gv[4];
      ffunkti(u,fu);
      ffunkti(v,gv);
      T rat=T(0.5)*pars.ainv;
      T rat2=rat*rat*r2;
      Br=pars.hb0*rat*(fu[1]-gv[1]-(fu[3]-gv[3])*rat2*T(0.5));
      Bz=pars.hb0*(fu[0]+gv[0]-(fu[2]+gv[2])*rat2);
      
      T corBr= pars.prm[4]*z*(az-pars.prm[5])*(az-pars.prm[5]);
      T corBz=-pars.prm[6]*(
                            myExp(-(z-pars.prm[7])*(z-pars.prm[7])*pars.coeff) +
                            myExp(-(z+pars.prm[7])*(z+pars.prm[7])*pars.coeff)
                            ); // double Gaussian
      Br+=corBr;
      Bz+=corBz;
    }
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.

                                                   {
      compute(r2,z,Br,Bz);
    }

Member Data Documentation

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

Definition at line 105 of file BCyl.h.