17 std::vector<std::pair<unsigned int, float> > current_table
18 = magnet_currents.
get<std::vector<std::pair<unsigned int, float> > >(
"table");
19 for (std::vector<std::pair<unsigned int, float > >::const_iterator current_table_it = current_table.begin();
20 current_table_it != current_table.end(); ++current_table_it)
21 fMagnetInfo[current_table_it->first] = current_table_it->second;
35 <<
"Requested run " << run <<
" has no magnet current information available.";
37 unsigned int run_with_current =
run;
39 run_with_current -= 1;
60 float field_magnitude = -0.0294 +
abs(magnet_current)/985.3 -
pow(
abs(magnet_current)/3451.2,2);
62 float b_field = copysign(field_magnitude, magnet_current);
#define DEFINE_ART_SERVICE(svc)
::xsd::cxx::tree::exception< char > exception
Utility to provide the magnetic field in the beamline for a given run number/run conditions. NB/ Currently this will use a lookup defined in a fhicl file, it should and will be replaced by an interface to a database when the field is stored in such a way.
T get(std::string const &key) const
BeamlineMagneticField(fhicl::ParameterSet const &pset)
std::map< unsigned int, float > fMagnetInfo
float FieldFromCurrent(float magnet_current)
Convert magnet current to magnetic field using field mapping information.
float MagnetCurrent(unsigned int beamline_run)
Return the magnet current for a given beamline data run.
float MagneticField(unsigned int beamline_run)
Return the magnetic field for a given beamline data run.