CMS 3D CMS Logo

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

#include <HLTPhi2METFilter.h>

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

Public Member Functions

bool hltFilter (edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
 
 HLTPhi2METFilter (const edm::ParameterSet &)
 
 ~HLTPhi2METFilter () 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 inputJetTag_
 
edm::InputTag inputMETTag_
 
edm::EDGetTokenT< reco::CaloJetCollectionm_theJetToken
 
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefsm_theMETToken
 
double maxDPhi_
 
double minDPhi_
 
double minEtjet1_
 
double minEtjet2_
 

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

Author
Dominique J. Mangeol

Definition at line 18 of file HLTPhi2METFilter.h.

Constructor & Destructor Documentation

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

Definition at line 25 of file HLTPhi2METFilter.cc.

References edm::ParameterSet::getParameter(), inputJetTag_, inputMETTag_, m_theJetToken, m_theMETToken, maxDPhi_, minDPhi_, minEtjet1_, minEtjet2_, and ~HLTPhi2METFilter().

25  : HLTFilter(iConfig)
26 {
27  inputJetTag_ = iConfig.getParameter< edm::InputTag > ("inputJetTag");
28  inputMETTag_ = iConfig.getParameter< edm::InputTag > ("inputMETTag");
29  minDPhi_ = iConfig.getParameter<double> ("minDeltaPhi");
30  maxDPhi_ = iConfig.getParameter<double> ("maxDeltaPhi");
31  minEtjet1_= iConfig.getParameter<double> ("minEtJet1");
32  minEtjet2_= iConfig.getParameter<double> ("minEtJet2");
33  m_theJetToken = consumes<reco::CaloJetCollection>(inputJetTag_);
34  m_theMETToken = consumes<trigger::TriggerFilterObjectWithRefs>(inputMETTag_);
35 }
edm::InputTag inputMETTag_
T getParameter(std::string const &) const
edm::InputTag inputJetTag_
edm::EDGetTokenT< reco::CaloJetCollection > m_theJetToken
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > m_theMETToken
HLTPhi2METFilter::~HLTPhi2METFilter ( )
overridedefault

Referenced by HLTPhi2METFilter().

Member Function Documentation

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

Definition at line 39 of file HLTPhi2METFilter.cc.

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

39  {
42  desc.add<edm::InputTag>("inputJetTag",edm::InputTag("iterativeCone5CaloJets"));
43  desc.add<edm::InputTag>("inputMETTag",edm::InputTag("hlt1MET60"));
44  desc.add<double>("minDeltaPhi",0.377);
45  desc.add<double>("minEtJet2",60.);
46  descriptions.add("hltPhi2METFilter",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 HLTPhi2METFilter::hltFilter ( edm::Event iEvent,
const edm::EventSetup iSetup,
trigger::TriggerFilterObjectWithRefs filterproduct 
) const
overridevirtual

Implements HLTFilter.

Definition at line 51 of file HLTPhi2METFilter.cc.

References funct::abs(), accept(), trigger::TriggerFilterObjectWithRefs::addCollectionTag(), trigger::TriggerRefsCollections::addObject(), SoftLeptonByDistance_cfi::distance, edm::Event::getByToken(), trigger::TriggerRefsCollections::getObjects(), inputJetTag_, inputMETTag_, M_PI, m_theJetToken, m_theMETToken, maxDPhi_, minDPhi_, minEtjet1_, minEtjet2_, gen::n, HLTFilter::saveTags(), trigger::TriggerJet, and trigger::TriggerMET.

52 {
53  using namespace std;
54  using namespace edm;
55  using namespace reco;
56  using namespace trigger;
57 
58  // The filter object
59  if (saveTags()) {
60  filterproduct.addCollectionTag(inputJetTag_);
61  filterproduct.addCollectionTag(inputMETTag_);
62  }
63 
64  Handle<CaloJetCollection> recocalojets;
65  iEvent.getByToken(m_theJetToken,recocalojets);
67  iEvent.getByToken(m_theMETToken,metcal);
68 
69  // look at all candidates, check cuts and add to filter object
70  int n(0);
71 
72  VRcalomet vrefMET;
73  metcal->getObjects(TriggerMET,vrefMET);
74  CaloMETRef metRef=vrefMET.at(0);
75  CaloJetRef ref1,ref2;
76 
77  if(recocalojets->size() > 1){
78  // events with two or more jets
79 
80  double etjet1=0.;
81  double etjet2=0.;
82  double phijet2=0.;
83  // double etmiss = vrefMET.at(0)->et();
84  double phimiss = vrefMET.at(0)->phi();
85  int countjets =0;
86 
87  for (auto recocalojet = recocalojets->begin();
88  recocalojet<=(recocalojets->begin()+1); recocalojet++) {
89 
90  if(countjets==0) {
91  etjet1 = recocalojet->et();
92  ref1 = CaloJetRef(recocalojets,distance(recocalojets->begin(),recocalojet));
93  }
94  if(countjets==1) {
95  etjet2 = recocalojet->et();
96  phijet2 = recocalojet->phi();
97  ref2 = CaloJetRef(recocalojets,distance(recocalojets->begin(),recocalojet));
98  }
99  countjets++;
100  }
101  double Dphi= std::abs(phimiss-phijet2);
102  if (Dphi>M_PI) Dphi=2.0*M_PI-Dphi;
103  if(etjet1>minEtjet1_ && etjet2>minEtjet2_ && Dphi>=minDPhi_ && Dphi<=maxDPhi_){
104  filterproduct.addObject(TriggerMET,metRef);
105  filterproduct.addObject(TriggerJet,ref1);
106  filterproduct.addObject(TriggerJet,ref2);
107  n++;
108  }
109 
110  } // events with two or more jets
111 
112 
113 
114  // filter decision
115  bool accept(n>=1);
116 
117  return accept;
118 }
edm::InputTag inputMETTag_
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
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
void addObject(int id, const reco::RecoEcalCandidateRef &ref)
setters for L3 collections: (id=physics type, and Ref<C>)
edm::InputTag inputJetTag_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::EDGetTokenT< reco::CaloJetCollection > m_theJetToken
#define M_PI
edm::Ref< CaloJetCollection > CaloJetRef
edm references
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
fixed size matrix
bool saveTags() const
Definition: HLTFilter.h:45
HLT enums.
std::vector< reco::CaloMETRef > VRcalomet
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > m_theMETToken

Member Data Documentation

edm::InputTag HLTPhi2METFilter::inputJetTag_
private

Definition at line 27 of file HLTPhi2METFilter.h.

Referenced by hltFilter(), and HLTPhi2METFilter().

edm::InputTag HLTPhi2METFilter::inputMETTag_
private

Definition at line 30 of file HLTPhi2METFilter.h.

Referenced by hltFilter(), and HLTPhi2METFilter().

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

Definition at line 28 of file HLTPhi2METFilter.h.

Referenced by hltFilter(), and HLTPhi2METFilter().

edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> HLTPhi2METFilter::m_theMETToken
private

Definition at line 29 of file HLTPhi2METFilter.h.

Referenced by hltFilter(), and HLTPhi2METFilter().

double HLTPhi2METFilter::maxDPhi_
private

Definition at line 34 of file HLTPhi2METFilter.h.

Referenced by hltFilter(), and HLTPhi2METFilter().

double HLTPhi2METFilter::minDPhi_
private

Definition at line 33 of file HLTPhi2METFilter.h.

Referenced by hltFilter(), and HLTPhi2METFilter().

double HLTPhi2METFilter::minEtjet1_
private

Definition at line 31 of file HLTPhi2METFilter.h.

Referenced by hltFilter(), and HLTPhi2METFilter().

double HLTPhi2METFilter::minEtjet2_
private

Definition at line 32 of file HLTPhi2METFilter.h.

Referenced by hltFilter(), and HLTPhi2METFilter().