CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
TCRecoTauProducer Class Reference
Inheritance diagram for TCRecoTauProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

virtual void produce (edm::Event &, const edm::EventSetup &)
 
 TCRecoTauProducer (const edm::ParameterSet &iConfig)
 
 ~TCRecoTauProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

edm::InputTag caloRecoTauProducer
 
TCTauAlgorithmtcTauAlgorithm
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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().

32  {
33  caloRecoTauProducer = iConfig.getParameter<edm::InputTag>("CaloRecoTauProducer");
34  tcTauAlgorithm = new TCTauAlgorithm(iConfig);
35 
36  produces<CaloTauCollection>();
37 }
T getParameter(std::string const &) const
TCTauAlgorithm * tcTauAlgorithm
edm::InputTag caloRecoTauProducer
TCRecoTauProducer::~TCRecoTauProducer ( )

Definition at line 38 of file TCRecoTauProducer.cc.

38  {
39  delete tcTauAlgorithm;
40 }
TCTauAlgorithm * 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().

42  {
43 
44  std::auto_ptr<CaloTauCollection> tcTauCollection(new CaloTauCollection);
45 
46  edm::Handle<CaloTauCollection> theCaloTauHandle;
47  iEvent.getByLabel(caloRecoTauProducer,theCaloTauHandle);
48 
49  tcTauAlgorithm->eventSetup(iEvent,iSetup);
50 
51  if(theCaloTauHandle.isValid()){
52  const CaloTauCollection & caloTaus = *(theCaloTauHandle.product());
53  CaloTauCollection::const_iterator iTau;
54  for(iTau = caloTaus.begin(); iTau != caloTaus.end(); iTau++){
55  CaloTau theTCTau = *iTau;
56  theTCTau.setP4(tcTauAlgorithm->recalculateEnergy(theTCTau));
57  tcTauCollection->push_back(theTCTau);
58  }
59  }
60 
61  iEvent.put(tcTauCollection);
62 }
void eventSetup(const edm::Event &, const edm::EventSetup &)
virtual void setP4(const LorentzVector &p4)
set 4-momentum
std::vector< CaloTau > CaloTauCollection
collection of CaloTau objects
Definition: CaloTauFwd.h:9
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
math::XYZTLorentzVector recalculateEnergy(const reco::CaloTau &)
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
T const * product() const
Definition: Handle.h:74
TCTauAlgorithm * tcTauAlgorithm
edm::InputTag caloRecoTauProducer

Member Data Documentation

edm::InputTag TCRecoTauProducer::caloRecoTauProducer
private

Definition at line 28 of file TCRecoTauProducer.cc.

TCTauAlgorithm* TCRecoTauProducer::tcTauAlgorithm
private

Definition at line 29 of file TCRecoTauProducer.cc.