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 
12 
16 
17 #include <string>
18 #include <iostream>
19 
20 using namespace std;
21 using namespace edm;
22 using namespace magneticfield;
23 
24 
27 }
28 
29 
31 {
32 }
33 
34 
35 std::auto_ptr<MagneticField>
37 {
38  string version = pset.getParameter<string>("version");
40 
41  if (version=="OAE_85l_030919") {
42  // V. Karimaki's off-axis expansion fitted to v85l TOSCA computation
43  std::auto_ptr<MagneticField> result(new OAE85lParametrizedMagneticField(parameters));
44  return result;
45  } else if (version=="OAE_1103l_071212") {
46  // V. Karimaki's off-axis expansion fitted to v1103l TOSCA computation
47  std::auto_ptr<MagneticField> result( new OAEParametrizedMagneticField(parameters));
48  return result;
49  } else if (version=="PolyFit2D") {
50  // V. Maroussov polynomial fit to mapping data
51  std::auto_ptr<MagneticField> result( new PolyFit2DParametrizedMagneticField(parameters));
52  return result;
53  } else if (version=="PolyFit3D") {
54  // V. Maroussov polynomial fit to mapping data
55  throw cms::Exception("InvalidParameter")<<"PolyFit3D is not supported anymore";
56  } else if (version=="Parabolic"){
57  std::auto_ptr<MagneticField> result( new ParabolicParametrizedMagneticField());
58  return result;
59  } else {
60  throw cms::Exception("InvalidParameter")<<"Invalid parametrization version " << version;
61  }
62  return std::auto_ptr<MagneticField>(0); //make compiler happy
63 }
64 
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