CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
pat::PATTriggerMatchEmbedder< PATObjectType > Class Template Reference

More...

#include "PhysicsTools/PatAlgos/plugins/PATTriggerMatchEmbedder.cc"

Inheritance diagram for pat::PATTriggerMatchEmbedder< PATObjectType >:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 PATTriggerMatchEmbedder (const edm::ParameterSet &iConfig)
 
 ~PATTriggerMatchEmbedder () override
 
- Public Member Functions inherited from edm::global::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
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () 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
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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 Member Functions

void produce (edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
 

Private Attributes

const std::vector< edm::InputTagmatches_
 
const std::vector< edm::EDGetTokenT< TriggerObjectStandAloneMatch > > matchesTokens_
 
const edm::InputTag src_
 
const edm::EDGetTokenT< edm::View< PATObjectType > > srcToken_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase 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::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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<class PATObjectType>
class pat::PATTriggerMatchEmbedder< PATObjectType >

Author
Volker Adler
Version
Id
PATTriggerMatchEmbedder.cc,v 1.6 2010/09/02 17:52:47 vadler Exp

Definition at line 40 of file PATTriggerMatchEmbedder.cc.

Constructor & Destructor Documentation

◆ PATTriggerMatchEmbedder()

template<class PATObjectType >
PATTriggerMatchEmbedder::PATTriggerMatchEmbedder ( const edm::ParameterSet iConfig)
explicit

Definition at line 66 of file PATTriggerMatchEmbedder.cc.

67  : src_(iConfig.getParameter<edm::InputTag>("src")),
69  matches_(iConfig.getParameter<std::vector<edm::InputTag>>("matches")),
71  matches_, [this](edm::InputTag const& tag) { return consumes<TriggerObjectStandAloneMatch>(tag); })) {
72  produces<std::vector<PATObjectType>>();
73 }

References GlobalPosition_Frontier_DevDB_cff::tag.

◆ ~PATTriggerMatchEmbedder()

template<class PATObjectType >
pat::PATTriggerMatchEmbedder< PATObjectType >::~PATTriggerMatchEmbedder ( )
inlineoverride

Definition at line 48 of file PATTriggerMatchEmbedder.cc.

48 {};

Member Function Documentation

◆ produce()

template<class PATObjectType >
void PATTriggerMatchEmbedder::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overrideprivatevirtual

Implements edm::global::EDProducerBase.

Definition at line 76 of file PATTriggerMatchEmbedder.cc.

78  {
79  auto output = std::make_unique<std::vector<PATObjectType>>();
80 
82  iEvent.getByToken(srcToken_, candidates);
83  if (!candidates.isValid()) {
84  edm::LogError("missingInputSource") << "Input source with InputTag " << src_.encode() << " not in event.";
85  return;
86  }
87 
88  for (typename edm::View<PATObjectType>::const_iterator iCand = candidates->begin(); iCand != candidates->end();
89  ++iCand) {
90  const unsigned index(iCand - candidates->begin());
91  PATObjectType cand(candidates->at(index));
92  std::set<TriggerObjectStandAloneRef> cachedRefs;
93  for (size_t iMatch = 0; iMatch < matchesTokens_.size(); ++iMatch) {
95  iEvent.getByToken(matchesTokens_.at(iMatch), match);
96  if (!match.isValid()) {
97  edm::LogError("missingInputMatch")
98  << "Input match with InputTag " << matches_.at(iMatch).encode() << " not in event.";
99  continue;
100  }
101  const TriggerObjectStandAloneRef trigRef((*match)[candidates->refAt(index)]);
102  if (trigRef.isNonnull() && trigRef.isAvailable()) {
103  if (cachedRefs.insert(trigRef).second) { // protection from multiple entries of the same trigger objects
104  cand.addTriggerObjectMatch(*trigRef);
105  }
106  }
107  }
108  output->push_back(cand);
109  }
110 
111  iEvent.put(std::move(output));
112 }

References HLT_FULL_cff::candidates, iEvent, match(), eostools::move(), and convertSQLitetoXML_cfg::output.

Member Data Documentation

◆ matches_

template<class PATObjectType >
const std::vector<edm::InputTag> pat::PATTriggerMatchEmbedder< PATObjectType >::matches_
private

Definition at line 43 of file PATTriggerMatchEmbedder.cc.

◆ matchesTokens_

template<class PATObjectType >
const std::vector<edm::EDGetTokenT<TriggerObjectStandAloneMatch> > pat::PATTriggerMatchEmbedder< PATObjectType >::matchesTokens_
private

Definition at line 44 of file PATTriggerMatchEmbedder.cc.

◆ src_

template<class PATObjectType >
const edm::InputTag pat::PATTriggerMatchEmbedder< PATObjectType >::src_
private

Definition at line 41 of file PATTriggerMatchEmbedder.cc.

◆ srcToken_

template<class PATObjectType >
const edm::EDGetTokenT<edm::View<PATObjectType> > pat::PATTriggerMatchEmbedder< PATObjectType >::srcToken_
private

Definition at line 42 of file PATTriggerMatchEmbedder.cc.

convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
pat::PATTriggerMatchEmbedder::matchesTokens_
const std::vector< edm::EDGetTokenT< TriggerObjectStandAloneMatch > > matchesTokens_
Definition: PATTriggerMatchEmbedder.cc:44
edm::Handle
Definition: AssociativeIterator.h:50
edm::Ref
Definition: AssociativeIterator.h:58
pat::PATTriggerMatchEmbedder::src_
const edm::InputTag src_
Definition: PATTriggerMatchEmbedder.cc:41
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
pat::PATTriggerMatchEmbedder::matches_
const std::vector< edm::InputTag > matches_
Definition: PATTriggerMatchEmbedder.cc:43
edm::vector_transform
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
Definition: transform.h:11
edm::View
Definition: CaloClusterFwd.h:14
match
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
cand
Definition: decayParser.h:32
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::InputTag::encode
std::string encode() const
Definition: InputTag.cc:159
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
eostools.move
def move(src, dest)
Definition: eostools.py:511
HLT_FULL_cff.candidates
candidates
Definition: HLT_FULL_cff.py:54985
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
edm::View::const_iterator
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
edm::EDConsumerBase::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: EDConsumerBase.h:153
pat::PATTriggerMatchEmbedder::srcToken_
const edm::EDGetTokenT< edm::View< PATObjectType > > srcToken_
Definition: PATTriggerMatchEmbedder.cc:42
edm::InputTag
Definition: InputTag.h:15