Go to the documentation of this file.00001 #ifndef MagneticFieldHelpers_h
00002 #define MagneticFieldHelpers_h
00003
00004
00005
00006 #include "FWCore/Framework/interface/ESHandle.h"
00007 #include "FWCore/Framework/interface/EventSetup.h"
00008
00009 namespace magneticFieldHelpers {
00010
00012 int closerNominalField(float current) {
00013 int zeroFieldThreshold = 1000;
00014 float nominalCurrents[5] = {9558,14416,16819,18268,19262} ;
00015 int nominalFields[5] = {20,30,35,38,40} ;
00016 if(current < zeroFieldThreshold) return 0;
00017 int i=0;
00018 for(;i<4;i++)
00019 {
00020 if(2*current < nominalCurrents[i]+nominalCurrents[i+1] )
00021 return nominalFields[i];
00022 }
00023 return nominalFields[i];
00024 }
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 }
00041
00042 #endif // MagneticFieldHelpers_h