CMS 3D CMS Logo

Functions
tmtt::trackFitFactory Namespace Reference

Functions

std::unique_ptr< TrackFitGenericcreate (const std::string &fitterName, const Settings *settings)
 

Function Documentation

◆ create()

std::unique_ptr< TrackFitGeneric > tmtt::trackFitFactory::create ( const std::string &  fitterName,
const Settings settings 
)

Definition at line 19 of file TrackFitFactory.cc.

References Exception.

Referenced by tmtt::TMTrackProducer::TMTrackProducer().

19  {
20  if (fitterName == "ChiSquaredFit4") {
21  return std::make_unique<ChiSquaredFit4>(settings, 4);
22  } else if (fitterName == "KF4ParamsComb") {
23  return std::make_unique<KFParamsComb>(settings, 4, fitterName);
24  } else if (fitterName == "KF5ParamsComb") {
25  return std::make_unique<KFParamsComb>(settings, 5, fitterName);
26  } else if (fitterName == "SimpleLR4") {
27  return std::make_unique<SimpleLR4>(settings);
28 #ifdef USE_HLS
29  } else if (fitterName == "KF4ParamsCombHLS") {
30  return std::make_unique<KFParamsCombCallHLS>(settings, 4, fitterName);
31  } else if (fitterName == "KF5ParamsCombHLS") {
32  return std::make_unique<KFParamsCombCallHLS>(settings, 5, fitterName);
33 #endif
34  } else {
35  throw cms::Exception("BadConfig")
36  << "TrackFitFactory: ERROR you requested unknown track fitterName: " << fitterName;
37  }
38  }