Public Member Functions | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
TCRecoTauProducer (const edm::ParameterSet &iConfig) | |
~TCRecoTauProducer () | |
Private Attributes | |
edm::InputTag | caloRecoTauProducer |
TCTauAlgorithm * | tcTauAlgorithm |
Definition at line 20 of file TCRecoTauProducer.cc.
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; }
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); }
Definition at line 28 of file TCRecoTauProducer.cc.
TCTauAlgorithm* TCRecoTauProducer::tcTauAlgorithm [private] |
Definition at line 29 of file TCRecoTauProducer.cc.