CMS 3D CMS Logo

KFBasedPixelFitterProducer.cc
Go to the documentation of this file.
3 
8 
12 
15 
22 
24 public:
25  explicit KFBasedPixelFitterProducer(const edm::ParameterSet& iConfig);
27 
28  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
29 
30 private:
31  void produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const override;
32 
37 };
38 
40  : thePropagatorLabel(iConfig.getParameter<std::string>("propagator")),
41  thePropagatorOppositeLabel(iConfig.getParameter<std::string>("propagator")),
42  theTTRHBuilderName(iConfig.getParameter<std::string>("TTRHBuilder")) {
43  if (iConfig.getParameter<bool>("useBeamSpotConstraint")) {
44  theBeamSpotToken = consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("beamSpotConstraint"));
45  }
46 
47  produces<PixelFitter>();
48 }
49 
52 
53  desc.add<bool>("useBeamSpotConstraint", true);
54  desc.add<edm::InputTag>("beamSpotConstraint", edm::InputTag("offlineBeamSpot"));
55  desc.add<std::string>("propagator", "PropagatorWithMaterial");
56  desc.add<std::string>("propagatorOpposite", "PropagatorWithMaterialOpposite");
57  desc.add<std::string>("TTRHBuilder", "PixelTTRHBuilderWithoutAngle");
58 
59  descriptions.add("kfBasedPixelFitter", desc);
60 }
61 
64  iSetup.get<TransientRecHitRecord>().get(theTTRHBuilderName, ttrhb);
65 
67  iSetup.get<TrackingComponentsRecord>().get(thePropagatorLabel, propagator);
68 
69  edm::ESHandle<Propagator> opropagator;
70  iSetup.get<TrackingComponentsRecord>().get(thePropagatorOppositeLabel, opropagator);
71 
73  iSetup.get<TrackerDigiGeometryRecord>().get(tracker);
74 
76  iSetup.get<IdealMagneticFieldRecord>().get(field);
77 
78  const reco::BeamSpot* beamspot = nullptr;
81  iEvent.getByToken(theBeamSpotToken, hbs);
82  beamspot = hbs.product();
83  }
84 
85  auto impl = std::make_unique<KFBasedPixelFitter>(
86  propagator.product(), opropagator.product(), ttrhb.product(), tracker.product(), field.product(), beamspot);
87  auto prod = std::make_unique<PixelFitter>(std::move(impl));
88  iEvent.put(std::move(prod));
89 }
90 
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void produce(edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
edm::EDGetTokenT< reco::BeamSpot > theBeamSpotToken
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
KFBasedPixelFitterProducer(const edm::ParameterSet &iConfig)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
T const * product() const
Definition: Handle.h:69
void add(std::string const &label, ParameterSetDescription const &psetDescription)
T get() const
Definition: EventSetup.h:73
bool isUninitialized() const
Definition: EDGetToken.h:70
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:511