CMS 3D CMS Logo

ProtonTransport.cc
Go to the documentation of this file.
7 #include <cctype>
8 
10  std::string transportMethod_ = iConfig.getParameter<std::string>("TransportMethod");
11  for (auto &c : transportMethod_)
12  c = toupper(c); // just to on the safe side
13 
14  if (transportMethod_ == "HECTOR") {
15  instance_ = std::make_unique<HectorTransport>(iConfig, iC);
16  } else if (transportMethod_ == "TOTEM") {
17  instance_ = std::make_unique<TotemTransport>(iConfig);
18  } else if (transportMethod_ == "OPTICALFUNCTIONS") {
19  instance_ = std::make_unique<OpticalFunctionsTransport>(iConfig, iC);
20  } else {
21  throw cms::Exception("ProtonTransport")
22  << "Unknow transport method. Is must be either HECTOR, TOTEM or OPTICALFUNCTIONS (case insensitive)";
23  }
24 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::unique_ptr< BaseProtonTransport > instance_
ProtonTransport(const edm::ParameterSet &iConfig, edm::ConsumesCollector iC)