CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
IsolationProducer< C1, C2, Alg, OutputCollection, Setup > Class Template Reference

#include <IsolationProducer.h>

Inheritance diagram for IsolationProducer< C1, C2, Alg, OutputCollection, Setup >:
edm::stream::EDProducer<>

Public Member Functions

 IsolationProducer (const edm::ParameterSet &)
 
 ~IsolationProducer () override
 
- Public Member Functions inherited from edm::stream::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
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Member Functions

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

Private Attributes

Alg alg_
 
edm::EDGetTokenT< C2 > elementsToken_
 
Setup::ESConsumesToken esToken_
 
edm::EDGetTokenT< C1 > srcToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

template<typename C1, typename C2, typename Alg, typename OutputCollection = edm::AssociationVector<edm::RefProd<C1>, std::vector<typename Alg::value_type> >, typename Setup = typename helper::IsolationAlgorithmSetup<Alg>::type>
class IsolationProducer< C1, C2, Alg, OutputCollection, Setup >

Definition at line 40 of file IsolationProducer.h.

Constructor & Destructor Documentation

◆ IsolationProducer()

template<typename C1 , typename C2 , typename Alg , typename OutputCollection , typename Setup >
IsolationProducer< C1, C2, Alg, OutputCollection, Setup >::IsolationProducer ( const edm::ParameterSet cfg)

Definition at line 54 of file IsolationProducer.h.

55  : srcToken_(consumes<C1>(cfg.template getParameter<edm::InputTag>("src"))),
56  elementsToken_(consumes<C2>(cfg.template getParameter<edm::InputTag>("elements"))),
57  alg_(reco::modules::make<Alg>(cfg)),
58  esToken_(Setup::esConsumes(consumesCollector())) {
59  produces<OutputCollection>();
60 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
Setup::ESConsumesToken esToken_
edm::EDGetTokenT< C1 > srcToken_
edm::EDGetTokenT< C2 > elementsToken_

◆ ~IsolationProducer()

template<typename C1 , typename C2 , typename Alg , typename OutputCollection , typename Setup >
IsolationProducer< C1, C2, Alg, OutputCollection, Setup >::~IsolationProducer ( )
override

Definition at line 63 of file IsolationProducer.h.

63 {}

Member Function Documentation

◆ produce()

template<typename C1 , typename C2 , typename Alg , typename OutputCollection , typename Setup >
void IsolationProducer< C1, C2, Alg, OutputCollection, Setup >::produce ( edm::Event evt,
const edm::EventSetup es 
)
overrideprivate

Definition at line 66 of file IsolationProducer.h.

References bookConverter::elements, edm::Event::getByToken(), mps_fire::i, init, genparticles_cff::iso, eostools::move(), edm::Event::put(), and TrackRefitter_38T_cff::src.

66  {
67  using namespace edm;
68  using namespace std;
71  evt.getByToken(srcToken_, src);
73 
75 
76  typename OutputCollection::refprod_type ref(src);
77  auto isolations = std::make_unique<OutputCollection>(ref);
78 
79  size_t i = 0;
80  for (typename C1::const_iterator lep = src->begin(); lep != src->end(); ++lep) {
81  typename Alg::value_type iso = alg_(*lep, *elements);
82  isolations->setValue(i++, iso);
83  }
84  evt.put(std::move(isolations));
85 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
int init
Definition: HydjetWrapper.h:66
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
Setup::ESConsumesToken esToken_
edm::EDGetTokenT< C1 > srcToken_
edm::EDGetTokenT< C2 > elementsToken_
HLT enums.
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ alg_

template<typename C1 , typename C2 , typename Alg , typename OutputCollection = edm::AssociationVector<edm::RefProd<C1>, std::vector<typename Alg::value_type> >, typename Setup = typename helper::IsolationAlgorithmSetup<Alg>::type>
Alg IsolationProducer< C1, C2, Alg, OutputCollection, Setup >::alg_
private

Definition at line 49 of file IsolationProducer.h.

◆ elementsToken_

template<typename C1 , typename C2 , typename Alg , typename OutputCollection = edm::AssociationVector<edm::RefProd<C1>, std::vector<typename Alg::value_type> >, typename Setup = typename helper::IsolationAlgorithmSetup<Alg>::type>
edm::EDGetTokenT<C2> IsolationProducer< C1, C2, Alg, OutputCollection, Setup >::elementsToken_
private

Definition at line 48 of file IsolationProducer.h.

◆ esToken_

template<typename C1 , typename C2 , typename Alg , typename OutputCollection = edm::AssociationVector<edm::RefProd<C1>, std::vector<typename Alg::value_type> >, typename Setup = typename helper::IsolationAlgorithmSetup<Alg>::type>
Setup::ESConsumesToken IsolationProducer< C1, C2, Alg, OutputCollection, Setup >::esToken_
private

Definition at line 50 of file IsolationProducer.h.

◆ srcToken_

template<typename C1 , typename C2 , typename Alg , typename OutputCollection = edm::AssociationVector<edm::RefProd<C1>, std::vector<typename Alg::value_type> >, typename Setup = typename helper::IsolationAlgorithmSetup<Alg>::type>
edm::EDGetTokenT<C1> IsolationProducer< C1, C2, Alg, OutputCollection, Setup >::srcToken_
private

Definition at line 47 of file IsolationProducer.h.