CMS 3D CMS Logo

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

#include <HLTMuonL1TtoL3TkPreFilter.h>

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

bool triggeredAtL1 (const l1t::MuonRef &l1mu, std::vector< l1t::MuonRef > &vcands) const
 

Private Attributes

edm::InputTag beamspotTag_
 
edm::EDGetTokenT< reco::BeamSpotbeamspotToken_
 
edm::InputTag candTag_
 
edm::EDGetTokenT< reco::RecoChargedCandidateCollectioncandToken_
 
double max_Dr_
 
double max_Dz_
 
double max_Eta_
 
int min_N_
 
int min_Nhits_
 
double min_Pt_
 
double nsigma_Pt_
 
edm::InputTag previousCandTag_
 
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefspreviousCandToken_
 

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 class is an HLTFilter (-> EDFilter) implementing a first filtering for HLT muons

Author
J-R Vlimant

Definition at line 26 of file HLTMuonL1TtoL3TkPreFilter.h.

Constructor & Destructor Documentation

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

Definition at line 36 of file HLTMuonL1TtoL3TkPreFilter.cc.

References candTag_, edm::InputTag::encode(), LogDebug, max_Dr_, max_Dz_, max_Eta_, min_N_, min_Nhits_, min_Pt_, nsigma_Pt_, and ~HLTMuonL1TtoL3TkPreFilter().

36  : HLTFilter(iConfig),
37  beamspotTag_ (iConfig.getParameter< edm::InputTag > ("BeamSpotTag")),
38  beamspotToken_ (consumes<reco::BeamSpot>(beamspotTag_)),
39  candTag_ (iConfig.getParameter<InputTag > ("CandTag")),
40  candToken_ (consumes<reco::RecoChargedCandidateCollection>(candTag_)),
41  previousCandTag_ (iConfig.getParameter<InputTag > ("PreviousCandTag")),
42  previousCandToken_ (consumes<trigger::TriggerFilterObjectWithRefs>(previousCandTag_)),
43  min_N_ (iConfig.getParameter<int> ("MinN")),
44  max_Eta_ (iConfig.getParameter<double> ("MaxEta")),
45  min_Nhits_ (iConfig.getParameter<int> ("MinNhits")),
46  max_Dr_ (iConfig.getParameter<double> ("MaxDr")),
47  max_Dz_ (iConfig.getParameter<double> ("MaxDz")),
48  min_Pt_ (iConfig.getParameter<double> ("MinPt")),
49  nsigma_Pt_ (iConfig.getParameter<double> ("NSigmaPt"))
50 {
51 
52  LogDebug("HLTMuonL1TtoL3TkPreFilter")
53  << " CandTag/MinN/MaxEta/MinNhits/MaxDr/MaxDz/MinPt/NSigmaPt : "
54  << candTag_.encode()
55  << " " << min_N_
56  << " " << max_Eta_
57  << " " << min_Nhits_
58  << " " << max_Dr_
59  << " " << max_Dz_
60  << " " << min_Pt_
61  << " " << nsigma_Pt_;
62 
63  //register your products
64  produces<TriggerFilterObjectWithRefs>();
65 }
#define LogDebug(id)
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > candToken_
std::string encode() const
Definition: InputTag.cc:159
edm::EDGetTokenT< reco::BeamSpot > beamspotToken_
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
HLTMuonL1TtoL3TkPreFilter::~HLTMuonL1TtoL3TkPreFilter ( )
overridedefault

Member Function Documentation

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

Definition at line 73 of file HLTMuonL1TtoL3TkPreFilter.cc.

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

73  {
76  desc.add<edm::InputTag>("BeamSpotTag",edm::InputTag("hltBeamSpotTag"));
77  desc.add<edm::InputTag>("CandTag",edm::InputTag("hltCandTag"));
78  desc.add<edm::InputTag>("PreviousCandTag",edm::InputTag("hltPreviousCandTag"));
79  desc.add<int>("MinN",0);
80  desc.add<double>("MaxEta",9999.0);
81  desc.add<int>("MinNhits",0);
82  desc.add<double>("MaxDr",9999.0);
83  desc.add<double>("MaxDz",9999.0);
84  desc.add<double>("MinPt",0.0);
85  desc.add<double>("NSigmaPt",9999.0);
86  descriptions.add("hltMuonL1TtoL3TkPreFilter", desc);
87 }
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 HLTMuonL1TtoL3TkPreFilter::hltFilter ( edm::Event iEvent,
const edm::EventSetup iSetup,
trigger::TriggerFilterObjectWithRefs filterproduct 
) const
overridevirtual

Implements HLTFilter.

Definition at line 91 of file HLTMuonL1TtoL3TkPreFilter.cc.

References accept(), trigger::TriggerFilterObjectWithRefs::addCollectionTag(), trigger::TriggerRefsCollections::addObject(), ecalDrivenElectronSeedsParameters_cff::beamSpot, beamspotToken_, candTag_, candToken_, edm::Event::getByToken(), trigger::TriggerRefsCollections::getObjects(), mps_fire::i, LogDebug, LogTrace, max_Dr_, max_Dz_, max_Eta_, numberPerLSFilter_cff::maxN, min_N_, min_Nhits_, min_Pt_, gen::n, nsigma_Pt_, reco::BeamSpot::position(), previousCandToken_, EnergyCorrector::pt, HLTFilter::saveTags(), triggeredAtL1(), trigger::TriggerL1Mu, and trigger::TriggerMuon.

92 {
93 
94  // All HLT filters must create and fill an HLT filter object,
95  // recording any reconstructed physics objects satisfying (or not)
96  // this HLT filter, and place it in the Event.
97 
98  // get hold of trks
100  iEvent.getByToken(candToken_,mucands);
101  if (saveTags()) filterproduct.addCollectionTag(candTag_);
102  // sort them by L2Track
103  std::map<l1t::MuonRef, std::vector<RecoChargedCandidateRef> > L1toL3s;
104  unsigned int n = 0;
105  unsigned int maxN = mucands->size();
106  for (;n!=maxN;n++){
107  TrackRef tk = (*mucands)[n].track();
109  l1t::MuonRef l1mu = l3seedRef->l1tParticle();
110  L1toL3s[l1mu].push_back(RecoChargedCandidateRef(mucands,n));
111  }
112 
113  // additionnal objects needed
114  Handle<TriggerFilterObjectWithRefs> previousLevelCands;
115  iEvent.getByToken(previousCandToken_,previousLevelCands);
117  Handle<BeamSpot> recoBeamSpotHandle;
118  iEvent.getByToken(beamspotToken_,recoBeamSpotHandle);
119  beamSpot = *recoBeamSpotHandle;
120 
121 
122  //needed to compare to L1
123  vector<l1t::MuonRef> vl1cands;
124  previousLevelCands->getObjects(TriggerL1Mu,vl1cands);
125 
126  auto L1toL3s_it = L1toL3s.begin();
127  auto L1toL3s_end = L1toL3s.end();
128  for (; L1toL3s_it!=L1toL3s_end; ++L1toL3s_it){
129 
130  if (!triggeredAtL1(L1toL3s_it->first,vl1cands)) continue;
131 
132  //loop over the L3Tk reconstructed for this L1.
133  unsigned int iTk=0;
134  unsigned int maxItk=L1toL3s_it->second.size();
135  for (; iTk!=maxItk; iTk++){
136 
137  RecoChargedCandidateRef & cand=L1toL3s_it->second[iTk];
138  TrackRef tk = cand->track();
139 
140  if (fabs(tk->eta())>max_Eta_) continue;
141 
142  // cut on number of hits
143  if (tk->numberOfValidHits()<min_Nhits_) continue;
144 
145  //dr cut
146  //if (fabs(tk->d0())>max_Dr_) continue;
147  if (fabs(tk->dxy(beamSpot.position()))>max_Dr_) continue;
148 
149  //dz cut
150  if (fabs(tk->dz())>max_Dz_) continue;
151 
152  // Pt threshold cut
153  double pt = tk->pt();
154  double err0 = tk->error(0);
155  double abspar0 = fabs(tk->parameter(0));
156  double ptLx = pt;
157  // convert 50% efficiency threshold to 90% efficiency threshold
158  if (abspar0>0) ptLx += nsigma_Pt_*err0/abspar0*pt;
159  LogTrace("HLTMuonL1TtoL3TkPreFilter") << " ...Muon in loop, pt= "
160  << pt << ", ptLx= " << ptLx;
161  if (ptLx<min_Pt_) continue;
162 
163  //one good L3Tk
164  filterproduct.addObject(TriggerMuon,cand);
165  break; // and go on with the next L1 association
166  }
167 
168  }//loop over L1s from L3 grouping
169 
170 
171  vector<RecoChargedCandidateRef> vref;
172  filterproduct.getObjects(TriggerMuon,vref);
173  for (auto & i : vref) {
174  TrackRef tk = i->track();
175  LogDebug("HLTMuonL1TtoL3TkPreFilter")
176  << " Track passing filter: pt= " << tk->pt() << ", eta: "
177  << tk->eta();
178  }
179 
180  // filter decision
181  const bool accept ((int)n >= min_N_);
182 
183  LogDebug("HLTMuonL1TtoL3TkPreFilter") << " >>>>> Result of HLTMuonL1TtoL3TkPreFilter is " << accept << ", number of muons passing thresholds= " << n;
184 
185  return accept;
186 }
#define LogDebug(id)
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
bool triggeredAtL1(const l1t::MuonRef &l1mu, std::vector< l1t::MuonRef > &vcands) const
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > candToken_
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
edm::Ref< RecoChargedCandidateCollection > RecoChargedCandidateRef
reference to an object in a collection of RecoChargedCandidate objects
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::EDGetTokenT< reco::BeamSpot > beamspotToken_
#define LogTrace(id)
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
bool saveTags() const
Definition: HLTFilter.h:45
const Point & position() const
position
Definition: BeamSpot.h:62
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
bool HLTMuonL1TtoL3TkPreFilter::triggeredAtL1 ( const l1t::MuonRef l1mu,
std::vector< l1t::MuonRef > &  vcands 
) const
private

Definition at line 189 of file HLTMuonL1TtoL3TkPreFilter.cc.

References DEFINE_FWK_MODULE, LogDebug, and convertSQLiteXML::ok.

Referenced by hltFilter().

190 {
191  bool ok=false;
192 
193  // compare to previously triggered L1
194  for (auto & vcand : vcands) {
195  // l1extra::L1MuonParticleRef candref = L1MuonParticleRef(vcands[i]);
196  if (vcand == l1mu){
197  ok=true;
198  LogDebug("HLTMuonL1TtoL3TkPreFilter") << "The L1 mu triggered";
199  break;}
200  }
201  return ok;
202 }
#define LogDebug(id)

Member Data Documentation

edm::InputTag HLTMuonL1TtoL3TkPreFilter::beamspotTag_
private

Definition at line 37 of file HLTMuonL1TtoL3TkPreFilter.h.

edm::EDGetTokenT<reco::BeamSpot> HLTMuonL1TtoL3TkPreFilter::beamspotToken_
private

Definition at line 38 of file HLTMuonL1TtoL3TkPreFilter.h.

Referenced by hltFilter().

edm::InputTag HLTMuonL1TtoL3TkPreFilter::candTag_
private

Definition at line 39 of file HLTMuonL1TtoL3TkPreFilter.h.

Referenced by hltFilter(), and HLTMuonL1TtoL3TkPreFilter().

edm::EDGetTokenT<reco::RecoChargedCandidateCollection> HLTMuonL1TtoL3TkPreFilter::candToken_
private

Definition at line 40 of file HLTMuonL1TtoL3TkPreFilter.h.

Referenced by hltFilter().

double HLTMuonL1TtoL3TkPreFilter::max_Dr_
private

Definition at line 46 of file HLTMuonL1TtoL3TkPreFilter.h.

Referenced by hltFilter(), and HLTMuonL1TtoL3TkPreFilter().

double HLTMuonL1TtoL3TkPreFilter::max_Dz_
private

Definition at line 47 of file HLTMuonL1TtoL3TkPreFilter.h.

Referenced by hltFilter(), and HLTMuonL1TtoL3TkPreFilter().

double HLTMuonL1TtoL3TkPreFilter::max_Eta_
private

Definition at line 44 of file HLTMuonL1TtoL3TkPreFilter.h.

Referenced by hltFilter(), and HLTMuonL1TtoL3TkPreFilter().

int HLTMuonL1TtoL3TkPreFilter::min_N_
private

Definition at line 43 of file HLTMuonL1TtoL3TkPreFilter.h.

Referenced by hltFilter(), and HLTMuonL1TtoL3TkPreFilter().

int HLTMuonL1TtoL3TkPreFilter::min_Nhits_
private

Definition at line 45 of file HLTMuonL1TtoL3TkPreFilter.h.

Referenced by hltFilter(), and HLTMuonL1TtoL3TkPreFilter().

double HLTMuonL1TtoL3TkPreFilter::min_Pt_
private

Definition at line 48 of file HLTMuonL1TtoL3TkPreFilter.h.

Referenced by hltFilter(), and HLTMuonL1TtoL3TkPreFilter().

double HLTMuonL1TtoL3TkPreFilter::nsigma_Pt_
private

Definition at line 49 of file HLTMuonL1TtoL3TkPreFilter.h.

Referenced by hltFilter(), and HLTMuonL1TtoL3TkPreFilter().

edm::InputTag HLTMuonL1TtoL3TkPreFilter::previousCandTag_
private

Definition at line 41 of file HLTMuonL1TtoL3TkPreFilter.h.

edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> HLTMuonL1TtoL3TkPreFilter::previousCandToken_
private

Definition at line 42 of file HLTMuonL1TtoL3TkPreFilter.h.

Referenced by hltFilter().