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 
15 
21 
22 
25 
30 
31 #include <string>
32 #include <iostream>
33 #include <map>
34 
35 
36 
37 template <typename T1>
39 {
40  public:
41  explicit TrackMergeremb(const edm::ParameterSet&);
43 
44  private:
45  virtual void produce(edm::Event&, const edm::EventSetup&) override;
46 
47  typedef T1 TrackCollectionemb;
48 
49 
51  void willconsume(const edm::ParameterSet& iConfig);
53 
54  std::map<std::string, std::vector<edm::EDGetTokenT<TrackCollectionemb > > > inputs_;
55  std::map<std::string, std::vector<edm::EDGetTokenT<edm::ValueMap<reco::MuonQuality> > > > inputs_qual_;
56 
57  //typedef edm::ValueMap<reco::TrackRef> TrackToTrackMapnew;
59 
60 
63 
66 
67 
68 };
69 
70 template <typename T1>
72 {
73  std::string alias( iConfig.getParameter<std::string>( "@module_label" ) );
74  std::vector<edm::InputTag> inCollections = iConfig.getParameter<std::vector<edm::InputTag> >("mergCollections");
75  for (auto inCollection : inCollections){
76  inputs_[inCollection.instance()].push_back(consumes<TrackCollectionemb >(inCollection) );
77  }
78  willconsume(iConfig);
79  for (auto toproduce : inputs_){
80  willproduce(toproduce.first,alias);
81  }
82 }
83 
84 template <typename T1>
86 {
87 // nothing to be done yet...
88 }
89 
90 
91 template <typename T1>
93 {
94 
95  for (auto input_ : inputs_){
96 
97  merg_and_put(iEvent,input_.first, input_.second);
98 
99  }// end instance
100 
101 
102 }
103 #endif
T getParameter(std::string const &) const
void willconsume(const edm::ParameterSet &iConfig)
static PFTauRenderPlugin instance
void willproduce(std::string instance, std::string alias)
std::map< std::string, std::vector< edm::EDGetTokenT< edm::ValueMap< reco::MuonQuality > > > > inputs_qual_
edm::EDGetTokenT< reco::MuonCollection > inputs_fixmucol_
int iEvent
Definition: GenABIO.cc:230
edm::EDGetTokenT< reco::MuonToMuonMap > inputs_fixmurefs_
edm::EDGetTokenT< reco::TrackCollection > inputs_fixtrackcol_
std::map< std::string, std::vector< edm::EDGetTokenT< TrackCollectionemb > > > inputs_
void merg_and_put(edm::Event &, std::string, std::vector< edm::EDGetTokenT< TrackCollectionemb > > &)
edm::EDGetTokenT< TrackToTrackMapnew > inputs_fixtrackrefs_
edm::ValueMap< reco::TrackRefVector > TrackToTrackMapnew
TrackMergeremb(const edm::ParameterSet &)
virtual void produce(edm::Event &, const edm::EventSetup &) override