CMS 3D CMS Logo

Public Member Functions | Private Attributes

TCRecoTauProducer Class Reference

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

List of all members.

Public Member Functions

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

Private Attributes

edm::InputTag caloRecoTauProducer
TCTauAlgorithmtcTauAlgorithm

Detailed Description

Definition at line 20 of file TCRecoTauProducer.cc.


Constructor & Destructor Documentation

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

Definition at line 32 of file TCRecoTauProducer.cc.

References RecoTCTauTag_cff::caloRecoTauProducer, and edm::ParameterSet::getParameter().

                                                                  {
        caloRecoTauProducer = iConfig.getParameter<edm::InputTag>("CaloRecoTauProducer");
        tcTauAlgorithm = new TCTauAlgorithm(iConfig);

        produces<CaloTauCollection>();
}
TCRecoTauProducer::~TCRecoTauProducer ( )

Definition at line 38 of file TCRecoTauProducer.cc.

                                     {
        delete tcTauAlgorithm;
}

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 42 of file TCRecoTauProducer.cc.

References RecoTCTauTag_cff::caloRecoTauProducer, edm::Event::getByLabel(), edm::HandleBase::isValid(), edm::Handle< T >::product(), edm::Event::put(), and reco::LeafCandidate::setP4().

                                                                           {

        std::auto_ptr<CaloTauCollection> tcTauCollection(new CaloTauCollection);

        edm::Handle<CaloTauCollection> theCaloTauHandle;
        iEvent.getByLabel(caloRecoTauProducer,theCaloTauHandle);

        tcTauAlgorithm->eventSetup(iEvent,iSetup);

        if(theCaloTauHandle.isValid()){
          const CaloTauCollection & caloTaus = *(theCaloTauHandle.product());
          CaloTauCollection::const_iterator iTau;
          for(iTau = caloTaus.begin(); iTau != caloTaus.end(); iTau++){
                CaloTau theTCTau = *iTau;
                theTCTau.setP4(tcTauAlgorithm->recalculateEnergy(theTCTau));
                tcTauCollection->push_back(theTCTau);
          }
        }

        iEvent.put(tcTauCollection);
}

Member Data Documentation

Definition at line 28 of file TCRecoTauProducer.cc.

Definition at line 29 of file TCRecoTauProducer.cc.