CMS 3D CMS Logo

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

This produces a reco::MET object that stores HT and MHT. More...

#include <HLTCaloTowerHtMhtProducer.h>

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

Public Member Functions

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

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::EDGetTokenT< CaloTowerCollectionm_theTowersToken
 
double maxEtaTowerHt_
 Maximum (abs) eta requirement for jets. More...
 
double maxEtaTowerMht_
 
double minPtTowerHt_
 Minimum pt requirement for jets. More...
 
double minPtTowerMht_
 
edm::InputTag towersLabel_
 Input CaloTower collection. More...
 
bool usePt_
 Use pt; otherwise, use et. More...
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

This produces a reco::MET object that stores HT and MHT.

Author
Steven Lowette
Michele de Gruttola, Jia Fu Low (Nov 2013)
Thiago Tomei (added the "HT from CaloTower code")

HT & MHT are calculated using input CaloTower collection. HT is stored as sumet_, MHT is stored as p4_ in the output.

See header file for documentation

Author
Steven Lowette
Thiago Tomei

Definition at line 31 of file HLTCaloTowerHtMhtProducer.h.

Constructor & Destructor Documentation

◆ HLTCaloTowerHtMhtProducer()

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

Definition at line 18 of file HLTCaloTowerHtMhtProducer.cc.

References m_theTowersToken, and towersLabel_.

19  : usePt_(iConfig.getParameter<bool>("usePt")),
20  minPtTowerHt_(iConfig.getParameter<double>("minPtTowerHt")),
21  minPtTowerMht_(iConfig.getParameter<double>("minPtTowerMht")),
22  maxEtaTowerHt_(iConfig.getParameter<double>("maxEtaTowerHt")),
23  maxEtaTowerMht_(iConfig.getParameter<double>("maxEtaTowerMht")),
24  towersLabel_(iConfig.getParameter<edm::InputTag>("towersLabel")) {
25  m_theTowersToken = consumes<CaloTowerCollection>(towersLabel_);
26 
27  // Register the products
28  produces<reco::METCollection>();
29 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
double minPtTowerHt_
Minimum pt requirement for jets.
edm::InputTag towersLabel_
Input CaloTower collection.
edm::EDGetTokenT< CaloTowerCollection > m_theTowersToken
double maxEtaTowerHt_
Maximum (abs) eta requirement for jets.
bool usePt_
Use pt; otherwise, use et.

◆ ~HLTCaloTowerHtMhtProducer()

HLTCaloTowerHtMhtProducer::~HLTCaloTowerHtMhtProducer ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 35 of file HLTCaloTowerHtMhtProducer.cc.

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

35  {
36  // Current default is for hltHtMht
38  desc.add<bool>("usePt", false);
39  desc.add<double>("minPtTowerHt", 1.);
40  desc.add<double>("minPtTowerMht", 1.);
41  desc.add<double>("maxEtaTowerHt", 5.);
42  desc.add<double>("maxEtaTowerMht", 5.);
43  desc.add<edm::InputTag>("towersLabel", edm::InputTag("hltTowerMakerForAll"));
44  descriptions.add("hltCaloTowerHtMhtProducer", desc);
45 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

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

Definition at line 48 of file HLTCaloTowerHtMhtProducer.cc.

References funct::abs(), funct::cos(), PVValHelper::eta, htmht(), iEvent, dqmiolumiharvest::j, m_theTowersToken, maxEtaTowerHt_, maxEtaTowerMht_, minPtTowerHt_, minPtTowerMht_, eostools::move(), phi, DiDispStaMuonMonitor_cfi::pt, multPhiCorr_741_25nsDY_cfi::px, multPhiCorr_741_25nsDY_cfi::py, mps_fire::result, funct::sin(), mathSSE::sqrt(), HLT_2023v12_cff::towers, usePt_, and extraflags_cff::vtx.

48  {
49  // Create a pointer to the products
50  std::unique_ptr<reco::METCollection> result(new reco::METCollection());
51 
53  iEvent.getByToken(m_theTowersToken, towers);
54 
55  double ht = 0., mhx = 0., mhy = 0.;
56 
57  if (!towers->empty()) {
58  for (auto const& j : *towers) {
59  double pt = usePt_ ? j.pt() : j.et();
60  double eta = j.eta();
61  double phi = j.phi();
62  double px = usePt_ ? j.px() : j.et() * cos(phi);
63  double py = usePt_ ? j.py() : j.et() * sin(phi);
64 
66  ht += pt;
67  }
68 
70  mhx -= px;
71  mhy -= py;
72  }
73  }
74  }
75 
76  reco::MET::LorentzVector p4(mhx, mhy, 0, sqrt(mhx * mhx + mhy * mhy));
77  reco::MET::Point vtx(0, 0, 0);
78  reco::MET htmht(ht, p4, vtx);
79  result->push_back(htmht);
80 
81  // Put the products into the Event
82  iEvent.put(std::move(result));
83 }
l1ct::Sum htmht(std::vector< l1ct::Jet > jets)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
std::vector< reco::MET > METCollection
collection of MET objects
Definition: METCollection.h:22
int iEvent
Definition: GenABIO.cc:224
Definition: MET.h:41
T sqrt(T t)
Definition: SSEVec.h:19
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double minPtTowerHt_
Minimum pt requirement for jets.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
edm::EDGetTokenT< CaloTowerCollection > m_theTowersToken
double maxEtaTowerHt_
Maximum (abs) eta requirement for jets.
bool usePt_
Use pt; otherwise, use et.
math::XYZPoint Point
point in the space
Definition: Candidate.h:40
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ m_theTowersToken

edm::EDGetTokenT<CaloTowerCollection> HLTCaloTowerHtMhtProducer::m_theTowersToken
private

Definition at line 52 of file HLTCaloTowerHtMhtProducer.h.

Referenced by HLTCaloTowerHtMhtProducer(), and produce().

◆ maxEtaTowerHt_

double HLTCaloTowerHtMhtProducer::maxEtaTowerHt_
private

Maximum (abs) eta requirement for jets.

Definition at line 47 of file HLTCaloTowerHtMhtProducer.h.

Referenced by produce().

◆ maxEtaTowerMht_

double HLTCaloTowerHtMhtProducer::maxEtaTowerMht_
private

Definition at line 48 of file HLTCaloTowerHtMhtProducer.h.

Referenced by produce().

◆ minPtTowerHt_

double HLTCaloTowerHtMhtProducer::minPtTowerHt_
private

Minimum pt requirement for jets.

Definition at line 43 of file HLTCaloTowerHtMhtProducer.h.

Referenced by produce().

◆ minPtTowerMht_

double HLTCaloTowerHtMhtProducer::minPtTowerMht_
private

Definition at line 44 of file HLTCaloTowerHtMhtProducer.h.

Referenced by produce().

◆ towersLabel_

edm::InputTag HLTCaloTowerHtMhtProducer::towersLabel_
private

Input CaloTower collection.

Definition at line 51 of file HLTCaloTowerHtMhtProducer.h.

Referenced by HLTCaloTowerHtMhtProducer().

◆ usePt_

bool HLTCaloTowerHtMhtProducer::usePt_
private

Use pt; otherwise, use et.

Definition at line 40 of file HLTCaloTowerHtMhtProducer.h.

Referenced by produce().