|
15 | 15 | #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" |
16 | 16 | #include "Geometry/Records/interface/TrackerTopologyRcd.h" |
17 | 17 |
|
18 | | -#include "PixelTrackProducer.h" |
| 18 | +#include "FWCore/Framework/interface/stream/EDProducer.h" |
| 19 | +#include "RecoPixelVertexing/PixelTrackFitting/interface/PixelTrackReconstruction.h" |
| 20 | +#include "Geometry/Records/interface/TrackerTopologyRcd.h" |
19 | 21 | #include "storeTracks.h" |
20 | 22 |
|
| 23 | +#include "FWCore/PluginManager/interface/ModuleDef.h" |
| 24 | +#include "FWCore/Framework/interface/MakerMacros.h" |
| 25 | + |
| 26 | +namespace edm { |
| 27 | + class Event; |
| 28 | + class EventSetup; |
| 29 | + class ParameterSet; |
| 30 | + class ConfigurationDescriptions; |
| 31 | +} // namespace edm |
| 32 | +class TrackerTopology; |
| 33 | + |
21 | 34 | using namespace pixeltrackfitting; |
22 | 35 | using edm::ParameterSet; |
23 | 36 |
|
24 | | -PixelTrackProducer::PixelTrackProducer(const ParameterSet& cfg) |
25 | | - : theReconstruction(cfg, consumesCollector()), |
26 | | - htTopoToken_(esConsumes()) { |
27 | | - edm::LogInfo("PixelTrackProducer") << " construction..."; |
28 | | - produces<reco::TrackCollection>(); |
29 | | - produces<TrackingRecHitCollection>(); |
30 | | - produces<reco::TrackExtraCollection>(); |
31 | | -} |
| 37 | +class PixelTrackProducer : public edm::stream::EDProducer<> { |
| 38 | +public: |
| 39 | + explicit PixelTrackProducer(const edm::ParameterSet& cfg) |
| 40 | + : theReconstruction(cfg, consumesCollector()), |
| 41 | + htTopoToken_(esConsumes()) { |
| 42 | + edm::LogInfo("PixelTrackProducer") << " construction..."; |
| 43 | + produces<reco::TrackCollection>(); |
| 44 | + produces<TrackingRecHitCollection>(); |
| 45 | + produces<reco::TrackExtraCollection>(); |
| 46 | + } |
| 47 | + |
| 48 | + ~PixelTrackProducer() override {} |
| 49 | + |
| 50 | + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) { |
| 51 | + edm::ParameterSetDescription desc; |
32 | 52 |
|
33 | | -PixelTrackProducer::~PixelTrackProducer() {} |
| 53 | + desc.add<std::string>("passLabel", "pixelTracks"); // What is this? It is not used anywhere in this code. |
| 54 | + PixelTrackReconstruction::fillDescriptions(desc); |
34 | 55 |
|
35 | | -void PixelTrackProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { |
36 | | - edm::ParameterSetDescription desc; |
| 56 | + descriptions.add("pixelTracks", desc); |
| 57 | + } |
37 | 58 |
|
38 | | - desc.add<std::string>("passLabel", "pixelTracks"); // What is this? It is not used anywhere in this code. |
39 | | - PixelTrackReconstruction::fillDescriptions(desc); |
| 59 | + void produce(edm::Event& ev, const edm::EventSetup& es) override { |
| 60 | + LogDebug("PixelTrackProducer, produce") << "event# :" << ev.id(); |
40 | 61 |
|
41 | | - descriptions.add("pixelTracks", desc); |
42 | | -} |
| 62 | + TracksWithTTRHs tracks; |
| 63 | + theReconstruction.run(tracks, ev, es); |
| 64 | + auto htTopo = es.getData(htTopoToken_); |
43 | 65 |
|
44 | | -void PixelTrackProducer::produce(edm::Event& ev, const edm::EventSetup& es) { |
45 | | - LogDebug("PixelTrackProducer, produce") << "event# :" << ev.id(); |
| 66 | + // store tracks |
| 67 | + storeTracks(ev, tracks, htTopo); |
| 68 | + } |
46 | 69 |
|
47 | | - TracksWithTTRHs tracks; |
48 | | - theReconstruction.run(tracks, ev, es); |
49 | | - auto htTopo = es.getData(htTopoToken_); |
| 70 | +private: |
| 71 | + PixelTrackReconstruction theReconstruction; |
| 72 | + const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> htTopoToken_; |
| 73 | +}; |
50 | 74 |
|
51 | | - // store tracks |
52 | | - storeTracks(ev, tracks, htTopo); |
53 | | -} |
| 75 | +DEFINE_FWK_MODULE(PixelTrackProducer); |
0 commit comments