CMS 3D CMS Logo

KFBasedPixelFitterProducer.cc
Go to the documentation of this file.
3 
7 
11 
14 
21 
23 public:
24  explicit KFBasedPixelFitterProducer(const edm::ParameterSet& iConfig);
26 
27  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
28 
29 private:
30  void produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const override;
31 
39 };
40 
42  : theTTRHBuilderToken(esConsumes(edm::ESInputTag("", iConfig.getParameter<std::string>("TTRHBuilder")))),
43  thePropagatorToken(esConsumes(edm::ESInputTag("", iConfig.getParameter<std::string>("propagator")))),
44  thePropagatorOppositeToken(esConsumes(edm::ESInputTag("", iConfig.getParameter<std::string>("propagator")))),
45  theTrackerToken(esConsumes()),
46  theFieldToken(esConsumes()),
47  thePutToken(produces()) {
48  if (iConfig.getParameter<bool>("useBeamSpotConstraint")) {
49  theBeamSpotToken = consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("beamSpotConstraint"));
50  }
51 }
52 
55 
56  desc.add<bool>("useBeamSpotConstraint", true);
57  desc.add<edm::InputTag>("beamSpotConstraint", edm::InputTag("offlineBeamSpot"));
58  desc.add<std::string>("propagator", "PropagatorWithMaterial");
59  desc.add<std::string>("propagatorOpposite", "PropagatorWithMaterialOpposite");
60  desc.add<std::string>("TTRHBuilder", "PixelTTRHBuilderWithoutAngle");
61 
62  descriptions.add("kfBasedPixelFitter", desc);
63 }
64 
66  const reco::BeamSpot* beamspot = nullptr;
69  iEvent.getByToken(theBeamSpotToken, hbs);
70  beamspot = hbs.product();
71  }
72 
73  iEvent.emplace(thePutToken,
74  std::make_unique<KFBasedPixelFitter>(&iSetup.getData(thePropagatorToken),
77  &iSetup.getData(theTrackerToken),
78  &iSetup.getData(theFieldToken),
79  beamspot));
80 }
81 
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void produce(edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
const edm::ESGetToken< Propagator, TrackingComponentsRecord > thePropagatorToken
T const * product() const
Definition: Handle.h:70
constexpr bool isUninitialized() const noexcept
Definition: EDGetToken.h:104
const edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > theTTRHBuilderToken
edm::EDGetTokenT< reco::BeamSpot > theBeamSpotToken
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > theTrackerToken
int iEvent
Definition: GenABIO.cc:224
KFBasedPixelFitterProducer(const edm::ParameterSet &iConfig)
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theFieldToken
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
const edm::EDPutTokenT< PixelFitter > thePutToken
void add(std::string const &label, ParameterSetDescription const &psetDescription)
HLT enums.
const edm::ESGetToken< Propagator, TrackingComponentsRecord > thePropagatorOppositeToken