CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
ElectronHEEPIDValueMapProducer Class Reference
Inheritance diagram for ElectronHEEPIDValueMapProducer:
edm::stream::EDProducer<>

Classes

class  DataFormat
 
struct  DualToken
 

Public Member Functions

 ElectronHEEPIDValueMapProducer (const edm::ParameterSet &)
 
 ~ElectronHEEPIDValueMapProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 
template<typename T >
void setToken (edm::EDGetTokenT< T > &token, edm::InputTag tag)
 
template<typename T >
void setToken (edm::EDGetTokenT< T > &token, const edm::ParameterSet &iPara, const std::string &tag)
 
template<typename T >
void setToken (std::vector< edm::EDGetTokenT< T >> &tokens, const edm::ParameterSet &iPara, const std::string &tagName)
 
template<typename T >
void setToken (DualToken< T > &token, const edm::ParameterSet &iPara, const std::string &tagAOD, const std::string &tagMiniAOD, DataFormat format)
 
template<typename T >
void setToken (std::vector< DualToken< T >> &tokens, const edm::ParameterSet &iPara, const std::string &tagAOD, const std::string &tagMiniAOD, DataFormat format)
 

Static Private Member Functions

static float calTrkIso (const reco::GsfElectron &ele, IsolationCalculators const &isolationCalculators)
 
template<typename T >
static edm::Handle< TgetHandle (const edm::Event &iEvent, const DualToken< T > &token)
 
template<typename T >
static std::vector
< edm::Handle< T > > 
getHandles (const edm::Event &iEvent, const std::vector< DualToken< T >> &tokens)
 
template<typename T >
static bool isEventAOD (const edm::Event &iEvent, const DualToken< T > &token)
 
static int nrSaturatedCrysIn5x5 (const reco::GsfElectron &ele, edm::Handle< EcalRecHitCollection > &ebHits, edm::Handle< EcalRecHitCollection > &eeHits, edm::ESHandle< CaloTopology > &caloTopo)
 
template<typename T >
static void writeValueMap (edm::Event &iEvent, const edm::Handle< edm::View< reco::GsfElectron >> &handle, const std::vector< T > &values, const std::string &label)
 

Private Attributes

edm::EDGetTokenT< reco::BeamSpotbeamSpotToken_
 
edm::ESGetToken< CaloTopology,
CaloTopologyRecord
caloTopoToken_
 
std::vector< DualToken
< pat::PackedCandidateCollection > > 
candTokens_
 
std::vector
< EleTkIsolFromCands::PIDVeto
candVetosAOD_
 
std::vector
< EleTkIsolFromCands::PIDVeto
candVetosMiniAOD_
 
DataFormat dataFormat_
 
DualToken< EcalRecHitCollectionebRecHitToken_
 
DualToken< EcalRecHitCollectioneeRecHitToken_
 
DualToken< edm::View
< reco::GsfElectron > > 
eleToken_
 
bool makeTrkIso04_
 
EleTkIsolFromCands::Configuration trkIso04CalcCfg_
 
EleTkIsolFromCands::Configuration trkIsoCalcCfg_
 

Static Private Attributes

static const std::string eleNrSaturateIn5x5Label_ = "eleNrSaturateIn5x5"
 
static const std::string eleTrkPtIso04Label_ = "eleTrkPtIso04"
 
static const std::string eleTrkPtIsoLabel_ = "eleTrkPtIso"
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 33 of file ElectronHEEPIDValueMapProducer.cc.

Constructor & Destructor Documentation

ElectronHEEPIDValueMapProducer::ElectronHEEPIDValueMapProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 191 of file ElectronHEEPIDValueMapProducer.cc.

References beamSpotToken_, caloTopoToken_, candTokens_, candVetosAOD_, candVetosMiniAOD_, dataFormat_, ebRecHitToken_, eeRecHitToken_, eleNrSaturateIn5x5Label_, eleToken_, eleTrkPtIso04Label_, eleTrkPtIsoLabel_, DeDxTools::esConsumes(), Exception, edm::ParameterSet::getParameter(), recoMuon::in, makeTrkIso04_, submitPVResolutionJobs::out, EleTkIsolFromCands::pidVetoFromStr(), setToken(), findQualityFiles::size, and HcalDetIdTransform::transform().

192  : trkIsoCalcCfg_(iConfig.getParameter<edm::ParameterSet>("trkIsoConfig")),
193  trkIso04CalcCfg_(iConfig.getParameter<edm::ParameterSet>("trkIso04Config")),
194  makeTrkIso04_(iConfig.getParameter<bool>("makeTrkIso04")),
195  dataFormat_(iConfig.getParameter<int>("dataFormat")) {
196  setToken(ebRecHitToken_, iConfig, "ebRecHitsAOD", "ebRecHitsMiniAOD", dataFormat_);
197  setToken(eeRecHitToken_, iConfig, "eeRecHitsAOD", "eeRecHitsMiniAOD", dataFormat_);
198  setToken(eleToken_, iConfig, "elesAOD", "elesMiniAOD", dataFormat_);
199  setToken(candTokens_, iConfig, "candsAOD", "candsMiniAOD", dataFormat_);
200  setToken(beamSpotToken_, iConfig, "beamSpot");
202 
203  auto fillVetos = [](const auto& in, auto& out) {
204  std::transform(in.begin(), in.end(), std::back_inserter(out), EleTkIsolFromCands::pidVetoFromStr);
205  };
206 
207  fillVetos(iConfig.getParameter<std::vector<std::string>>("candVetosAOD"), candVetosAOD_);
208  if (candVetosAOD_.size() != iConfig.getParameter<std::vector<edm::InputTag>>("candsAOD").size()) {
209  throw cms::Exception("ConfigError") << " Error candVetosAOD should be the same size as candsAOD " << std::endl;
210  }
211 
212  fillVetos(iConfig.getParameter<std::vector<std::string>>("candVetosMiniAOD"), candVetosMiniAOD_);
213  if (candVetosMiniAOD_.size() != iConfig.getParameter<std::vector<edm::InputTag>>("candsMiniAOD").size()) {
214  throw cms::Exception("ConfigError") << " Error candVetosMiniAOD should be the same size as candsMiniAOD "
215  << std::endl;
216  }
217 
218  produces<edm::ValueMap<float>>(eleTrkPtIsoLabel_);
219  if (makeTrkIso04_)
220  produces<edm::ValueMap<float>>(eleTrkPtIso04Label_);
221  produces<edm::ValueMap<int>>(eleNrSaturateIn5x5Label_);
222 }
DualToken< EcalRecHitCollection > ebRecHitToken_
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
std::vector< DualToken< pat::PackedCandidateCollection > > candTokens_
std::vector< EleTkIsolFromCands::PIDVeto > candVetosMiniAOD_
edm::ESGetToken< CaloTopology, CaloTopologyRecord > caloTopoToken_
DualToken< edm::View< reco::GsfElectron > > eleToken_
DualToken< EcalRecHitCollection > eeRecHitToken_
static PIDVeto pidVetoFromStr(const std::string &vetoStr)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::vector< EleTkIsolFromCands::PIDVeto > candVetosAOD_
EleTkIsolFromCands::Configuration trkIso04CalcCfg_
void setToken(edm::EDGetTokenT< T > &token, edm::InputTag tag)
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
tuple size
Write out results.
EleTkIsolFromCands::Configuration trkIsoCalcCfg_
unsigned transform(const HcalDetId &id, unsigned transformCode)
ElectronHEEPIDValueMapProducer::~ElectronHEEPIDValueMapProducer ( )
override

Definition at line 224 of file ElectronHEEPIDValueMapProducer.cc.

224 {}

Member Function Documentation

float ElectronHEEPIDValueMapProducer::calTrkIso ( const reco::GsfElectron ele,
IsolationCalculators const &  isolationCalculators 
)
staticprivate

Definition at line 280 of file ElectronHEEPIDValueMapProducer.cc.

References reco::GsfElectron::gsfTrack(), edm::Ref< C, T, F >::isNull(), and SiStripPI::max.

Referenced by produce().

281  {
282  if (ele.gsfTrack().isNull()) {
284  }
285 
286  float trkIso = 0.;
287  for (auto& calculator : isolationCalculators) {
288  trkIso += (*calculator)(*ele.gsfTrack()).ptSum;
289  }
290  return trkIso;
291 }
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
Definition: GsfElectron.h:156
bool isNull() const
Checks for null.
Definition: Ref.h:235
void ElectronHEEPIDValueMapProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 305 of file ElectronHEEPIDValueMapProducer.cc.

References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addDefault(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, and EleTkIsolFromCands::pSetDescript().

305  {
307  desc.add<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot"));
308  desc.add<edm::InputTag>("ebRecHitsAOD", edm::InputTag("reducedEcalRecHitsEB"));
309  desc.add<edm::InputTag>("eeRecHitsAOD", edm::InputTag("reducedEcalRecHitsEE"));
310  desc.add<std::vector<edm::InputTag>>("candsAOD", {edm::InputTag("packedCandidates")});
311  desc.add<std::vector<std::string>>("candVetosAOD", {"none"});
312  desc.add<edm::InputTag>("elesAOD", edm::InputTag("gedGsfElectrons"));
313 
314  desc.add<edm::InputTag>("ebRecHitsMiniAOD", edm::InputTag("reducedEcalRecHitsEB"));
315  desc.add<edm::InputTag>("eeRecHitsMiniAOD", edm::InputTag("reducedEcalRecHitsEE"));
316  desc.add<std::vector<edm::InputTag>>("candsMiniAOD", {edm::InputTag("packedCandidates")});
317  desc.add<std::vector<std::string>>("candVetosMiniAOD", {"none"});
318  desc.add<edm::InputTag>("elesMiniAOD", edm::InputTag("gedGsfElectrons"));
319  desc.add<int>("dataFormat", 0);
320  desc.add<bool>("makeTrkIso04", false);
321  desc.add("trkIsoConfig", EleTkIsolFromCands::pSetDescript());
322  desc.add("trkIso04Config", EleTkIsolFromCands::pSetDescript());
323 
324  descriptions.addDefault(desc);
325 }
void addDefault(ParameterSetDescription const &psetDescription)
static edm::ParameterSetDescription pSetDescript()
ParameterDescriptionBase * add(U const &iLabel, T const &value)
template<typename T >
static edm::Handle<T> ElectronHEEPIDValueMapProducer::getHandle ( const edm::Event iEvent,
const DualToken< T > &  token 
)
inlinestaticprivate

Definition at line 129 of file ElectronHEEPIDValueMapProducer.cc.

References ElectronHEEPIDValueMapProducer::DualToken< T >::aod, edm::Event::getByToken(), patZpeak::handle, edm::HandleBase::isValid(), and ElectronHEEPIDValueMapProducer::DualToken< T >::miniAOD.

Referenced by produce().

129  {
131  if (!token.aod.isUninitialized())
132  iEvent.getByToken(token.aod, handle);
133  if (!handle.isValid() && !token.miniAOD.isUninitialized())
134  iEvent.getByToken(token.miniAOD, handle);
135  return handle;
136  }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
tuple handle
Definition: patZpeak.py:23
bool isValid() const
Definition: HandleBase.h:70
template<typename T >
static std::vector<edm::Handle<T> > ElectronHEEPIDValueMapProducer::getHandles ( const edm::Event iEvent,
const std::vector< DualToken< T >> &  tokens 
)
inlinestaticprivate

Definition at line 139 of file ElectronHEEPIDValueMapProducer.cc.

References edm::Event::getByToken(), PAT_cff::miniAOD, and unpackBuffers-CaloStage2::token.

Referenced by produce().

139  {
140  std::vector<edm::Handle<T>> handles(tokens.size());
141  if (tokens.empty())
142  return handles;
143  if (!tokens[0].aod.isUninitialized())
144  iEvent.getByToken(tokens[0].aod, handles[0]);
145  bool isAOD = handles[0].isValid();
146  if (!isAOD && !tokens[0].miniAOD.isUninitialized())
147  iEvent.getByToken(tokens[0].miniAOD, handles[0]);
148 
149  for (size_t tokenNr = 1; tokenNr < tokens.size(); tokenNr++) {
150  auto token = isAOD ? tokens[tokenNr].aod : tokens[tokenNr].miniAOD;
151  if (!token.isUninitialized())
152  iEvent.getByToken(token, handles[tokenNr]);
153  }
154  return handles;
155  }
tuple miniAOD
Definition: PAT_cff.py:15
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
std::vector< BaseVolumeHandle * > handles
template<typename T >
static bool ElectronHEEPIDValueMapProducer::isEventAOD ( const edm::Event iEvent,
const DualToken< T > &  token 
)
inlinestaticprivate

Definition at line 158 of file ElectronHEEPIDValueMapProducer.cc.

References ElectronHEEPIDValueMapProducer::DualToken< T >::aod, edm::Event::getByToken(), patZpeak::handle, and edm::HandleBase::isValid().

Referenced by produce().

158  {
160  if (!token.aod.isUninitialized())
161  iEvent.getByToken(token.aod, handle);
162  if (handle.isValid())
163  return true;
164  else
165  return false;
166  }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
tuple handle
Definition: patZpeak.py:23
bool isValid() const
Definition: HandleBase.h:70
int ElectronHEEPIDValueMapProducer::nrSaturatedCrysIn5x5 ( const reco::GsfElectron ele,
edm::Handle< EcalRecHitCollection > &  ebHits,
edm::Handle< EcalRecHitCollection > &  eeHits,
edm::ESHandle< CaloTopology > &  caloTopo 
)
staticprivate

Definition at line 271 of file ElectronHEEPIDValueMapProducer.cc.

References EcalBarrel, EcalClusterToolsT< noZS >::nrSaturatedCrysIn5x5(), edm::Handle< T >::product(), edm::ESHandle< class >::product(), HLT_FULL_cff::recHits, and reco::GsfElectron::superCluster().

Referenced by produce().

274  {
275  DetId id = ele.superCluster()->seed()->seed();
276  auto recHits = id.subdetId() == EcalBarrel ? ebHits.product() : eeHits.product();
278 }
static int nrSaturatedCrysIn5x5(const DetId &id, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: DetId.h:17
T const * product() const
Definition: Handle.h:70
T const * product() const
Definition: ESHandle.h:86
SuperClusterRef superCluster() const override
reference to a SuperCluster
Definition: GsfElectron.h:155
void ElectronHEEPIDValueMapProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 226 of file ElectronHEEPIDValueMapProducer.cc.

References beamSpotToken_, caloTopoToken_, calTrkIso(), candTokens_, candVetosAOD_, candVetosMiniAOD_, ebRecHitToken_, eeRecHitToken_, eleNrSaturateIn5x5Label_, eleToken_, eleTrkPtIso04Label_, eleTrkPtIsoLabel_, getHandle(), edm::EventSetup::getHandle(), edm::Event::getHandle(), getHandles(), patZpeak::handle, isEventAOD(), makeTrkIso04_, nrSaturatedCrysIn5x5(), trkIso04CalcCfg_, trkIsoCalcCfg_, and writeValueMap().

226  {
227  auto eleHandle = getHandle(iEvent, eleToken_);
228  auto ebRecHitHandle = getHandle(iEvent, ebRecHitToken_);
229  auto eeRecHitHandle = getHandle(iEvent, eeRecHitToken_);
230  auto beamSpotHandle = iEvent.getHandle(beamSpotToken_);
231 
232  bool isAOD = isEventAOD(iEvent, eleToken_);
233  const auto& candVetos = isAOD ? candVetosAOD_ : candVetosMiniAOD_;
234 
235  IsolationCalculators trkIsoCalcs;
236  IsolationCalculators trkIso04Calcs;
237 
238  {
239  int handleNr = 0;
240  for (auto const& handle : getHandles(iEvent, candTokens_)) {
241  if (handle.isValid()) {
242  trkIsoCalcs.emplace_back(std::make_unique<EleTkIsolFromCands>(trkIsoCalcCfg_, *handle, candVetos[handleNr]));
243  if (makeTrkIso04_) {
244  trkIso04Calcs.emplace_back(
245  std::make_unique<EleTkIsolFromCands>(trkIso04CalcCfg_, *handle, candVetos[handleNr]));
246  }
247  }
248  ++handleNr;
249  }
250  }
251 
252  edm::ESHandle<CaloTopology> caloTopoHandle = iSetup.getHandle(caloTopoToken_);
253 
254  std::vector<float> eleTrkPtIso;
255  std::vector<float> eleTrkPtIso04;
256  std::vector<int> eleNrSaturateIn5x5;
257  for (auto const& ele : *eleHandle) {
258  eleTrkPtIso.push_back(calTrkIso(ele, trkIsoCalcs));
259  if (makeTrkIso04_) {
260  eleTrkPtIso04.push_back(calTrkIso(ele, trkIso04Calcs));
261  }
262  eleNrSaturateIn5x5.push_back(nrSaturatedCrysIn5x5(ele, ebRecHitHandle, eeRecHitHandle, caloTopoHandle));
263  }
264 
265  writeValueMap(iEvent, eleHandle, eleTrkPtIso, eleTrkPtIsoLabel_);
266  if (makeTrkIso04_)
267  writeValueMap(iEvent, eleHandle, eleTrkPtIso04, eleTrkPtIso04Label_);
268  writeValueMap(iEvent, eleHandle, eleNrSaturateIn5x5, eleNrSaturateIn5x5Label_);
269 }
DualToken< EcalRecHitCollection > ebRecHitToken_
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
static int nrSaturatedCrysIn5x5(const reco::GsfElectron &ele, edm::Handle< EcalRecHitCollection > &ebHits, edm::Handle< EcalRecHitCollection > &eeHits, edm::ESHandle< CaloTopology > &caloTopo)
std::vector< std::unique_ptr< EleTkIsolFromCands >> IsolationCalculators
std::vector< DualToken< pat::PackedCandidateCollection > > candTokens_
static edm::Handle< T > getHandle(const edm::Event &iEvent, const DualToken< T > &token)
static float calTrkIso(const reco::GsfElectron &ele, IsolationCalculators const &isolationCalculators)
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
Definition: Event.h:563
std::vector< EleTkIsolFromCands::PIDVeto > candVetosMiniAOD_
edm::ESGetToken< CaloTopology, CaloTopologyRecord > caloTopoToken_
static std::vector< edm::Handle< T > > getHandles(const edm::Event &iEvent, const std::vector< DualToken< T >> &tokens)
DualToken< edm::View< reco::GsfElectron > > eleToken_
tuple handle
Definition: patZpeak.py:23
DualToken< EcalRecHitCollection > eeRecHitToken_
static void writeValueMap(edm::Event &iEvent, const edm::Handle< edm::View< reco::GsfElectron >> &handle, const std::vector< T > &values, const std::string &label)
std::vector< EleTkIsolFromCands::PIDVeto > candVetosAOD_
EleTkIsolFromCands::Configuration trkIso04CalcCfg_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:157
static bool isEventAOD(const edm::Event &iEvent, const DualToken< T > &token)
EleTkIsolFromCands::Configuration trkIsoCalcCfg_
template<typename T >
void ElectronHEEPIDValueMapProducer::setToken ( edm::EDGetTokenT< T > &  token,
edm::InputTag  tag 
)
inlineprivate

Definition at line 78 of file ElectronHEEPIDValueMapProducer.cc.

References GlobalPosition_Frontier_DevDB_cff::tag.

Referenced by ElectronHEEPIDValueMapProducer(), and setToken().

78  {
79  token = consumes<T>(tag);
80  }
template<typename T >
void ElectronHEEPIDValueMapProducer::setToken ( edm::EDGetTokenT< T > &  token,
const edm::ParameterSet iPara,
const std::string &  tag 
)
inlineprivate

Definition at line 82 of file ElectronHEEPIDValueMapProducer.cc.

References edm::ParameterSet::getParameter(), and GlobalPosition_Frontier_DevDB_cff::tag.

82  {
83  token = consumes<T>(iPara.getParameter<edm::InputTag>(tag));
84  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
template<typename T >
void ElectronHEEPIDValueMapProducer::setToken ( std::vector< edm::EDGetTokenT< T >> &  tokens,
const edm::ParameterSet iPara,
const std::string &  tagName 
)
inlineprivate

Definition at line 86 of file ElectronHEEPIDValueMapProducer.cc.

References edm::ParameterSet::getParameter(), setToken(), GlobalPosition_Frontier_DevDB_cff::tag, getPayloadData::tags, and unpackBuffers-CaloStage2::token.

86  {
87  auto tags = iPara.getParameter<std::vector<edm::InputTag>>(tagName);
88  for (auto& tag : tags) {
90  setToken(token, tag);
91  tokens.push_back(token);
92  }
93  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
void setToken(edm::EDGetTokenT< T > &token, edm::InputTag tag)
template<typename T >
void ElectronHEEPIDValueMapProducer::setToken ( DualToken< T > &  token,
const edm::ParameterSet iPara,
const std::string &  tagAOD,
const std::string &  tagMiniAOD,
DataFormat  format 
)
inlineprivate
template<typename T >
void ElectronHEEPIDValueMapProducer::setToken ( std::vector< DualToken< T >> &  tokens,
const edm::ParameterSet iPara,
const std::string &  tagAOD,
const std::string &  tagMiniAOD,
DataFormat  format 
)
inlineprivate

Definition at line 106 of file ElectronHEEPIDValueMapProducer.cc.

References edm::ParameterSet::getParameter(), SiStripPI::max, reco_skim_cfg_mod::maxSize, PAT_cff::miniAOD, setToken(), ElectronHEEPIDValueMapProducer::DataFormat::tryAOD(), and ElectronHEEPIDValueMapProducer::DataFormat::tryMiniAOD().

110  {
111  auto tagsAOD = iPara.getParameter<std::vector<edm::InputTag>>(tagAOD);
112  auto tagsMiniAOD = iPara.getParameter<std::vector<edm::InputTag>>(tagMiniAOD);
113  size_t maxSize = std::max(tagsAOD.size(), tagsMiniAOD.size());
114  tokens.clear();
115  tokens.resize(maxSize);
116  if (format.tryAOD()) {
117  for (size_t tagNr = 0; tagNr < tagsAOD.size(); tagNr++) {
118  setToken(tokens[tagNr].aod, tagsAOD[tagNr]);
119  }
120  }
121  if (format.tryMiniAOD()) {
122  for (size_t tagNr = 0; tagNr < tagsMiniAOD.size(); tagNr++) {
123  setToken(tokens[tagNr].miniAOD, tagsMiniAOD[tagNr]);
124  }
125  }
126  }
tuple miniAOD
Definition: PAT_cff.py:15
tuple maxSize
&#39;/store/data/Commissioning08/BeamHalo/RECO/StuffAlmostToP5_v1/000/061/642/10A0FE34-A67D-DD11-AD05-000...
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
void setToken(edm::EDGetTokenT< T > &token, edm::InputTag tag)
template<typename T >
void ElectronHEEPIDValueMapProducer::writeValueMap ( edm::Event iEvent,
const edm::Handle< edm::View< reco::GsfElectron >> &  handle,
const std::vector< T > &  values,
const std::string &  label 
)
staticprivate

Definition at line 294 of file ElectronHEEPIDValueMapProducer.cc.

References edm::helper::Filler< Map >::fill(), patZpeak::handle, edm::helper::Filler< Map >::insert(), eostools::move(), and edm::Event::put().

Referenced by produce().

297  {
298  std::unique_ptr<edm::ValueMap<T>> valMap(new edm::ValueMap<T>());
299  typename edm::ValueMap<T>::Filler filler(*valMap);
300  filler.insert(handle, values.begin(), values.end());
301  filler.fill();
302  iEvent.put(std::move(valMap), label);
303 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
char const * label
def move
Definition: eostools.py:511

Member Data Documentation

edm::EDGetTokenT<reco::BeamSpot> ElectronHEEPIDValueMapProducer::beamSpotToken_
private

Definition at line 172 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by ElectronHEEPIDValueMapProducer(), and produce().

edm::ESGetToken<CaloTopology, CaloTopologyRecord> ElectronHEEPIDValueMapProducer::caloTopoToken_
private

Definition at line 173 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by ElectronHEEPIDValueMapProducer(), and produce().

std::vector<DualToken<pat::PackedCandidateCollection> > ElectronHEEPIDValueMapProducer::candTokens_
private

Definition at line 171 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by ElectronHEEPIDValueMapProducer(), and produce().

std::vector<EleTkIsolFromCands::PIDVeto> ElectronHEEPIDValueMapProducer::candVetosAOD_
private

Definition at line 179 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by ElectronHEEPIDValueMapProducer(), and produce().

std::vector<EleTkIsolFromCands::PIDVeto> ElectronHEEPIDValueMapProducer::candVetosMiniAOD_
private

Definition at line 180 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by ElectronHEEPIDValueMapProducer(), and produce().

DataFormat ElectronHEEPIDValueMapProducer::dataFormat_
private

Definition at line 178 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by ElectronHEEPIDValueMapProducer().

DualToken<EcalRecHitCollection> ElectronHEEPIDValueMapProducer::ebRecHitToken_
private

Definition at line 168 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by ElectronHEEPIDValueMapProducer(), and produce().

DualToken<EcalRecHitCollection> ElectronHEEPIDValueMapProducer::eeRecHitToken_
private

Definition at line 169 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by ElectronHEEPIDValueMapProducer(), and produce().

const std::string ElectronHEEPIDValueMapProducer::eleNrSaturateIn5x5Label_ = "eleNrSaturateIn5x5"
staticprivate

Definition at line 184 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by ElectronHEEPIDValueMapProducer(), and produce().

DualToken<edm::View<reco::GsfElectron> > ElectronHEEPIDValueMapProducer::eleToken_
private

Definition at line 170 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by ElectronHEEPIDValueMapProducer(), and produce().

const std::string ElectronHEEPIDValueMapProducer::eleTrkPtIso04Label_ = "eleTrkPtIso04"
staticprivate

Definition at line 183 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by ElectronHEEPIDValueMapProducer(), and produce().

const std::string ElectronHEEPIDValueMapProducer::eleTrkPtIsoLabel_ = "eleTrkPtIso"
staticprivate

Definition at line 182 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by ElectronHEEPIDValueMapProducer(), and produce().

bool ElectronHEEPIDValueMapProducer::makeTrkIso04_
private

Definition at line 177 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by ElectronHEEPIDValueMapProducer(), and produce().

EleTkIsolFromCands::Configuration ElectronHEEPIDValueMapProducer::trkIso04CalcCfg_
private

Definition at line 176 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by produce().

EleTkIsolFromCands::Configuration ElectronHEEPIDValueMapProducer::trkIsoCalcCfg_
private

Definition at line 175 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by produce().