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

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

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

Public Member Functions

 JetIDProducer (const edm::ParameterSet &)
 
 ~JetIDProducer ()
 
- 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 Member Functions

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

Private Attributes

reco::helper::JetIDHelper helper_
 
reco::helper::JetMuonHitsIDHelper muHelper_
 
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
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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 46 of file JetIDProducer.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file JetIDProducer.cc.

18  :
19  src_ ( iConfig.getParameter<edm::InputTag>("src") ),
20  helper_ ( iConfig ),
21  muHelper_ ( iConfig )
22 {
23  produces< reco::JetIDValueMap >();
24 }
T getParameter(std::string const &) const
reco::helper::JetIDHelper helper_
Definition: JetIDProducer.h:59
edm::InputTag src_
Definition: JetIDProducer.h:58
reco::helper::JetMuonHitsIDHelper muHelper_
Definition: JetIDProducer.h:60
JetIDProducer::~JetIDProducer ( )

Definition at line 27 of file JetIDProducer.cc.

28 {
29 }

Member Function Documentation

void JetIDProducer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 106 of file JetIDProducer.cc.

107 {
108 }
void JetIDProducer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 112 of file JetIDProducer.cc.

112  {
113 }
void JetIDProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 38 of file JetIDProducer.cc.

References reco::helper::JetIDHelper::approximatefHPD(), reco::helper::JetIDHelper::approximatefRBX(), reco::helper::JetIDHelper::calculate(), reco::helper::JetMuonHitsIDHelper::calculate(), 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(), edm::helper::Filler< Map >::fill(), 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::getByLabel(), helper_, reco::helper::JetIDHelper::hitsInN90(), edm::helper::Filler< Map >::insert(), 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(), reco::helper::JetIDHelper::restrictedEMF(), and src_.

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

Member Data Documentation

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

Definition at line 59 of file JetIDProducer.h.

Referenced by produce().

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

Definition at line 60 of file JetIDProducer.h.

Referenced by produce().

edm::InputTag JetIDProducer::src_
private

Definition at line 58 of file JetIDProducer.h.

Referenced by produce().