CMS 3D CMS Logo

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

#include <HLTRapGapFilter.h>

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

double absEtaMax_
 
double absEtaMin_
 
double caloThresh_
 
edm::InputTag inputTag_
 
edm::EDGetTokenT< reco::CaloJetCollectionm_theJetToken
 

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 18 of file HLTRapGapFilter.h.

Constructor & Destructor Documentation

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

Definition at line 25 of file HLTRapGapFilter.cc.

References absEtaMax_, absEtaMin_, caloThresh_, edm::ParameterSet::getParameter(), inputTag_, m_theJetToken, and ~HLTRapGapFilter().

25  : HLTFilter(iConfig)
26 {
27  inputTag_ = iConfig.getParameter< edm::InputTag > ("inputTag");
28  absEtaMin_ = iConfig.getParameter<double> ("minEta");
29  absEtaMax_ = iConfig.getParameter<double> ("maxEta");
30  caloThresh_ = iConfig.getParameter<double> ("caloThresh");
31  m_theJetToken = consumes<reco::CaloJetCollection>(inputTag_);
32 }
T getParameter(std::string const &) const
edm::InputTag inputTag_
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
edm::EDGetTokenT< reco::CaloJetCollection > m_theJetToken
HLTRapGapFilter::~HLTRapGapFilter ( )
overridedefault

Referenced by HLTRapGapFilter().

Member Function Documentation

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

Definition at line 36 of file HLTRapGapFilter.cc.

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

36  {
39  desc.add<edm::InputTag>("inputJetTag",edm::InputTag("iterativeCone5CaloJets"));
40  desc.add<double>("minEta",3.0);
41  desc.add<double>("maxEta",5.0);
42  desc.add<double>("caloThresh",20.);
43  descriptions.add("hltRapGapFilter",desc);
44 }
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 HLTRapGapFilter::hltFilter ( edm::Event iEvent,
const edm::EventSetup iSetup,
trigger::TriggerFilterObjectWithRefs filterproduct 
) const
overridevirtual

Implements HLTFilter.

Definition at line 48 of file HLTRapGapFilter.cc.

References funct::abs(), absEtaMax_, absEtaMin_, accept(), trigger::TriggerFilterObjectWithRefs::addCollectionTag(), trigger::TriggerRefsCollections::addObject(), caloThresh_, SoftLeptonByDistance_cfi::distance, edm::Event::getByToken(), inputTag_, m_theJetToken, gen::n, HLTFilter::saveTags(), and trigger::TriggerJet.

49 {
50  using namespace reco;
51  using namespace trigger;
52 
53  // The filter object
54  if (saveTags()) filterproduct.addCollectionTag(inputTag_);
55 
56  edm::Handle<CaloJetCollection> recocalojets;
57  iEvent.getByToken(m_theJetToken,recocalojets);
58 
59  // look at all candidates, check cuts and add to filter object
60  int n(0);
61 
62  //std::cout << "Found " << recocalojets->size() << " jets in this event" << std::endl;
63 
64  if(recocalojets->size() > 1){
65  // events with two or more jets
66 
67  double etjet=0.;
68  double etajet=0.;
69  double sumets=0.;
70  int countjets =0;
71 
72  for (auto const & recocalojet : *recocalojets) {
73 
74  etjet = recocalojet.energy();
75  etajet = recocalojet.eta();
76 
77  if(std::abs(etajet) > absEtaMin_ && std::abs(etajet) < absEtaMax_)
78  {
79  sumets += etjet;
80  //std::cout << "Adding jet with eta = " << etajet << ", and e = "
81  // << etjet << std::endl;
82  }
83  countjets++;
84  }
85 
86  //std::cout << "Sum jet energy = " << sumets << std::endl;
87  if(sumets<=caloThresh_){
88  //std::cout << "Passed filter!" << std::endl;
89  for (auto recocalojet = recocalojets->begin();
90  recocalojet!=(recocalojets->end()); recocalojet++) {
91  CaloJetRef ref(CaloJetRef(recocalojets,distance(recocalojets->begin(),recocalojet)));
92  filterproduct.addObject(TriggerJet,ref);
93  n++;
94  }
95  }
96 
97  } // events with two or more jets
98 
99  // filter decision
100  bool accept(n>0);
101 
102  return accept;
103 }
edm::InputTag inputTag_
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>)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::Ref< CaloJetCollection > CaloJetRef
edm references
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
fixed size matrix
bool saveTags() const
Definition: HLTFilter.h:45
edm::EDGetTokenT< reco::CaloJetCollection > m_theJetToken

Member Data Documentation

double HLTRapGapFilter::absEtaMax_
private

Definition at line 30 of file HLTRapGapFilter.h.

Referenced by hltFilter(), and HLTRapGapFilter().

double HLTRapGapFilter::absEtaMin_
private

Definition at line 29 of file HLTRapGapFilter.h.

Referenced by hltFilter(), and HLTRapGapFilter().

double HLTRapGapFilter::caloThresh_
private

Definition at line 31 of file HLTRapGapFilter.h.

Referenced by hltFilter(), and HLTRapGapFilter().

edm::InputTag HLTRapGapFilter::inputTag_
private

Definition at line 28 of file HLTRapGapFilter.h.

Referenced by hltFilter(), and HLTRapGapFilter().

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

Definition at line 27 of file HLTRapGapFilter.h.

Referenced by hltFilter(), and HLTRapGapFilter().