CMS 3D CMS Logo

Public Member Functions | Private Attributes

EcalCompactTrigPrimProducer Class Reference

#include <EcalCompactTrigPrimProducer.h>

Inheritance diagram for EcalCompactTrigPrimProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 EcalCompactTrigPrimProducer (const edm::ParameterSet &ps)
virtual void produce (edm::Event &evt, const edm::EventSetup &es)
virtual ~EcalCompactTrigPrimProducer ()

Private Attributes

edm::InputTag inCollection_
std::string outCollection_

Detailed Description

$Id: $Date: $Revision:

Author:
Ph. Gras CEA/IRFU Saclay

Definition at line 16 of file EcalCompactTrigPrimProducer.h.


Constructor & Destructor Documentation

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

Definition at line 14 of file EcalCompactTrigPrimProducer.cc.

References outCollection_.

                                                                                 :
  inCollection_(ps.getParameter<edm::InputTag>("inColl")),
  outCollection_(ps.getParameter<std::string>("outColl"))
{

  produces<EcalTrigPrimCompactColl>(outCollection_);
}
virtual EcalCompactTrigPrimProducer::~EcalCompactTrigPrimProducer ( ) [inline, virtual]

Definition at line 20 of file EcalCompactTrigPrimProducer.h.

{}

Member Function Documentation

void EcalCompactTrigPrimProducer::produce ( edm::Event evt,
const edm::EventSetup es 
) [virtual]

Implements edm::EDProducer.

Definition at line 22 of file EcalCompactTrigPrimProducer.cc.

References edm::SortedCollection< T, SORT >::begin(), edm::SortedCollection< T, SORT >::end(), inCollection_, ExpressReco_HICollisions_FallBack::outColl, outCollection_, and edm::Handle< T >::product().

{
  std::auto_ptr<EcalTrigPrimCompactColl> outColl(new EcalTrigPrimCompactColl);
  edm::Handle<EcalTrigPrimDigiCollection> hTPDigis;
  event.getByLabel(inCollection_, hTPDigis);
  
  const EcalTrigPrimDigiCollection* trigPrims =  hTPDigis.product();
  
  for(EcalTrigPrimDigiCollection::const_iterator trigPrim = trigPrims->begin();
      trigPrim != trigPrims->end(); ++trigPrim){
    outColl->setValue(trigPrim->id().ieta(), trigPrim->id().iphi(), trigPrim->sample(trigPrim->sampleOfInterest()).raw());
  }
  event.put(outColl, outCollection_);
}

Member Data Documentation

Definition at line 26 of file EcalCompactTrigPrimProducer.h.

Referenced by produce().

Definition at line 31 of file EcalCompactTrigPrimProducer.h.

Referenced by EcalCompactTrigPrimProducer(), and produce().