CMS 3D CMS Logo

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

◆ closerNominalField()

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.

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  }

References mps_fire::i, RunInfoPI::nominalCurrents, and RunInfoPI::nominalFields.

mps_fire.i
i
Definition: mps_fire.py:355
RunInfoPI::nominalCurrents
constexpr std::array< int, 7 > nominalCurrents
Definition: RunInfoPayloadInspectoHelper.h:16
RunInfoPI::nominalFields
constexpr std::array< float, 7 > nominalFields
Definition: RunInfoPayloadInspectoHelper.h:17