File indexing completed on 2024-04-06 12:31:32
0001
0002
0003
0004
0005
0006
0007 #include "FWCore/Framework/interface/ESProducer.h"
0008 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0009 #include "TrackingTools/Records/interface/TrackingComponentsRecord.h"
0010 #include "TrackingTools/KalmanUpdators/interface/KFSwitching1DUpdator.h"
0011 #include <memory>
0012
0013 #include "MagneticField/Engine/interface/MagneticField.h"
0014 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0015
0016 #include "FWCore/Framework/interface/EventSetup.h"
0017 #include "FWCore/Framework/interface/ESHandle.h"
0018 #include "FWCore/Framework/interface/ModuleFactory.h"
0019 #include "FWCore/Framework/interface/ESProducer.h"
0020
0021 #include <string>
0022 #include <memory>
0023
0024 class KFSwitching1DUpdatorESProducer : public edm::ESProducer {
0025 public:
0026 KFSwitching1DUpdatorESProducer(const edm::ParameterSet& p);
0027
0028 std::unique_ptr<TrajectoryStateUpdator> produce(const TrackingComponentsRecord&);
0029
0030 static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0031
0032 private:
0033 const bool doEndCap_;
0034 };
0035 using namespace edm;
0036
0037 KFSwitching1DUpdatorESProducer::KFSwitching1DUpdatorESProducer(const edm::ParameterSet& p)
0038 : doEndCap_(p.getParameter<bool>("doEndCap")) {
0039 std::string myname = p.getParameter<std::string>("ComponentName");
0040 setWhatProduced(this, myname);
0041 }
0042
0043 std::unique_ptr<TrajectoryStateUpdator> KFSwitching1DUpdatorESProducer::produce(
0044 const TrackingComponentsRecord& iRecord) {
0045 return std::make_unique<KFSwitching1DUpdator>(doEndCap_);
0046 }
0047
0048 void KFSwitching1DUpdatorESProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0049 edm::ParameterSetDescription desc;
0050 desc.add<bool>("doEndCap");
0051 desc.add<std::string>("ComponentName");
0052 descriptions.addDefault(desc);
0053 }
0054 DEFINE_FWK_EVENTSETUP_MODULE(KFSwitching1DUpdatorESProducer);