CMS 3D CMS Logo

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

#include <HLTMuonTrkL1TFilter.h>

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

unsigned int m_allowedTypeMask
 
edm::InputTag m_candsTag
 
edm::EDGetTokenT< reco::RecoChargedCandidateCollectionm_candsToken
 
double m_maxAbsEta
 
double m_maxNormalizedChi2
 
int m_minMuonHits
 
int m_minMuonStations
 
unsigned int m_minN
 
double m_minPt
 
int m_minTrkHits
 
edm::InputTag m_muonsTag
 
edm::EDGetTokenT< reco::MuonCollectionm_muonsToken
 
edm::InputTag m_previousCandTag
 
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefsm_previousCandToken
 
unsigned int m_requiredTypeMask
 
bool m_saveTags
 
muon::SelectionType m_trkMuonId
 

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

Definition at line 14 of file HLTMuonTrkL1TFilter.h.

Constructor & Destructor Documentation

HLTMuonTrkL1TFilter::HLTMuonTrkL1TFilter ( const edm::ParameterSet iConfig)

Definition at line 28 of file HLTMuonTrkL1TFilter.cc.

References edm::ParameterSet::getParameter(), m_allowedTypeMask, m_candsTag, m_candsToken, m_maxAbsEta, m_maxNormalizedChi2, m_minMuonHits, m_minMuonStations, m_minN, m_minPt, m_minTrkHits, m_muonsTag, m_muonsToken, m_previousCandTag, m_previousCandToken, m_requiredTypeMask, and m_trkMuonId.

28  : HLTFilter(iConfig) {
29  m_muonsTag = iConfig.getParameter<edm::InputTag>("inputMuonCollection");
30  m_muonsToken = consumes<reco::MuonCollection>(m_muonsTag);
31  m_candsTag = iConfig.getParameter<edm::InputTag>("inputCandCollection");
32  m_candsToken = consumes<reco::RecoChargedCandidateCollection>(m_candsTag);
33  m_previousCandTag = iConfig.getParameter<edm::InputTag> ("previousCandTag");
34  m_previousCandToken = consumes<trigger::TriggerFilterObjectWithRefs>(m_previousCandTag);
35  m_minTrkHits = iConfig.getParameter<int>("minTrkHits");
36  m_minMuonHits = iConfig.getParameter<int>("minMuonHits");
37  m_minMuonStations = iConfig.getParameter<int>("minMuonStations");
38  m_maxNormalizedChi2 = iConfig.getParameter<double>("maxNormalizedChi2");
39  m_allowedTypeMask = iConfig.getParameter<unsigned int>("allowedTypeMask");
40  m_requiredTypeMask = iConfig.getParameter<unsigned int>("requiredTypeMask");
41  m_trkMuonId = muon::SelectionType(iConfig.getParameter<unsigned int>("trkMuonId"));
42  m_minPt = iConfig.getParameter<double>("minPt");
43  m_minN = iConfig.getParameter<unsigned int>("minN");
44  m_maxAbsEta = iConfig.getParameter<double>("maxAbsEta");
45 }
T getParameter(std::string const &) const
unsigned int m_requiredTypeMask
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > m_previousCandToken
edm::EDGetTokenT< reco::MuonCollection > m_muonsToken
muon::SelectionType m_trkMuonId
unsigned int m_allowedTypeMask
SelectionType
Selector type.
Definition: MuonSelectors.h:17
edm::InputTag m_previousCandTag
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > m_candsToken
HLTMuonTrkL1TFilter::~HLTMuonTrkL1TFilter ( )
inlineoverride

Definition at line 17 of file HLTMuonTrkL1TFilter.h.

References fillDescriptions().

17 {}

Member Function Documentation

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

Definition at line 48 of file HLTMuonTrkL1TFilter.cc.

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

48  {
51  desc.add<edm::InputTag>("inputMuonCollection",edm::InputTag(""));
52  desc.add<edm::InputTag>("inputCandCollection",edm::InputTag(""));
53  desc.add<edm::InputTag>("previousCandTag",edm::InputTag(""));
54  desc.add<int>("minTrkHits",-1);
55  desc.add<int>("minMuonHits",-1);
56  desc.add<int>("minMuonStations",-1);
57  desc.add<double>("maxNormalizedChi2",1e99);
58  desc.add<unsigned int>("allowedTypeMask",255);
59  desc.add<unsigned int>("requiredTypeMask",0);
60  desc.add<unsigned int>("trkMuonId",0);
61  desc.add<double>("minPt",24);
62  desc.add<unsigned int>("minN",1);
63  desc.add<double>("maxAbsEta",1e99);
64  descriptions.add("hltMuonTrkL1TFilter",desc);
65 }
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 HLTMuonTrkL1TFilter::hltFilter ( edm::Event iEvent,
const edm::EventSetup iSetup,
trigger::TriggerFilterObjectWithRefs filterproduct 
) const
overridevirtual

Implements HLTFilter.

Definition at line 68 of file HLTMuonTrkL1TFilter.cc.

References funct::abs(), trigger::TriggerFilterObjectWithRefs::addCollectionTag(), trigger::TriggerRefsCollections::addObject(), egammaForCoreTracking_cff::cands, edm::errors::Configuration, DEFINE_FWK_MODULE, boostedElectronIsolation_cff::deltaR, edm::Event::getByToken(), trigger::TriggerRefsCollections::getObjects(), mps_fire::i, muon::isGoodMuon(), m_allowedTypeMask, m_candsTag, m_candsToken, m_maxAbsEta, m_maxNormalizedChi2, m_minMuonHits, m_minMuonStations, m_minN, m_minPt, m_minTrkHits, m_muonsToken, m_previousCandTag, m_previousCandToken, m_requiredTypeMask, m_trkMuonId, metsig::muon, extraflags_cff::muons, HLTFilter::saveTags(), trigger::TriggerL1Mu, and trigger::TriggerMuon.

69 {
71  iEvent.getByToken(m_muonsToken,muons);
73  iEvent.getByToken(m_candsToken,cands);
74  if ( saveTags() ) filterproduct.addCollectionTag(m_candsTag);
75  if ( cands->size() != muons->size() )
76  throw edm::Exception(edm::errors::Configuration) << "Both input collection must be aligned and represent same physical muon objects";
77 
79  std::vector<l1t::MuonRef> vl1cands;
80  std::vector<l1t::MuonRef>::iterator vl1cands_begin;
81  std::vector<l1t::MuonRef>::iterator vl1cands_end;
82 
83  bool check_l1match = true;
84  if (m_previousCandTag == edm::InputTag("")) check_l1match = false;
85  if (check_l1match) {
86  iEvent.getByToken(m_previousCandToken,previousLevelCands);
87  previousLevelCands->getObjects(trigger::TriggerL1Mu,vl1cands);
88  vl1cands_begin = vl1cands.begin();
89  vl1cands_end = vl1cands.end();
90  }
91 
92  std::vector<unsigned int> filteredMuons;
93  for ( unsigned int i=0; i<muons->size(); ++i ){
94  const reco::Muon& muon(muons->at(i));
95  // check for dR match to L1 muons
96  if (check_l1match) {
97  bool matchl1 = false;
98  for (auto l1cand = vl1cands_begin; l1cand != vl1cands_end; ++l1cand) {
99  if (deltaR(muon,**l1cand) < 0.3) {
100  matchl1 = true;
101  break;
102  }
103  }
104  if (!matchl1) continue;
105  }
106  if ( (muon.type() & m_allowedTypeMask) == 0 ) continue;
107  if ( (muon.type() & m_requiredTypeMask) != m_requiredTypeMask ) continue;
108  if ( muon.numberOfMatchedStations()<m_minMuonStations ) continue;
109  if ( !muon.innerTrack().isNull() ){
110  if (muon.innerTrack()->numberOfValidHits()<m_minTrkHits) continue;
111  }
112  if ( !muon.globalTrack().isNull() ){
113  if (muon.globalTrack()->normalizedChi2()>m_maxNormalizedChi2) continue;
114  if (muon.globalTrack()->hitPattern().numberOfValidMuonHits()<m_minMuonHits) continue;
115  }
116  if ( muon.isTrackerMuon() && !muon::isGoodMuon(muon,m_trkMuonId) ) continue;
117  if ( muon.pt() < m_minPt ) continue;
118  if ( std::abs(muon.eta()) > m_maxAbsEta ) continue;
119  filteredMuons.push_back(i);
120  }
121 
122  for ( std::vector<unsigned int>::const_iterator itr = filteredMuons.begin(); itr != filteredMuons.end(); ++itr )
124 
125  return filteredMuons.size()>=m_minN;
126 }
unsigned int m_requiredTypeMask
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > m_previousCandToken
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
edm::EDGetTokenT< reco::MuonCollection > m_muonsToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
enum start value shifted to 81 so as to avoid clashes with PDG codes
muon::SelectionType m_trkMuonId
unsigned int m_allowedTypeMask
void addObject(int id, const reco::RecoEcalCandidateRef &ref)
setters for L3 collections: (id=physics type, and Ref<C>)
edm::InputTag m_previousCandTag
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
bool saveTags() const
Definition: HLTFilter.h:45
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > m_candsToken

Member Data Documentation

unsigned int HLTMuonTrkL1TFilter::m_allowedTypeMask
private

Definition at line 33 of file HLTMuonTrkL1TFilter.h.

Referenced by hltFilter(), and HLTMuonTrkL1TFilter().

edm::InputTag HLTMuonTrkL1TFilter::m_candsTag
private

Definition at line 26 of file HLTMuonTrkL1TFilter.h.

Referenced by hltFilter(), and HLTMuonTrkL1TFilter().

edm::EDGetTokenT<reco::RecoChargedCandidateCollection> HLTMuonTrkL1TFilter::m_candsToken
private

Definition at line 27 of file HLTMuonTrkL1TFilter.h.

Referenced by hltFilter(), and HLTMuonTrkL1TFilter().

double HLTMuonTrkL1TFilter::m_maxAbsEta
private

Definition at line 38 of file HLTMuonTrkL1TFilter.h.

Referenced by hltFilter(), and HLTMuonTrkL1TFilter().

double HLTMuonTrkL1TFilter::m_maxNormalizedChi2
private

Definition at line 35 of file HLTMuonTrkL1TFilter.h.

Referenced by hltFilter(), and HLTMuonTrkL1TFilter().

int HLTMuonTrkL1TFilter::m_minMuonHits
private

Definition at line 31 of file HLTMuonTrkL1TFilter.h.

Referenced by hltFilter(), and HLTMuonTrkL1TFilter().

int HLTMuonTrkL1TFilter::m_minMuonStations
private

Definition at line 32 of file HLTMuonTrkL1TFilter.h.

Referenced by hltFilter(), and HLTMuonTrkL1TFilter().

unsigned int HLTMuonTrkL1TFilter::m_minN
private

Definition at line 37 of file HLTMuonTrkL1TFilter.h.

Referenced by hltFilter(), and HLTMuonTrkL1TFilter().

double HLTMuonTrkL1TFilter::m_minPt
private

Definition at line 36 of file HLTMuonTrkL1TFilter.h.

Referenced by hltFilter(), and HLTMuonTrkL1TFilter().

int HLTMuonTrkL1TFilter::m_minTrkHits
private

Definition at line 30 of file HLTMuonTrkL1TFilter.h.

Referenced by hltFilter(), and HLTMuonTrkL1TFilter().

edm::InputTag HLTMuonTrkL1TFilter::m_muonsTag
private

Definition at line 24 of file HLTMuonTrkL1TFilter.h.

Referenced by HLTMuonTrkL1TFilter().

edm::EDGetTokenT<reco::MuonCollection> HLTMuonTrkL1TFilter::m_muonsToken
private

Definition at line 25 of file HLTMuonTrkL1TFilter.h.

Referenced by hltFilter(), and HLTMuonTrkL1TFilter().

edm::InputTag HLTMuonTrkL1TFilter::m_previousCandTag
private

Definition at line 28 of file HLTMuonTrkL1TFilter.h.

Referenced by hltFilter(), and HLTMuonTrkL1TFilter().

edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> HLTMuonTrkL1TFilter::m_previousCandToken
private

Definition at line 29 of file HLTMuonTrkL1TFilter.h.

Referenced by hltFilter(), and HLTMuonTrkL1TFilter().

unsigned int HLTMuonTrkL1TFilter::m_requiredTypeMask
private

Definition at line 34 of file HLTMuonTrkL1TFilter.h.

Referenced by hltFilter(), and HLTMuonTrkL1TFilter().

bool HLTMuonTrkL1TFilter::m_saveTags
private

Definition at line 40 of file HLTMuonTrkL1TFilter.h.

muon::SelectionType HLTMuonTrkL1TFilter::m_trkMuonId
private

Definition at line 39 of file HLTMuonTrkL1TFilter.h.

Referenced by hltFilter(), and HLTMuonTrkL1TFilter().