#include <OAE85lParametrizedMagneticField.h>
Public Member Functions | |
GlobalVector | inTesla (const GlobalPoint &gp) const |
Field value ad specified global point, in Tesla. | |
GlobalVector | inTeslaUnchecked (const GlobalPoint &gp) const |
bool | isDefined (const GlobalPoint &gp) const |
True if the point is within the region where the concrete field. | |
OAE85lParametrizedMagneticField (const edm::ParameterSet ¶meters) | |
Constructor. Parameters taken from a PSet. | |
OAE85lParametrizedMagneticField (float b0_=40.681, float a_=4.6430, float l_=15.284) | |
virtual | ~OAE85lParametrizedMagneticField () |
Destructor. | |
Private Member Functions | |
void | ffunkti (float u, float *ff) const |
void | init () |
Private Attributes | |
float | a |
float | ainv |
float | ap2 |
float | b0 |
float | hb0 |
float | hlova |
float | l |
Magnetic Field engine wrapper for V. Karimaki's "off-axis expansion" of the TOSCA field version 85l_030919 (4 T) valid in the region r<1.2 m and |z|<3.0 m
Definition at line 19 of file OAE85lParametrizedMagneticField.h.
OAE85lParametrizedMagneticField::OAE85lParametrizedMagneticField | ( | float | b0_ = 40.681 , |
float | a_ = 4.6430 , |
||
float | l_ = 15.284 |
||
) |
OAE85lParametrizedMagneticField::OAE85lParametrizedMagneticField | ( | const edm::ParameterSet & | parameters | ) |
Constructor. Parameters taken from a PSet.
Definition at line 29 of file OAE85lParametrizedMagneticField.cc.
References a, b0, edm::ParameterSet::getParameter(), init(), and l.
{ b0 = parameters.getParameter<double>("b0"); l = parameters.getParameter<double>("l"); a = parameters.getParameter<double>("a"); init(); }
OAE85lParametrizedMagneticField::~OAE85lParametrizedMagneticField | ( | ) | [virtual] |
void OAE85lParametrizedMagneticField::ffunkti | ( | float | u, |
float * | ff | ||
) | const [private] |
Definition at line 120 of file OAE85lParametrizedMagneticField.cc.
References a, b, and mathSSE::sqrt().
Referenced by inTeslaUnchecked().
void OAE85lParametrizedMagneticField::init | ( | void | ) | [private] |
GlobalVector OAE85lParametrizedMagneticField::inTesla | ( | const GlobalPoint & | gp | ) | const [virtual] |
Field value ad specified global point, in Tesla.
Implements MagneticField.
Definition at line 49 of file OAE85lParametrizedMagneticField.cc.
References inTeslaUnchecked(), and isDefined().
{ if (isDefined(gp)) { return inTeslaUnchecked(gp); } else { edm::LogWarning("MagneticField|FieldOutsideValidity") << " Point " << gp << " is outside the validity region of OAE85lParametrizedMagneticField"; return GlobalVector(); } }
GlobalVector OAE85lParametrizedMagneticField::inTeslaUnchecked | ( | const GlobalPoint & | gp | ) | const [virtual] |
Optional implementation that derived classes can implement to provide faster query by skipping the check to isDefined.
GlobalVector bresult(br*xyz[0]*rinv, br*xyz[1]*rinv, bz);
Reimplemented from MagneticField.
Definition at line 61 of file OAE85lParametrizedMagneticField.cc.
References ainv, beamvalidation::br, funct::exp(), ffunkti(), hb0, hlova, csvReporter::r, mathSSE::sqrt(), v, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), PV3DBase< T, PVType, FrameType >::z(), and z.
Referenced by inTesla().
{ // Method formerly named "trackerField" // // B-field in Tracker volume // // In: xyz[3]: coordinates (m) // Out: bxyz[3]: Bx,By,Bz (kG) // // Valid for r<1.2 and |z|<3.0 V.Karimäki 040301 // Updated for CMSSW field 070424 // // b0=field at centre, l=solenoid length, a=radius (m) (phenomen. parameters) // FIXME: beware of statics... // static float ap2=4.0*a*a/(l*l); // static float hb0=0.5*b0*sqrt(1.0+ap2); // static float hlova=1.0/sqrt(ap2); // static float ainv=2.0*hlova/l; float xyz[3];//, bxyz[3]; // convert to m (CMSSW) xyz[0]=0.01*gp.x(); xyz[1]=0.01*gp.y(); xyz[2]=0.01*gp.z(); float r=sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]); float z=xyz[2]; float az = fabs(z); // if (r<1.2&&az<3.0) // NOTE: check omitted, is done already by inTesla (NA) { float zainv=z*ainv; float rinv=(r>0.0) ? 1.0/r : 0.0; float u=hlova-zainv; float v=hlova+zainv; float fu[5],gv[5]; ffunkti(u,fu); ffunkti(v,gv); float rat=r*ainv; float corrr=0.00894*r*z*(az-2.2221)*(az-2.2221); float corrz=-0.02996*exp(-0.5*(az-1.9820)*(az-1.9820)/(0.78915*0.78915)); float br=hb0*0.5*rat*(fu[1]-gv[1]-0.125*(fu[3]-gv[3])*rat*rat)+corrr; float bz=hb0*(fu[0]+gv[0]-(fu[2]+gv[2])*0.25*rat*rat)+corrz; //bxyz[0]=br*xyz[0]*rinv; //bxyz[1]=br*xyz[1]*rinv; //bxyz[2]=bz; // bvec.x()=0.1*br*xyz[0]*rinv; //bvec.y()=0.1*br*xyz[1]*rinv; //bvec.z()=0.1*bz; return 0.1*GlobalVector(br*xyz[0]*rinv, br*xyz[1]*rinv, bz); } // else { // cout <<"The point is outside the region r<1.2m && |z|<3.0m"<<endl; //} // return GlobalVector(); }
bool OAE85lParametrizedMagneticField::isDefined | ( | const GlobalPoint & | gp | ) | const [virtual] |
True if the point is within the region where the concrete field.
Reimplemented from MagneticField.
Definition at line 134 of file OAE85lParametrizedMagneticField.cc.
References PV3DBase< T, PVType, FrameType >::perp(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by inTesla().
float OAE85lParametrizedMagneticField::a [private] |
Definition at line 51 of file OAE85lParametrizedMagneticField.h.
Referenced by ffunkti(), init(), and OAE85lParametrizedMagneticField().
float OAE85lParametrizedMagneticField::ainv [private] |
Definition at line 56 of file OAE85lParametrizedMagneticField.h.
Referenced by init(), and inTeslaUnchecked().
float OAE85lParametrizedMagneticField::ap2 [private] |
Definition at line 53 of file OAE85lParametrizedMagneticField.h.
Referenced by init().
float OAE85lParametrizedMagneticField::b0 [private] |
Definition at line 49 of file OAE85lParametrizedMagneticField.h.
Referenced by init(), and OAE85lParametrizedMagneticField().
float OAE85lParametrizedMagneticField::hb0 [private] |
Definition at line 54 of file OAE85lParametrizedMagneticField.h.
Referenced by init(), and inTeslaUnchecked().
float OAE85lParametrizedMagneticField::hlova [private] |
Definition at line 55 of file OAE85lParametrizedMagneticField.h.
Referenced by init(), and inTeslaUnchecked().
float OAE85lParametrizedMagneticField::l [private] |
Definition at line 50 of file OAE85lParametrizedMagneticField.h.
Referenced by init(), and OAE85lParametrizedMagneticField().