CMS 3D CMS Logo

MkFitIterationConfigESProducer.cc
Go to the documentation of this file.
3 
5 
7 
8 // mkFit includes
10 
12 public:
14 
15  static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);
16 
17  std::unique_ptr<mkfit::IterationConfig> produce(const TrackerRecoGeometryRecord &iRecord);
18 
19 private:
22  const float minPtCut_;
23  const unsigned int maxClusterSize_;
24 };
25 
27  : geomToken_{setWhatProduced(this, iConfig.getParameter<std::string>("ComponentName")).consumes()},
28  configFile_{iConfig.getParameter<edm::FileInPath>("config").fullPath()},
29  minPtCut_{(float)iConfig.getParameter<double>("minPt")},
30  maxClusterSize_{iConfig.getParameter<unsigned int>("maxClusterSize")} {}
31 
34  desc.add<std::string>("ComponentName", "")->setComment("Product label");
35  desc.add<edm::FileInPath>("config", edm::FileInPath())
36  ->setComment("Path to the JSON file for the mkFit configuration parameters");
37  desc.add<double>("minPt", 0.0)->setComment("min pT cut applied during track building");
38  desc.add<unsigned int>("maxClusterSize", 8)->setComment("Max cluster size of SiStrip hits");
39  descriptions.addWithDefaultLabel(desc);
40 }
41 
42 std::unique_ptr<mkfit::IterationConfig> MkFitIterationConfigESProducer::produce(
43  const TrackerRecoGeometryRecord &iRecord) {
45  auto it_conf = cj.load_File(configFile_);
46  it_conf->m_params.minPtCut = minPtCut_;
47  it_conf->m_backward_params.minPtCut = minPtCut_;
48  it_conf->m_params.maxClusterSize = maxClusterSize_;
49  it_conf->m_backward_params.maxClusterSize = maxClusterSize_;
50  it_conf->setupStandardFunctionsFromNames();
51  return it_conf;
52 }
53 
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::unique_ptr< mkfit::IterationConfig > produce(const TrackerRecoGeometryRecord &iRecord)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:61
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const edm::ESGetToken< MkFitGeometry, TrackerRecoGeometryRecord > geomToken_
std::unique_ptr< IterationConfig > load_File(const std::string &fname)
MkFitIterationConfigESProducer(const edm::ParameterSet &iConfig)