CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
EcalCompactTrigPrimProducer Class Reference

#include <EcalCompactTrigPrimProducer.h>

Inheritance diagram for EcalCompactTrigPrimProducer:
edm::stream::EDProducer<>

Public Member Functions

 EcalCompactTrigPrimProducer (const edm::ParameterSet &ps)
 
void produce (edm::Event &evt, const edm::EventSetup &es) override
 
 ~EcalCompactTrigPrimProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Attributes

edm::EDGetTokenT< EcalTrigPrimDigiCollectioninCollectionToken_
 
std::string outCollection_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

$Id: $Date: $Revision:

Author
Ph. Gras CEA/IRFU Saclay

Definition at line 17 of file EcalCompactTrigPrimProducer.h.

Constructor & Destructor Documentation

EcalCompactTrigPrimProducer::EcalCompactTrigPrimProducer ( const edm::ParameterSet ps)

Definition at line 12 of file EcalCompactTrigPrimProducer.cc.

References edm::ParameterSet::getParameter(), inCollectionToken_, and outCollection_.

13  : outCollection_(ps.getParameter<std::string>("outColl")) {
14  inCollectionToken_ = consumes<EcalTrigPrimDigiCollection>((ps.getParameter<edm::InputTag>("inColl")));
15  produces<EcalTrigPrimCompactColl>(outCollection_);
16 }
T getParameter(std::string const &) const
edm::EDGetTokenT< EcalTrigPrimDigiCollection > inCollectionToken_
EcalCompactTrigPrimProducer::~EcalCompactTrigPrimProducer ( )
inlineoverride

Definition at line 20 of file EcalCompactTrigPrimProducer.h.

References produce().

20 {}

Member Function Documentation

void EcalCompactTrigPrimProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
override

Definition at line 18 of file EcalCompactTrigPrimProducer.cc.

References edm::SortedCollection< T, SORT >::begin(), edm::SortedCollection< T, SORT >::end(), inCollectionToken_, eostools::move(), ecalCompactTrigPrim_cfi::outColl, and outCollection_.

Referenced by ~EcalCompactTrigPrimProducer().

18  {
19  auto outColl = std::make_unique<EcalTrigPrimCompactColl>();
21  event.getByToken(inCollectionToken_, hTPDigis);
22 
23  const EcalTrigPrimDigiCollection* trigPrims = hTPDigis.product();
24 
25  for (EcalTrigPrimDigiCollection::const_iterator trigPrim = trigPrims->begin(); trigPrim != trigPrims->end();
26  ++trigPrim) {
27  outColl->setValue(
28  trigPrim->id().ieta(), trigPrim->id().iphi(), trigPrim->sample(trigPrim->sampleOfInterest()).raw());
29  }
30  event.put(std::move(outColl), outCollection_);
31 }
edm::EDGetTokenT< EcalTrigPrimDigiCollection > inCollectionToken_
std::vector< T >::const_iterator const_iterator
const_iterator end() const
def move(src, dest)
Definition: eostools.py:511
const_iterator begin() const

Member Data Documentation

edm::EDGetTokenT<EcalTrigPrimDigiCollection> EcalCompactTrigPrimProducer::inCollectionToken_
private

Definition at line 24 of file EcalCompactTrigPrimProducer.h.

Referenced by EcalCompactTrigPrimProducer(), and produce().

std::string EcalCompactTrigPrimProducer::outCollection_
private

Definition at line 29 of file EcalCompactTrigPrimProducer.h.

Referenced by EcalCompactTrigPrimProducer(), and produce().