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

#include <RecoJets/JetProducers/plugins/CastorJetIDProducer.cc>

Inheritance diagram for CastorJetIDProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 CastorJetIDProducer (const edm::ParameterSet &)
 
 ~CastorJetIDProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- 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 ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

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

Private Attributes

reco::helper::CastorJetIDHelper helper_
 
edm::InputTag src_
 

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
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

Description: Produces a value map of jet—> jet Id

Definition at line 42 of file CastorJetIDProducer.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file CastorJetIDProducer.cc.

18  :
19  src_ ( iConfig.getParameter<edm::InputTag>("src") ),
20  helper_ ( )
21 {
22  produces< reco::CastorJetIDValueMap >();
23 }
T getParameter(std::string const &) const
reco::helper::CastorJetIDHelper helper_
CastorJetIDProducer::~CastorJetIDProducer ( )

Definition at line 26 of file CastorJetIDProducer.cc.

27 {
28 }

Member Function Documentation

void CastorJetIDProducer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 86 of file CastorJetIDProducer.cc.

87 {
88 }
void CastorJetIDProducer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 92 of file CastorJetIDProducer.cc.

92  {
93 }
void CastorJetIDProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 37 of file CastorJetIDProducer.cc.

References reco::helper::CastorJetIDHelper::calculate(), reco::helper::CastorJetIDHelper::depth(), reco::helper::CastorJetIDHelper::emEnergy(), reco::helper::CastorJetIDHelper::fem(), reco::helper::CastorJetIDHelper::fhot(), edm::helper::Filler< Map >::fill(), edm::Event::getByLabel(), reco::helper::CastorJetIDHelper::hadEnergy(), helper_, edm::helper::Filler< Map >::insert(), reco::helper::CastorJetIDHelper::nTowers(), edm::Event::put(), reco::helper::CastorJetIDHelper::sigmaz(), src_, and reco::helper::CastorJetIDHelper::width().

38 {
39 
40  // get the input jets
42  iEvent.getByLabel( src_, h_jets );
43 
44  // allocate the jet--->jetid value map
45  std::auto_ptr<reco::CastorJetIDValueMap> castorjetIdValueMap( new reco::CastorJetIDValueMap );
46  // instantiate the filler with the map
47  reco::CastorJetIDValueMap::Filler filler(*castorjetIdValueMap);
48 
49  // allocate the vector of ids
50  size_t njets = h_jets->size();
51  std::vector<reco::CastorJetID> ids (njets);
52 
53  // loop over the jets
54  for ( edm::View<reco::BasicJet>::const_iterator jetsBegin = h_jets->begin(),
55  jetsEnd = h_jets->end(),
56  ijet = jetsBegin;
57  ijet != jetsEnd; ++ijet ) {
58 
59  // get the id from each jet
60  helper_.calculate( iEvent, *ijet );
61 
62  ids[ijet-jetsBegin].emEnergy = helper_.emEnergy();
63  ids[ijet-jetsBegin].hadEnergy = helper_.hadEnergy();
64  ids[ijet-jetsBegin].fem = helper_.fem();
65  ids[ijet-jetsBegin].depth = helper_.depth();
66  ids[ijet-jetsBegin].width = helper_.width();
67  ids[ijet-jetsBegin].fhot = helper_.fhot();
68  ids[ijet-jetsBegin].sigmaz = helper_.sigmaz();
69  ids[ijet-jetsBegin].nTowers = helper_.nTowers();
70 
71 
72  }
73 
74  // set up the map
75  filler.insert( h_jets, ids.begin(), ids.end() );
76 
77  // fill the vals
78  filler.fill();
79 
80  // write map to the event
81  iEvent.put( castorjetIdValueMap );
82 }
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
void calculate(const edm::Event &event, const reco::BasicJet &jet)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
reco::helper::CastorJetIDHelper helper_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361

Member Data Documentation

reco::helper::CastorJetIDHelper CastorJetIDProducer::helper_
private

Definition at line 55 of file CastorJetIDProducer.h.

Referenced by produce().

edm::InputTag CastorJetIDProducer::src_
private

Definition at line 54 of file CastorJetIDProducer.h.

Referenced by produce().