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::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

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

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

Private Attributes

edm::InputTag jetLabel_
 
edm::InputTag subjetLabel_
 

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 57 of file BoostedJetMerger.h.

Constructor & Destructor Documentation

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

Definition at line 4 of file BoostedJetMerger.cc.

4  :
5  jetLabel_(iConfig.getParameter<edm::InputTag>("jetSrc")),
6  subjetLabel_(iConfig.getParameter<edm::InputTag>("subjetSrc"))
7 {
8  //register products
9  produces<std::vector<pat::Jet> > ();
10 }
T getParameter(std::string const &) const
edm::InputTag jetLabel_
edm::InputTag subjetLabel_
BoostedJetMerger::~BoostedJetMerger ( )

Definition at line 13 of file BoostedJetMerger.cc.

14 {
15 }

Member Function Documentation

void BoostedJetMerger::beginJob ( const edm::EventSetup )
privatevirtual

Definition at line 62 of file BoostedJetMerger.cc.

63 {
64 }
void BoostedJetMerger::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 68 of file BoostedJetMerger.cc.

68  {
69 }
void BoostedJetMerger::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 20 of file BoostedJetMerger.cc.

References edm::Event::getByLabel(), jetLabel_, edm::Event::put(), and subjetLabel_.

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.getByLabel( jetLabel_, jetHandle );
29  iEvent.getByLabel( subjetLabel_, 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 }
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
edm::InputTag jetLabel_
edm::InputTag subjetLabel_

Member Data Documentation

edm::InputTag BoostedJetMerger::jetLabel_
private

Definition at line 70 of file BoostedJetMerger.h.

Referenced by produce().

edm::InputTag BoostedJetMerger::subjetLabel_
private

Definition at line 71 of file BoostedJetMerger.h.

Referenced by produce().