CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
RecoTauPiZeroUnembedder Class Reference
Inheritance diagram for RecoTauPiZeroUnembedder:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void produce (edm::Event &evt, const edm::EventSetup &es) override
 
 RecoTauPiZeroUnembedder (const edm::ParameterSet &pset)
 
virtual ~RecoTauPiZeroUnembedder ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

edm::InputTag src_
 
edm::EDGetTokenT< reco::CandidateViewtoken
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 36 of file RecoTauPiZeroUnembedder.cc.

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

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

Definition at line 29 of file RecoTauPiZeroUnembedder.cc.

References produce().

29 {}

Member Function Documentation

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

Definition at line 42 of file RecoTauPiZeroUnembedder.cc.

References DEFINE_FWK_MODULE, edm::Event::getByToken(), edm::Event::getRefBeforePut(), reco::PFTau::isolationPiZeroCandidates(), eostools::move(), 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(), jetCleaner_cfi::taus, and token.

Referenced by ~RecoTauPiZeroUnembedder().

42  {
43  auto piZerosOut = std::make_unique<reco::RecoTauPiZeroCollection>();
44  auto tausOut = std::make_unique<reco::PFTauCollection>();
45 
47  evt.getByToken(token, tauView);
48 
50  reco::tau::castView<reco::PFTauRefVector>(tauView);
51 
52  // Get the reference to the product of where the final pizeros will end up
53  reco::RecoTauPiZeroRefProd piZeroProd =
55 
56  for (size_t iTau = 0; iTau < taus.size(); ++iTau) {
57  // Make a copy
58  reco::PFTau myTau = *taus[iTau];
59  // The ref vectors that will be filled
60  reco::RecoTauPiZeroRefVector signalPiZeroRefs;
61  reco::RecoTauPiZeroRefVector isolationPiZeroRefs;
62 
63  // Copy the PiZeros into the new vector, while updating what refs they will
64  // have
65  const reco::RecoTauPiZeroCollection& signalPiZeros =
66  myTau.signalPiZeroCandidates();
67 
68  for (size_t iPiZero = 0; iPiZero < signalPiZeros.size(); ++iPiZero) {
69  piZerosOut->push_back(signalPiZeros[iPiZero]);
70  // Figure out what the ref for this pizero will be in the new coll.
71  signalPiZeroRefs.push_back(
72  reco::RecoTauPiZeroRef(piZeroProd, piZerosOut->size()-1));
73  }
74 
75  const reco::RecoTauPiZeroCollection& isolationPiZeroCandidates =
77  for (size_t iPiZero = 0; iPiZero < isolationPiZeroCandidates.size(); ++iPiZero) {
78  piZerosOut->push_back(isolationPiZeroCandidates[iPiZero]);
79  // Figure out what the ref for this pizero will be in the new coll.
80  isolationPiZeroRefs.push_back(
81  reco::RecoTauPiZeroRef(piZeroProd, piZerosOut->size()-1));
82  }
83 
84  myTau.setSignalPiZeroCandidatesRefs(signalPiZeroRefs);
85  myTau.setIsolationPiZeroCandidatesRefs(isolationPiZeroRefs);
86 
87  tausOut->push_back(myTau);
88  }
89 
90  evt.put(std::move(piZerosOut), "pizeros");
91  evt.put(std::move(tausOut));
92 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
std::vector< RecoTauPiZero > RecoTauPiZeroCollection
collection of RecoTauPiZero objects
const std::vector< RecoTauPiZero > & signalPiZeroCandidates() const
Retrieve the association of signal region gamma candidates into candidate PiZeros.
Definition: PFTau.cc:127
RefProd< PROD > getRefBeforePut()
Definition: Event.h:134
const std::vector< RecoTauPiZero > & isolationPiZeroCandidates() const
Retrieve the association of isolation region gamma candidates into candidate PiZeros.
Definition: PFTau.cc:146
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:69
size_type size() const
Size of the RefVector.
Definition: RefVector.h:107
void setIsolationPiZeroCandidatesRefs(RecoTauPiZeroRefVector)
Definition: PFTau.cc:157
def move(src, dest)
Definition: eostools.py:510
edm::EDGetTokenT< reco::CandidateView > token
void setSignalPiZeroCandidatesRefs(RecoTauPiZeroRefVector)
Definition: PFTau.cc:142

Member Data Documentation

edm::InputTag RecoTauPiZeroUnembedder::src_
private

Definition at line 32 of file RecoTauPiZeroUnembedder.cc.

Referenced by RecoTauPiZeroUnembedder().

edm::EDGetTokenT<reco::CandidateView> RecoTauPiZeroUnembedder::token
private

Definition at line 33 of file RecoTauPiZeroUnembedder.cc.

Referenced by produce(), and RecoTauPiZeroUnembedder().