CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
reco::tau::AssociationMatchRefSelector< InputType, MatchedType, OutputType, ClonePolicy > Class Template Reference
Inheritance diagram for reco::tau::AssociationMatchRefSelector< InputType, MatchedType, OutputType, ClonePolicy >:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

typedef edm::Association< MatchedType > AssocType
 
typedef edm::RefToBase< InputType > InputRef
 
typedef OutputType::value_type OutputValue
 
- Public Types inherited from edm::EDFilter
typedef EDFilter 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
 

Public Member Functions

 AssociationMatchRefSelector (const edm::ParameterSet &pset)
 
bool filter (edm::Event &evt, const edm::EventSetup &es) override
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilter () 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 Attributes

ClonePolicy cloner_
 
bool filter_
 
edm::InputTag matching_
 
edm::InputTag src_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 InputType, typename MatchedType, typename OutputType = typename edm::RefToBaseVector<InputType>, typename ClonePolicy = RefCopier>
class reco::tau::AssociationMatchRefSelector< InputType, MatchedType, OutputType, ClonePolicy >

Definition at line 51 of file RecoTauGenJetMatchSelector.cc.

Member Typedef Documentation

template<typename InputType , typename MatchedType , typename OutputType = typename edm::RefToBaseVector<InputType>, typename ClonePolicy = RefCopier>
typedef edm::Association<MatchedType> reco::tau::AssociationMatchRefSelector< InputType, MatchedType, OutputType, ClonePolicy >::AssocType

Definition at line 55 of file RecoTauGenJetMatchSelector.cc.

template<typename InputType , typename MatchedType , typename OutputType = typename edm::RefToBaseVector<InputType>, typename ClonePolicy = RefCopier>
typedef edm::RefToBase<InputType> reco::tau::AssociationMatchRefSelector< InputType, MatchedType, OutputType, ClonePolicy >::InputRef

Definition at line 56 of file RecoTauGenJetMatchSelector.cc.

template<typename InputType , typename MatchedType , typename OutputType = typename edm::RefToBaseVector<InputType>, typename ClonePolicy = RefCopier>
typedef OutputType::value_type reco::tau::AssociationMatchRefSelector< InputType, MatchedType, OutputType, ClonePolicy >::OutputValue

Definition at line 54 of file RecoTauGenJetMatchSelector.cc.

Constructor & Destructor Documentation

template<typename InputType , typename MatchedType , typename OutputType = typename edm::RefToBaseVector<InputType>, typename ClonePolicy = RefCopier>
reco::tau::AssociationMatchRefSelector< InputType, MatchedType, OutputType, ClonePolicy >::AssociationMatchRefSelector ( const edm::ParameterSet pset)
inlineexplicit

Definition at line 58 of file RecoTauGenJetMatchSelector.cc.

References edm::ParameterSet::getParameter().

58  {
59  src_ = pset.getParameter<edm::InputTag>("src");
60  matching_ = pset.getParameter<edm::InputTag>("matching");
61  filter_ = pset.getParameter<bool>("filter");
62  produces<OutputType>();
63  }
T getParameter(std::string const &) const

Member Function Documentation

template<typename InputType , typename MatchedType , typename OutputType = typename edm::RefToBaseVector<InputType>, typename ClonePolicy = RefCopier>
bool reco::tau::AssociationMatchRefSelector< InputType, MatchedType, OutputType, ClonePolicy >::filter ( edm::Event evt,
const edm::EventSetup es 
)
inlineoverride

Definition at line 64 of file RecoTauGenJetMatchSelector.cc.

References edm::Event::getByLabel(), mps_fire::i, input, edm::Ref< C, T, F >::isNonnull(), match(), electrons_cff::matched, eostools::move(), convertSQLitetoXML_cfg::output, edm::Event::put(), and DBConfiguration_cff::toPut.

64  {
66  evt.getByLabel(src_, input);
68  evt.getByLabel(matching_, match);
69  auto output = std::make_unique<OutputType>();
70  for (size_t i = 0; i < input->size(); ++i) {
71  typename AssocType::reference_type matched = (*match)[input->refAt(i)];
72  // Check if matched
73  if (matched.isNonnull()) {
75  cloner_.template convert<InputRef, OutputValue>(input->refAt(i));
76  output->push_back(toPut);
77  }
78  }
79  bool notEmpty = !output->empty();
80  evt.put(std::move(output));
81  // Filter if no events passed
82  return ( !filter_ || notEmpty );
83  }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
Ref< typename refprod_type::product_type > reference_type
Definition: Association.h:24
static std::string const input
Definition: EdmProvDump.cc:48
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:480
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

template<typename InputType , typename MatchedType , typename OutputType = typename edm::RefToBaseVector<InputType>, typename ClonePolicy = RefCopier>
ClonePolicy reco::tau::AssociationMatchRefSelector< InputType, MatchedType, OutputType, ClonePolicy >::cloner_
private

Definition at line 85 of file RecoTauGenJetMatchSelector.cc.

template<typename InputType , typename MatchedType , typename OutputType = typename edm::RefToBaseVector<InputType>, typename ClonePolicy = RefCopier>
bool reco::tau::AssociationMatchRefSelector< InputType, MatchedType, OutputType, ClonePolicy >::filter_
private

Definition at line 88 of file RecoTauGenJetMatchSelector.cc.

template<typename InputType , typename MatchedType , typename OutputType = typename edm::RefToBaseVector<InputType>, typename ClonePolicy = RefCopier>
edm::InputTag reco::tau::AssociationMatchRefSelector< InputType, MatchedType, OutputType, ClonePolicy >::matching_
private

Definition at line 87 of file RecoTauGenJetMatchSelector.cc.

template<typename InputType , typename MatchedType , typename OutputType = typename edm::RefToBaseVector<InputType>, typename ClonePolicy = RefCopier>
edm::InputTag reco::tau::AssociationMatchRefSelector< InputType, MatchedType, OutputType, ClonePolicy >::src_
private

Definition at line 86 of file RecoTauGenJetMatchSelector.cc.