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 
16 
23 
25  public:
27  src_(cfg.getParameter<std::vector<edm::InputTag> >("src")) {
28  produces<reco::PFTauRefVector>();
29  }
30  static void fillDescriptions(edm::ConfigurationDescriptions & descriptions);
31  private:
32  void produce(edm::Event & evt, const edm::EventSetup &) override {
33  auto out = std::make_unique<reco::PFTauRefVector>();
34  for(auto const& inputSrc : src_) {
36  evt.getByLabel(inputSrc, src);
37  reco::PFTauRefVector inputRefs =
38  reco::tau::castView<reco::PFTauRefVector>(src);
39  // Merge all the collections
40  for(auto const& tau : inputRefs) {
41  out->push_back(tau);
42  }
43  }
44  evt.put(std::move(out));
45  }
46  std::vector<edm::InputTag> src_;
47 };
48 
49 void
51  // pfTauViewRefMerger
53 
54  desc.add<std::vector<edm::InputTag>>("src");
55 
56  descriptions.add("pfTauViewRefMerger", desc);
57 }
58 
59 
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
PFTauViewRefMerger(const edm::ParameterSet &cfg)
std::vector< edm::InputTag > src_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void produce(edm::Event &evt, const edm::EventSetup &) override
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:480
void add(std::string const &label, ParameterSetDescription const &psetDescription)
HLT enums.
def move(src, dest)
Definition: eostools.py:511