CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
edmtest::AcquireIntStreamProducer Class Reference
Inheritance diagram for edmtest::AcquireIntStreamProducer:
edm::stream::EDProducer< edm::ExternalWork >

Public Member Functions

void acquire (edm::Event const &, edm::EventSetup const &, edm::WaitingTaskWithArenaHolder) override
 
 AcquireIntStreamProducer (edm::ParameterSet const &pset)
 
void produce (edm::Event &, edm::EventSetup const &) override
 
 ~AcquireIntStreamProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::ExternalWork >
 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 Attributes

std::vector< edm::EDGetTokenT< IntProduct > > m_getTokens
 
test_acquire::Token m_token
 
edm::EDGetTokenT< IntProduct > m_tokenForProduce
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer< edm::ExternalWork >
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

Definition at line 22 of file AcquireIntStreamProducer.cc.

Constructor & Destructor Documentation

◆ AcquireIntStreamProducer()

edmtest::AcquireIntStreamProducer::AcquireIntStreamProducer ( edm::ParameterSet const &  pset)
explicit

Definition at line 35 of file AcquireIntStreamProducer.cc.

References EcalCondTools::getToken().

37  for (auto const& tag : pset.getParameter<std::vector<edm::InputTag>>("tags")) {
38  m_getTokens.emplace_back(consumes<IntProduct>(tag));
39  }
40  m_tokenForProduce = consumes<IntProduct>(pset.getParameter<edm::InputTag>("produceTag"));
41  produces<IntProduct>();
42  }
std::vector< edm::EDGetTokenT< IntProduct > > m_getTokens
edm::EDGetTokenT< IntProduct > m_tokenForProduce
def getToken(db, tag, since)

◆ ~AcquireIntStreamProducer()

edmtest::AcquireIntStreamProducer::~AcquireIntStreamProducer ( )
override

Definition at line 44 of file AcquireIntStreamProducer.cc.

44 {}

Member Function Documentation

◆ acquire()

void edmtest::AcquireIntStreamProducer::acquire ( edm::Event const &  event,
edm::EventSetup const &  ,
edm::WaitingTaskWithArenaHolder  holder 
)
override

Definition at line 46 of file AcquireIntStreamProducer.cc.

References utilities::cache(), m_getTokens, m_token, and unpackBuffers-CaloStage2::token.

48  {
49  test_acquire::Cache* cache = edm::Service<test_acquire::WaitingService>()->getCache(m_token);
50  cache->retrieved().clear();
51  cache->processed().clear();
52 
53  for (auto const& token : m_getTokens) {
54  cache->retrieved().push_back(event.get(token).value);
55  }
56 
57  edm::Service<test_acquire::WaitingService>()->requestValuesAsync(
58  m_token, &cache->retrieved(), &cache->processed(), holder);
59  }
std::vector< edm::EDGetTokenT< IntProduct > > m_getTokens
def cache(function)
Definition: utilities.py:3
Definition: event.py:1

◆ produce()

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

Definition at line 61 of file AcquireIntStreamProducer.cc.

References utilities::cache(), m_token, m_tokenForProduce, findQualityFiles::v, and funct::void.

61  {
62  int sum = 0;
63  test_acquire::Cache* cache = edm::Service<test_acquire::WaitingService>()->getCache(m_token);
64  for (auto v : cache->processed()) {
65  sum += v;
66  }
67  event.put(std::make_unique<IntProduct>(sum));
68 
69  // This part is here only for the Parentage test.
71  }
TEMPL(T2) struct Divides void
Definition: Factorize.h:24
edm::EDGetTokenT< IntProduct > m_tokenForProduce
def cache(function)
Definition: utilities.py:3
Definition: event.py:1

Member Data Documentation

◆ m_getTokens

std::vector<edm::EDGetTokenT<IntProduct> > edmtest::AcquireIntStreamProducer::m_getTokens
private

Definition at line 30 of file AcquireIntStreamProducer.cc.

Referenced by acquire().

◆ m_token

test_acquire::Token edmtest::AcquireIntStreamProducer::m_token
private

Definition at line 32 of file AcquireIntStreamProducer.cc.

Referenced by acquire(), and produce().

◆ m_tokenForProduce

edm::EDGetTokenT<IntProduct> edmtest::AcquireIntStreamProducer::m_tokenForProduce
private

Definition at line 31 of file AcquireIntStreamProducer.cc.

Referenced by produce().