CMS 3D CMS Logo

MergedTrackstersProducer.cc
Go to the documentation of this file.
1 // Author: Felice Pantaleo, Wahid Redjeb, Aurora Perego (CERN) - felice.pantaleo@cern.ch, wahid.redjeb@cern.ch, aurora.perego@cern.ch
2 // Date: 12/2023
13 
14 using namespace ticl;
15 
17 public:
18  explicit MergedTrackstersProducer(const edm::ParameterSet &ps);
20  void produce(edm::Event &, const edm::EventSetup &) override;
21  static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);
22 
23 private:
25 
27 };
28 
30  : egamma_tracksters_token_(
31  consumes<std::vector<ticl::Trackster>>(ps.getParameter<edm::InputTag>("egamma_tracksters"))),
32  general_tracksters_token_(
33  consumes<std::vector<ticl::Trackster>>(ps.getParameter<edm::InputTag>("had_tracksters"))) {
34  produces<std::vector<Trackster>>();
35 }
36 
38  auto resultTracksters = std::make_unique<std::vector<Trackster>>();
39  auto const &egamma_tracksters = evt.get(egamma_tracksters_token_);
40  auto const &had_tracksters = evt.get(general_tracksters_token_);
41  for (auto const &eg_trackster : egamma_tracksters) {
42  resultTracksters->push_back(eg_trackster);
43  }
44  for (auto const &had_trackster : had_tracksters) {
45  resultTracksters->push_back(had_trackster);
46  }
47 
48  evt.put(std::move(resultTracksters));
49 }
50 
53  desc.add<edm::InputTag>("egamma_tracksters", edm::InputTag("ticlTrackstersCLUE3DEM"));
54  desc.add<edm::InputTag>("had_tracksters", edm::InputTag("ticlTrackstersCLUE3DHAD"));
55  descriptions.add("mergedTrackstersProducer", desc);
56 }
57 
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
edm::EDGetTokenT< std::vector< Trackster > > egamma_tracksters_token_
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:344
MergedTrackstersProducer(const edm::ParameterSet &ps)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
HLT enums.
edm::EDGetTokenT< std::vector< Trackster > > general_tracksters_token_
void produce(edm::Event &, const edm::EventSetup &) override
Definition: Common.h:10
def move(src, dest)
Definition: eostools.py:511