Imperial Analysis
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ICFillerStructs.hh
Go to the documentation of this file.
1 #ifndef UserCode_ICHiggsTauTau_ICFillerStructs_h
2 #define UserCode_ICHiggsTauTau_ICFillerStructs_h
3 
4 #include "DataFormats/Provenance/interface/ProductID.h"
5 #include "FWCore/Framework/interface/EDProducer.h"
6 #include "FWCore/ParameterSet/interface/ParameterSet.h"
7 #include "FWCore/Framework/interface/Event.h"
8 #include "FWCore/Framework/interface/EventSetup.h"
9 #include "FWCore/Utilities/interface/InputTag.h"
10 #include "DataFormats/EgammaCandidates/interface/Conversion.h"
11 #include "RecoEgamma/EgammaTools/interface/ConversionTools.h"
12 
13 //These structs make sure the correct ID is passed to filler.insert(handle,...)
14 //when producing a ValueMap from an edm::View.
15 //In case the edm::View points to an edm::RefVector, passing a CollectionIDAndSize
16 //to filler.insert(handle,...) instead of the handle itself ensures the ValueMap
17 //is linked to the ID of the underlying collection, not the edm::RefVector
18 //For an example interpretation, see ICElectronConversionCalculator.cc
19 
20  template <typename T>
22  edm::Handle<edm::View<T> > handle_;
23  size_t size() const {return handle_->size();};
24  };
25 
26  template <typename T>
29  edm::ProductID id() const {return collsizepointer->handle_->refAt(0).id();};
31  return collsizepointer;
32  }
33  };
34 
35 #endif
36 
size_t size() const
edm::ProductID id() const
edm::Handle< edm::View< T > > handle_
CollectionSize< T > * collsizepointer
CollectionSize< T > * operator->() const