CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TICLSeedingRegionProducer.cc
Go to the documentation of this file.
1 // Authors: Felice Pantaleo, Marco Rovere
2 // Emails: felice.pantaleo@cern.ch, marco.rovere@cern.ch
3 // Date: 06/2019
4 
5 #include <vector>
6 
19 #include "SeedingRegionByL1.h"
20 #include "SeedingRegionByTracks.h"
21 #include "SeedingRegionGlobal.h"
22 #include "SeedingRegionByHF.h"
23 
24 using namespace ticl;
25 
27 public:
30  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
31 
32  void beginRun(edm::Run const& iEvent, edm::EventSetup const& es) override;
33 
34  void produce(edm::Event&, const edm::EventSetup&) override;
35 
36 private:
37  std::unique_ptr<SeedingRegionAlgoBase> myAlgo_;
38 };
39 
41 
43  auto sumes = consumesCollector();
44  auto seedingPSet = ps.getParameter<edm::ParameterSet>("seedingPSet");
45  auto algoType = seedingPSet.getParameter<std::string>("type");
46  myAlgo_ = SeedingRegionAlgoFactory::get()->create(algoType, seedingPSet, sumes);
47  produces<std::vector<TICLSeedingRegion>>();
48 }
49 
52 
53  edm::ParameterSetDescription seedingDesc;
54  seedingDesc.addNode(edm::PluginDescription<SeedingRegionAlgoFactory>("type", "SeedingRegionGlobal", true));
55  desc.add<edm::ParameterSetDescription>("seedingPSet", seedingDesc);
56  descriptions.add("ticlSeedingRegionProducer", desc);
57 }
58 
59 void TICLSeedingRegionProducer::beginRun(edm::Run const& iEvent, edm::EventSetup const& es) { myAlgo_->initialize(es); }
60 
62  auto result = std::make_unique<std::vector<TICLSeedingRegion>>();
63  myAlgo_->makeRegions(evt, es, *result);
64 
65  evt.put(std::move(result));
66 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
void beginRun(edm::Run const &iEvent, edm::EventSetup const &es) override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
std::unique_ptr< SeedingRegionAlgoBase > myAlgo_
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
tuple result
Definition: mps_fire.py:311
int iEvent
Definition: GenABIO.cc:224
def move
Definition: eostools.py:511
TICLSeedingRegionProducer(const edm::ParameterSet &)
void produce(edm::Event &, const edm::EventSetup &) override
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
void add(std::string const &label, ParameterSetDescription const &psetDescription)
#define get
Definition: Run.h:45