test
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::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void produce (edm::Event &, const edm::EventSetup &) override
 
 TCRecoTauProducer (const edm::ParameterSet &iConfig)
 
 ~TCRecoTauProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

edm::InputTag caloRecoTauProducer
 
TCTauAlgorithmtcTauAlgorithm
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- 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::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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 CaloRecoTauProducer_cfi::caloRecoTauProducer, and edm::ParameterSet::getParameter().

32  {
33  caloRecoTauProducer = iConfig.getParameter<edm::InputTag>("CaloRecoTauProducer");
35 
36  produces<CaloTauCollection>();
37 }
T getParameter(std::string const &) const
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
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 
)
overridevirtual

Implements edm::EDProducer.

Definition at line 42 of file TCRecoTauProducer.cc.

References CaloRecoTauProducer_cfi::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:116
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:390
T const * product() const
Definition: Handle.h:81
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.