CMS 3D CMS Logo

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

This rejects events using the minimum delta phi between a jet and MET. More...

#include <HLTMinDPhiMETFilter.h>

Inheritance diagram for HLTMinDPhiMETFilter:
HLTFilter edm::global::EDFilter<> edm::global::EDFilterBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

bool hltFilter (edm::Event &iEvent, const edm::EventSetup &iSetup, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
 
 HLTMinDPhiMETFilter (const edm::ParameterSet &iConfig)
 
 ~HLTMinDPhiMETFilter () override
 
- Public Member Functions inherited from HLTFilter
 HLTFilter (const edm::ParameterSet &config)
 
int module (edm::Event const &) const
 
const std::string * moduleLabel () const
 
int path (edm::Event const &) const
 
const std::string * pathName (edm::Event const &) const
 
std::pair< int, int > pmid (edm::Event const &) const
 
bool saveTags () const
 
 ~HLTFilter () override
 
- Public Member Functions inherited from edm::global::EDFilter<>
 EDFilter ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDFilterBase
 EDFilterBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilterBase () 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)
 
 ~ProducerBase () noexcept(false) override
 
- 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from HLTFilter
static void makeHLTFilterDescription (edm::ParameterSetDescription &desc)
 
- Static Public Member Functions inherited from edm::global::EDFilterBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::InputTag calometLabel_
 
edm::InputTag jetsLabel_
 
edm::EDGetTokenT< reco::CaloMETCollectionm_theCaloMETToken
 
edm::EDGetTokenT< reco::JetViewm_theJetToken
 
edm::EDGetTokenT< reco::METCollectionm_theMETToken
 
double maxEta_
 Maximum (abs) eta requirement for jets. More...
 
int maxNJets_
 Consider only n leading-pt (or et) jets, n = maxNJets_. More...
 
edm::InputTag metLabel_
 Input jet, MET collections. More...
 
double minDPhi_
 Minium delta phi between a jet and MET. More...
 
double minPt_
 Minimum pt requirement for jets. More...
 
int triggerType_
 Output trigger type. More...
 
bool usePt_
 Use pt; otherwise, use et. More...
 

Additional Inherited Members

- Public Types inherited from edm::global::EDFilterBase
typedef EDFilterBase 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
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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

This rejects events using the minimum delta phi between a jet and MET.

Author
Jia Fu Low (Nov 2013)

This code rejects events when a jet is too close to MET. The angle between the closest jet and MET in the transverse plane is called the min delta phi.

See header file for more information.

Author
a Jet/MET person

Definition at line 29 of file HLTMinDPhiMETFilter.h.

Constructor & Destructor Documentation

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

Definition at line 20 of file HLTMinDPhiMETFilter.cc.

References calometLabel_, jetsLabel_, m_theCaloMETToken, m_theJetToken, m_theMETToken, metLabel_, and ~HLTMinDPhiMETFilter().

20  : HLTFilter(iConfig),
21  usePt_ (iConfig.getParameter<bool>("usePt")),
22  //excludePFMuons_ (iConfig.getParameter<bool>("excludePFMuons")),
23  triggerType_ (iConfig.getParameter<int>("triggerType")),
24  maxNJets_ (iConfig.getParameter<int>("maxNJets")),
25  minPt_ (iConfig.getParameter<double>("minPt")),
26  maxEta_ (iConfig.getParameter<double>("maxEta")),
27  minDPhi_ (iConfig.getParameter<double>("minDPhi")),
28  metLabel_ (iConfig.getParameter<edm::InputTag>("metLabel")),
29  calometLabel_ (iConfig.getParameter<edm::InputTag>("calometLabel")),
30  jetsLabel_ (iConfig.getParameter<edm::InputTag>("jetsLabel")) {
31  m_theMETToken = consumes<reco::METCollection>(metLabel_);
32  m_theCaloMETToken = consumes<reco::CaloMETCollection>(calometLabel_);
33  m_theJetToken = consumes<reco::JetView>(jetsLabel_);
34 }
T getParameter(std::string const &) const
double minDPhi_
Minium delta phi between a jet and MET.
int maxNJets_
Consider only n leading-pt (or et) jets, n = maxNJets_.
edm::InputTag metLabel_
Input jet, MET collections.
edm::InputTag calometLabel_
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
edm::EDGetTokenT< reco::JetView > m_theJetToken
double minPt_
Minimum pt requirement for jets.
edm::EDGetTokenT< reco::CaloMETCollection > m_theCaloMETToken
int triggerType_
Output trigger type.
bool usePt_
Use pt; otherwise, use et.
double maxEta_
Maximum (abs) eta requirement for jets.
edm::EDGetTokenT< reco::METCollection > m_theMETToken
HLTMinDPhiMETFilter::~HLTMinDPhiMETFilter ( )
overridedefault

Referenced by HLTMinDPhiMETFilter().

Member Function Documentation

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

Definition at line 40 of file HLTMinDPhiMETFilter.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), HLTFilter::makeHLTFilterDescription(), and trigger::TriggerJet.

40  {
43  desc.add<bool>("usePt", true);
44  //desc.add<bool>("excludePFMuons", false);
45  desc.add<int>("triggerType", trigger::TriggerJet);
46  desc.add<int>("maxNJets", 2);
47  desc.add<double>("minPt", 30.);
48  desc.add<double>("maxEta", 2.5);
49  desc.add<double>("minDPhi", 0.5);
50  desc.add<edm::InputTag>("metLabel", edm::InputTag("hltPFMETProducer"));
51  desc.add<edm::InputTag>("calometLabel", edm::InputTag(""));
52  desc.add<edm::InputTag>("jetsLabel", edm::InputTag("hltAK4PFJetL1FastL2L3Corrected"));
53  descriptions.add("hltMinDPhiMETFilter", desc);
54 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
Definition: HLTFilter.cc:29
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool HLTMinDPhiMETFilter::hltFilter ( edm::Event iEvent,
const edm::EventSetup iSetup,
trigger::TriggerFilterObjectWithRefs filterproduct 
) const
overridevirtual

Implements HLTFilter.

Definition at line 57 of file HLTMinDPhiMETFilter.cc.

References funct::abs(), accept(), trigger::TriggerFilterObjectWithRefs::addCollectionTag(), edm::View< T >::begin(), calometLabel_, reco::deltaPhi(), particleFlow_cfi::dPhi, edm::View< T >::empty(), edm::View< T >::end(), PVValHelper::eta, edm::Event::getByToken(), fwrapper::jets, jetsLabel_, edm::InputTag::label(), m_theJetToken, m_theMETToken, maxEta_, maxNJets_, metLabel_, RazorAnalyzer::metphi, TtSemiLepSignalSelMVAComputer_cfi::mets, minDPhi_, minPt_, phi, EnergyCorrector::pt, HLTFilter::saveTags(), and usePt_.

57  {
58 
59  // The filter object
60  if (saveTags()) filterproduct.addCollectionTag(jetsLabel_);
61 
62  bool usePFMET = (metLabel_.label() != "") || (calometLabel_.label() == "");
63 
66  if (usePFMET) {
67  iEvent.getByToken(m_theMETToken, mets);
68  } else {
69  iEvent.getByToken(m_theMETToken, calomets);
70  }
71 
72  edm::Handle<reco::JetView> jets; // assume to be sorted by pT
73  iEvent.getByToken(m_theJetToken, jets);
74 
75  double minDPhi = 3.141593;
76  int nJets = 0; // nJets counts all jets in the events, not only those that pass pt, eta requirements
77 
78  if (!jets->empty() &&
79  ((usePFMET ? mets->size() : calomets->size()) > 0) ) {
80  double metphi = usePFMET ? mets->front().phi() : calomets->front().phi();
81  for (reco::JetView::const_iterator j = jets->begin(); j != jets->end(); ++j) {
82  if (nJets >= maxNJets_)
83  break;
84 
85  double pt = usePt_ ? j->pt() : j->et();
86  double eta = j->eta();
87  double phi = j->phi();
88  if (pt > minPt_ && std::abs(eta) < maxEta_) {
89  double dPhi = std::abs(reco::deltaPhi(metphi, phi));
90  if (minDPhi > dPhi) {
91  minDPhi = dPhi;
92  }
93 
94  // Not sure what to save, since an event quantity is used
95  //reco::JetBaseRef ref(jets, distance(jets->begin(), j));
96  //filterproduct.addObject(triggerType_, ref);
97  }
98 
99  ++nJets;
100  }
101  }
102 
103  bool accept(minDPhi > minDPhi_);
104 
105  return accept;
106 }
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:22
double minDPhi_
Minium delta phi between a jet and MET.
int maxNJets_
Consider only n leading-pt (or et) jets, n = maxNJets_.
edm::InputTag metLabel_
Input jet, MET collections.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
const_iterator begin() const
vector< PseudoJet > jets
bool empty() const
edm::InputTag calometLabel_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::EDGetTokenT< reco::JetView > m_theJetToken
double minPt_
Minimum pt requirement for jets.
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
std::string const & label() const
Definition: InputTag.h:36
bool usePt_
Use pt; otherwise, use et.
bool saveTags() const
Definition: HLTFilter.h:45
double maxEta_
Maximum (abs) eta requirement for jets.
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
edm::EDGetTokenT< reco::METCollection > m_theMETToken
const_iterator end() const

Member Data Documentation

edm::InputTag HLTMinDPhiMETFilter::calometLabel_
private

Definition at line 59 of file HLTMinDPhiMETFilter.h.

Referenced by hltFilter(), and HLTMinDPhiMETFilter().

edm::InputTag HLTMinDPhiMETFilter::jetsLabel_
private

Definition at line 60 of file HLTMinDPhiMETFilter.h.

Referenced by hltFilter(), and HLTMinDPhiMETFilter().

edm::EDGetTokenT<reco::CaloMETCollection> HLTMinDPhiMETFilter::m_theCaloMETToken
private

Definition at line 63 of file HLTMinDPhiMETFilter.h.

Referenced by HLTMinDPhiMETFilter().

edm::EDGetTokenT<reco::JetView> HLTMinDPhiMETFilter::m_theJetToken
private

Definition at line 64 of file HLTMinDPhiMETFilter.h.

Referenced by hltFilter(), and HLTMinDPhiMETFilter().

edm::EDGetTokenT<reco::METCollection> HLTMinDPhiMETFilter::m_theMETToken
private

Definition at line 62 of file HLTMinDPhiMETFilter.h.

Referenced by hltFilter(), and HLTMinDPhiMETFilter().

double HLTMinDPhiMETFilter::maxEta_
private

Maximum (abs) eta requirement for jets.

Definition at line 52 of file HLTMinDPhiMETFilter.h.

Referenced by hltFilter().

int HLTMinDPhiMETFilter::maxNJets_
private

Consider only n leading-pt (or et) jets, n = maxNJets_.

Definition at line 46 of file HLTMinDPhiMETFilter.h.

Referenced by hltFilter().

edm::InputTag HLTMinDPhiMETFilter::metLabel_
private

Input jet, MET collections.

Definition at line 58 of file HLTMinDPhiMETFilter.h.

Referenced by hltFilter(), and HLTMinDPhiMETFilter().

double HLTMinDPhiMETFilter::minDPhi_
private

Minium delta phi between a jet and MET.

Definition at line 55 of file HLTMinDPhiMETFilter.h.

Referenced by hltFilter().

double HLTMinDPhiMETFilter::minPt_
private

Minimum pt requirement for jets.

Definition at line 49 of file HLTMinDPhiMETFilter.h.

Referenced by hltFilter().

int HLTMinDPhiMETFilter::triggerType_
private

Output trigger type.

Definition at line 43 of file HLTMinDPhiMETFilter.h.

bool HLTMinDPhiMETFilter::usePt_
private

Use pt; otherwise, use et.

Definition at line 38 of file HLTMinDPhiMETFilter.h.

Referenced by hltFilter().