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 #include <boost/foreach.hpp>
11 
14 
21 
23  public:
25  src_(cfg.getParameter<std::vector<edm::InputTag> >("src")) {
26  produces<reco::PFTauRefVector>();
27  }
28  private:
29  void produce(edm::Event & evt, const edm::EventSetup &) override {
30  auto out = std::make_unique<reco::PFTauRefVector>();
31  BOOST_FOREACH(const edm::InputTag& inputSrc, src_) {
33  evt.getByLabel(inputSrc, src);
34  reco::PFTauRefVector inputRefs =
35  reco::tau::castView<reco::PFTauRefVector>(src);
36  // Merge all the collections
37  BOOST_FOREACH(const reco::PFTauRef tau, inputRefs) {
38  out->push_back(tau);
39  }
40  }
41  evt.put(std::move(out));
42  }
43  std::vector<edm::InputTag> src_;
44 };
45 
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