CMS 3D CMS Logo

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
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

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, const edm::View< reco::GsfElectron > &eles, const std::vector< edm::Handle< pat::PackedCandidateCollection > > &handles, const std::vector< EleTkIsolFromCands::PIDVeto > &pidVetos, const EleTkIsolFromCands &trkIsoCalc)
 
template<typename T >
static edm::Handle< TgetHandle (const edm::Event &iEvent, const edm::EDGetTokenT< T > &token)
 
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_
 
std::vector< DualToken< pat::PackedCandidateCollection > > candTokens_
 
std::vector< EleTkIsolFromCands::PIDVetocandVetosAOD_
 
std::vector< EleTkIsolFromCands::PIDVetocandVetosMiniAOD_
 
DataFormat dataFormat_
 
DualToken< EcalRecHitCollectionebRecHitToken_
 
DualToken< EcalRecHitCollectioneeRecHitToken_
 
DualToken< edm::View< reco::GsfElectron > > eleToken_
 
bool makeTrkIso04_
 
EleTkIsolFromCands trkIso04Calc_
 
EleTkIsolFromCands trkIsoCalc_
 

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<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 32 of file ElectronHEEPIDValueMapProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 175 of file ElectronHEEPIDValueMapProducer.cc.

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

Referenced by ElectronHEEPIDValueMapProducer::DataFormat::operator()().

175  :
176  trkIsoCalc_(iConfig.getParameter<edm::ParameterSet>("trkIsoConfig")),
177  trkIso04Calc_(iConfig.getParameter<edm::ParameterSet>("trkIso04Config")),
178  makeTrkIso04_(iConfig.getParameter<bool>("makeTrkIso04")),
179  dataFormat_(iConfig.getParameter<int>("dataFormat"))
180 {
181  setToken(ebRecHitToken_,iConfig,"ebRecHitsAOD","ebRecHitsMiniAOD",dataFormat_);
182  setToken(eeRecHitToken_,iConfig,"eeRecHitsAOD","eeRecHitsMiniAOD",dataFormat_);
183  setToken(eleToken_,iConfig,"elesAOD","elesMiniAOD",dataFormat_);
184  setToken(candTokens_,iConfig,"candsAOD","candsMiniAOD",dataFormat_);
185  setToken(beamSpotToken_,iConfig,"beamSpot");
186 
187  auto fillVetos=[](const auto& in,auto& out){
188  std::transform(in.begin(),in.end(),std::back_inserter(out),EleTkIsolFromCands::pidVetoFromStr);
189  };
190 
191  fillVetos(iConfig.getParameter<std::vector<std::string> >("candVetosAOD"),candVetosAOD_);
192  if(candVetosAOD_.size()!=iConfig.getParameter<std::vector<edm::InputTag> >("candsAOD").size()){
193  throw cms::Exception("ConfigError") <<" Error candVetosAOD should be the same size as candsAOD "<<std::endl;
194  }
195 
196  fillVetos(iConfig.getParameter<std::vector<std::string> >("candVetosMiniAOD"),candVetosMiniAOD_);
197  if(candVetosMiniAOD_.size()!=iConfig.getParameter<std::vector<edm::InputTag> >("candsMiniAOD").size()){
198  throw cms::Exception("ConfigError") <<" Error candVetosMiniAOD should be the same size as candsMiniAOD "<<std::endl;
199  }
200 
201  produces<edm::ValueMap<float> >(eleTrkPtIsoLabel_);
202  if(makeTrkIso04_) produces<edm::ValueMap<float> >(eleTrkPtIso04Label_);
203  produces<edm::ValueMap<int> >(eleNrSaturateIn5x5Label_);
204 }
size
Write out results.
T getParameter(std::string const &) const
DualToken< EcalRecHitCollection > ebRecHitToken_
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
std::vector< DualToken< pat::PackedCandidateCollection > > candTokens_
std::vector< EleTkIsolFromCands::PIDVeto > candVetosMiniAOD_
DualToken< edm::View< reco::GsfElectron > > eleToken_
DualToken< EcalRecHitCollection > eeRecHitToken_
static PIDVeto pidVetoFromStr(const std::string &vetoStr)
std::vector< EleTkIsolFromCands::PIDVeto > candVetosAOD_
void setToken(edm::EDGetTokenT< T > &token, edm::InputTag tag)
ElectronHEEPIDValueMapProducer::~ElectronHEEPIDValueMapProducer ( )
override

Definition at line 206 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by ElectronHEEPIDValueMapProducer::DataFormat::operator()().

207 {
208 
209 }

Member Function Documentation

float ElectronHEEPIDValueMapProducer::calTrkIso ( const reco::GsfElectron ele,
const edm::View< reco::GsfElectron > &  eles,
const std::vector< edm::Handle< pat::PackedCandidateCollection > > &  handles,
const std::vector< EleTkIsolFromCands::PIDVeto > &  pidVetos,
const EleTkIsolFromCands trkIsoCalc 
)
staticprivate

Definition at line 253 of file ElectronHEEPIDValueMapProducer.cc.

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

Referenced by nrSaturatedCrysIn5x5(), ElectronHEEPIDValueMapProducer::DataFormat::operator()(), and produce().

258 {
259  if(ele.gsfTrack().isNull()) return std::numeric_limits<float>::max();
260  else{
261  float trkIso=0.;
262  for(size_t handleNr=0;handleNr<handles.size();handleNr++){
263  auto& handle = handles[handleNr];
264  if(handle.isValid()){
265  if(handleNr<pidVetos.size()){
266  trkIso+= trkIsoCalc.calIsolPt(*ele.gsfTrack(),*handle,pidVetos[handleNr]);
267  }else{
268  throw cms::Exception("LogicError") <<" somehow the pidVetos and handles do not much, given this is checked at construction time, something has gone wrong in the code handle nr "<<handleNr<<" size of vetos "<<pidVetos.size();
269  }
270  }
271  }
272  return trkIso;
273  }
274 }
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
Definition: GsfElectron.h:186
double calIsolPt(Args &&...args) const
bool isNull() const
Checks for null.
Definition: Ref.h:248
void ElectronHEEPIDValueMapProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 289 of file ElectronHEEPIDValueMapProducer.cc.

References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addDefault(), DEFINE_FWK_MODULE, and EleTkIsolFromCands::pSetDescript().

Referenced by ElectronHEEPIDValueMapProducer::DataFormat::operator()().

289  {
290 
292  desc.add<edm::InputTag>("beamSpot",edm::InputTag("offlineBeamSpot"));
293  desc.add<edm::InputTag>("ebRecHitsAOD",edm::InputTag("reducedEcalRecHitsEB"));
294  desc.add<edm::InputTag>("eeRecHitsAOD",edm::InputTag("reducedEcalRecHitsEE"));
295  desc.add<std::vector<edm::InputTag> >("candsAOD",{edm::InputTag("packedCandidates")});
296  desc.add<std::vector<std::string> >("candVetosAOD",{"none"});
297  desc.add<edm::InputTag>("elesAOD",edm::InputTag("gedGsfElectrons"));
298 
299  desc.add<edm::InputTag>("ebRecHitsMiniAOD",edm::InputTag("reducedEcalRecHitsEB"));
300  desc.add<edm::InputTag>("eeRecHitsMiniAOD",edm::InputTag("reducedEcalRecHitsEE"));
301  desc.add<std::vector<edm::InputTag> >("candsMiniAOD",{edm::InputTag("packedCandidates")});
302  desc.add<std::vector<std::string> >("candVetosMiniAOD",{"none"});
303  desc.add<edm::InputTag>("elesMiniAOD",edm::InputTag("gedGsfElectrons"));
304  desc.add<int>("dataFormat",0);
305  desc.add<bool>("makeTrkIso04",false);
306  desc.add("trkIsoConfig",EleTkIsolFromCands::pSetDescript());
307  desc.add("trkIso04Config",EleTkIsolFromCands::pSetDescript());
308 
309  descriptions.addDefault(desc);
310 }
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 edm::EDGetTokenT< T > &  token 
)
inlinestaticprivate

Definition at line 110 of file ElectronHEEPIDValueMapProducer.cc.

References edm::Event::getByToken(), and cmsBatch::handle.

Referenced by produce().

111  {
113  iEvent.getByToken(token,handle);
114  return handle;
115  }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
template<typename T >
static edm::Handle<T> ElectronHEEPIDValueMapProducer::getHandle ( const edm::Event iEvent,
const DualToken< T > &  token 
)
inlinestaticprivate

Definition at line 117 of file ElectronHEEPIDValueMapProducer.cc.

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

118  {
120  if(!token.aod.isUninitialized()) iEvent.getByToken(token.aod,handle);
121  if(!handle.isValid() && !token.miniAOD.isUninitialized()) iEvent.getByToken(token.miniAOD,handle);
122  return handle;
123  }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
bool isValid() const
Definition: HandleBase.h:74
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 127 of file ElectronHEEPIDValueMapProducer.cc.

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

Referenced by produce().

127  {
128  std::vector<edm::Handle<T> > handles(tokens.size());
129  if(tokens.empty()) return handles;
130  if(!tokens[0].aod.isUninitialized()) iEvent.getByToken(tokens[0].aod,handles[0]);
131  bool isAOD = handles[0].isValid();
132  if(!isAOD && !tokens[0].miniAOD.isUninitialized() ) iEvent.getByToken(tokens[0].miniAOD,handles[0]);
133 
134  for(size_t tokenNr=1;tokenNr<tokens.size();tokenNr++){
135  auto token = isAOD ? tokens[tokenNr].aod : tokens[tokenNr].miniAOD;
136  if(!token.isUninitialized()) iEvent.getByToken(token,handles[tokenNr]);
137  }
138  return handles;
139  }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
template<typename T >
static bool ElectronHEEPIDValueMapProducer::isEventAOD ( const edm::Event iEvent,
const DualToken< T > &  token 
)
inlinestaticprivate

Definition at line 142 of file ElectronHEEPIDValueMapProducer.cc.

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

Referenced by produce().

142  {
144  if(!token.aod.isUninitialized()) iEvent.getByToken(token.aod,handle);
145  if(handle.isValid()) return true;
146  else return false;
147  }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
bool isValid() const
Definition: HandleBase.h:74
int ElectronHEEPIDValueMapProducer::nrSaturatedCrysIn5x5 ( const reco::GsfElectron ele,
edm::Handle< EcalRecHitCollection > &  ebHits,
edm::Handle< EcalRecHitCollection > &  eeHits,
edm::ESHandle< CaloTopology > &  caloTopo 
)
staticprivate

Definition at line 241 of file ElectronHEEPIDValueMapProducer.cc.

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

Referenced by ElectronHEEPIDValueMapProducer::DataFormat::operator()(), and produce().

245 {
246  DetId id = ele.superCluster()->seed()->seed();
247  auto recHits = id.subdetId()==EcalBarrel ? ebHits.product() : eeHits.product();
248  return noZS::EcalClusterTools::nrSaturatedCrysIn5x5(id,recHits,caloTopo.product());
249 
250 }
static int nrSaturatedCrysIn5x5(const DetId &id, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: DetId.h:18
T const * product() const
Definition: Handle.h:74
SuperClusterRef superCluster() const override
reference to a SuperCluster
Definition: GsfElectron.h:185
T const * product() const
Definition: ESHandle.h:86
void ElectronHEEPIDValueMapProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 211 of file ElectronHEEPIDValueMapProducer.cc.

References beamSpotToken_, calTrkIso(), candTokens_, candVetosAOD_, candVetosMiniAOD_, ebRecHitToken_, eeRecHitToken_, eleNrSaturateIn5x5Label_, eleToken_, eleTrkPtIso04Label_, eleTrkPtIsoLabel_, edm::EventSetup::get(), getHandle(), getHandles(), isEventAOD(), makeTrkIso04_, nrSaturatedCrysIn5x5(), trkIso04Calc_, trkIsoCalc_, and writeValueMap().

Referenced by ElectronHEEPIDValueMapProducer::DataFormat::operator()().

212 {
213  auto eleHandle = getHandle(iEvent,eleToken_);
214  auto ebRecHitHandle = getHandle(iEvent,ebRecHitToken_);
215  auto eeRecHitHandle = getHandle(iEvent,eeRecHitToken_);
216  auto beamSpotHandle = getHandle(iEvent,beamSpotToken_);
217  auto candHandles = getHandles(iEvent,candTokens_);
218 
219  bool isAOD = isEventAOD(iEvent,eleToken_);
220  const auto& candVetos = isAOD ? candVetosAOD_ : candVetosMiniAOD_;
221 
222  edm::ESHandle<CaloTopology> caloTopoHandle;
223  iSetup.get<CaloTopologyRecord>().get(caloTopoHandle);
224 
225  std::vector<float> eleTrkPtIso;
226  std::vector<float> eleTrkPtIso04;
227  std::vector<int> eleNrSaturateIn5x5;
228  for(auto const& ele : *eleHandle) {
229  eleTrkPtIso.push_back(calTrkIso(ele,*eleHandle,candHandles,candVetos,trkIsoCalc_));
230  if(makeTrkIso04_){
231  eleTrkPtIso04.push_back(calTrkIso(ele,*eleHandle,candHandles,candVetos,trkIso04Calc_));
232  }
233  eleNrSaturateIn5x5.push_back(nrSaturatedCrysIn5x5(ele,ebRecHitHandle,eeRecHitHandle,caloTopoHandle));
234  }
235 
236  writeValueMap(iEvent,eleHandle,eleTrkPtIso,eleTrkPtIsoLabel_);
237  if(makeTrkIso04_) writeValueMap(iEvent,eleHandle,eleTrkPtIso04,eleTrkPtIso04Label_);
238  writeValueMap(iEvent,eleHandle,eleNrSaturateIn5x5,eleNrSaturateIn5x5Label_);
239 }
DualToken< EcalRecHitCollection > ebRecHitToken_
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
static void writeValueMap(edm::Event &iEvent, const edm::Handle< edm::View< reco::GsfElectron > > &handle, const std::vector< T > &values, const std::string &label)
static int nrSaturatedCrysIn5x5(const reco::GsfElectron &ele, edm::Handle< EcalRecHitCollection > &ebHits, edm::Handle< EcalRecHitCollection > &eeHits, edm::ESHandle< CaloTopology > &caloTopo)
std::vector< DualToken< pat::PackedCandidateCollection > > candTokens_
std::vector< EleTkIsolFromCands::PIDVeto > candVetosMiniAOD_
DualToken< edm::View< reco::GsfElectron > > eleToken_
DualToken< EcalRecHitCollection > eeRecHitToken_
static edm::Handle< T > getHandle(const edm::Event &iEvent, const edm::EDGetTokenT< T > &token)
static std::vector< edm::Handle< T > > getHandles(const edm::Event &iEvent, const std::vector< DualToken< T > > &tokens)
std::vector< EleTkIsolFromCands::PIDVeto > candVetosAOD_
T get() const
Definition: EventSetup.h:71
static float calTrkIso(const reco::GsfElectron &ele, const edm::View< reco::GsfElectron > &eles, const std::vector< edm::Handle< pat::PackedCandidateCollection > > &handles, const std::vector< EleTkIsolFromCands::PIDVeto > &pidVetos, const EleTkIsolFromCands &trkIsoCalc)
static bool isEventAOD(const edm::Event &iEvent, const DualToken< T > &token)
template<typename T >
void ElectronHEEPIDValueMapProducer::setToken ( edm::EDGetTokenT< T > &  token,
edm::InputTag  tag 
)
inlineprivate
template<typename T >
void ElectronHEEPIDValueMapProducer::setToken ( edm::EDGetTokenT< T > &  token,
const edm::ParameterSet iPara,
const std::string &  tag 
)
inlineprivate
template<typename T >
void ElectronHEEPIDValueMapProducer::setToken ( std::vector< edm::EDGetTokenT< T > > &  tokens,
const edm::ParameterSet iPara,
const std::string &  tagName 
)
inlineprivate

Definition at line 79 of file ElectronHEEPIDValueMapProducer.cc.

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

79  {
80  auto tags =iPara.getParameter<std::vector<edm::InputTag> >(tagName);
81  for(auto& tag : tags) {
82  edm::EDGetTokenT<T> token;
83  setToken(token,tag);
84  tokens.push_back(token);
85  }
86  }
T getParameter(std::string const &) const
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 91 of file ElectronHEEPIDValueMapProducer.cc.

References ElectronHEEPIDValueMapProducer::DualToken< T >::aod, edm::ParameterSet::getParameter(), SiStripPI::max, copyPickMerge_cfg::maxSize, ElectronHEEPIDValueMapProducer::DualToken< T >::miniAOD, setToken(), ElectronHEEPIDValueMapProducer::DataFormat::tryAOD(), and ElectronHEEPIDValueMapProducer::DataFormat::tryMiniAOD().

91  {
92  auto tagsAOD =iPara.getParameter<std::vector<edm::InputTag> >(tagAOD);
93  auto tagsMiniAOD =iPara.getParameter<std::vector<edm::InputTag> >(tagMiniAOD);
94  size_t maxSize = std::max(tagsAOD.size(),tagsMiniAOD.size());
95  tokens.clear();
96  tokens.resize(maxSize);
97  if(format.tryAOD()){
98  for(size_t tagNr=0;tagNr<tagsAOD.size();tagNr++) {
99  setToken(tokens[tagNr].aod,tagsAOD[tagNr]);
100  }
101  }
102  if(format.tryMiniAOD()){
103  for(size_t tagNr=0;tagNr<tagsMiniAOD.size();tagNr++) {
104  setToken(tokens[tagNr].miniAOD,tagsMiniAOD[tagNr]);
105  }
106  }
107  }
T getParameter(std::string const &) const
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 277 of file ElectronHEEPIDValueMapProducer.cc.

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

Referenced by ElectronHEEPIDValueMapProducer::DataFormat::operator()(), and produce().

281 {
282  std::unique_ptr<edm::ValueMap<T> > valMap(new edm::ValueMap<T>());
283  typename edm::ValueMap<T>::Filler filler(*valMap);
284  filler.insert(handle, values.begin(), values.end());
285  filler.fill();
286  iEvent.put(std::move(valMap),label);
287 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
char const * label
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

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

Definition at line 155 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by ElectronHEEPIDValueMapProducer(), and produce().

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

Definition at line 154 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by ElectronHEEPIDValueMapProducer(), and produce().

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

Definition at line 161 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by ElectronHEEPIDValueMapProducer(), and produce().

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

Definition at line 162 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by ElectronHEEPIDValueMapProducer(), and produce().

DataFormat ElectronHEEPIDValueMapProducer::dataFormat_
private

Definition at line 160 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by ElectronHEEPIDValueMapProducer().

DualToken<EcalRecHitCollection> ElectronHEEPIDValueMapProducer::ebRecHitToken_
private

Definition at line 151 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by ElectronHEEPIDValueMapProducer(), and produce().

DualToken<EcalRecHitCollection> ElectronHEEPIDValueMapProducer::eeRecHitToken_
private

Definition at line 152 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by ElectronHEEPIDValueMapProducer(), and produce().

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

Definition at line 166 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by ElectronHEEPIDValueMapProducer(), and produce().

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

Definition at line 153 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by ElectronHEEPIDValueMapProducer(), and produce().

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

Definition at line 165 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by ElectronHEEPIDValueMapProducer(), and produce().

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

Definition at line 164 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by ElectronHEEPIDValueMapProducer(), and produce().

bool ElectronHEEPIDValueMapProducer::makeTrkIso04_
private

Definition at line 159 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by ElectronHEEPIDValueMapProducer(), and produce().

EleTkIsolFromCands ElectronHEEPIDValueMapProducer::trkIso04Calc_
private

Definition at line 158 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by produce().

EleTkIsolFromCands ElectronHEEPIDValueMapProducer::trkIsoCalc_
private

Definition at line 157 of file ElectronHEEPIDValueMapProducer.cc.

Referenced by produce().