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 
14 
18 
19 #include <string>
20 #include <iostream>
21 
22 using namespace std;
23 using namespace edm;
24 using namespace magneticfield;
25 
26 
28  setWhatProduced(this, pset.getUntrackedParameter<std::string>("label",""));
29 }
30 
31 
33 {
34 }
35 
36 
37 std::auto_ptr<MagneticField>
39 {
40  string version = pset.getParameter<string>("version");
42 
43  if (version=="OAE_85l_030919") {
44  // V. Karimaki's off-axis expansion fitted to v85l TOSCA computation
45  std::auto_ptr<MagneticField> result(new OAE85lParametrizedMagneticField(parameters));
46  return result;
47  } else if (version=="OAE_1103l_071212") {
48  // V. Karimaki's off-axis expansion fitted to v1103l TOSCA computation
49  std::auto_ptr<MagneticField> result( new OAEParametrizedMagneticField(parameters));
50  return result;
51  } else if (version=="PolyFit2D") {
52  // V. Maroussov polynomial fit to mapping data
53  std::auto_ptr<MagneticField> result( new PolyFit2DParametrizedMagneticField(parameters));
54  return result;
55  } else if (version=="PolyFit3D") {
56  // V. Maroussov polynomial fit to mapping data
57  std::auto_ptr<MagneticField> result( new PolyFit3DParametrizedMagneticField(parameters));
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:56