CMS 3D CMS Logo

TrackingRegionEDProducerT.h
Go to the documentation of this file.
1 #ifndef RecoTracker_TkTrackingRegions_TrackingRegionEDProducerT_H
2 #define RecoTracker_TkTrackingRegions_TrackingRegionEDProducerT_H
3 
7 
10 
11 template <typename T_TrackingRegionProducer>
13 public:
14  // using OwnVector as vector<shared_ptr> and vector<unique_ptr> cause problems
15  // I can't get dictionary compiled with unique_ptr
16  // shared_ptr fails with runtime error "Class name 'TrackingRegionstdshared_ptrs' contains an underscore ('_'), which is illegal in the name of a product."
18 
19  TrackingRegionEDProducerT(const edm::ParameterSet& iConfig) : regionProducer_(iConfig, consumesCollector()) {
20  produces<ProductType>();
21  }
22 
23  ~TrackingRegionEDProducerT() override = default;
24 
25  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
27  }
28 
29  void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) override {
30  auto regions = regionProducer_.regions(iEvent, iSetup);
31  auto ret = std::make_unique<ProductType>();
32  ret->reserve(regions.size());
33  for (auto& regionPtr : regions) {
34  ret->push_back(regionPtr.release());
35  }
36 
37  iEvent.put(std::move(ret));
38  }
39 
40 private:
41  T_TrackingRegionProducer regionProducer_;
42 };
43 
44 #endif
T_TrackingRegionProducer regionProducer_
ret
prodAgent to be discontinued
~TrackingRegionEDProducerT() override=default
TrackingRegionEDProducerT(const edm::ParameterSet &iConfig)
int iEvent
Definition: GenABIO.cc:224
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
def move(src, dest)
Definition: eostools.py:511