CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
magneticFieldHelpers Namespace Reference

Functions

int closerNominalField (float current)
 Return the closer nominal field value (kGauss) to a given magnet current (A) More...
 

Function Documentation

int magneticFieldHelpers::closerNominalField ( float  current)

Return the closer nominal field value (kGauss) to a given magnet current (A)

Definition at line 12 of file MagneticFieldHelpers.h.

References i.

12  {
13  int zeroFieldThreshold = 1000; //fixme
14  float nominalCurrents[5] = {9558,14416,16819,18268,19262} ; //FIXME: replace with correct values...
15  int nominalFields[5] = {20,30,35,38,40} ; //in kGauss
16  if(current < zeroFieldThreshold) return 0;
17  int i=0;
18  for(;i<4;i++)
19  {
20  if(2*current < nominalCurrents[i]+nominalCurrents[i+1] )
21  return nominalFields[i];
22  }
23  return nominalFields[i];
24  }
int i
Definition: DBlmapReader.cc:9