CMS 3D CMS Logo

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

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

#include <HLTMhtFilter.h>

Inheritance diagram for HLTMhtFilter:
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
 
 HLTMhtFilter (const edm::ParameterSet &iConfig)
 
 ~HLTMhtFilter () 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::EDGetTokenT< reco::METCollection > > m_theMhtToken
 number of pairs of MHT More...
 
std::vector< edm::InputTagmhtLabels_
 Input reco::MET collections to retrieve MHT. 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 variant of MHT. An event is kept if at least one satisfies MHT > minHht_[i].

See header file for documentation

Author
Steven Lowette

Definition at line 26 of file HLTMhtFilter.h.

Constructor & Destructor Documentation

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

Definition at line 19 of file HLTMhtFilter.cc.

References mps_fire::i, m_theMhtToken, mhtLabels_, minMht_, nOrs_, and ~HLTMhtFilter().

19  : HLTFilter(iConfig),
20  minMht_ ( iConfig.getParameter<std::vector<double> >("minMht") ),
21  mhtLabels_ ( iConfig.getParameter<std::vector<edm::InputTag> >("mhtLabels") ),
22  nOrs_ ( mhtLabels_.size() ) { // number of settings to .OR.
23  if (!(mhtLabels_.size() == minMht_.size()) ||
24  mhtLabels_.empty() ) {
25  nOrs_ = (minMht_.size() < nOrs_ ? minMht_.size() : nOrs_);
26  edm::LogError("HLTMhtFilter") << "inconsistent module configuration!";
27  }
28 
29  for(unsigned int i=0; i<nOrs_; ++i) {
30  m_theMhtToken.push_back(consumes<reco::METCollection>(mhtLabels_[i]));
31  }
32 
33 }
T getParameter(std::string const &) const
std::vector< double > minMht_
Minimum MHT requirements.
Definition: HLTMhtFilter.h:35
std::vector< edm::InputTag > mhtLabels_
Input reco::MET collections to retrieve MHT.
Definition: HLTMhtFilter.h:38
std::vector< edm::EDGetTokenT< reco::METCollection > > m_theMhtToken
number of pairs of MHT
Definition: HLTMhtFilter.h:42
unsigned int nOrs_
Definition: HLTMhtFilter.h:40
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
HLTMhtFilter::~HLTMhtFilter ( )
overridedefault

Referenced by HLTMhtFilter().

Member Function Documentation

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

Definition at line 39 of file HLTMhtFilter.cc.

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

39  {
40  std::vector<edm::InputTag> tmp1(1, edm::InputTag("hltMhtProducer"));
41  std::vector<double> tmp2(1, 0.);
44  desc.add<std::vector<edm::InputTag> >("mhtLabels", tmp1);
45  tmp2[0] = 70; desc.add<std::vector<double> >("minMht", tmp2);
46  descriptions.add("hltMhtFilter", desc);
47 }
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 HLTMhtFilter::hltFilter ( edm::Event iEvent,
const edm::EventSetup iSetup,
trigger::TriggerFilterObjectWithRefs filterproduct 
) const
overridevirtual

Implements HLTFilter.

Definition at line 50 of file HLTMhtFilter.cc.

References accept(), trigger::TriggerFilterObjectWithRefs::addCollectionTag(), trigger::TriggerRefsCollections::addObject(), edm::Event::getByToken(), mps_fire::i, m_theMhtToken, mhtLabels_, minMht_, nOrs_, HLTFilter::saveTags(), and trigger::TriggerMHT.

50  {
51 
52  reco::METRef mhtref;
53 
54  bool accept = false;
55 
56  // Take the .OR. of all sets of requirements
57  for (unsigned int i = 0; i < nOrs_; ++i) {
58 
59  // Create the reference to the output filter objects
60  if (saveTags()) filterproduct.addCollectionTag(mhtLabels_[i]);
61 
63  iEvent.getByToken(m_theMhtToken[i], hmht);
64  double mht = 0;
65  if (!hmht->empty()) mht = hmht->front().pt();
66 
67  // Check if the event passes this cut set
68  accept = accept || (mht > minMht_[i]);
69  // In principle we could break if accepted, but in order to save
70  // for offline analysis all possible decisions we keep looping here
71  // in term of timing this will not matter much; typically 1 or 2 cut-sets
72  // will be checked only
73 
74  // Store the ref (even if it is not accepted)
75  mhtref = reco::METRef(hmht, 0);
76 
77  filterproduct.addObject(trigger::TriggerMHT, mhtref); // save as TriggerMHT object
78  }
79 
80  return accept;
81 }
std::vector< double > minMht_
Minimum MHT requirements.
Definition: HLTMhtFilter.h:35
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
std::vector< edm::InputTag > mhtLabels_
Input reco::MET collections to retrieve MHT.
Definition: HLTMhtFilter.h:38
std::vector< edm::EDGetTokenT< reco::METCollection > > m_theMhtToken
number of pairs of MHT
Definition: HLTMhtFilter.h:42
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_
Definition: HLTMhtFilter.h:40
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
bool saveTags() const
Definition: HLTFilter.h:45
edm::Ref< METCollection > METRef
edm references
Definition: METFwd.h:13

Member Data Documentation

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

number of pairs of MHT

Definition at line 42 of file HLTMhtFilter.h.

Referenced by hltFilter(), and HLTMhtFilter().

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

Input reco::MET collections to retrieve MHT.

Definition at line 38 of file HLTMhtFilter.h.

Referenced by hltFilter(), and HLTMhtFilter().

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

Minimum MHT requirements.

Definition at line 35 of file HLTMhtFilter.h.

Referenced by hltFilter(), and HLTMhtFilter().

unsigned int HLTMhtFilter::nOrs_
private

Definition at line 40 of file HLTMhtFilter.h.

Referenced by hltFilter(), and HLTMhtFilter().