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 Member Functions | Private Attributes
BoostedJetMerger Class Reference

#include <BoostedJetMerger.h>

Inheritance diagram for BoostedJetMerger:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 BoostedJetMerger (const edm::ParameterSet &)
 
 ~BoostedJetMerger ()
 
- 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
 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 Member Functions

virtual void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

edm::EDGetTokenT< edm::View
< pat::Jet > > 
jetToken_
 
edm::EDGetTokenT< edm::View
< pat::Jet > > 
subjetToken_
 

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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- 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::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 57 of file BoostedJetMerger.h.

Constructor & Destructor Documentation

BoostedJetMerger::BoostedJetMerger ( const edm::ParameterSet iConfig)
explicit

Definition at line 4 of file BoostedJetMerger.cc.

4  :
7 {
8  //register products
9  produces<std::vector<pat::Jet> > ();
10 }
T getParameter(std::string const &) const
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< edm::View< pat::Jet > > jetToken_
edm::EDGetTokenT< edm::View< pat::Jet > > subjetToken_
BoostedJetMerger::~BoostedJetMerger ( )

Definition at line 13 of file BoostedJetMerger.cc.

14 {
15 }

Member Function Documentation

void BoostedJetMerger::produce ( edm::Event iEvent,
const edm::EventSetup  
)
overrideprivatevirtual

Implements edm::stream::EDProducerBase.

Definition at line 20 of file BoostedJetMerger.cc.

References edm::Event::getByToken(), jetToken_, edm::Event::put(), and subjetToken_.

21 {
22 
23  std::auto_ptr< std::vector<pat::Jet> > outputs( new std::vector<pat::Jet> );
24 
26  edm::Handle< edm::View<pat::Jet> > subjetHandle;
27 
28  iEvent.getByToken( jetToken_, jetHandle );
29  iEvent.getByToken( subjetToken_, subjetHandle );
30 
31  for ( edm::View<pat::Jet>::const_iterator ijetBegin = jetHandle->begin(),
32  ijetEnd = jetHandle->end(), ijet = ijetBegin; ijet != ijetEnd; ++ijet ) {
33 
34  outputs->push_back( *ijet );
35  std::vector< edm::Ptr<reco::Candidate> > nextSubjets;
36 
37  for ( unsigned int isubjet = 0; isubjet < ijet->numberOfDaughters(); ++isubjet ) {
38  edm::Ptr<reco::Candidate> const & subjet = ijet->daughterPtr(isubjet);
39  edm::View<pat::Jet>::const_iterator ifound = find_if( subjetHandle->begin(),
40  subjetHandle->end(),
41  FindCorrectedSubjet(subjet) );
42  if ( ifound != subjetHandle->end() ) {
43  nextSubjets.push_back( subjetHandle->ptrAt( ifound - subjetHandle->begin() ) );
44 
45  }
46  }
47  outputs->back().clearDaughters();
48  for ( std::vector< edm::Ptr<reco::Candidate> >::const_iterator nextSubjet = nextSubjets.begin(),
49  nextSubjetEnd = nextSubjets.end(); nextSubjet != nextSubjetEnd; ++nextSubjet ) {
50  outputs->back().addDaughter( *nextSubjet );
51  }
52 
53 
54  }
55 
56  iEvent.put(outputs);
57 
58 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
edm::EDGetTokenT< edm::View< pat::Jet > > jetToken_
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
edm::EDGetTokenT< edm::View< pat::Jet > > subjetToken_

Member Data Documentation

edm::EDGetTokenT<edm::View<pat::Jet> > BoostedJetMerger::jetToken_
private

Definition at line 68 of file BoostedJetMerger.h.

Referenced by produce().

edm::EDGetTokenT<edm::View<pat::Jet> > BoostedJetMerger::subjetToken_
private

Definition at line 69 of file BoostedJetMerger.h.

Referenced by produce().