CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ParametrizedMagneticFieldProducer.cc
Go to the documentation of this file.
1 
13 
17 
18 #include <string>
19 #include <iostream>
20 
21 using namespace std;
22 using namespace edm;
23 using namespace magneticfield;
24 
25 
28 }
29 
30 
32 {
33 }
34 
35 
36 std::auto_ptr<MagneticField>
38 {
39  string version = pset.getParameter<string>("version");
41 
42  if (version=="OAE_85l_030919") {
43  // V. Karimaki's off-axis expansion fitted to v85l TOSCA computation
44  std::auto_ptr<MagneticField> result(new OAE85lParametrizedMagneticField(parameters));
45  return result;
46  } else if (version=="OAE_1103l_071212") {
47  // V. Karimaki's off-axis expansion fitted to v1103l TOSCA computation
48  std::auto_ptr<MagneticField> result( new OAEParametrizedMagneticField(parameters));
49  return result;
50  } else if (version=="PolyFit2D") {
51  // V. Maroussov polynomial fit to mapping data
52  std::auto_ptr<MagneticField> result( new PolyFit2DParametrizedMagneticField(parameters));
53  return result;
54  } else if (version=="PolyFit3D") {
55  // V. Maroussov polynomial fit to mapping data
56  std::auto_ptr<MagneticField> result( new PolyFit3DParametrizedMagneticField(parameters));
57  return result;
58  } else if (version=="Parabolic"){
59  std::auto_ptr<MagneticField> result( new ParabolicParametrizedMagneticField());
60  return result;
61  } else {
62  throw cms::Exception("InvalidParameter")<<"Invalid parametrization version " << version;
63  }
64  return std::auto_ptr<MagneticField>(0); //make compiler happy
65 }
66 
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
dictionary parameters
Definition: Parameters.py:2
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
tuple result
Definition: query.py:137
std::auto_ptr< MagneticField > produce(const IdealMagneticFieldRecord &)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60