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")->setComment("Path to the JSON file for the mkFit configuration parameters");
36  desc.add<double>("minPt", 0.0)->setComment("min pT cut applied during track building");
37  desc.add<unsigned int>("maxClusterSize", 8)->setComment("Max cluster size of SiStrip hits");
38  descriptions.addWithDefaultLabel(desc);
39 }
40 
41 std::unique_ptr<mkfit::IterationConfig> MkFitIterationConfigESProducer::produce(
42  const TrackerRecoGeometryRecord &iRecord) {
44  auto it_conf = cj.load_File(configFile_);
45  it_conf->m_params.minPtCut = minPtCut_;
46  it_conf->m_backward_params.minPtCut = minPtCut_;
47  it_conf->m_params.maxClusterSize = maxClusterSize_;
48  it_conf->m_backward_params.maxClusterSize = maxClusterSize_;
49  it_conf->setupStandardFunctionsFromNames();
50  return it_conf;
51 }
52 
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:165
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)