CMS 3D CMS Logo

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

This filters events based on HT and MHT produced by HLTHtMhtProducer2. More...

#include <HLTHtMhtFilter.h>

Inheritance diagram for HLTHtMhtFilter:
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
 
 HLTHtMhtFilter (const edm::ParameterSet &iConfig)
 
 ~HLTHtMhtFilter () 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

std::vector< edm::InputTaghtLabels_
 Input reco::MET collections to retrieve HT and MHT. More...
 
std::vector< edm::EDGetTokenT< reco::METCollection > > m_theHtToken
 number of pairs of HT and MHT More...
 
std::vector< edm::EDGetTokenT< reco::METCollection > > m_theMhtToken
 
std::vector< double > meffSlope_
 Meff slope requirements. More...
 
std::vector< edm::InputTagmhtLabels_
 
std::vector< double > minHt_
 Minimum HT requirements. More...
 
std::vector< double > minMeff_
 Minimum Meff requirements. More...
 
std::vector< double > minMht_
 Minimum MHT requirements. More...
 
unsigned int nOrs_
 

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 filters events based on HT and MHT produced by HLTHtMhtProducer2.

Author
Steven Lowette
Michele de Gruttola, Jia Fu Low (Nov 2013)

This filter can accept more than one pair of HT and MHT. An event is kept if at least one pair satisfies:

See header file for documentation

Author
Steven Lowette

Definition at line 29 of file HLTHtMhtFilter.h.

Constructor & Destructor Documentation

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

Definition at line 19 of file HLTHtMhtFilter.cc.

References htLabels_, mps_fire::i, m_theHtToken, m_theMhtToken, meffSlope_, mhtLabels_, minHt_, minMeff_, minMht_, nOrs_, and ~HLTHtMhtFilter().

19  : HLTFilter(iConfig),
20  minHt_ ( iConfig.getParameter<std::vector<double> >("minHt") ),
21  minMht_ ( iConfig.getParameter<std::vector<double> >("minMht") ),
22  minMeff_ ( iConfig.getParameter<std::vector<double> >("minMeff") ),
23  meffSlope_ ( iConfig.getParameter<std::vector<double> >("meffSlope") ),
24  htLabels_ ( iConfig.getParameter<std::vector<edm::InputTag> >("htLabels") ),
25  mhtLabels_ ( iConfig.getParameter<std::vector<edm::InputTag> >("mhtLabels") ),
26  nOrs_ ( htLabels_.size() ) { // number of settings to .OR.
27  if (!( htLabels_.size() == minHt_.size() &&
28  htLabels_.size() == minMht_.size() &&
29  htLabels_.size() == minMeff_.size() &&
30  htLabels_.size() == meffSlope_.size() &&
31  htLabels_.size() == mhtLabels_.size() ) ||
32  htLabels_.empty() ) {
33  nOrs_ = (minHt_.size() < nOrs_ ? minHt_.size() : nOrs_);
34  nOrs_ = (minMht_.size() < nOrs_ ? minMht_.size() : nOrs_);
35  nOrs_ = (minMeff_.size() < nOrs_ ? minMeff_.size() : nOrs_);
36  nOrs_ = (meffSlope_.size() < nOrs_ ? meffSlope_.size() : nOrs_);
37  nOrs_ = (mhtLabels_.size() < nOrs_ ? mhtLabels_.size() : nOrs_);
38  edm::LogError("HLTHtMhtFilter") << "inconsistent module configuration!";
39  }
40 
41  for(unsigned int i=0; i<nOrs_; ++i) {
42  m_theHtToken.push_back(consumes<reco::METCollection>(htLabels_[i]));
43  m_theMhtToken.push_back(consumes<reco::METCollection>(mhtLabels_[i]));
44  }
45 
46 }
T getParameter(std::string const &) const
std::vector< edm::EDGetTokenT< reco::METCollection > > m_theHtToken
number of pairs of HT and MHT
std::vector< edm::InputTag > htLabels_
Input reco::MET collections to retrieve HT and MHT.
unsigned int nOrs_
std::vector< double > meffSlope_
Meff slope requirements.
std::vector< edm::EDGetTokenT< reco::METCollection > > m_theMhtToken
std::vector< edm::InputTag > mhtLabels_
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
std::vector< double > minMeff_
Minimum Meff requirements.
std::vector< double > minHt_
Minimum HT requirements.
std::vector< double > minMht_
Minimum MHT requirements.
HLTHtMhtFilter::~HLTHtMhtFilter ( )
overridedefault

Referenced by HLTHtMhtFilter().

Member Function Documentation

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

Definition at line 52 of file HLTHtMhtFilter.cc.

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

52  {
53  std::vector<edm::InputTag> tmp1(1, edm::InputTag("hltHtMhtProducer"));
54  std::vector<double> tmp2(1, 0.);
57  desc.add<std::vector<edm::InputTag> >("htLabels", tmp1);
58  desc.add<std::vector<edm::InputTag> >("mhtLabels", tmp1);
59  tmp2[0] = 250; desc.add<std::vector<double> >("minHt", tmp2);
60  tmp2[0] = 70; desc.add<std::vector<double> >("minMht", tmp2);
61  tmp2[0] = 0; desc.add<std::vector<double> >("minMeff", tmp2);
62  tmp2[0] = 1; desc.add<std::vector<double> >("meffSlope", tmp2);
63  descriptions.add("hltHtMhtFilter", desc);
64 }
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 HLTHtMhtFilter::hltFilter ( edm::Event iEvent,
const edm::EventSetup iSetup,
trigger::TriggerFilterObjectWithRefs filterproduct 
) const
overridevirtual

Implements HLTFilter.

Definition at line 67 of file HLTHtMhtFilter.cc.

References accept(), trigger::TriggerFilterObjectWithRefs::addCollectionTag(), trigger::TriggerRefsCollections::addObject(), edm::Event::getByToken(), htLabels_, mps_fire::i, m_theHtToken, m_theMhtToken, meffSlope_, mhtLabels_, minHt_, minMeff_, minMht_, nOrs_, HLTFilter::saveTags(), mathSSE::sqrt(), trigger::TriggerMHT, and trigger::TriggerTHT.

67  {
68 
69  bool accept = false;
70 
71  // Take the .OR. of all sets of requirements
72  for (unsigned int i = 0; i < nOrs_; ++i) {
73  // Create the reference to the output filter objects
74  if (saveTags()) {
75  filterproduct.addCollectionTag(htLabels_[i]);
76  filterproduct.addCollectionTag(mhtLabels_[i]);
77  }
78 
80  iEvent.getByToken(m_theHtToken[i], hht);
81  double ht = 0;
82  if (!hht->empty()) ht = hht->front().sumEt();
83 
85  iEvent.getByToken(m_theMhtToken[i], hmht);
86  double mht = 0;
87  if (!hmht->empty()) mht = hmht->front().pt();
88 
89  // Check if the event passes this cut set
90  accept = accept || (ht > minHt_[i] && mht > minMht_[i] && sqrt(mht + meffSlope_[i]*ht) > minMeff_[i]);
91  // In principle we could break if accepted, but in order to save
92  // for offline analysis all possible decisions we keep looping here
93  // in term of timing this will not matter much; typically 1 or 2 cut-sets
94  // will be checked only
95 
96  // Store the object that was cut on and the ref to it
97  // (even if it is not accepted)
98  edm::Ref<reco::METCollection> htref(hht,0);
99  edm::Ref<reco::METCollection> mhtref(hmht,0);
100  filterproduct.addObject(trigger::TriggerTHT, htref); // save as TriggerTHT object
101  filterproduct.addObject(trigger::TriggerMHT, mhtref); // save as TriggerMHT object
102  }
103 
104  return accept;
105 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
std::vector< edm::EDGetTokenT< reco::METCollection > > m_theHtToken
number of pairs of HT and MHT
std::vector< edm::InputTag > htLabels_
Input reco::MET collections to retrieve HT and MHT.
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
void addObject(int id, const reco::RecoEcalCandidateRef &ref)
setters for L3 collections: (id=physics type, and Ref<C>)
unsigned int nOrs_
std::vector< double > meffSlope_
Meff slope requirements.
std::vector< edm::EDGetTokenT< reco::METCollection > > m_theMhtToken
T sqrt(T t)
Definition: SSEVec.h:18
std::vector< edm::InputTag > mhtLabels_
std::vector< double > minMeff_
Minimum Meff requirements.
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
bool saveTags() const
Definition: HLTFilter.h:45
std::vector< double > minHt_
Minimum HT requirements.
std::vector< double > minMht_
Minimum MHT requirements.

Member Data Documentation

std::vector<edm::InputTag> HLTHtMhtFilter::htLabels_
private

Input reco::MET collections to retrieve HT and MHT.

Definition at line 50 of file HLTHtMhtFilter.h.

Referenced by hltFilter(), and HLTHtMhtFilter().

std::vector<edm::EDGetTokenT<reco::METCollection> > HLTHtMhtFilter::m_theHtToken
private

number of pairs of HT and MHT

Definition at line 55 of file HLTHtMhtFilter.h.

Referenced by hltFilter(), and HLTHtMhtFilter().

std::vector<edm::EDGetTokenT<reco::METCollection> > HLTHtMhtFilter::m_theMhtToken
private

Definition at line 56 of file HLTHtMhtFilter.h.

Referenced by hltFilter(), and HLTHtMhtFilter().

std::vector<double> HLTHtMhtFilter::meffSlope_
private

Meff slope requirements.

Definition at line 47 of file HLTHtMhtFilter.h.

Referenced by hltFilter(), and HLTHtMhtFilter().

std::vector<edm::InputTag> HLTHtMhtFilter::mhtLabels_
private

Definition at line 51 of file HLTHtMhtFilter.h.

Referenced by hltFilter(), and HLTHtMhtFilter().

std::vector<double> HLTHtMhtFilter::minHt_
private

Minimum HT requirements.

Definition at line 38 of file HLTHtMhtFilter.h.

Referenced by hltFilter(), and HLTHtMhtFilter().

std::vector<double> HLTHtMhtFilter::minMeff_
private

Minimum Meff requirements.

Definition at line 44 of file HLTHtMhtFilter.h.

Referenced by hltFilter(), and HLTHtMhtFilter().

std::vector<double> HLTHtMhtFilter::minMht_
private

Minimum MHT requirements.

Definition at line 41 of file HLTHtMhtFilter.h.

Referenced by hltFilter(), and HLTHtMhtFilter().

unsigned int HLTHtMhtFilter::nOrs_
private

Definition at line 53 of file HLTHtMhtFilter.h.

Referenced by hltFilter(), and HLTHtMhtFilter().