CMS 3D CMS Logo

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

This creates a MET object from the difference in MET between two input jet collections. More...

#include <HLTMETCleanerUsingJetID.h>

Inheritance diagram for HLTMETCleanerUsingJetID:
edm::stream::EDProducer<>

Public Member Functions

 HLTMETCleanerUsingJetID (const edm::ParameterSet &iConfig)
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 ~HLTMETCleanerUsingJetID () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::InputTag goodJetsLabel_
 Input tag for the 'good jets' collection. More...
 
edm::InputTag jetsLabel_
 Input tag for the 'all jets' collection. More...
 
edm::EDGetTokenT< reco::CaloJetCollectionm_theGoodJetToken
 
edm::EDGetTokenT< reco::CaloJetCollectionm_theJetToken
 
edm::EDGetTokenT< reco::CaloMETCollectionm_theMETToken
 
double maxEta_
 Maximum (abs) eta requirement for jets. More...
 
edm::InputTag metLabel_
 Input tag for the MET collection. More...
 
double minPt_
 Minimum pt requirement for jets. More...
 

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
 

Detailed Description

This creates a MET object from the difference in MET between two input jet collections.

Author
Jia Fu Low (Nov 2013)

This code creates a new MET vector defined as:

output MET = input MET + MET from 'good jets' - MET from 'all jets'

See header file for more information.

Author
a Jet/MET person

Definition at line 32 of file HLTMETCleanerUsingJetID.h.

Constructor & Destructor Documentation

◆ HLTMETCleanerUsingJetID()

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

Definition at line 13 of file HLTMETCleanerUsingJetID.cc.

14  : minPt_(iConfig.getParameter<double>("minPt")),
15  maxEta_(iConfig.getParameter<double>("maxEta")),
16  metLabel_(iConfig.getParameter<edm::InputTag>("metLabel")),
17  jetsLabel_(iConfig.getParameter<edm::InputTag>("jetsLabel")),
18  goodJetsLabel_(iConfig.getParameter<edm::InputTag>("goodJetsLabel")) {
19  m_theMETToken = consumes<reco::CaloMETCollection>(metLabel_);
20  m_theJetToken = consumes<reco::CaloJetCollection>(jetsLabel_);
21  m_theGoodJetToken = consumes<reco::CaloJetCollection>(goodJetsLabel_);
22 
23  // Register the products
24  produces<reco::CaloMETCollection>();
25 }

References goodJetsLabel_, jetsLabel_, m_theGoodJetToken, m_theJetToken, m_theMETToken, and metLabel_.

◆ ~HLTMETCleanerUsingJetID()

HLTMETCleanerUsingJetID::~HLTMETCleanerUsingJetID ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

void HLTMETCleanerUsingJetID::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 31 of file HLTMETCleanerUsingJetID.cc.

31  {
33  desc.add<double>("minPt", 20.);
34  desc.add<double>("maxEta", 5.);
35  desc.add<edm::InputTag>("metLabel", edm::InputTag("hltMet"));
36  desc.add<edm::InputTag>("jetsLabel", edm::InputTag("hltAntiKT4CaloJets"));
37  desc.add<edm::InputTag>("goodJetsLabel", edm::InputTag("hltCaloJetIDPassed"));
38  descriptions.add("hltMETCleanerUsingJetID", desc);
39 }

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and HLT_FULL_cff::InputTag.

◆ produce()

void HLTMETCleanerUsingJetID::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 42 of file HLTMETCleanerUsingJetID.cc.

42  {
43  // Create a pointer to the products
44  std::unique_ptr<reco::CaloMETCollection> result(new reco::CaloMETCollection);
45 
49 
50  iEvent.getByToken(m_theMETToken, met);
51  iEvent.getByToken(m_theJetToken, jets);
52  iEvent.getByToken(m_theGoodJetToken, goodJets);
53 
54  double mex_jets = 0.;
55  double mey_jets = 0.;
56  double sumet_jets = 0.;
57  if (!jets->empty()) {
58  for (auto const& j : *jets) {
59  double pt = j.pt();
60  double eta = j.eta();
61  double px = j.px();
62  double py = j.py();
63 
64  if (pt > minPt_ && std::abs(eta) < maxEta_) {
65  mex_jets -= px;
66  mey_jets -= py;
67  sumet_jets += pt;
68  }
69  }
70  }
71 
72  double mex_goodJets = 0.;
73  double mey_goodJets = 0.;
74  double sumet_goodJets = 0.;
75  if (!goodJets->empty()) {
76  for (auto const& j : *goodJets) {
77  double pt = j.pt();
78  double eta = j.eta();
79  double px = j.px();
80  double py = j.py();
81 
82  if (pt > minPt_ && std::abs(eta) < maxEta_) {
83  mex_goodJets -= px;
84  mey_goodJets -= py;
85  sumet_goodJets += pt;
86  }
87  }
88  }
89 
90  if (!met->empty()) {
91  double mex_diff = mex_goodJets - mex_jets;
92  double mey_diff = mey_goodJets - mey_jets;
93  //double sumet_diff = sumet_goodJets - sumet_jets; // cannot set sumet...
94  reco::Candidate::LorentzVector p4_clean(met->front().px() + mex_diff,
95  mey_diff + met->front().py(),
96  0,
97  sqrt((met->front().px() + mex_diff) * (met->front().px() + mex_diff) +
98  (met->front().py() + mey_diff) * (met->front().py() + mey_diff)));
99 
100  reco::CaloMET cleanmet = met->front();
101  cleanmet.setP4(p4_clean);
102  result->push_back(cleanmet);
103  }
104 
105  iEvent.put(std::move(result));
106 }

References funct::abs(), PVValHelper::eta, topObjectSelection_cff::goodJets, iEvent, dqmiolumiharvest::j, singleTopDQM_cfi::jets, m_theGoodJetToken, m_theJetToken, m_theMETToken, maxEta_, BTaggingMonitor_cfi::met, minPt_, eostools::move(), DiDispStaMuonMonitor_cfi::pt, multPhiCorr_741_25nsDY_cfi::px, multPhiCorr_741_25nsDY_cfi::py, mps_fire::result, and mathSSE::sqrt().

Member Data Documentation

◆ goodJetsLabel_

edm::InputTag HLTMETCleanerUsingJetID::goodJetsLabel_
private

Input tag for the 'good jets' collection.

Definition at line 54 of file HLTMETCleanerUsingJetID.h.

Referenced by HLTMETCleanerUsingJetID().

◆ jetsLabel_

edm::InputTag HLTMETCleanerUsingJetID::jetsLabel_
private

Input tag for the 'all jets' collection.

Definition at line 51 of file HLTMETCleanerUsingJetID.h.

Referenced by HLTMETCleanerUsingJetID().

◆ m_theGoodJetToken

edm::EDGetTokenT<reco::CaloJetCollection> HLTMETCleanerUsingJetID::m_theGoodJetToken
private

Definition at line 58 of file HLTMETCleanerUsingJetID.h.

Referenced by HLTMETCleanerUsingJetID(), and produce().

◆ m_theJetToken

edm::EDGetTokenT<reco::CaloJetCollection> HLTMETCleanerUsingJetID::m_theJetToken
private

Definition at line 57 of file HLTMETCleanerUsingJetID.h.

Referenced by HLTMETCleanerUsingJetID(), and produce().

◆ m_theMETToken

edm::EDGetTokenT<reco::CaloMETCollection> HLTMETCleanerUsingJetID::m_theMETToken
private

Definition at line 56 of file HLTMETCleanerUsingJetID.h.

Referenced by HLTMETCleanerUsingJetID(), and produce().

◆ maxEta_

double HLTMETCleanerUsingJetID::maxEta_
private

Maximum (abs) eta requirement for jets.

Definition at line 45 of file HLTMETCleanerUsingJetID.h.

Referenced by produce().

◆ metLabel_

edm::InputTag HLTMETCleanerUsingJetID::metLabel_
private

Input tag for the MET collection.

Definition at line 48 of file HLTMETCleanerUsingJetID.h.

Referenced by HLTMETCleanerUsingJetID().

◆ minPt_

double HLTMETCleanerUsingJetID::minPt_
private

Minimum pt requirement for jets.

Definition at line 42 of file HLTMETCleanerUsingJetID.h.

Referenced by produce().

HLTMETCleanerUsingJetID::maxEta_
double maxEta_
Maximum (abs) eta requirement for jets.
Definition: HLTMETCleanerUsingJetID.h:45
HLTMETCleanerUsingJetID::jetsLabel_
edm::InputTag jetsLabel_
Input tag for the 'all jets' collection.
Definition: HLTMETCleanerUsingJetID.h:51
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89281
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
HLTMETCleanerUsingJetID::goodJetsLabel_
edm::InputTag goodJetsLabel_
Input tag for the 'good jets' collection.
Definition: HLTMETCleanerUsingJetID.h:54
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
HLTMETCleanerUsingJetID::m_theGoodJetToken
edm::EDGetTokenT< reco::CaloJetCollection > m_theGoodJetToken
Definition: HLTMETCleanerUsingJetID.h:58
edm::Handle< reco::CaloMETCollection >
HLTMETCleanerUsingJetID::minPt_
double minPt_
Minimum pt requirement for jets.
Definition: HLTMETCleanerUsingJetID.h:42
BTaggingMonitor_cfi.met
met
Definition: BTaggingMonitor_cfi.py:84
reco::CaloMET
Definition: CaloMET.h:21
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
PVValHelper::eta
Definition: PVValidationHelpers.h:70
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
HLTMETCleanerUsingJetID::metLabel_
edm::InputTag metLabel_
Input tag for the MET collection.
Definition: HLTMETCleanerUsingJetID.h:48
HLTMETCleanerUsingJetID::m_theMETToken
edm::EDGetTokenT< reco::CaloMETCollection > m_theMETToken
Definition: HLTMETCleanerUsingJetID.h:56
iEvent
int iEvent
Definition: GenABIO.cc:224
multPhiCorr_741_25nsDY_cfi.px
px
Definition: multPhiCorr_741_25nsDY_cfi.py:10
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HLTMETCleanerUsingJetID::m_theJetToken
edm::EDGetTokenT< reco::CaloJetCollection > m_theJetToken
Definition: HLTMETCleanerUsingJetID.h:57
topObjectSelection_cff.goodJets
goodJets
Definition: topObjectSelection_cff.py:58
mps_fire.result
result
Definition: mps_fire.py:311
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
reco::CaloMETCollection
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
Definition: CaloMETCollection.h:20
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::InputTag
Definition: InputTag.h:15