CMS 3D CMS Logo

TrackMergeremb.h
Go to the documentation of this file.
1 
12 #ifndef TauAnalysis_MCEmbeddingTools_TrackMergeremb_H
13 #define TauAnalysis_MCEmbeddingTools_TrackMergeremb_H
14 
20 
23 
28 
29 #include <string>
30 #include <iostream>
31 #include <map>
32 
33 template <typename T1>
35 public:
36  explicit TrackMergeremb(const edm::ParameterSet&);
37  ~TrackMergeremb() override;
38 
39 private:
40  void produce(edm::Event&, const edm::EventSetup&) override;
41 
42  typedef T1 TrackCollectionemb;
43 
45  void willconsume(const edm::ParameterSet& iConfig);
47 
48  std::map<std::string, std::vector<edm::EDGetTokenT<TrackCollectionemb> > > inputs_;
49  std::map<std::string, std::vector<edm::EDGetTokenT<edm::ValueMap<reco::MuonQuality> > > > inputs_qual_;
50 
51  //typedef edm::ValueMap<reco::TrackRef> TrackToTrackMapnew;
53 
56 
59 };
60 
61 template <typename T1>
63  std::string alias(iConfig.getParameter<std::string>("@module_label"));
64  std::vector<edm::InputTag> inCollections = iConfig.getParameter<std::vector<edm::InputTag> >("mergCollections");
65  for (const auto& inCollection : inCollections) {
66  inputs_[inCollection.instance()].push_back(consumes<TrackCollectionemb>(inCollection));
67  }
68  willconsume(iConfig);
69  for (const auto& toproduce : inputs_) {
70  willproduce(toproduce.first, alias);
71  }
72 }
73 
74 template <typename T1>
76  // nothing to be done yet...
77 }
78 
79 template <typename T1>
81  for (auto input_ : inputs_) {
82  merg_and_put(iEvent, input_.first, input_.second);
83 
84  } // end instance
85 }
86 #endif
void willconsume(const edm::ParameterSet &iConfig)
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
static PFTauRenderPlugin instance
std::map< std::string, std::vector< edm::EDGetTokenT< TrackCollectionemb > > > inputs_
edm::EDGetTokenT< reco::MuonToMuonMap > inputs_fixmurefs_
~TrackMergeremb() override
edm::EDGetTokenT< reco::TrackCollection > inputs_fixtrackcol_
void willproduce(std::string instance, std::string alias)
std::map< std::string, std::vector< edm::EDGetTokenT< edm::ValueMap< reco::MuonQuality > > > > inputs_qual_
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< reco::MuonCollection > inputs_fixmucol_
void merg_and_put(edm::Event &, std::string, std::vector< edm::EDGetTokenT< TrackCollectionemb > > &)
edm::ValueMap< reco::TrackRefVector > TrackToTrackMapnew
edm::EDGetTokenT< TrackToTrackMapnew > inputs_fixtrackrefs_
TrackMergeremb(const edm::ParameterSet &)
void produce(edm::Event &, const edm::EventSetup &) override