CMS 3D CMS Logo

Public Member Functions | Private Attributes

AlCaEcalHcalReadoutsProducer Class Reference

#include <AlCaEcalHcalReadoutsProducer.h>

Inheritance diagram for AlCaEcalHcalReadoutsProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 AlCaEcalHcalReadoutsProducer (const edm::ParameterSet &)
virtual void produce (edm::Event &, const edm::EventSetup &)
 ~AlCaEcalHcalReadoutsProducer ()

Private Attributes

edm::InputTag hbheLabel_
edm::InputTag hfLabel_
edm::InputTag hoLabel_

Detailed Description

Definition at line 37 of file AlCaEcalHcalReadoutsProducer.h.


Constructor & Destructor Documentation

AlCaEcalHcalReadoutsProducer::AlCaEcalHcalReadoutsProducer ( const edm::ParameterSet iConfig) [explicit]

Definition at line 5 of file AlCaEcalHcalReadoutsProducer.cc.

References edm::ParameterSet::getParameter(), hbheLabel_, hfLabel_, and hoLabel_.

{

   hoLabel_ = iConfig.getParameter<edm::InputTag>("hoInput");
   hfLabel_ = iConfig.getParameter<edm::InputTag>("hfInput");
   hbheLabel_ = iConfig.getParameter<edm::InputTag>("hbheInput");
   
   //register your products
   produces<HBHERecHitCollection>("HBHERecHitCollection");
   produces<HORecHitCollection>("HORecHitCollection");
   produces<HFRecHitCollection>("HFRecHitCollection");
}
AlCaEcalHcalReadoutsProducer::~AlCaEcalHcalReadoutsProducer ( )

Definition at line 19 of file AlCaEcalHcalReadoutsProducer.cc.

{
 

}

Member Function Documentation

void AlCaEcalHcalReadoutsProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [virtual]

Implements edm::EDProducer.

Definition at line 28 of file AlCaEcalHcalReadoutsProducer.cc.

References edm::Event::getByLabel(), hbheLabel_, hfLabel_, hoLabel_, LogDebug, edm::SortedCollection< T, SORT >::push_back(), and edm::Event::put().

{
   using namespace edm;
   using namespace std;

   edm::Handle<HBHERecHitCollection> hbhe;
   edm::Handle<HORecHitCollection> ho;
   edm::Handle<HFRecHitCollection> hf;

   iEvent.getByLabel(hbheLabel_,hbhe);
   if(!hbhe.isValid()){
     LogDebug("") << "AlCaEcalHcalReadoutProducer: Error! can't get hbhe product!" << std::endl;
     return ;
   }

   iEvent.getByLabel(hoLabel_,ho);
    if(!ho.isValid()) {
      LogDebug("") << "AlCaEcalHcalReadoutProducer: Error! can't get ho product!" << std::endl;
    }
    
    iEvent.getByLabel(hfLabel_,hf);
    if(!hf.isValid()) {
      LogDebug("") << "AlCaEcalHcalReadoutProducer: Error! can't get hf product!" << std::endl;
    }
    //Create empty output collections
   
  std::auto_ptr<HBHERecHitCollection> miniHBHERecHitCollection(new HBHERecHitCollection);
  std::auto_ptr<HORecHitCollection> miniHORecHitCollection(new HORecHitCollection);
  std::auto_ptr<HFRecHitCollection> miniHFRecHitCollection(new HFRecHitCollection);

  const HBHERecHitCollection Hithbhe = *(hbhe.product());
  for(HBHERecHitCollection::const_iterator hbheItr=Hithbhe.begin(); hbheItr!=Hithbhe.end(); hbheItr++)
        {
         miniHBHERecHitCollection->push_back(*hbheItr);
        }
  const HORecHitCollection Hitho = *(ho.product());
  for(HORecHitCollection::const_iterator hoItr=Hitho.begin(); hoItr!=Hitho.end(); hoItr++)
        {
         miniHORecHitCollection->push_back(*hoItr);
        }

  const HFRecHitCollection Hithf = *(hf.product());
  for(HFRecHitCollection::const_iterator hfItr=Hithf.begin(); hfItr!=Hithf.end(); hfItr++)
      {
         miniHFRecHitCollection->push_back(*hfItr);
      }



  //Put selected information in the event
  iEvent.put( miniHBHERecHitCollection, "HBHERecHitCollection");
  iEvent.put( miniHORecHitCollection, "HORecHitCollection");
  iEvent.put( miniHFRecHitCollection, "HFRecHitCollection");
  
  
}

Member Data Documentation

Definition at line 47 of file AlCaEcalHcalReadoutsProducer.h.

Referenced by AlCaEcalHcalReadoutsProducer(), and produce().

Definition at line 49 of file AlCaEcalHcalReadoutsProducer.h.

Referenced by AlCaEcalHcalReadoutsProducer(), and produce().

Definition at line 48 of file AlCaEcalHcalReadoutsProducer.h.

Referenced by AlCaEcalHcalReadoutsProducer(), and produce().