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
RecoTauPiZeroUnembedder Class Reference
Inheritance diagram for RecoTauPiZeroUnembedder:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void produce (edm::Event &evt, const edm::EventSetup &es)
 
 RecoTauPiZeroUnembedder (const edm::ParameterSet &pset)
 
virtual ~RecoTauPiZeroUnembedder ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
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 ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

edm::InputTag src_
 

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
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 26 of file RecoTauPiZeroUnembedder.cc.

Constructor & Destructor Documentation

RecoTauPiZeroUnembedder::RecoTauPiZeroUnembedder ( const edm::ParameterSet pset)

Definition at line 35 of file RecoTauPiZeroUnembedder.cc.

References edm::ParameterSet::getParameter(), and src_.

35  {
36  src_ = pset.getParameter<edm::InputTag>("src");
37  produces<reco::RecoTauPiZeroCollection>("pizeros");
38  produces<reco::PFTauCollection>();
39 }
T getParameter(std::string const &) const
virtual RecoTauPiZeroUnembedder::~RecoTauPiZeroUnembedder ( )
inlinevirtual

Definition at line 29 of file RecoTauPiZeroUnembedder.cc.

29 {}

Member Function Documentation

void RecoTauPiZeroUnembedder::produce ( edm::Event evt,
const edm::EventSetup es 
)
virtual

Implements edm::EDProducer.

Definition at line 40 of file RecoTauPiZeroUnembedder.cc.

References edm::Event::getByLabel(), edm::Event::getRefBeforePut(), reco::PFTau::isolationPiZeroCandidates(), edm::RefVector< C, T, F >::push_back(), edm::Event::put(), reco::PFTau::setIsolationPiZeroCandidatesRefs(), reco::PFTau::setSignalPiZeroCandidatesRefs(), reco::PFTau::signalPiZeroCandidates(), edm::RefVector< C, T, F >::size(), and src_.

40  {
41  std::auto_ptr<reco::RecoTauPiZeroCollection> piZerosOut(
43  std::auto_ptr<reco::PFTauCollection> tausOut(new reco::PFTauCollection);
44 
46  evt.getByLabel(src_, tauView);
47 
49  reco::tau::castView<reco::PFTauRefVector>(tauView);
50 
51  // Get the reference to the product of where the final pizeros will end up
52  reco::RecoTauPiZeroRefProd piZeroProd =
54 
55  for (size_t iTau = 0; iTau < taus.size(); ++iTau) {
56  // Make a copy
57  reco::PFTau myTau = *taus[iTau];
58  // The ref vectors that will be filled
59  reco::RecoTauPiZeroRefVector signalPiZeroRefs;
60  reco::RecoTauPiZeroRefVector isolationPiZeroRefs;
61 
62  // Copy the PiZeros into the new vector, while updating what refs they will
63  // have
64  const reco::RecoTauPiZeroCollection& signalPiZeros =
65  myTau.signalPiZeroCandidates();
66 
67  for (size_t iPiZero = 0; iPiZero < signalPiZeros.size(); ++iPiZero) {
68  piZerosOut->push_back(signalPiZeros[iPiZero]);
69  // Figure out what the ref for this pizero will be in the new coll.
70  signalPiZeroRefs.push_back(
71  reco::RecoTauPiZeroRef(piZeroProd, piZerosOut->size()-1));
72  }
73 
74  const reco::RecoTauPiZeroCollection& isolationPiZeroCandidates =
76  for (size_t iPiZero = 0; iPiZero < isolationPiZeroCandidates.size(); ++iPiZero) {
77  piZerosOut->push_back(isolationPiZeroCandidates[iPiZero]);
78  // Figure out what the ref for this pizero will be in the new coll.
79  isolationPiZeroRefs.push_back(
80  reco::RecoTauPiZeroRef(piZeroProd, piZerosOut->size()-1));
81  }
82 
83  myTau.setSignalPiZeroCandidatesRefs(signalPiZeroRefs);
84  myTau.setIsolationPiZeroCandidatesRefs(isolationPiZeroRefs);
85 
86  tausOut->push_back(myTau);
87  }
88 
89  evt.put(piZerosOut, "pizeros");
90  evt.put(tausOut);
91 }
std::vector< PFTau > PFTauCollection
collection of PFTau objects
Definition: PFTauFwd.h:9
std::vector< RecoTauPiZero > RecoTauPiZeroCollection
collection of RecoTauPiZero objects
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
const std::vector< RecoTauPiZero > & signalPiZeroCandidates() const
Retrieve the association of signal region gamma candidates into candidate PiZeros.
Definition: PFTau.cc:92
void setIsolationPiZeroCandidatesRefs(const RecoTauPiZeroRefVector &)
Definition: PFTau.cc:111
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
RefProd< PROD > getRefBeforePut()
Definition: Event.h:106
const std::vector< RecoTauPiZero > & isolationPiZeroCandidates() const
Retrieve the association of isolation region gamma candidates into candidate PiZeros.
Definition: PFTau.cc:115
void setSignalPiZeroCandidatesRefs(const RecoTauPiZeroRefVector &)
Definition: PFTau.cc:107
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:64
size_type size() const
Size of the RefVector.
Definition: RefVector.h:89

Member Data Documentation

edm::InputTag RecoTauPiZeroUnembedder::src_
private

Definition at line 32 of file RecoTauPiZeroUnembedder.cc.

Referenced by produce(), and RecoTauPiZeroUnembedder().