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 {
44  if(iConfig.getParameter<bool>("useBeamSpotConstraint")) {
45  theBeamSpotToken = consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("beamSpotConstraint"));
46  }
47 
48  produces<PixelFitter>();
49 }
50 
53 
54  desc.add<bool>("useBeamSpotConstraint", true);
55  desc.add<edm::InputTag>("beamSpotConstraint", edm::InputTag("offlineBeamSpot"));
56  desc.add<std::string>("propagator", "PropagatorWithMaterial");
57  desc.add<std::string>("propagatorOpposite", "PropagatorWithMaterialOpposite");
58  desc.add<std::string>("TTRHBuilder", "PixelTTRHBuilderWithoutAngle");
59 
60  descriptions.add("kfBasedPixelFitter", desc);
61 }
62 
65  iSetup.get<TransientRecHitRecord>().get( theTTRHBuilderName, ttrhb);
66 
68  iSetup.get<TrackingComponentsRecord>().get(thePropagatorLabel, propagator);
69 
70  edm::ESHandle<Propagator> opropagator;
71  iSetup.get<TrackingComponentsRecord>().get(thePropagatorOppositeLabel, opropagator);
72 
74  iSetup.get<TrackerDigiGeometryRecord>().get(tracker);
75 
77  iSetup.get<IdealMagneticFieldRecord>().get(field);
78 
79  const reco::BeamSpot *beamspot = nullptr;
82  iEvent.getByToken(theBeamSpotToken, hbs);
83  beamspot = hbs.product();
84  }
85 
86  auto impl = std::make_unique<KFBasedPixelFitter>(propagator.product(),
87  opropagator.product(),
88  ttrhb.product(),
89  tracker.product(),
90  field.product(),
91  beamspot);
92  auto prod = std::make_unique<PixelFitter>(std::move(impl));
93  iEvent.put(std::move(prod));
94 }
95 
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
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:517
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:74
void add(std::string const &label, ParameterSetDescription const &psetDescription)
T get() const
Definition: EventSetup.h:71
bool isUninitialized() const
Definition: EDGetToken.h:70
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:511