CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
JetIDProducer Class Reference

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

Inheritance diagram for JetIDProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 JetIDProducer (const edm::ParameterSet &)
 
 ~JetIDProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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 ()
 
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, std::unordered_multimap< std::string, edm::ProductResolverIndex > 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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

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

Private Attributes

reco::helper::JetIDHelper helper_
 
edm::EDGetTokenT< edm::View< reco::CaloJet > > input_jet_token_
 
reco::helper::JetMuonHitsIDHelper muHelper_
 
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
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

Implementation: There are two modes: AOD only, in which case only a subset of the info is written, and RECO, when all the info is written. The AOD-only case will be suitable for the "very loose" jet ID, whereas the RECO case will be globally suitable.

Definition at line 45 of file JetIDProducer.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file JetIDProducer.cc.

References input_jet_token_, and src_.

18  :
19  src_ ( iConfig.getParameter<edm::InputTag>("src") ),
20  helper_ ( iConfig, consumesCollector() ),
21  muHelper_ ( iConfig, consumesCollector() )
22 {
23  produces< reco::JetIDValueMap >();
24 
25  input_jet_token_ = consumes<edm::View<reco::CaloJet> >(src_);
26 
27 }
T getParameter(std::string const &) const
reco::helper::JetIDHelper helper_
Definition: JetIDProducer.h:56
edm::InputTag src_
Definition: JetIDProducer.h:55
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
reco::helper::JetMuonHitsIDHelper muHelper_
Definition: JetIDProducer.h:57
edm::EDGetTokenT< edm::View< reco::CaloJet > > input_jet_token_
Definition: JetIDProducer.h:59
JetIDProducer::~JetIDProducer ( )

Definition at line 30 of file JetIDProducer.cc.

31 {
32 }

Member Function Documentation

void JetIDProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Definition at line 41 of file JetIDProducer.cc.

References reco::helper::JetIDHelper::approximatefHPD(), reco::helper::JetIDHelper::approximatefRBX(), reco::helper::JetMuonHitsIDHelper::calculate(), reco::helper::JetIDHelper::calculate(), DEFINE_FWK_MODULE, reco::helper::JetIDHelper::fEB(), reco::helper::JetIDHelper::fEE(), reco::helper::JetIDHelper::fHB(), reco::helper::JetIDHelper::fHE(), reco::helper::JetIDHelper::fHFOOT(), reco::helper::JetIDHelper::fHO(), reco::helper::JetIDHelper::fHPD(), objects.autophobj::filler, reco::helper::JetIDHelper::fLong(), reco::helper::JetIDHelper::fLSbad(), reco::helper::JetIDHelper::fRBX(), reco::helper::JetIDHelper::fShort(), reco::helper::JetIDHelper::fSubDetector1(), reco::helper::JetIDHelper::fSubDetector2(), reco::helper::JetIDHelper::fSubDetector3(), reco::helper::JetIDHelper::fSubDetector4(), edm::Event::getByToken(), helper_, reco::helper::JetIDHelper::hitsInN90(), input_jet_token_, eostools::move(), muHelper_, reco::helper::JetIDHelper::n90Hits(), reco::helper::JetIDHelper::nECALTowers(), reco::helper::JetIDHelper::nHCALTowers(), reco::helper::JetMuonHitsIDHelper::numberOfHits2RPC(), reco::helper::JetMuonHitsIDHelper::numberOfHits3RPC(), reco::helper::JetMuonHitsIDHelper::numberOfHitsRPC(), edm::Event::put(), and reco::helper::JetIDHelper::restrictedEMF().

42 {
43 
44  // get the input jets
46  iEvent.getByToken( input_jet_token_, h_jets );
47 
48  // allocate the jet--->jetid value map
49  auto jetIdValueMap = std::make_unique<reco::JetIDValueMap>();
50  // instantiate the filler with the map
51  reco::JetIDValueMap::Filler filler(*jetIdValueMap);
52 
53  // allocate the vector of ids
54  size_t njets = h_jets->size();
55  std::vector<reco::JetID> ids (njets);
56 
57  // loop over the jets
58  for ( edm::View<reco::CaloJet>::const_iterator jetsBegin = h_jets->begin(),
59  jetsEnd = h_jets->end(),
60  ijet = jetsBegin;
61  ijet != jetsEnd; ++ijet ) {
62 
63  // get the id from each jet
64  helper_.calculate( iEvent, *ijet );
65 
66  muHelper_.calculate( iEvent, iSetup, *ijet );
67 
68  ids[ijet-jetsBegin].fHPD = helper_.fHPD();
69  ids[ijet-jetsBegin].fRBX = helper_.fRBX();
70  ids[ijet-jetsBegin].n90Hits = helper_.n90Hits();
71  ids[ijet-jetsBegin].fSubDetector1 = helper_.fSubDetector1();
72  ids[ijet-jetsBegin].fSubDetector2 = helper_.fSubDetector2();
73  ids[ijet-jetsBegin].fSubDetector3 = helper_.fSubDetector3();
74  ids[ijet-jetsBegin].fSubDetector4 = helper_.fSubDetector4();
75  ids[ijet-jetsBegin].restrictedEMF = helper_.restrictedEMF();
76  ids[ijet-jetsBegin].nHCALTowers = helper_.nHCALTowers();
77  ids[ijet-jetsBegin].nECALTowers = helper_.nECALTowers();
78  ids[ijet-jetsBegin].approximatefHPD = helper_.approximatefHPD();
79  ids[ijet-jetsBegin].approximatefRBX = helper_.approximatefRBX();
80  ids[ijet-jetsBegin].hitsInN90 = helper_.hitsInN90();
81 
82  ids[ijet-jetsBegin].numberOfHits2RPC = muHelper_.numberOfHits2RPC();
83  ids[ijet-jetsBegin].numberOfHits3RPC = muHelper_.numberOfHits3RPC();
84  ids[ijet-jetsBegin].numberOfHitsRPC = muHelper_.numberOfHitsRPC();
85 
86  ids[ijet-jetsBegin].fEB = helper_.fEB ();
87  ids[ijet-jetsBegin].fEE = helper_.fEE ();
88  ids[ijet-jetsBegin].fHB = helper_.fHB ();
89  ids[ijet-jetsBegin].fHE = helper_.fHE ();
90  ids[ijet-jetsBegin].fHO = helper_.fHO ();
91  ids[ijet-jetsBegin].fLong = helper_.fLong ();
92  ids[ijet-jetsBegin].fShort = helper_.fShort();
93  ids[ijet-jetsBegin].fLS = helper_.fLSbad ();
94  ids[ijet-jetsBegin].fHFOOT = helper_.fHFOOT();
95  }
96 
97  // set up the map
98  filler.insert( h_jets, ids.begin(), ids.end() );
99 
100  // fill the vals
101  filler.fill();
102 
103  // write map to the event
104  iEvent.put(std::move(jetIdValueMap));
105 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
double fHE() const
Definition: JetIDHelper.h:50
double fHB() const
Definition: JetIDHelper.h:49
double fLSbad() const
Definition: JetIDHelper.h:54
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
int nHCALTowers() const
Definition: JetIDHelper.h:58
double approximatefRBX() const
Definition: JetIDHelper.h:62
double fLong() const
Definition: JetIDHelper.h:52
int nECALTowers() const
Definition: JetIDHelper.h:59
double fHPD() const
Definition: JetIDHelper.h:40
double fSubDetector4() const
Definition: JetIDHelper.h:46
reco::helper::JetIDHelper helper_
Definition: JetIDProducer.h:56
double restrictedEMF() const
Definition: JetIDHelper.h:57
double fSubDetector1() const
Definition: JetIDHelper.h:43
void calculate(const edm::Event &event, const edm::EventSetup &isetup, const reco::Jet &jet, const int iDbg=0)
double approximatefHPD() const
Definition: JetIDHelper.h:61
double fEB() const
Definition: JetIDHelper.h:47
double fEE() const
Definition: JetIDHelper.h:48
double fSubDetector3() const
Definition: JetIDHelper.h:45
double fShort() const
Definition: JetIDHelper.h:53
reco::helper::JetMuonHitsIDHelper muHelper_
Definition: JetIDProducer.h:57
double fSubDetector2() const
Definition: JetIDHelper.h:44
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
edm::EDGetTokenT< edm::View< reco::CaloJet > > input_jet_token_
Definition: JetIDProducer.h:59
double fHO() const
Definition: JetIDHelper.h:51
double fHFOOT() const
Definition: JetIDHelper.h:55
def move(src, dest)
Definition: eostools.py:510
void calculate(const edm::Event &event, const reco::CaloJet &jet, const int iDbg=0)
Definition: JetIDHelper.cc:98
double fRBX() const
Definition: JetIDHelper.h:41

Member Data Documentation

reco::helper::JetIDHelper JetIDProducer::helper_
private

Definition at line 56 of file JetIDProducer.h.

Referenced by produce().

edm::EDGetTokenT<edm::View<reco::CaloJet> > JetIDProducer::input_jet_token_
private

Definition at line 59 of file JetIDProducer.h.

Referenced by JetIDProducer(), and produce().

reco::helper::JetMuonHitsIDHelper JetIDProducer::muHelper_
private

Definition at line 57 of file JetIDProducer.h.

Referenced by produce().

edm::InputTag JetIDProducer::src_
private

Definition at line 55 of file JetIDProducer.h.

Referenced by JetIDProducer().