CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
JetChargeProducer Class Reference

#include <JetChargeProducer.h>

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

Public Types

typedef
reco::JetFloatAssociation::Container 
JetChargeCollection
 
- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 

Public Member Functions

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

JetCharge algo_
 
edm::InputTag src_
 

Additional Inherited Members

- 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 13 of file JetChargeProducer.h.

Member Typedef Documentation

Definition at line 15 of file JetChargeProducer.h.

Constructor & Destructor Documentation

JetChargeProducer::JetChargeProducer ( const edm::ParameterSet cfg)
explicit

Definition at line 3 of file JetChargeProducer.cc.

3  :
4 src_(cfg.getParameter<edm::InputTag>("src")),
5 algo_(cfg) {
6  produces<JetChargeCollection>();
7 }
T getParameter(std::string const &) const
edm::InputTag src_

Member Function Documentation

void JetChargeProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 9 of file JetChargeProducer.cc.

References algo_, JetCharge::charge(), edm::Event::getByLabel(), metsig::jet, edm::Event::put(), run_regression::ret, reco::JetFloatAssociation::setValue(), src_, and testEve_cfg::tracks.

9  {
11  iEvent.getByLabel(src_, hJTAs);
14 
15  if (hJTAs->keyProduct().isNull()) {
16  // need to work around this bug someway, altough it's not stricly my fault
17  std::auto_ptr<JetChargeCollection> ret(new JetChargeCollection());
18  iEvent.put(ret);
19  return;
20  }
21  std::auto_ptr<JetChargeCollection> ret(new JetChargeCollection(hJTAs->keyProduct()));
22  for (IT it = hJTAs->begin(), ed = hJTAs->end(); it != ed; ++it) {
23  const JetRef &jet = it->first;
24  const reco::TrackRefVector &tracks = it->second;
25  float val = static_cast<float>( algo_.charge(jet->p4(), tracks) );
27  }
28 
29  iEvent.put(ret);
30 }
double charge(const LorentzVector &lv, const reco::TrackCollection &vec) const
Definition: JetCharge.cc:7
transient_vector_type::const_iterator const_iterator
edm::Ref< JetCollection > JetRef
Definition: Jet.h:52
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
edm::InputTag src_
std::vector< LinkConnSpec >::const_iterator IT
reco::JetFloatAssociation::Container JetChargeCollection
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
bool setValue(Container &, const reco::JetBaseRef &, float)
associate jet with value
tuple tracks
Definition: testEve_cfg.py:39

Member Data Documentation

JetCharge JetChargeProducer::algo_
private

Definition at line 21 of file JetChargeProducer.h.

Referenced by produce().

edm::InputTag JetChargeProducer::src_
private

Definition at line 20 of file JetChargeProducer.h.

Referenced by produce().