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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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 14 of file EcalCompactTrigPrimProducer.cc.

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

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

Definition at line 21 of file EcalCompactTrigPrimProducer.h.

References produce().

21 {}

Member Function Documentation

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

Definition at line 22 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().

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

Member Data Documentation

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

Definition at line 26 of file EcalCompactTrigPrimProducer.h.

Referenced by EcalCompactTrigPrimProducer(), and produce().

std::string EcalCompactTrigPrimProducer::outCollection_
private

Definition at line 31 of file EcalCompactTrigPrimProducer.h.

Referenced by EcalCompactTrigPrimProducer(), and produce().