CMS 3D CMS Logo

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

#include <IsolationProducerNew.h>

Inheritance diagram for reco::modulesNew::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_
 
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::ValueMap<float>, typename Setup = typename helper::IsolationAlgorithmSetup<Alg>::type>
class reco::modulesNew::IsolationProducer< C1, C2, Alg, OutputCollection, Setup >

Definition at line 42 of file IsolationProducerNew.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 55 of file IsolationProducerNew.h.

56  : srcToken_(consumes<C1>(cfg.template getParameter<edm::InputTag>("src"))),
57  elementsToken_(consumes<C2>(cfg.template getParameter<edm::InputTag>("elements"))),
58  alg_(reco::modules::make<Alg>(cfg)) {
59  produces<OutputCollection>();
60  }

◆ ~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 IsolationProducerNew.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 IsolationProducerNew.h.

References bookConverter::elements, trigObjTnPSource_cfi::filler, edm::Event::getByToken(), mps_fire::i, init, volumeBasedMagneticField_160812_cfi::master, 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 
74  Setup::init(alg_, es);
75 
76  ::helper::MasterCollection<C1> master(src, evt);
77  auto isolations = std::make_unique<OutputCollection>();
78  if (!src->empty()) {
79  typename OutputCollection::Filler filler(*isolations);
80  vector<double> iso(master.size(), -1);
81  size_t i = 0;
82  for (typename C1::const_iterator lep = src->begin(); lep != src->end(); ++lep)
83  iso[master.index(i++)] = alg_(*lep, *elements);
84  filler.insert(master.get(), iso.begin(), iso.end());
85  filler.fill();
86  }
87  evt.put(std::move(isolations));
88  }
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:536
HLT enums.
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ alg_

template<typename C1 , typename C2 , typename Alg , typename OutputCollection = edm::ValueMap<float>, typename Setup = typename helper::IsolationAlgorithmSetup<Alg>::type>
Alg reco::modulesNew::IsolationProducer< C1, C2, Alg, OutputCollection, Setup >::alg_
private

Definition at line 51 of file IsolationProducerNew.h.

◆ elementsToken_

template<typename C1 , typename C2 , typename Alg , typename OutputCollection = edm::ValueMap<float>, typename Setup = typename helper::IsolationAlgorithmSetup<Alg>::type>
edm::EDGetTokenT<C2> reco::modulesNew::IsolationProducer< C1, C2, Alg, OutputCollection, Setup >::elementsToken_
private

Definition at line 50 of file IsolationProducerNew.h.

◆ srcToken_

template<typename C1 , typename C2 , typename Alg , typename OutputCollection = edm::ValueMap<float>, typename Setup = typename helper::IsolationAlgorithmSetup<Alg>::type>
edm::EDGetTokenT<C1> reco::modulesNew::IsolationProducer< C1, C2, Alg, OutputCollection, Setup >::srcToken_
private

Definition at line 49 of file IsolationProducerNew.h.