CMS 3D CMS Logo

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

#include <HLT2jetGapFilter.h>

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

Public Member Functions

 HLT2jetGapFilter (const edm::ParameterSet &)
 
bool hltFilter (edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
 
 ~HLT2jetGapFilter () 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 inputTag_
 
edm::EDGetTokenT< reco::CaloJetCollectionm_theCaloJetToken
 
double minEt_
 
double minEta_
 

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
Monica Vazquez Acosta (CERN)

Definition at line 20 of file HLT2jetGapFilter.h.

Constructor & Destructor Documentation

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

Definition at line 26 of file HLT2jetGapFilter.cc.

References edm::ParameterSet::getParameter(), inputTag_, m_theCaloJetToken, minEt_, minEta_, and ~HLT2jetGapFilter().

26  : HLTFilter(iConfig)
27 {
28  inputTag_ = iConfig.getParameter<edm::InputTag> ("inputTag");
29  minEt_ = iConfig.getParameter<double> ("minEt");
30  minEta_ = iConfig.getParameter<double> ("minEta");
31 
32  m_theCaloJetToken = consumes<reco::CaloJetCollection>(inputTag_);
33 
34 }
edm::InputTag inputTag_
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::CaloJetCollection > m_theCaloJetToken
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
HLT2jetGapFilter::~HLT2jetGapFilter ( )
overridedefault

Referenced by HLT2jetGapFilter().

Member Function Documentation

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

Definition at line 39 of file HLT2jetGapFilter.cc.

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

39  {
42  desc.add<edm::InputTag>("inputTag",edm::InputTag("iterativeCone5CaloJets"));
43  desc.add<double>("minEt",90.0);
44  desc.add<double>("minEta",1.9);
45  descriptions.add("hlt2jetGapFilter",desc);
46 }
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 HLT2jetGapFilter::hltFilter ( edm::Event iEvent,
const edm::EventSetup iSetup,
trigger::TriggerFilterObjectWithRefs filterproduct 
) const
overridevirtual

Implements HLTFilter.

Definition at line 50 of file HLT2jetGapFilter.cc.

References funct::abs(), accept(), trigger::TriggerFilterObjectWithRefs::addCollectionTag(), trigger::TriggerRefsCollections::addObject(), SoftLeptonByDistance_cfi::distance, edm::Event::getByToken(), inputTag_, m_theCaloJetToken, minEt_, minEta_, gen::n, HLTFilter::saveTags(), and trigger::TriggerJet.

51 {
52  using namespace trigger;
53 
54  // The filter object
55  if (saveTags()) filterproduct.addCollectionTag(inputTag_);
56 
58  iEvent.getByToken(m_theCaloJetToken,recocalojets);
59 
60  // look at all candidates, check cuts and add to filter object
61  int n(0);
62 
63  if(recocalojets->size() > 1){
64  // events with two or more jets
65 
66  double etjet1=0.;
67  double etjet2=0.;
68  double etajet1=0.;
69  double etajet2=0.;
70  int countjets =0;
71 
72  for (auto recocalojet = recocalojets->begin();
73  recocalojet<=(recocalojets->begin()+1); recocalojet++) {
74 
75  if(countjets==0) {
76  etjet1 = recocalojet->et();
77  etajet1 = recocalojet->eta();
78  }
79  if(countjets==1) {
80  etjet2 = recocalojet->et();
81  etajet2 = recocalojet->eta();
82  }
83  countjets++;
84  }
85 
86  if(etjet1>minEt_ && etjet2>minEt_ && (etajet1*etajet2)<0 && std::abs(etajet1)>minEta_ && std::abs(etajet2)>minEta_){
87  for (auto recocalojet = recocalojets->begin();
88  recocalojet<=(recocalojets->begin()+1); recocalojet++) {
89  reco::CaloJetRef ref(reco::CaloJetRef(recocalojets,distance(recocalojets->begin(),recocalojet)));
90  filterproduct.addObject(TriggerJet,ref);
91  n++;
92  }
93  }
94 
95  } // events with two or more jets
96 
97 
98 
99  // filter decision
100  bool accept(n>=2);
101 
102  return accept;
103 }
edm::InputTag inputTag_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
edm::EDGetTokenT< reco::CaloJetCollection > m_theCaloJetToken
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>)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
bool saveTags() const
Definition: HLTFilter.h:45

Member Data Documentation

edm::InputTag HLT2jetGapFilter::inputTag_
private

Definition at line 31 of file HLT2jetGapFilter.h.

Referenced by HLT2jetGapFilter(), and hltFilter().

edm::EDGetTokenT<reco::CaloJetCollection> HLT2jetGapFilter::m_theCaloJetToken
private

Definition at line 29 of file HLT2jetGapFilter.h.

Referenced by HLT2jetGapFilter(), and hltFilter().

double HLT2jetGapFilter::minEt_
private

Definition at line 32 of file HLT2jetGapFilter.h.

Referenced by HLT2jetGapFilter(), and hltFilter().

double HLT2jetGapFilter::minEta_
private

Definition at line 33 of file HLT2jetGapFilter.h.

Referenced by HLT2jetGapFilter(), and hltFilter().