CMS 3D CMS Logo

PFTauViewRefMerger.cc
Go to the documentation of this file.
1 /* \class PFTauViewRefMerger
2  *
3  * Produces a RefVector of PFTaus from a different views of PFTau.
4  *
5  * Note that the collections must all come from the same original collection!
6  *
7  * Author: Evan K. Friis
8  *
9  */
10 
13 
20 
22  public:
24  src_(cfg.getParameter<std::vector<edm::InputTag> >("src")) {
25  produces<reco::PFTauRefVector>();
26  }
27  private:
28  void produce(edm::Event & evt, const edm::EventSetup &) override {
29  auto out = std::make_unique<reco::PFTauRefVector>();
30  for(auto const& inputSrc : src_) {
32  evt.getByLabel(inputSrc, src);
33  reco::PFTauRefVector inputRefs =
34  reco::tau::castView<reco::PFTauRefVector>(src);
35  // Merge all the collections
36  for(auto const& tau : inputRefs) {
37  out->push_back(tau);
38  }
39  }
40  evt.put(std::move(out));
41  }
42  std::vector<edm::InputTag> src_;
43 };
44 
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
PFTauViewRefMerger(const edm::ParameterSet &cfg)
std::vector< edm::InputTag > src_
void produce(edm::Event &evt, const edm::EventSetup &) override
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:535
HLT enums.
def move(src, dest)
Definition: eostools.py:511