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
 
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)
 
 ~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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, 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)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, 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

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

Definition at line 68 of file MuIsolatorResultProducer.h.

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

Definition at line 66 of file MuIsolatorResultProducer.h.

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

Definition at line 62 of file MuIsolatorResultProducer.h.

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

Definition at line 63 of file MuIsolatorResultProducer.h.

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

Definition at line 65 of file MuIsolatorResultProducer.h.

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

Definition at line 64 of file MuIsolatorResultProducer.h.

Constructor & Destructor Documentation

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.

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.

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 }
#define LogDebug(id)
T getParameter(std::string const &) const
std::vector< DepositConf > theDepositConfs
bool theRemoveOtherVetos
choose which muon vetos should be removed from all deposits
void callWhatProduces()
declare what&#39;s going to be produced
Isolator * theIsolator
the isolator
std::string theBeamlineOption
beam spot
virtual ResultType resultType() const =0
reco::TrackBase::Point theBeam
template<typename BT >
MuIsolatorResultProducer< BT >::~MuIsolatorResultProducer ( )
override

destructor

Definition at line 274 of file MuIsolatorResultProducer.h.

References LogDebug, and MuIsolatorResultProducer< BT >::theIsolator.

274  {
275  if (theIsolator)
276  delete theIsolator;
277  LogDebug("RecoMuon|MuIsolatorResultProducer") << " MuIsolatorResultProducer DTOR";
278 }
#define LogDebug(id)
Isolator * theIsolator
the isolator

Member Function Documentation

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

declare what's going to be produced

Definition at line 152 of file MuIsolatorResultProducer.h.

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

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.

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, GlobalPosition_Frontier_DevDB_cff::tag, and MuIsolatorResultProducer< BT >::theDepositConfs.

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

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 }
#define LogDebug(id)
bool empty() const
Definition: ValueMap.h:158
std::pair< key_type, value_type > pair_type
const std::string metname
std::vector< DepositConf > theDepositConfs
edm::RefToBase< BT > key_type
edm::Handle< edm::View< BT > > handle_type
muisorhelper::DepositContainer DepositContainer
const_iterator begin() const
Definition: ValueMap.h:229
container::const_iterator begin() const
Definition: ValueMap.h:174
size_t size() const
Definition: ValueMap.h:156
std::vector< value_type > container
Definition: ValueMap.h:110
ProductID id() const
Definition: ValueMap.h:173
container::const_iterator end() const
Definition: ValueMap.h:175
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.

References HLTMuonOfflineAnalyzer_cfi::d0, muisorhelper::CandMap< BT >::get(), LogDebug, metname, amptDefaultParameters_cff::mu, MuIsolatorResultProducer< BT >::VetoCuts::muAbsEtaMax, MuIsolatorResultProducer< BT >::VetoCuts::muAbsZMax, MuIsolatorResultProducer< BT >::VetoCuts::muD0Max, MuIsolatorResultProducer< BT >::VetoCuts::muPtMin, MuIsolatorResultProducer< BT >::VetoCuts::selectAll, AlCaHLTBitMon_QueryRunRegistry::string, MuIsolatorResultProducer< BT >::theBeam, MuIsolatorResultProducer< BT >::theRemoveOtherVetos, and MuIsolatorResultProducer< BT >::theVetoCuts.

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

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 }
#define LogDebug(id)
const std::string metname
bool theRemoveOtherVetos
choose which muon vetos should be removed from all deposits
edm::RefToBase< BT > key_type
std::vector< Veto > Vetos
Definition: IsoDeposit.h:65
reco::TrackBase::Point theBeam
template<typename BT >
void MuIsolatorResultProducer< BT >::produce ( edm::Event event,
const edm::EventSetup eventSetup 
)
override

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

Definition at line 281 of file MuIsolatorResultProducer.h.

References pwdgSkimBPark_cfi::beamSpot, muisorhelper::CandMap< BT >::get(), MuIsolatorResultProducer< BT >::initAssociation(), MuIsolatorResultProducer< BT >::initVetos(), edm::HandleBase::isValid(), LogDebug, LogTrace, metname, reco::BeamSpot::position(), muonisolation::MuIsoBaseIsolator::result(), bookConverter::results, muonisolation::MuIsoBaseIsolator::resultType(), MuIsolatorResultProducer< BT >::VetoCuts::selectAll, AlCaHLTBitMon_QueryRunRegistry::string, MuIsolatorResultProducer< BT >::theBeam, MuIsolatorResultProducer< BT >::theBeamlineOption, MuIsolatorResultProducer< BT >::theBeamSpotLabel, MuIsolatorResultProducer< BT >::theDepositConfs, MuIsolatorResultProducer< BT >::theIsolator, MuIsolatorResultProducer< BT >::theRemoveOtherVetos, MuIsolatorResultProducer< BT >::theVetoCuts, and MuIsolatorResultProducer< BT >::writeOut().

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 }
#define LogDebug(id)
const std::string metname
std::vector< DepositConf > theDepositConfs
bool theRemoveOtherVetos
choose which muon vetos should be removed from all deposits
Isolator * theIsolator
the isolator
std::string theBeamlineOption
beam spot
math::XYZPoint Point
point in the space
Definition: TrackBase.h:80
void initVetos(std::vector< reco::IsoDeposit::Vetos * > &vetos, CandMap &candMap) const
bool isValid() const
Definition: HandleBase.h:70
#define LogTrace(id)
virtual ResultType resultType() const =0
unsigned int initAssociation(edm::Event &event, CandMap &candMapT) const
virtual Result result(const DepositContainer &deposits, const edm::Event *=0) const =0
Compute and return the isolation variable.
const Point & position() const
position
Definition: BeamSpot.h:59
void writeOut(edm::Event &event, const CandMap &candMap, const Results &results) const
choose which result type to write here
reco::TrackBase::Point theBeam
muisorhelper::CandMap< BT > CandMap
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.

References event(), LogDebug, metname, bookConverter::results, and AlCaHLTBitMon_QueryRunRegistry::string.

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

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 }
#define LogDebug(id)
const std::string metname
Isolator * theIsolator
the isolator
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
virtual ResultType resultType() const =0
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.

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

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 }
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

template<typename BT = reco::Candidate>
reco::TrackBase::Point MuIsolatorResultProducer< BT >::theBeam
private
template<typename BT = reco::Candidate>
std::string MuIsolatorResultProducer< BT >::theBeamlineOption
private
template<typename BT = reco::Candidate>
edm::InputTag MuIsolatorResultProducer< BT >::theBeamSpotLabel
private
template<typename BT = reco::Candidate>
edm::ParameterSet MuIsolatorResultProducer< BT >::theConfig
private

Definition at line 95 of file MuIsolatorResultProducer.h.

template<typename BT = reco::Candidate>
std::vector<DepositConf> MuIsolatorResultProducer< BT >::theDepositConfs
private
template<typename BT = reco::Candidate>
Isolator* MuIsolatorResultProducer< BT >::theIsolator
private
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 >::initVetos(), MuIsolatorResultProducer< BT >::MuIsolatorResultProducer(), and MuIsolatorResultProducer< BT >::produce().

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