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
JetTracksAssociatorExplicit Class Reference

#include <JetTracksAssociatorExplicit.h>

Inheritance diagram for JetTracksAssociatorExplicit:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 JetTracksAssociatorExplicit (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
virtual ~JetTracksAssociatorExplicit ()
 
- 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 Attributes

JetTracksAssociationExplicit mAssociatorExplicit
 
edm::InputTag mJets
 
edm::InputTag mTracks
 

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 20 of file JetTracksAssociatorExplicit.h.

Constructor & Destructor Documentation

JetTracksAssociatorExplicit::JetTracksAssociatorExplicit ( const edm::ParameterSet fConfig)

Definition at line 19 of file JetTracksAssociatorExplicit.cc.

20  : mJets (fConfig.getParameter<edm::InputTag> ("jets")),
21  mTracks (fConfig.getParameter<edm::InputTag> ("tracks")),
23 {
24 
25  produces<reco::JetTracksAssociation::Container> ();
26 }
T getParameter(std::string const &) const
JetTracksAssociationExplicit mAssociatorExplicit
JetTracksAssociatorExplicit::~JetTracksAssociatorExplicit ( )
virtual

Definition at line 28 of file JetTracksAssociatorExplicit.cc.

28 {}

Member Function Documentation

void JetTracksAssociatorExplicit::produce ( edm::Event fEvent,
const edm::EventSetup fSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 30 of file JetTracksAssociatorExplicit.cc.

References reco::JetExtendedAssociation::allJets(), muonTagProbeFilters_cff::allTracks, edm::Event::getByLabel(), i, mAssociatorExplicit, mJets, mTracks, JetTracksAssociationExplicit::produce(), and edm::Event::put().

30  {
32  fEvent.getByLabel (mJets, jets_h);
34  fEvent.getByLabel (mTracks, tracks_h);
35 
36  std::auto_ptr<reco::JetTracksAssociation::Container> jetTracks (new reco::JetTracksAssociation::Container (reco::JetRefBaseProd(jets_h)));
37 
38  // format inputs
39  std::vector <edm::RefToBase<reco::Jet> > allJets;
40  allJets.reserve (jets_h->size());
41  for (unsigned i = 0; i < jets_h->size(); ++i) allJets.push_back (jets_h->refAt(i));
42  std::vector <reco::TrackRef> allTracks;
43  allTracks.reserve (tracks_h->size());
44  // run algo
45  for (unsigned i = 0; i < tracks_h->size(); ++i) {
46  allTracks.push_back (reco::TrackRef (tracks_h, i));
47  }
48 
49 
50  mAssociatorExplicit.produce (&*jetTracks, allJets, allTracks);
51 
52 
53  // store output
54  fEvent.put (jetTracks);
55 }
std::vector< reco::JetBaseRef > allJets(const Container &)
fill list of all jets associated with values. Return # of jets in the list
int i
Definition: DBlmapReader.cc:9
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
void produce(reco::JetTracksAssociation::Container *fAssociation, const std::vector< edm::RefToBase< reco::Jet > > &fJets, const std::vector< reco::TrackRef > &fTracks) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
JetTracksAssociationExplicit mAssociatorExplicit

Member Data Documentation

JetTracksAssociationExplicit JetTracksAssociatorExplicit::mAssociatorExplicit
private

Definition at line 30 of file JetTracksAssociatorExplicit.h.

Referenced by produce().

edm::InputTag JetTracksAssociatorExplicit::mJets
private

Definition at line 28 of file JetTracksAssociatorExplicit.h.

Referenced by produce().

edm::InputTag JetTracksAssociatorExplicit::mTracks
private

Definition at line 29 of file JetTracksAssociatorExplicit.h.

Referenced by produce().