CMS 3D CMS Logo

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

Public Member Functions

 CastorJetIDProducer (const edm::ParameterSet &)
 
 ~CastorJetIDProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

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

Private Attributes

reco::helper::CastorJetIDHelper helper_
 
edm::EDGetTokenT< edm::View< reco::BasicJet > > input_jet_token_
 
edm::InputTag src_
 

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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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::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 41 of file CastorJetIDProducer.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file CastorJetIDProducer.cc.

References input_jet_token_, and src_.

18  :
19  src_ ( iConfig.getParameter<edm::InputTag>("src") ),
20  helper_ ( )
21 {
22  produces< reco::CastorJetIDValueMap >();
23 
24  input_jet_token_ = consumes<edm::View<reco::BasicJet> >(src_);
25 
26 }
T getParameter(std::string const &) const
reco::helper::CastorJetIDHelper helper_
edm::EDGetTokenT< edm::View< reco::BasicJet > > input_jet_token_
CastorJetIDProducer::~CastorJetIDProducer ( )
override

Definition at line 29 of file CastorJetIDProducer.cc.

30 {
31 }

Member Function Documentation

void CastorJetIDProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 40 of file CastorJetIDProducer.cc.

References reco::helper::CastorJetIDHelper::calculate(), DEFINE_FWK_MODULE, reco::helper::CastorJetIDHelper::depth(), reco::helper::CastorJetIDHelper::emEnergy(), reco::helper::CastorJetIDHelper::fem(), reco::helper::CastorJetIDHelper::fhot(), objects.autophobj::filler, edm::Event::getByToken(), reco::helper::CastorJetIDHelper::hadEnergy(), helper_, electrons_cff::ids, input_jet_token_, eostools::move(), reco::helper::CastorJetIDHelper::nTowers(), edm::Event::put(), reco::helper::CastorJetIDHelper::sigmaz(), and reco::helper::CastorJetIDHelper::width().

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

Member Data Documentation

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

Definition at line 52 of file CastorJetIDProducer.h.

Referenced by produce().

edm::EDGetTokenT<edm::View<reco::BasicJet> > CastorJetIDProducer::input_jet_token_
private

Definition at line 54 of file CastorJetIDProducer.h.

Referenced by CastorJetIDProducer(), and produce().

edm::InputTag CastorJetIDProducer::src_
private

Definition at line 51 of file CastorJetIDProducer.h.

Referenced by CastorJetIDProducer().