CMS 3D CMS Logo

ReducedEGProducer.h
Go to the documentation of this file.
1 #ifndef RecoEgamma_EgammaPhotonProducers_ReducedEGProducer_h
2 #define RecoEgamma_EgammaPhotonProducers_ReducedEGProducer_h
3 
42 
44 
45 
46 // ReducedEGProducer inherits from EDProducer, so it can be a module:
48 
49  public:
50 
52  ~ReducedEGProducer() override;
53 
54  void beginRun (edm::Run const&, const edm::EventSetup&) final;
55  void produce(edm::Event& evt, const edm::EventSetup& es) final;
56 
57  private:
58 
59  template <typename T, typename U>
60  void linkCore(const T& core, U& cores, std::map<T, unsigned int>& coreMap);
61 
62  void linkSuperCluster(const reco::SuperClusterRef& superCluster,
63  std::map<reco::SuperClusterRef, unsigned int>& superClusterMap,
64  reco::SuperClusterCollection& superClusters,
65  const bool relink,
66  std::unordered_set<unsigned int>& superClusterFullRelinkMap);
67 
68  void linkConversions(const reco::ConversionRefVector& convrefs,
70  std::map<reco::ConversionRef, unsigned int>& conversionMap);
71 
73  const reco::GsfElectron& gsfElectron,
74  reco::ConversionCollection& conversions,
75  std::map<reco::ConversionRef, unsigned int>& conversionMap);
76 
78  const reco::SuperCluster& superCluster,
79  reco::ConversionCollection& conversions,
80  std::map<reco::ConversionRef, unsigned int>& conversionMap);
81 
82  void linkConversion(const reco::ConversionRef& convref,
83  reco::ConversionCollection& conversions,
84  std::map<reco::ConversionRef, unsigned int>& conversionMap);
85 
86  void linkCaloCluster(const reco::CaloClusterPtr& caloCluster,
87  reco::CaloClusterCollection& caloClusters,
88  std::map<reco::CaloClusterPtr, unsigned int>& caloClusterMap);
89 
90  void linkCaloClusters(const reco::SuperCluster& superCluster,
91  reco::CaloClusterCollection& ebeeClusters,
92  std::map<reco::CaloClusterPtr, unsigned int>& ebeeClusterMap,
93  std::unordered_set<DetId>& rechitMap,
94  const edm::Handle<EcalRecHitCollection>& barrelHitHandle,
95  const edm::Handle<EcalRecHitCollection>& endcapHitHandle,
96  const CaloTopology *caloTopology,
97  reco::CaloClusterCollection& esClusters,
98  std::map<reco::CaloClusterPtr, unsigned int>& esClusterMap);
99 
100  void linkHcalHits(const reco::SuperCluster& superClus,const HBHERecHitCollection& recHits,
101  std::unordered_set<DetId>& hcalDetIds);
102 
103  void relinkCaloClusters(reco::SuperCluster& superCluster,
104  const std::map<reco::CaloClusterPtr, unsigned int>& ebeeClusterMap,
105  const std::map<reco::CaloClusterPtr, unsigned int>& esClusterMap,
106  const edm::OrphanHandle<reco::CaloClusterCollection>& outEBEEClusterHandle,
107  const edm::OrphanHandle<reco::CaloClusterCollection>& outESClusterHandle);
108 
109  template <typename T>
110  void relinkSuperCluster(T& core,
111  const std::map<reco::SuperClusterRef, unsigned int>& superClusterMap,
112  const edm::OrphanHandle<reco::SuperClusterCollection>& outSuperClusterHandle);
113 
114  void relinkGsfTrack(reco::GsfElectronCore& electroncore,
115  const std::map<reco::GsfTrackRef, unsigned int>& gsfTrackMap,
116  const edm::OrphanHandle<reco::GsfTrackCollection>& outGsfTrackHandle);
117 
119  const reco::ConversionRefVector& convrefs,
120  const std::map<reco::ConversionRef, unsigned int>& conversionMap,
121  const edm::OrphanHandle<reco::ConversionCollection> &outConversionHandle);
122 
124  const std::map<reco::PhotonCoreRef, unsigned int>& photonCoreMap,
125  const edm::OrphanHandle<reco::PhotonCoreCollection>& outPhotonCoreHandle);
126 
127  void relinkGsfElectronCore(reco::GsfElectron& gsfElectron,
128  const std::map<reco::GsfElectronCoreRef, unsigned int>& gsfElectronCoreMap,
129  const edm::OrphanHandle<reco::GsfElectronCoreCollection>& outGsfElectronCoreHandle);
130 
131  static void calibratePhoton(reco::Photon& photon,
132  const reco::PhotonRef& oldPhoRef,
133  const edm::ValueMap<float>& energyMap,
134  const edm::ValueMap<float>& energyErrMap);
135 
136  static void calibrateElectron(reco::GsfElectron& gsfElectron,
137  const reco::GsfElectronRef& oldEleRef,
138  const edm::ValueMap<float>& energyMap,
139  const edm::ValueMap<float>& energyErrMap,
140  const edm::ValueMap<float>& ecalEnergyMap,
141  const edm::ValueMap<float>& ecalEnergyErrMap);
142 
143 
144  template <typename T>
146  token = consumes<T>(config.getParameter<edm::InputTag>(name));
147  }
148 
149 
150  //tokens for input collections
157 
163 
166 
167  std::vector<edm::EDGetTokenT<edm::ValueMap<bool> > > photonIdTs_;
168  std::vector<edm::EDGetTokenT<edm::ValueMap<float> > > gsfElectronIdTs_;
169 
170  std::vector<edm::EDGetTokenT<edm::ValueMap<float> > > photonFloatValueMapTs_;
171  std::vector<edm::EDGetTokenT<edm::ValueMap<float> > > ootPhotonFloatValueMapTs_;
172  std::vector<edm::EDGetTokenT<edm::ValueMap<float> > > gsfElectronFloatValueMapTs_;
173 
184 
185  //names for output collections
207  const std::vector<std::string> outPhotonIds_;
208  const std::vector<std::string> outGsfElectronIds_;
209  const std::vector<std::string> outPhotonFloatValueMaps_;
210  const std::vector<std::string> outOOTPhotonFloatValueMaps_;
211  const std::vector<std::string> outGsfElectronFloatValueMaps_;
212 
222 
224 
225 };
226 #endif
227 
228 
const bool doPreshowerEcalHits_
void linkCaloClusters(const reco::SuperCluster &superCluster, reco::CaloClusterCollection &ebeeClusters, std::map< reco::CaloClusterPtr, unsigned int > &ebeeClusterMap, std::unordered_set< DetId > &rechitMap, const edm::Handle< EcalRecHitCollection > &barrelHitHandle, const edm::Handle< EcalRecHitCollection > &endcapHitHandle, const CaloTopology *caloTopology, reco::CaloClusterCollection &esClusters, std::map< reco::CaloClusterPtr, unsigned int > &esClusterMap)
void relinkGsfTrack(reco::GsfElectronCore &electroncore, const std::map< reco::GsfTrackRef, unsigned int > &gsfTrackMap, const edm::OrphanHandle< reco::GsfTrackCollection > &outGsfTrackHandle)
T getParameter(std::string const &) const
const StringCutObjectSelector< reco::Photon > relinkOOTPhotonSel_
const edm::EDGetTokenT< reco::GsfElectronCollection > gsfElectronT_
const bool applyPhotonCalibOnData_
const edm::EDGetTokenT< reco::GsfTrackCollection > gsfTrackT_
edm::EDGetTokenT< edm::ValueMap< float > > gsfElectronCalibEnergyT_
const StringCutObjectSelector< reco::Photon > slimRelinkPhotonSel_
const edm::EDGetTokenT< reco::ConversionCollection > singleConversionT_
const std::vector< std::string > outPhotonIds_
~ReducedEGProducer() override
const std::vector< std::string > outOOTPhotonFloatValueMaps_
EGHcalRecHitSelector hcalHitSel_
static void calibratePhoton(reco::Photon &photon, const reco::PhotonRef &oldPhoRef, const edm::ValueMap< float > &energyMap, const edm::ValueMap< float > &energyErrMap)
edm::EDGetTokenT< edm::ValueMap< float > > photonCalibEnergyT_
const std::vector< std::string > outPhotonFloatValueMaps_
Definition: __init__.py:1
const std::string outGsfTracks_
void setToken(edm::EDGetTokenT< T > &token, const edm::ParameterSet &config, const std::string &name)
const StringCutObjectSelector< reco::GsfElectron > keepGsfElectronSel_
const std::string outOOTPhotons_
void linkHcalHits(const reco::SuperCluster &superClus, const HBHERecHitCollection &recHits, std::unordered_set< DetId > &hcalDetIds)
void beginRun(edm::Run const &, const edm::EventSetup &) final
Definition: config.py:1
const std::string outEBEEClusters_
const StringCutObjectSelector< reco::Photon > keepPhotonSel_
const edm::EDGetTokenT< edm::ValueMap< std::vector< reco::PFCandidateRef > > > photonPfCandMapT_
const bool applyGsfElectronCalibOnData_
edm::EDGetTokenT< edm::ValueMap< float > > photonCalibEnergyErrT_
const std::string outHBHERecHits_
const StringCutObjectSelector< reco::GsfElectron > relinkGsfElectronSel_
void linkConversion(const reco::ConversionRef &convref, reco::ConversionCollection &conversions, std::map< reco::ConversionRef, unsigned int > &conversionMap)
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
Definition: ConversionFwd.h:9
const edm::EDGetTokenT< edm::ValueMap< std::vector< reco::PFCandidateRef > > > gsfElectronPfCandMapT_
const std::string outEBRecHits_
const std::string outESRecHits_
void relinkConversions(reco::PhotonCore &photonCore, const reco::ConversionRefVector &convrefs, const std::map< reco::ConversionRef, unsigned int > &conversionMap, const edm::OrphanHandle< reco::ConversionCollection > &outConversionHandle)
const edm::EDGetTokenT< EcalRecHitCollection > preshowerEcalHits_
void linkConversions(const reco::ConversionRefVector &convrefs, reco::ConversionCollection &conversions, std::map< reco::ConversionRef, unsigned int > &conversionMap)
const std::vector< std::string > outGsfElectronIds_
const std::string outSingleConversions_
const std::string outESClusters_
const std::string outOOTSuperClusters_
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
const StringCutObjectSelector< reco::Photon > keepOOTPhotonSel_
const std::string outOOTESClusters_
static void calibrateElectron(reco::GsfElectron &gsfElectron, const reco::GsfElectronRef &oldEleRef, const edm::ValueMap< float > &energyMap, const edm::ValueMap< float > &energyErrMap, const edm::ValueMap< float > &ecalEnergyMap, const edm::ValueMap< float > &ecalEnergyErrMap)
void relinkGsfElectronCore(reco::GsfElectron &gsfElectron, const std::map< reco::GsfElectronCoreRef, unsigned int > &gsfElectronCoreMap, const edm::OrphanHandle< reco::GsfElectronCoreCollection > &outGsfElectronCoreHandle)
std::vector< edm::EDGetTokenT< edm::ValueMap< float > > > gsfElectronFloatValueMapTs_
void linkConversionsByTrackRef(const edm::Handle< reco::ConversionCollection > &conversionHandle, const reco::GsfElectron &gsfElectron, reco::ConversionCollection &conversions, std::map< reco::ConversionRef, unsigned int > &conversionMap)
edm::EDGetTokenT< reco::PhotonCollection > ootPhotonT_
const std::string outOOTEBEEClusters_
std::vector< CaloCluster > CaloClusterCollection
collection of CaloCluster objects
void linkSuperCluster(const reco::SuperClusterRef &superCluster, std::map< reco::SuperClusterRef, unsigned int > &superClusterMap, reco::SuperClusterCollection &superClusters, const bool relink, std::unordered_set< unsigned int > &superClusterFullRelinkMap)
void linkCore(const T &core, U &cores, std::map< T, unsigned int > &coreMap)
const StringCutObjectSelector< reco::Photon > relinkPhotonSel_
std::vector< edm::EDGetTokenT< edm::ValueMap< float > > > gsfElectronIdTs_
edm::EDGetTokenT< edm::ValueMap< float > > gsfElectronCalibEnergyErrT_
const edm::EDGetTokenT< HBHERecHitCollection > hbheHits_
const bool applyPhotonCalibOnMC_
void relinkCaloClusters(reco::SuperCluster &superCluster, const std::map< reco::CaloClusterPtr, unsigned int > &ebeeClusterMap, const std::map< reco::CaloClusterPtr, unsigned int > &esClusterMap, const edm::OrphanHandle< reco::CaloClusterCollection > &outEBEEClusterHandle, const edm::OrphanHandle< reco::CaloClusterCollection > &outESClusterHandle)
const std::string outPhotons_
const std::string outGsfElectronPfCandMap_
void relinkSuperCluster(T &core, const std::map< reco::SuperClusterRef, unsigned int > &superClusterMap, const edm::OrphanHandle< reco::SuperClusterCollection > &outSuperClusterHandle)
const std::string outGsfElectronCores_
std::vector< edm::EDGetTokenT< edm::ValueMap< float > > > photonFloatValueMapTs_
const edm::EDGetTokenT< reco::PhotonCollection > photonT_
void relinkPhotonCore(reco::Photon &photon, const std::map< reco::PhotonCoreRef, unsigned int > &photonCoreMap, const edm::OrphanHandle< reco::PhotonCoreCollection > &outPhotonCoreHandle)
const std::string outSuperClusters_
const std::string outConversions_
std::vector< edm::EDGetTokenT< edm::ValueMap< float > > > ootPhotonFloatValueMapTs_
const std::string outGsfElectrons_
const StringCutObjectSelector< reco::GsfElectron > slimRelinkGsfElectronSel_
const std::string outPhotonCores_
edm::EDGetTokenT< edm::ValueMap< float > > gsfElectronCalibEcalEnergyErrT_
void linkCaloCluster(const reco::CaloClusterPtr &caloCluster, reco::CaloClusterCollection &caloClusters, std::map< reco::CaloClusterPtr, unsigned int > &caloClusterMap)
const std::string outEERecHits_
const StringCutObjectSelector< reco::Photon > slimRelinkOOTPhotonSel_
void produce(edm::Event &evt, const edm::EventSetup &es) final
const std::vector< std::string > outGsfElectronFloatValueMaps_
const std::string outPhotonPfCandMap_
const edm::EDGetTokenT< EcalRecHitCollection > endcapEcalHits_
std::vector< edm::EDGetTokenT< edm::ValueMap< bool > > > photonIdTs_
const std::string outOOTPhotonCores_
long double T
edm::EDGetTokenT< edm::ValueMap< float > > gsfElectronCalibEcalEnergyT_
const edm::EDGetTokenT< EcalRecHitCollection > barrelEcalHits_
const bool applyGsfElectronCalibOnMC_
Definition: Run.h:45
ReducedEGProducer(const edm::ParameterSet &ps)
const edm::EDGetTokenT< reco::ConversionCollection > conversionT_