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>(&iSetup,
87  propagator.product(),
88  opropagator.product(),
89  ttrhb.product(),
90  tracker.product(),
91  field.product(),
92  beamspot);
93  auto prod = std::make_unique<PixelFitter>(std::move(impl));
94  iEvent.put(std::move(prod));
95 }
96 
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:127
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:508
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
edm::EDGetTokenT< reco::BeamSpot > theBeamSpotToken
int iEvent
Definition: GenABIO.cc:230
KFBasedPixelFitterProducer(const edm::ParameterSet &iConfig)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
T const * product() const
Definition: Handle.h:81
const T & get() const
Definition: EventSetup.h:55
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool isUninitialized() const
Definition: EDGetToken.h:73
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:510