CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes
MuIsolatorResultProducer< BT > Class Template Reference

BT == base type. More...

#include <MuIsolatorResultProducer.h>

Inheritance diagram for MuIsolatorResultProducer< BT >:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Classes

struct  DepositConf
 
struct  VetoCuts
 

Public Member Functions

 MuIsolatorResultProducer (const edm::ParameterSet &)
 constructor with config More...
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~MuIsolatorResultProducer () override
 destructor More...
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Types

typedef muisorhelper::CandMap< BT > CandMap
 
typedef muisorhelper::DepositContainer DepositContainer
 
typedef muisorhelper::Isolator Isolator
 
typedef muisorhelper::Result Result
 
typedef muisorhelper::Results Results
 
typedef muisorhelper::ResultType ResultType
 

Private Member Functions

void callWhatProduces ()
 declare what's going to be produced More...
 
unsigned int initAssociation (edm::Event &event, CandMap &candMapT) const
 
void initVetos (std::vector< reco::IsoDeposit::Vetos * > &vetos, CandMap &candMap) const
 
void writeOut (edm::Event &event, const CandMap &candMap, const Results &results) const
 choose which result type to write here More...
 
template<typename RT >
void writeOutImpl (edm::Event &event, const CandMap &candMapT, const Results &results) const
 actually do the writing here More...
 

Private Attributes

reco::TrackBase::Point theBeam
 
std::string theBeamlineOption
 beam spot More...
 
edm::InputTag theBeamSpotLabel
 
edm::ParameterSet theConfig
 
std::vector< DepositConftheDepositConfs
 
IsolatortheIsolator
 the isolator More...
 
bool theRemoveOtherVetos
 choose which muon vetos should be removed from all deposits More...
 
ResultType theResultType
 
VetoCuts theVetoCuts
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

template<typename BT = reco::Candidate>
class MuIsolatorResultProducer< BT >

BT == base type.

Definition at line 53 of file MuIsolatorResultProducer.h.

Member Typedef Documentation

◆ CandMap

template<typename BT = reco::Candidate>
typedef muisorhelper::CandMap<BT> MuIsolatorResultProducer< BT >::CandMap
private

Definition at line 68 of file MuIsolatorResultProducer.h.

◆ DepositContainer

template<typename BT = reco::Candidate>
typedef muisorhelper::DepositContainer MuIsolatorResultProducer< BT >::DepositContainer
private

Definition at line 66 of file MuIsolatorResultProducer.h.

◆ Isolator

template<typename BT = reco::Candidate>
typedef muisorhelper::Isolator MuIsolatorResultProducer< BT >::Isolator
private

Definition at line 62 of file MuIsolatorResultProducer.h.

◆ Result

template<typename BT = reco::Candidate>
typedef muisorhelper::Result MuIsolatorResultProducer< BT >::Result
private

Definition at line 63 of file MuIsolatorResultProducer.h.

◆ Results

template<typename BT = reco::Candidate>
typedef muisorhelper::Results MuIsolatorResultProducer< BT >::Results
private

Definition at line 65 of file MuIsolatorResultProducer.h.

◆ ResultType

template<typename BT = reco::Candidate>
typedef muisorhelper::ResultType MuIsolatorResultProducer< BT >::ResultType
private

Definition at line 64 of file MuIsolatorResultProducer.h.

Constructor & Destructor Documentation

◆ MuIsolatorResultProducer()

template<typename BT >
MuIsolatorResultProducer< BT >::MuIsolatorResultProducer ( const edm::ParameterSet par)

constructor with config

read input config for deposit types and weights and thresholds to apply to them

will switch to a factory at some point

FIXME

FIXME: need to get the file name here

"other vetoes" is limited to the same collection now for non-trivial choice an external map with pre-made selection flags can be a better choice

Definition at line 186 of file MuIsolatorResultProducer.h.

187  : theConfig(par),
188  theRemoveOtherVetos(par.getParameter<bool>("RemoveOtherVetos")),
189  theIsolator(nullptr),
190  theBeam(0, 0, 0) {
191  LogDebug("RecoMuon|MuonIsolation") << " MuIsolatorResultProducer CTOR";
192 
194  std::vector<edm::ParameterSet> depositInputs = par.getParameter<std::vector<edm::ParameterSet>>("InputMuIsoDeposits");
195 
196  std::vector<double> dWeights(depositInputs.size());
197  std::vector<double> dThresholds(depositInputs.size());
198 
199  for (unsigned int iDep = 0; iDep < depositInputs.size(); ++iDep) {
200  DepositConf dConf;
201  dConf.tag = depositInputs[iDep].getParameter<edm::InputTag>("DepositTag");
202  dConf.weight = depositInputs[iDep].getParameter<double>("DepositWeight");
203  dConf.threshold = depositInputs[iDep].getParameter<double>("DepositThreshold");
204 
205  dWeights[iDep] = dConf.weight;
206  dThresholds[iDep] = dConf.threshold;
207 
208  theDepositConfs.push_back(dConf);
209  }
210 
211  edm::ParameterSet isoPset = par.getParameter<edm::ParameterSet>("IsolatorPSet");
213  std::string isolatorType = isoPset.getParameter<std::string>("ComponentName");
214  if (isolatorType == "IsolatorByDeposit") {
215  std::string coneSizeType = isoPset.getParameter<std::string>("ConeSizeType");
216  if (coneSizeType == "FixedConeSize") {
217  float coneSize(isoPset.getParameter<double>("coneSize"));
218 
219  theIsolator = new muonisolation::IsolatorByDeposit(coneSize, dWeights, dThresholds);
220 
221  // theIsolator = new IsolatorByDeposit(isoPset);
222  } else if (coneSizeType == "CutsConeSize") {
224  // Cuts cuts(isoPset.getParameter<edm::ParameterSet>("CutsPSet"));
225 
226  // theIsolator = new IsolatorByDeposit(coneSize, dWeights, dThresholds);
227  }
228  } else if (isolatorType == "IsolatorByNominalEfficiency") {
230  theIsolator =
231  new muonisolation::IsolatorByNominalEfficiency("noname", std::vector<std::string>(1, "8:0.97"), dWeights);
232  } else if (isolatorType == "IsolatorByDepositCount") {
233  std::string coneSizeType = isoPset.getParameter<std::string>("ConeSizeType");
234  if (coneSizeType == "FixedConeSize") {
235  float coneSize(isoPset.getParameter<double>("coneSize"));
236 
238 
239  // theIsolator = new IsolatorByDeposit(isoPset);
240  } else if (coneSizeType == "CutsConeSize") {
241  // Cuts cuts(isoPset.getParameter<edm::ParameterSet>("CutsPSet"));
242 
243  // theIsolator = new IsolatorByDeposit(coneSize, dWeights, dThresholds);
244  }
245  }
246 
247  if (theIsolator == nullptr) {
248  edm::LogError("MuonIsolationProducers") << "Failed to initialize an isolator";
249  }
251 
253 
254  if (theRemoveOtherVetos) {
255  edm::ParameterSet vetoPSet = par.getParameter<edm::ParameterSet>("VetoPSet");
256  theVetoCuts.selectAll = vetoPSet.getParameter<bool>("SelectAll");
257 
261  if (!theVetoCuts.selectAll) {
262  theVetoCuts.muAbsEtaMax = vetoPSet.getParameter<double>("MuAbsEtaMax");
263  theVetoCuts.muPtMin = vetoPSet.getParameter<double>("MuPtMin");
264  theVetoCuts.muAbsZMax = vetoPSet.getParameter<double>("MuAbsZMax");
265  theVetoCuts.muD0Max = vetoPSet.getParameter<double>("MuD0Max");
266  theBeamlineOption = par.getParameter<std::string>("BeamlineOption");
267  theBeamSpotLabel = par.getParameter<edm::InputTag>("BeamSpotLabel");
268  }
269  }
270 }

References MuIsolatorResultProducer< BT >::callWhatProduces(), HLT_2018_cff::coneSize, edm::ParameterSet::getParameter(), LogDebug, MuIsolatorResultProducer< BT >::VetoCuts::muAbsEtaMax, MuIsolatorResultProducer< BT >::VetoCuts::muAbsZMax, MuIsolatorResultProducer< BT >::VetoCuts::muD0Max, MuIsolatorResultProducer< BT >::VetoCuts::muPtMin, muonisolation::MuIsoBaseIsolator::resultType(), MuIsolatorResultProducer< BT >::VetoCuts::selectAll, AlCaHLTBitMon_QueryRunRegistry::string, MuIsolatorResultProducer< BT >::DepositConf::tag, MuIsolatorResultProducer< BT >::theBeamlineOption, MuIsolatorResultProducer< BT >::theBeamSpotLabel, MuIsolatorResultProducer< BT >::theDepositConfs, MuIsolatorResultProducer< BT >::theIsolator, MuIsolatorResultProducer< BT >::theRemoveOtherVetos, MuIsolatorResultProducer< BT >::theResultType, MuIsolatorResultProducer< BT >::theVetoCuts, MuIsolatorResultProducer< BT >::DepositConf::threshold, and MuIsolatorResultProducer< BT >::DepositConf::weight.

◆ ~MuIsolatorResultProducer()

template<typename BT >
MuIsolatorResultProducer< BT >::~MuIsolatorResultProducer ( )
override

destructor

Definition at line 274 of file MuIsolatorResultProducer.h.

274  {
275  if (theIsolator)
276  delete theIsolator;
277  LogDebug("RecoMuon|MuIsolatorResultProducer") << " MuIsolatorResultProducer DTOR";
278 }

References LogDebug.

Member Function Documentation

◆ callWhatProduces()

template<typename BT >
void MuIsolatorResultProducer< BT >::callWhatProduces ( )
inlineprivate

declare what's going to be produced

Definition at line 152 of file MuIsolatorResultProducer.h.

152  {
154  produces<edm::ValueMap<float>>();
156  produces<edm::ValueMap<int>>();
158  produces<edm::ValueMap<bool>>();
159 }

Referenced by MuIsolatorResultProducer< BT >::MuIsolatorResultProducer().

◆ initAssociation()

template<typename BT >
unsigned int MuIsolatorResultProducer< BT >::initAssociation ( edm::Event event,
CandMap candMapT 
) const
private

WARNING: the input ValueMaps are better be for a single key product ID no effort is done (FIXME) for more complex cases

init {muon, {[deposit,veto]_type}} container

Definition at line 348 of file MuIsolatorResultProducer.h.

348  {
349  std::string metname = "RecoMuon|MuonIsolationProducers";
350 
352 
353  for (unsigned int iMap = 0; iMap < theDepositConfs.size(); ++iMap) {
355  event.getByLabel(theDepositConfs[iMap].tag, depH);
356  LogDebug(metname) << "Got Deposits of size " << depH->size();
357  if (depH->empty())
358  continue;
359 
362  typename CandMap::handle_type keyH;
363  event.get(depH->begin().id(), keyH);
364  candMapT.setHandle(keyH);
365  typename CT::const_iterator depHCI = depH->begin().begin();
366  typename CT::const_iterator depEnd = depH->begin().end();
367  unsigned int keyI = 0;
368  for (; depHCI != depEnd; ++depHCI, ++keyI) {
369  typename CandMap::key_type muPtr(keyH->refAt(keyI));
371  if (iMap == 0)
372  candMapT.get().push_back(typename CandMap::pair_type(muPtr, DepositContainer(theDepositConfs.size())));
373  typename CandMap::iterator muI = candMapT.get().begin();
374  for (; muI != candMapT.get().end(); ++muI) {
375  if (muI->first == muPtr)
376  break;
377  }
378  if (muI->first != muPtr) {
379  edm::LogError("MuonIsolationProducers") << "Failed to align muon map";
380  }
381  muI->second[iMap].dep = &*depHCI;
382  }
383  }
384 
385  LogDebug(metname) << "Picked and aligned nDeps = " << candMapT.get().size();
386  return candMapT.get().size();
387 }

References edm::ValueMap< T >::const_iterator::begin(), edm::ValueMap< T >::begin(), edm::ValueMap< T >::empty(), edm::ValueMap< T >::const_iterator::end(), muisorhelper::CandMap< BT >::get(), edm::ValueMap< T >::const_iterator::id(), LogDebug, metname, muisorhelper::CandMap< BT >::setHandle(), edm::ValueMap< T >::size(), AlCaHLTBitMon_QueryRunRegistry::string, and GlobalPosition_Frontier_DevDB_cff::tag.

◆ initVetos()

template<typename BT >
void MuIsolatorResultProducer< BT >::initVetos ( std::vector< reco::IsoDeposit::Vetos * > &  vetos,
CandMap candMap 
) const
private

Definition at line 390 of file MuIsolatorResultProducer.h.

390  {
391  std::string metname = "RecoMuon|MuonIsolationProducers";
392 
393  if (theRemoveOtherVetos) {
394  LogDebug(metname) << "Start checking for vetos based on input/expected vetos.size of " << vetos.size()
395  << " passed at " << &vetos << " and an input map.size of " << candMapT.get().size();
396 
397  unsigned int muI = 0;
398  for (; muI < candMapT.get().size(); ++muI) {
399  typename CandMap::key_type mu = candMapT.get()[muI].first;
400  double d0 = ((mu->vx() - theBeam.x()) * mu->py() - (mu->vy() - theBeam.y()) * mu->px()) / mu->pt();
401  LogDebug(metname) << "Muon at index " << muI;
402  if (theVetoCuts.selectAll || (fabs(mu->eta()) < theVetoCuts.muAbsEtaMax && mu->pt() > theVetoCuts.muPtMin &&
403  fabs(mu->vz()) < theVetoCuts.muAbsZMax && fabs(d0) < theVetoCuts.muD0Max)) {
404  LogDebug(metname) << "muon passes the cuts";
405  for (unsigned int iDep = 0; iDep < candMapT.get()[muI].second.size(); ++iDep) {
406  if (vetos[iDep] == nullptr)
407  vetos[iDep] = new reco::IsoDeposit::Vetos();
408 
409  vetos[iDep]->push_back(candMapT.get()[muI].second[iDep].dep->veto());
410  }
411  }
412  }
413 
414  LogDebug(metname) << "Assigning vetos";
415  muI = 0;
416  for (; muI < candMapT.get().size(); ++muI) {
417  for (unsigned int iDep = 0; iDep < candMapT.get()[muI].second.size(); ++iDep) {
418  candMapT.get()[muI].second[iDep].vetos = vetos[iDep];
419  }
420  }
421  LogDebug(metname) << "Done with vetos";
422  }
423 }

References d0, muisorhelper::CandMap< BT >::get(), LogDebug, metname, amptDefaultParameters_cff::mu, AlCaHLTBitMon_QueryRunRegistry::string, and boostedElectronIsolation_cff::vetos.

◆ produce()

template<typename BT >
void MuIsolatorResultProducer< BT >::produce ( edm::Event event,
const edm::EventSetup eventSetup 
)
overridevirtual

do it only if needed

"smart" container used to repackage deposits_type_candIndex into deposits_candIndex_type have to have it for veto removal (could do away without it otherwise) IMPORTANT: ALL THE REFERENCING BUSINESS IS DONE THROUGH POINTERS Access to the mapped values as reference type HAS TO BE AVAILABLE

isolator results will be here

extra vetos will be filled here

call the isolator result, passing {[deposit,vetos]_type} set and the candidate

do cleanup

Implements edm::EDProducer.

Definition at line 281 of file MuIsolatorResultProducer.h.

281  {
282  std::string metname = "RecoMuon|MuonIsolationProducers";
283  LogDebug(metname) << " Muon Deposit producing..."
284  << " BEGINING OF EVENT "
285  << "================================";
286 
287  theBeam = reco::TrackBase::Point(0, 0, 0);
288 
291  if (theBeamlineOption == "BeamSpotFromEvent") {
292  //pick beamSpot
294  edm::Handle<reco::BeamSpot> beamSpotH;
295 
296  event.getByLabel(theBeamSpotLabel, beamSpotH);
297 
298  if (beamSpotH.isValid()) {
299  theBeam = beamSpotH->position();
300  LogTrace(metname) << "Extracted beam point at " << theBeam << std::endl;
301  }
302  }
303  }
304 
310  CandMap candMapT;
311 
312  unsigned int colSize = initAssociation(event, candMapT);
313 
315  Results results(colSize);
316 
318  std::vector<reco::IsoDeposit::Vetos*> vetoDeps(theDepositConfs.size(), nullptr);
319 
320  if (colSize != 0) {
321  if (theRemoveOtherVetos) {
322  initVetos(vetoDeps, candMapT);
323  }
324 
326  for (unsigned int muI = 0; muI < colSize; ++muI) {
327  results[muI] = theIsolator->result(candMapT.get()[muI].second, *(candMapT.get()[muI].first));
328 
329  if (results[muI].typeF() != theIsolator->resultType()) {
330  edm::LogError("MuonIsolationProducers") << "Failed to get result from the isolator";
331  }
332  }
333  }
334 
335  LogDebug(metname) << "Ready to write out results of size " << results.size();
336  writeOut(event, candMapT, results);
337 
338  for (unsigned int iDep = 0; iDep < vetoDeps.size(); ++iDep) {
340  if (vetoDeps[iDep]) {
341  delete vetoDeps[iDep];
342  vetoDeps[iDep] = nullptr;
343  }
344  }
345 }

References pwdgSkimBPark_cfi::beamSpot, muisorhelper::CandMap< BT >::get(), edm::HandleBase::isValid(), LogDebug, LogTrace, metname, reco::BeamSpot::position(), bookConverter::results, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ writeOut()

template<typename BT >
void MuIsolatorResultProducer< BT >::writeOut ( edm::Event event,
const CandMap candMap,
const Results results 
) const
inlineprivate

choose which result type to write here

Definition at line 136 of file MuIsolatorResultProducer.h.

138  {
139  std::string metname = "RecoMuon|MuonIsolationProducers";
140  LogDebug(metname) << "Before calling writeOutMap with result type " << theIsolator->resultType();
141 
143  writeOutImpl<int>(event, candMapT, results);
145  writeOutImpl<float>(event, candMapT, results);
147  writeOutImpl<bool>(event, candMapT, results);
148 }

References LogDebug, metname, bookConverter::results, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ writeOutImpl()

template<typename BT >
template<typename RT >
void MuIsolatorResultProducer< BT >::writeOutImpl ( edm::Event event,
const CandMap candMapT,
const Results results 
) const
inlineprivate

actually do the writing here

make an output vec of what's to be written with a concrete type

fill/insert of non-empty values only

Definition at line 115 of file MuIsolatorResultProducer.h.

117  {
119  std::vector<RT> resV(results.size());
120  for (unsigned int i = 0; i < resV.size(); ++i)
121  resV[i] = results[i].val<RT>();
122  auto outMap = std::make_unique<edm::ValueMap<RT>>();
123  typename edm::ValueMap<RT>::Filler filler(*outMap);
124 
126  if (!candMapT.get().empty()) {
127  filler.insert(candMapT.handle(), resV.begin(), resV.end());
128  filler.fill();
129  }
130 
131  event.put(std::move(outMap));
132 }

References trigObjTnPSource_cfi::filler, muisorhelper::CandMap< BT >::get(), muisorhelper::CandMap< BT >::handle(), mps_fire::i, eostools::move(), and bookConverter::results.

Member Data Documentation

◆ theBeam

template<typename BT = reco::Candidate>
reco::TrackBase::Point MuIsolatorResultProducer< BT >::theBeam
private

Definition at line 109 of file MuIsolatorResultProducer.h.

◆ theBeamlineOption

template<typename BT = reco::Candidate>
std::string MuIsolatorResultProducer< BT >::theBeamlineOption
private

◆ theBeamSpotLabel

template<typename BT = reco::Candidate>
edm::InputTag MuIsolatorResultProducer< BT >::theBeamSpotLabel
private

◆ theConfig

template<typename BT = reco::Candidate>
edm::ParameterSet MuIsolatorResultProducer< BT >::theConfig
private

Definition at line 95 of file MuIsolatorResultProducer.h.

◆ theDepositConfs

template<typename BT = reco::Candidate>
std::vector<DepositConf> MuIsolatorResultProducer< BT >::theDepositConfs
private

◆ theIsolator

template<typename BT = reco::Candidate>
Isolator* MuIsolatorResultProducer< BT >::theIsolator
private

the isolator

Definition at line 103 of file MuIsolatorResultProducer.h.

Referenced by MuIsolatorResultProducer< BT >::MuIsolatorResultProducer().

◆ theRemoveOtherVetos

template<typename BT = reco::Candidate>
bool MuIsolatorResultProducer< BT >::theRemoveOtherVetos
private

choose which muon vetos should be removed from all deposits

Definition at line 99 of file MuIsolatorResultProducer.h.

Referenced by MuIsolatorResultProducer< BT >::MuIsolatorResultProducer().

◆ theResultType

template<typename BT = reco::Candidate>
ResultType MuIsolatorResultProducer< BT >::theResultType
private

◆ theVetoCuts

template<typename BT = reco::Candidate>
VetoCuts MuIsolatorResultProducer< BT >::theVetoCuts
private
muonisolation::MuIsoBaseIsolator::ISOL_BOOL_TYPE
Definition: MuIsoBaseIsolator.h:25
mps_fire.i
i
Definition: mps_fire.py:355
pwdgSkimBPark_cfi.beamSpot
beamSpot
Definition: pwdgSkimBPark_cfi.py:5
MuIsolatorResultProducer::theRemoveOtherVetos
bool theRemoveOtherVetos
choose which muon vetos should be removed from all deposits
Definition: MuIsolatorResultProducer.h:99
muonisolation::MuIsoBaseIsolator::ISOL_FLOAT_TYPE
Definition: MuIsoBaseIsolator.h:25
MuIsolatorResultProducer::theVetoCuts
VetoCuts theVetoCuts
Definition: MuIsolatorResultProducer.h:100
MuIsolatorResultProducer::VetoCuts::selectAll
bool selectAll
Definition: MuIsolatorResultProducer.h:77
MuIsolatorResultProducer::theBeamSpotLabel
edm::InputTag theBeamSpotLabel
Definition: MuIsolatorResultProducer.h:108
amptDefaultParameters_cff.mu
mu
Definition: amptDefaultParameters_cff.py:16
muisorhelper::CandMap::pair_type
std::pair< key_type, value_type > pair_type
Definition: MuIsolatorResultProducer.h:36
MuIsolatorResultProducer::DepositContainer
muisorhelper::DepositContainer DepositContainer
Definition: MuIsolatorResultProducer.h:66
bookConverter.results
results
Definition: bookConverter.py:144
muisorhelper::CandMap::iterator
map_type::iterator iterator
Definition: MuIsolatorResultProducer.h:38
MuIsolatorResultProducer::theDepositConfs
std::vector< DepositConf > theDepositConfs
Definition: MuIsolatorResultProducer.h:96
MuIsolatorResultProducer::VetoCuts::muPtMin
double muPtMin
Definition: MuIsolatorResultProducer.h:79
edm::Handle
Definition: AssociativeIterator.h:50
MuIsolatorResultProducer::theResultType
ResultType theResultType
Definition: MuIsolatorResultProducer.h:104
edm::ValueMap::container
std::vector< value_type > container
Definition: ValueMap.h:110
muonisolation::MuIsoBaseIsolator::ISOL_INT_TYPE
Definition: MuIsoBaseIsolator.h:25
edm::ValueMap::empty
bool empty() const
Definition: ValueMap.h:158
MuIsolatorResultProducer::theBeamlineOption
std::string theBeamlineOption
beam spot
Definition: MuIsolatorResultProducer.h:107
HLT_2018_cff.coneSize
coneSize
Definition: HLT_2018_cff.py:49353
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
muonisolation::MuIsoBaseIsolator::result
virtual Result result(const DepositContainer &deposits, const edm::Event *=nullptr) const =0
Compute and return the isolation variable.
MuIsolatorResultProducer::theConfig
edm::ParameterSet theConfig
Definition: MuIsolatorResultProducer.h:95
muonisolation::IsolatorByDeposit
Definition: IsolatorByDeposit.h:16
MuIsolatorResultProducer::initVetos
void initVetos(std::vector< reco::IsoDeposit::Vetos * > &vetos, CandMap &candMap) const
Definition: MuIsolatorResultProducer.h:390
reco::BeamSpot
Definition: BeamSpot.h:21
muonisolation::MuIsoBaseIsolator::resultType
virtual ResultType resultType() const =0
reco::BeamSpot::position
const Point & position() const
position
Definition: BeamSpot.h:59
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
MuIsolatorResultProducer::theIsolator
Isolator * theIsolator
the isolator
Definition: MuIsolatorResultProducer.h:103
muonisolation::IsolatorByNominalEfficiency
Definition: IsolatorByNominalEfficiency.h:22
MuIsolatorResultProducer::theBeam
reco::TrackBase::Point theBeam
Definition: MuIsolatorResultProducer.h:109
MuIsolatorResultProducer::CandMap
muisorhelper::CandMap< BT > CandMap
Definition: MuIsolatorResultProducer.h:68
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
MuIsolatorResultProducer::writeOut
void writeOut(edm::Event &event, const CandMap &candMap, const Results &results) const
choose which result type to write here
Definition: MuIsolatorResultProducer.h:136
trigObjTnPSource_cfi.filler
filler
Definition: trigObjTnPSource_cfi.py:21
muisorhelper::CandMap::handle_type
edm::Handle< edm::View< BT > > handle_type
Definition: MuIsolatorResultProducer.h:34
edm::ValueMap::const_iterator::id
ProductID id() const
Definition: ValueMap.h:173
edm::ValueMap::begin
const_iterator begin() const
Definition: ValueMap.h:229
muonisolation::IsolatorByDepositCount
Definition: IsolatorByDepositCount.h:16
edm::ValueMap::const_iterator::end
container::const_iterator end() const
Definition: ValueMap.h:175
MuIsolatorResultProducer::VetoCuts::muD0Max
double muD0Max
Definition: MuIsolatorResultProducer.h:81
MuIsolatorResultProducer::initAssociation
unsigned int initAssociation(edm::Event &event, CandMap &candMapT) const
Definition: MuIsolatorResultProducer.h:348
MuIsolatorResultProducer::callWhatProduces
void callWhatProduces()
declare what's going to be produced
Definition: MuIsolatorResultProducer.h:152
reco::TrackBase::Point
math::XYZPoint Point
point in the space
Definition: TrackBase.h:80
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::ValueMap::const_iterator::begin
container::const_iterator begin() const
Definition: ValueMap.h:174
MuIsolatorResultProducer::VetoCuts::muAbsEtaMax
double muAbsEtaMax
Definition: MuIsolatorResultProducer.h:78
MuIsolatorResultProducer::VetoCuts::muAbsZMax
double muAbsZMax
Definition: MuIsolatorResultProducer.h:80
MuIsolatorResultProducer::Results
muisorhelper::Results Results
Definition: MuIsolatorResultProducer.h:65
edm::helper::Filler
Definition: ValueMap.h:22
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
event
Definition: event.py:1
d0
static constexpr float d0
Definition: L1EGammaCrystalsEmulatorProducer.cc:84
reco::IsoDeposit::Vetos
std::vector< Veto > Vetos
Definition: IsoDeposit.h:65
boostedElectronIsolation_cff.vetos
vetos
Definition: boostedElectronIsolation_cff.py:79
edm::InputTag
Definition: InputTag.h:15
muisorhelper::CandMap::key_type
edm::RefToBase< BT > key_type
Definition: MuIsolatorResultProducer.h:33
metname
const std::string metname
Definition: MuonSeedOrcaPatternRecognition.cc:43
edm::ValueMap::size
size_t size() const
Definition: ValueMap.h:156