Imperial Analysis
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ICJetProducer.hh
Go to the documentation of this file.
1 #ifndef UserCode_ICHiggsTauTau_ICJetProducer_h
2 #define UserCode_ICHiggsTauTau_ICJetProducer_h
3 
4 #include <memory>
5 #include <typeinfo>
6 #include "boost/functional/hash.hpp"
7 #include "boost/format.hpp"
8 #include "FWCore/Framework/interface/EDProducer.h"
9 #include "FWCore/ParameterSet/interface/ParameterSet.h"
10 #include "FWCore/Framework/interface/Event.h"
11 #include "FWCore/Framework/interface/EventSetup.h"
12 #include "FWCore/Utilities/interface/InputTag.h"
13 #include "DataFormats/Math/interface/deltaR.h"
14 #include "DataFormats/JetReco/interface/CaloJet.h"
15 #include "DataFormats/JetReco/interface/PFJet.h"
16 #include "DataFormats/JetReco/interface/JPTJet.h"
17 #include "DataFormats/PatCandidates/interface/Jet.h"
18 #include "DataFormats/JetReco/interface/JetID.h"
19 #include "DataFormats/BTauReco/interface/JetTag.h"
20 #include "DataFormats/BTauReco/interface/SecondaryVertexTagInfo.h"
21 #include "JetMETCorrections/Objects/interface/JetCorrector.h"
22 #include "CommonTools/Utils/interface/StringCutObjectSelector.h"
31 
39 template <class T, class U>
40 class ICJetProducer : public edm::EDProducer {
41  public:
42  explicit ICJetProducer(const edm::ParameterSet &);
44 
45  private:
46  virtual void beginJob();
47  virtual void produce(edm::Event &, const edm::EventSetup &);
48  virtual void endJob();
49  void constructSpecific(edm::Handle<edm::View<U> > const& jets_handle,
50  edm::Event& event, const edm::EventSetup& setup);
51 
52  std::vector<T> *jets_;
53  edm::InputTag input_;
54  std::string branch_;
55 
56  std::vector<unsigned> passed_;
57 
58  JetSrcHelper<U> src_;
59  JetDestHelper<T> dest_;
60 };
61 
62 
63 // =============================
64 // Template class implementation
65 // =============================
66 template <class T, class U>
67 ICJetProducer<T, U>::ICJetProducer(const edm::ParameterSet& config)
68  : input_(config.getParameter<edm::InputTag>("input")),
69  branch_(config.getParameter<std::string>("branch")),
70  src_(config.getParameterSet("srcConfig"),consumesCollector()),
71  dest_(config.getParameterSet("destConfig"),consumesCollector()) {
72  consumes<edm::View<U>>(input_);
73  jets_ = new std::vector<T>();
74 
75 
76  PrintHeaderWithProduces(config, input_, branch_);
77 
78  src_.DoSetup(this);
79  dest_.DoSetup(this);
80 }
81 
82 
83 template <class T, class U>
85 
86 
87 // =============
88 // Main producer
89 // =============
90 template <class T, class U>
91 void ICJetProducer<T, U>::produce(edm::Event& event,
92  const edm::EventSetup& setup) {
93 
94  edm::Handle<edm::View<U> > jets_handle;
95  event.getByLabel(input_, jets_handle);
96 
97  jets_->clear();
98  passed_.clear();
99  jets_->reserve(jets_handle->size());
100  passed_.reserve(jets_handle->size());
101 
102  src_.Produce(jets_handle, jets_, &passed_, event, setup);
103 
104  constructSpecific(jets_handle, event, setup);
105 }
106 
107 
108 // =============================
109 // Specific producers
110 // =============================
111 template <class T, class U>
113  edm::Handle<edm::View<U> > const& jets_handle, edm::Event& event,
114  const edm::EventSetup& setup) {}
115 
116 
117 // =============================
118 // reco::CaloJet --> ic::CaloJet
119 // =============================
120 template <>
122  edm::Handle<edm::View<reco::CaloJet> > const& jets_handle,
123  edm::Event& event, const edm::EventSetup& setup) {
124  //}
125 
126  edm::Handle<reco::JetIDValueMap> jet_id_handle;
127  if (dest_.do_jet_id) event.getByLabel(dest_.input_jet_id, jet_id_handle);
128  for (unsigned i = 0; i < passed_.size(); ++i) {
129  reco::CaloJet const& src = jets_handle->at(passed_[i]);
130  ic::CaloJet & dest = jets_->at(i);
131  FillCommonCaloJet(&dest, src);
132  if (dest_.do_n_carrying) {
133  dest.set_n90(src.n90());
134  dest.set_n60(src.n60());
135  }
136  // Assume input jet is uncorrected
137  dest.set_uncorrected_energy(src.energy());
138  if (dest_.do_jet_id) {
139  reco::JetID const& jet_id =
140  (*jet_id_handle)[jets_handle->refAt(passed_[i])];
141  dest.set_fHPD(jet_id.fHPD);
142  dest.set_fRBX(jet_id.fRBX);
143  dest.set_id_loose((*(dest_.loose_id))(src, jet_id));
144  dest.set_id_tight((*(dest_.tight_id))(src, jet_id));
145  }
146  }
147 }
148 
149 // =============================
150 // pat::Jet --> ic::CaloJet
151 // =============================
152 template <>
154  edm::Handle<edm::View<pat::Jet> > const& jets_handle,
155  edm::Event& event, const edm::EventSetup& setup) {
156 
157  for (unsigned i = 0; i < passed_.size(); ++i) {
158  pat::Jet const& src = jets_handle->at(passed_[i]);
159  ic::CaloJet & dest = jets_->at(i);
160  FillCommonCaloJet(&dest, src);
161  if (dest_.do_n_carrying) {
162  dest.set_n90(src.n90());
163  dest.set_n60(src.n60());
164  }
165 
167  (src.jecSetsAvailable() ? src.jecFactor(0) : 1.) * src.energy());
168  if (dest_.do_jet_id) {
169  dest.set_fHPD(src.jetID().fHPD);
170  dest.set_fRBX(src.jetID().fRBX);
171  dest.set_id_loose((*(dest_.loose_id))(src));
172  dest.set_id_tight((*(dest_.tight_id))(src));
173  }
174  }
175 }
176 
177 // =============================
178 // reco::JPTJet --> ic::JPTJet
179 // =============================
180 template <>
182  edm::Handle<edm::View<reco::JPTJet> > const& jets_handle,
183  edm::Event& event, const edm::EventSetup& setup) {
184 
185  edm::Handle<reco::JetIDValueMap> jet_id_handle;
186  if (dest_.do_jet_id) event.getByLabel(dest_.input_jet_id, jet_id_handle);
187 
188  edm::Handle<reco::TrackCollection> trk_handle;
189  edm::Handle<reco::VertexCollection> vtx_handle;
190  std::map<unsigned, unsigned> trk_vtx_map;
191 
192  std::auto_ptr<reco::TrackRefVector> track_requests(
193  new reco::TrackRefVector());
194 
195  if (dest_.do_trk_vars) {
196  event.getByLabel(dest_.input_trks, trk_handle);
197  event.getByLabel(dest_.input_vtxs, vtx_handle);
198  trk_vtx_map = BuildTrkVtxMap(trk_handle, vtx_handle);
199  }
200 
201  for (unsigned i = 0; i < passed_.size(); ++i) {
202  reco::JPTJet const& src = jets_handle->at(passed_[i]);
203 
204  reco::CaloJetRef calo(src.getCaloJetRef().castTo<reco::CaloJetRef>());
205  ic::JPTJet & dest = jets_->at(i);
206  FillCommonCaloJet(&dest, *calo);
207  if (dest_.do_n_carrying) {
208  dest.set_n90(calo->n90());
209  dest.set_n60(calo->n60());
210  }
211  FillCommonJPTJet(&dest, src);
212  // Assume input jet is uncorrected
213  dest.set_uncorrected_energy(src.energy());
214  if (dest_.do_jet_id) {
215  reco::JetID const& jet_id = (*jet_id_handle)[calo];
216  dest.set_id_loose((*(dest_.loose_id))(*calo, jet_id));
217  dest.set_id_tight((*(dest_.tight_id))(*calo, jet_id));
218  }
219 
220  if (dest_.request_trks) {
221  dest.set_pions_in_vtx_in_calo(dest_.DoTrackCollection(
222  src.getPionsInVertexInCalo(), track_requests.get()));
223  dest.set_pions_in_vtx_out_calo(dest_.DoTrackCollection(
224  src.getPionsInVertexOutCalo(), track_requests.get()));
225  dest.set_pions_out_vtx_in_calo(dest_.DoTrackCollection(
226  src.getPionsOutVertexInCalo(), track_requests.get()));
227  dest.set_muons_in_vtx_in_calo(dest_.DoTrackCollection(
228  src.getMuonsInVertexInCalo(), track_requests.get()));
229  dest.set_muons_in_vtx_out_calo(dest_.DoTrackCollection(
230  src.getMuonsInVertexOutCalo(), track_requests.get()));
231  dest.set_muons_out_vtx_in_calo(dest_.DoTrackCollection(
232  src.getMuonsOutVertexInCalo(), track_requests.get()));
233  dest.set_elecs_in_vtx_in_calo(dest_.DoTrackCollection(
234  src.getElecsInVertexInCalo(), track_requests.get()));
235  dest.set_elecs_in_vtx_out_calo(dest_.DoTrackCollection(
236  src.getElecsInVertexOutCalo(), track_requests.get()));
237  dest.set_elecs_out_vtx_in_calo(dest_.DoTrackCollection(
238  src.getElecsOutVertexInCalo(), track_requests.get()));
239  }
240 
241  if (dest_.do_trk_vars && trk_handle->size() > 0) {
242  std::vector<reco::Track const*> all_tracks;
243  dest_.AddTrackCollection(src.getPionsInVertexInCalo(), &all_tracks);
244  dest_.AddTrackCollection(src.getPionsInVertexOutCalo(), &all_tracks);
245  dest_.AddTrackCollection(src.getPionsOutVertexInCalo(), &all_tracks);
246  dest_.AddTrackCollection(src.getMuonsInVertexInCalo(), &all_tracks);
247  dest_.AddTrackCollection(src.getMuonsInVertexOutCalo(), &all_tracks);
248  dest_.AddTrackCollection(src.getMuonsOutVertexInCalo(), &all_tracks);
249  dest_.AddTrackCollection(src.getElecsInVertexInCalo(), &all_tracks);
250  dest_.AddTrackCollection(src.getElecsInVertexOutCalo(), &all_tracks);
251  dest_.AddTrackCollection(src.getElecsOutVertexInCalo(), &all_tracks);
252  FillJPTTrackVars(&dest, all_tracks, trk_handle, vtx_handle, trk_vtx_map);
253  }
254  }
255  if (dest_.request_trks) {
256  event.put(track_requests, "requestedTracks");
257  }
258 }
259 
260 // =============================
261 // pat::Jet --> ic::JPTJet
262 // =============================
263 template <>
265  edm::Handle<edm::View<pat::Jet> > const& jets_handle,
266  edm::Event& event, const edm::EventSetup& setup) {
267 
268  edm::Handle<reco::TrackCollection> trk_handle;
269  edm::Handle<reco::VertexCollection> vtx_handle;
270  std::map<unsigned, unsigned> trk_vtx_map;
271 
272  std::auto_ptr<reco::TrackRefVector> track_requests(
273  new reco::TrackRefVector());
274 
275  if (dest_.do_trk_vars) {
276  event.getByLabel(dest_.input_trks, trk_handle);
277  event.getByLabel(dest_.input_vtxs, vtx_handle);
278  trk_vtx_map = BuildTrkVtxMap(trk_handle, vtx_handle);
279  }
280 
281  for (unsigned i = 0; i < passed_.size(); ++i) {
282  pat::Jet const& src = jets_handle->at(passed_[i]);
283  ic::JPTJet & dest = jets_->at(i);
284  FillCommonCaloJet(&dest, src);
285  if (dest_.do_n_carrying) {
286  dest.set_n90(src.n90());
287  dest.set_n60(src.n60());
288  }
289  FillCommonJPTJet(&dest, src);
291  (src.jecSetsAvailable() ? src.jecFactor(0) : 1.) * src.energy());
292  if (dest_.do_jet_id) {
293  dest.set_fHPD(src.jetID().fHPD);
294  dest.set_fRBX(src.jetID().fRBX);
295  dest.set_id_loose((*(dest_.loose_id))(src));
296  dest.set_id_tight((*(dest_.tight_id))(src));
297  }
298 
299  if (dest_.request_trks) {
300  dest.set_pions_in_vtx_in_calo(dest_.DoTrackCollection(
301  src.pionsInVertexInCalo(), track_requests.get()));
302  dest.set_pions_in_vtx_out_calo(dest_.DoTrackCollection(
303  src.pionsInVertexOutCalo(), track_requests.get()));
304  dest.set_pions_out_vtx_in_calo(dest_.DoTrackCollection(
305  src.pionsOutVertexInCalo(), track_requests.get()));
306  dest.set_muons_in_vtx_in_calo(dest_.DoTrackCollection(
307  src.muonsInVertexInCalo(), track_requests.get()));
308  dest.set_muons_in_vtx_out_calo(dest_.DoTrackCollection(
309  src.muonsInVertexOutCalo(), track_requests.get()));
310  dest.set_muons_out_vtx_in_calo(dest_.DoTrackCollection(
311  src.muonsOutVertexInCalo(), track_requests.get()));
312  dest.set_elecs_in_vtx_in_calo(dest_.DoTrackCollection(
313  src.elecsInVertexInCalo(), track_requests.get()));
314  dest.set_elecs_in_vtx_out_calo(dest_.DoTrackCollection(
315  src.elecsInVertexOutCalo(), track_requests.get()));
316  dest.set_elecs_out_vtx_in_calo(dest_.DoTrackCollection(
317  src.elecsOutVertexInCalo(), track_requests.get()));
318  }
319 
320  if (dest_.do_trk_vars && trk_handle->size() > 0) {
321  std::vector<reco::Track const*> all_tracks;
322  dest_.AddTrackCollection(src.pionsInVertexInCalo(), &all_tracks);
323  dest_.AddTrackCollection(src.pionsInVertexOutCalo(), &all_tracks);
324  dest_.AddTrackCollection(src.pionsOutVertexInCalo(), &all_tracks);
325  dest_.AddTrackCollection(src.muonsInVertexInCalo(), &all_tracks);
326  dest_.AddTrackCollection(src.muonsInVertexOutCalo(), &all_tracks);
327  dest_.AddTrackCollection(src.muonsOutVertexInCalo(), &all_tracks);
328  dest_.AddTrackCollection(src.elecsInVertexInCalo(), &all_tracks);
329  dest_.AddTrackCollection(src.elecsInVertexOutCalo(), &all_tracks);
330  dest_.AddTrackCollection(src.elecsOutVertexInCalo(), &all_tracks);
331  FillJPTTrackVars(&dest, all_tracks, trk_handle, vtx_handle, trk_vtx_map);
332  }
333  }
334  if (dest_.request_trks) {
335  event.put(track_requests, "requestedTracks");
336  }
337 }
338 
339 // =============================
340 // reco::PFJet --> ic::PFJet
341 // =============================
342 template <>
344  edm::Handle<edm::View<reco::PFJet> > const& jets_handle,
345  edm::Event& event, const edm::EventSetup& setup) {
346 
347  edm::Handle<edm::ValueMap<float> > pu_id_handle;
348  if (dest_.do_pu_id) event.getByLabel(dest_.input_pu_id, pu_id_handle);
349 
350  edm::Handle<reco::TrackCollection> trk_handle;
351  edm::Handle<reco::VertexCollection> vtx_handle;
352  std::map<unsigned, unsigned> trk_vtx_map;
353 
354  std::auto_ptr<reco::TrackRefVector> track_requests(
355  new reco::TrackRefVector());
356 
357  if (dest_.do_trk_vars) {
358  event.getByLabel(dest_.input_trks, trk_handle);
359  event.getByLabel(dest_.input_vtxs, vtx_handle);
360  trk_vtx_map = BuildTrkVtxMap(trk_handle, vtx_handle);
361  }
362 
363  for (unsigned i = 0; i < passed_.size(); ++i) {
364  reco::PFJet const& src = jets_handle->at(passed_[i]);
365  ic::PFJet & dest = jets_->at(i);
366  FillCommonPFJet(&dest, src);
367  // Assume input jet is uncorrected
368  dest.set_uncorrected_energy(src.energy());
369  if (dest_.do_pu_id) {
370  dest.set_pu_id_mva_value((*pu_id_handle)[jets_handle->refAt(passed_[i])]);
371  }
372 
373  if (dest_.request_trks) {
374  FillPFTracksAndRequest(&dest, src.getPFConstituents(),
375  track_requests.get(), &(dest_.track_hasher));
376  }
377 
378  if (dest_.do_trk_vars && trk_handle->size() > 0) {
379  if (dest_.do_trk_vars && trk_handle->size() > 0) {
380  FillPFTrackVars(&dest, src.getPFConstituents(), trk_handle, vtx_handle,
381  trk_vtx_map);
382  }
383  }
384  }
385  if (dest_.request_trks) {
386  event.put(track_requests, "requestedTracks");
387  }
388 }
389 
390 // =============================
391 // pat::Jet --> ic::PFJet
392 // =============================
393 template <>
395  edm::Handle<edm::View<pat::Jet> > const& jets_handle,
396  edm::Event& event, const edm::EventSetup& setup) {
397 
398  edm::Handle<edm::ValueMap<float> > pu_id_handle;
399  if (dest_.do_pu_id) event.getByLabel(dest_.input_pu_id, pu_id_handle);
400 
401  edm::Handle<reco::TrackCollection> trk_handle;
402  edm::Handle<reco::VertexCollection> vtx_handle;
403  std::map<unsigned, unsigned> trk_vtx_map;
404 
405  std::auto_ptr<reco::TrackRefVector> track_requests(
406  new reco::TrackRefVector());
407 
408  if (dest_.do_trk_vars) {
409  event.getByLabel(dest_.input_trks, trk_handle);
410  event.getByLabel(dest_.input_vtxs, vtx_handle);
411  trk_vtx_map = BuildTrkVtxMap(trk_handle, vtx_handle);
412  }
413 
414  for (unsigned i = 0; i < passed_.size(); ++i) {
415  pat::Jet const& src = jets_handle->at(passed_[i]);
416  ic::PFJet & dest = jets_->at(i);
417  FillCommonPFJet(&dest, src);
419  (src.jecSetsAvailable() ? src.jecFactor(0) : 1.) * src.energy());
420  if (dest_.do_pu_id) {
421  if (src_.is_slimmed) {
422  dest.set_pu_id_mva_value(src.userFloat(src_.slimmed_puid_label));
423  //std::cout << " -- jet " << i << " pt " << dest.pt() << " pumva = " << dest.pu_id_mva_value() << std::endl;
424  } else {
425  dest.set_pu_id_mva_value(
426  (*pu_id_handle)[jets_handle->refAt(passed_[i])->originalObjectRef()]);
427  }
428  }
429 
430  if (dest_.request_trks) {
431  FillPFTracksAndRequest(&dest, src.getPFConstituents(),
432  track_requests.get(), &(dest_.track_hasher));
433  }
434 
435  if (dest_.do_trk_vars && trk_handle->size() > 0) {
436  FillPFTrackVars(&dest, src.getPFConstituents(), trk_handle, vtx_handle,
437  trk_vtx_map);
438  }
439  }
440  if (dest_.request_trks) {
441  event.put(track_requests, "requestedTracks");
442  }
443 }
444 
445 template <class T, class U>
447  ic::StaticTree::tree_->Branch(branch_.c_str(), &jets_);
448 }
449 
450 template <class T, class U>
452 }
453 
454 
455 #endif
void set_id_loose(bool const &id_loose)
Flag indicates if the jet passes the loose ID.
Definition: CaloJet.hh:157
void set_id_tight(bool const &id_tight)
Flag indicates if the jet passes the tight ID.
Definition: CaloJet.hh:160
void FillCommonPFJet(ic::PFJet *dest, U const &src)
void set_muons_in_vtx_in_calo(std::vector< std::size_t > const &muons_in_vtx_in_calo)
A vector of ic::Track::id() values for muons compatible with the jet both at the vertex and the calor...
Definition: JPTJet.hh:198
void set_fRBX(float const &fRBX)
Fraction of energy carried by the "hottest" RBX (readout box)
Definition: CaloJet.hh:154
void FillPFTrackVars(ic::PFJet *dest, std::vector< reco::PFCandidatePtr > const &pfcands, edm::Handle< reco::TrackCollection > const &trk_handle, edm::Handle< reco::VertexCollection > const &vtx_handle, std::map< unsigned, unsigned > const &trk_vtx_map)
void set_pions_in_vtx_out_calo(std::vector< std::size_t > const &pions_in_vtx_out_calo)
A vector of ic::Track::id() values for pions compatible with the jet at the vertex but not at the cal...
Definition: JPTJet.hh:186
void set_elecs_out_vtx_in_calo(std::vector< std::size_t > const &elecs_out_vtx_in_calo)
A vector of ic::Track::id() values for electrons compatible with the jet at the calorimeter but not a...
Definition: JPTJet.hh:228
void set_n90(int const &n90)
Number of constituents carrying 90% of the jet energy.
Definition: CaloJet.hh:145
void set_pions_in_vtx_in_calo(std::vector< std::size_t > const &pions_in_vtx_in_calo)
A vector of ic::Track::id() values for pions compatible with the jet both at the vertex and the calor...
Definition: JPTJet.hh:180
A class derived from ic::Jet which adds Jet-plus-track specific information.
Definition: JPTJet.hh:15
void FillCommonJPTJet(ic::JPTJet *dest, U const &src)
static TTree * tree_
Definition: StaticTree.hh:13
A struct to help with the configuration of the ICJetProducer, in particular the aspects that depend o...
ICJetProducer(const edm::ParameterSet &)
See documentation here.
void DoSetup(edm::EDProducer *prod)
void set_pu_id_mva_value(float const &pu_id_mva_value)
The output of the pileup ID MVA.
Definition: PFJet.hh:338
void set_elecs_in_vtx_out_calo(std::vector< std::size_t > const &elecs_in_vtx_out_calo)
A vector of ic::Track::id() values for electrons compatible with the jet at the vertex but not at the...
Definition: JPTJet.hh:222
void FillCommonCaloJet(ic::CaloJet *dest, U const &src)
void FillJPTTrackVars(ic::JPTJet *dest, std::vector< reco::Track const * > const &all_tracks, edm::Handle< reco::TrackCollection > const &trk_handle, edm::Handle< reco::VertexCollection > const &vtx_handle, std::map< unsigned, unsigned > const &trk_vtx_map)
Derived from the ic::Jet class and adding information specific to calorimeter jets.
Definition: CaloJet.hh:15
void set_elecs_in_vtx_in_calo(std::vector< std::size_t > const &elecs_in_vtx_in_calo)
A vector of ic::Track::id() values for electrons compatible with the jet both at the vertex and the c...
Definition: JPTJet.hh:216
void set_muons_in_vtx_out_calo(std::vector< std::size_t > const &muons_in_vtx_out_calo)
A vector of ic::Track::id() values for muons compatible with the jet at the vertex but not at the cal...
Definition: JPTJet.hh:204
A class deriving from ic::Jet that provides specific information for particle-flow jets...
Definition: PFJet.hh:14
void set_n60(int const &n60)
Number of constituents carrying 60% of the jet energy.
Definition: CaloJet.hh:148
Definition: Consumes.h:19
edm::ConsumesCollector consumesCollector()
Definition: Consumes.cc:4
void set_muons_out_vtx_in_calo(std::vector< std::size_t > const &muons_out_vtx_in_calo)
A vector of ic::Track::id() values for muons compatible with the jet at the calorimeter but not at th...
Definition: JPTJet.hh:210
void set_fHPD(float const &fHPD)
Fraction of energy carried by the "hottest" HPD (hybrid photodiode)
Definition: CaloJet.hh:151
std::map< unsigned, unsigned > BuildTrkVtxMap(edm::Handle< reco::TrackCollection > const &trk_handle, edm::Handle< reco::VertexCollection > const &vtx_handle)
void set_pions_out_vtx_in_calo(std::vector< std::size_t > const &pions_out_vtx_in_calo)
A vector of ic::Track::id() values for pions compatible with the jet at the calorimeter but not at th...
Definition: JPTJet.hh:192
void set_uncorrected_energy(double const &uncorrected_energy)
The raw value of the jet energy.
Definition: Jet.hh:117
void FillPFTracksAndRequest(ic::PFJet *dest, std::vector< reco::PFCandidatePtr > const &pfcands, reco::TrackRefVector *track_requests, boost::hash< reco::Track const * > *track_hasher)
void PrintHeaderWithProduces(edm::ParameterSet const &config, edm::InputTag const &in, std::string branch)