CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
L1MuonMatcherAlgo Class Reference

Matcher of reconstructed objects to L1 Muons. More...

#include "MuonAnalysis/MuonAssociators/interface/L1MuonMatcherAlgo.h"

Public Member Functions

TrajectoryStateOnSurface extrapolate (const FreeTrajectoryState &state) const
 
TrajectoryStateOnSurface extrapolate (const FreeTrajectoryState &state) const
 Extrapolate a FreeTrajectoryState to the muon station 2, return an invalid TSOS if it fails. More...
 
TrajectoryStateOnSurface extrapolate (const reco::Candidate &tk) const
 Extrapolate reco::Candidate to the muon station 2, return an invalid TSOS if it fails. More...
 
TrajectoryStateOnSurface extrapolate (const reco::Candidate &tk) const
 
TrajectoryStateOnSurface extrapolate (const reco::Track &tk) const
 
TrajectoryStateOnSurface extrapolate (const reco::Track &tk) const
 Extrapolate reco::Track to the muon station 2, return an invalid TSOS if it fails. More...
 
TrajectoryStateOnSurface extrapolate (const SimTrack &tk, const edm::SimVertexContainer &vtx) const
 Extrapolate a SimTrack to the muon station 2, return an invalid TSOS if it fails. Requires SimVertices to know where to start from. More...
 
void init (const edm::EventSetup &iSetup)
 
void init (const edm::EventSetup &iSetup)
 Call this method at the beginning of each run, to initialize geometry, magnetic field and propagators. More...
 
 L1MuonMatcherAlgo (const edm::ParameterSet &iConfig)
 
 L1MuonMatcherAlgo (const edm::ParameterSet &iConfig)
 
bool match (const reco::Candidate &c, const l1extra::L1MuonParticle &l1, float &deltaR, float &deltaPhi, TrajectoryStateOnSurface &propagated) const
 
bool match (const reco::Candidate &c, const l1extra::L1MuonParticle &l1, float &deltaR, float &deltaPhi, TrajectoryStateOnSurface &propagated) const
 
int match (const reco::Candidate &c, const std::vector< l1extra::L1MuonParticle > &l1, float &deltaR, float &deltaPhi, TrajectoryStateOnSurface &propagated) const
 
int match (const reco::Candidate &c, const std::vector< l1extra::L1MuonParticle > &l1, float &deltaR, float &deltaPhi, TrajectoryStateOnSurface &propagated) const
 
int match (const reco::Candidate &c, const std::vector< l1t::Muon > &l1, float &deltaR, float &deltaPhi, TrajectoryStateOnSurface &propagated) const
 
bool match (const reco::Track &tk, const l1extra::L1MuonParticle &l1, float &deltaR, float &deltaPhi, TrajectoryStateOnSurface &propagated) const
 
bool match (const reco::Track &tk, const l1extra::L1MuonParticle &l1, float &deltaR, float &deltaPhi, TrajectoryStateOnSurface &propagated) const
 
int match (const reco::Track &tk, const std::vector< l1extra::L1MuonParticle > &l1, float &deltaR, float &deltaPhi, TrajectoryStateOnSurface &propagated) const
 
int match (const reco::Track &tk, const std::vector< l1extra::L1MuonParticle > &l1, float &deltaR, float &deltaPhi, TrajectoryStateOnSurface &propagated) const
 
int match (const reco::Track &tk, const std::vector< l1t::Muon > &l1, float &deltaR, float &deltaPhi, TrajectoryStateOnSurface &propagated) const
 
bool match (const SimTrack &tk, const edm::SimVertexContainer &vtxs, const l1extra::L1MuonParticle &l1, float &deltaR, float &deltaPhi, TrajectoryStateOnSurface &propagated) const
 
int match (const SimTrack &tk, const edm::SimVertexContainer &vtxs, const std::vector< l1extra::L1MuonParticle > &l1, float &deltaR, float &deltaPhi, TrajectoryStateOnSurface &propagated) const
 
int match (const SimTrack &tk, const edm::SimVertexContainer &vtxs, const std::vector< l1t::Muon > &l1, float &deltaR, float &deltaPhi, TrajectoryStateOnSurface &propagated) const
 
bool match (TrajectoryStateOnSurface &propagated, const l1extra::L1MuonParticle &l1, float &deltaR, float &deltaPhi) const
 
bool match (TrajectoryStateOnSurface &propagated, const l1extra::L1MuonParticle &l1, float &deltaR, float &deltaPhi) const
 
int match (TrajectoryStateOnSurface &propagated, const std::vector< l1extra::L1MuonParticle > &l1, float &deltaR, float &deltaPhi) const
 
int match (TrajectoryStateOnSurface &propagated, const std::vector< l1extra::L1MuonParticle > &l1, float &deltaR, float &deltaPhi) const
 
int match (TrajectoryStateOnSurface &propagated, const std::vector< l1t::Muon > &l1, float &deltaR, float &deltaPhi) const
 
template<typename Collection , typename Selector >
int matchGeneric (const reco::Candidate &c, const Collection &l1, const Selector &sel, float &deltaR, float &deltaPhi, TrajectoryStateOnSurface &propagated) const
 
template<typename Collection , typename Selector >
int matchGeneric (const reco::Candidate &c, const Collection &l1, const Selector &sel, float &deltaR, float &deltaPhi, TrajectoryStateOnSurface &propagated) const
 
template<typename Collection , typename Selector >
int matchGeneric (const reco::Track &tk, const Collection &l1, const Selector &sel, float &deltaR, float &deltaPhi, TrajectoryStateOnSurface &propagated) const
 
template<typename Collection , typename Selector >
int matchGeneric (const reco::Track &tk, const Collection &l1, const Selector &sel, float &deltaR, float &deltaPhi, TrajectoryStateOnSurface &propagated) const
 
template<typename Collection , typename Selector >
int matchGeneric (TrajectoryStateOnSurface &propagated, const Collection &l1, const Selector &sel, float &deltaR, float &deltaPhi) const
 
template<typename Collection , typename Selector >
int matchGeneric (TrajectoryStateOnSurface &propagated, const Collection &l1, const Selector &sel, float &deltaR, float &deltaPhi) const
 
PropagateToMuonpropagatorToMuon ()
 Return the propagator to second muon station (in case it's needed) More...
 
PropagateToMuonpropagatorToMuon ()
 Return the propagator to second muon station (in case it's needed) More...
 
const PropagateToMuonpropagatorToMuon () const
 Return the propagator to second muon station (in case it's needed) More...
 
const PropagateToMuonpropagatorToMuon () const
 Return the propagator to second muon station (in case it's needed) More...
 
void setL1PhiOffset (double l1PhiOffset)
 Add this offset to the L1 phi before doing the match, to correct for different scales in L1 vs offline. More...
 
 ~L1MuonMatcherAlgo ()
 
 ~L1MuonMatcherAlgo ()
 

Private Types

typedef StringCutObjectSelector< l1extra::L1MuonParticleL1Selector
 
typedef StringCutObjectSelector< reco::Candidate, true > L1Selector
 
enum  SortBy {
  SortByDeltaR = 0, SortByDeltaPhi, SortByDeltaEta, SortByPt,
  SortByQual
}
 Sort by deltaPhi or deltaEta instead of deltaR. More...
 

Private Member Functions

template<class T >
int genericQuality (const T &cand) const
 

Private Attributes

double deltaEta_
 
double deltaPhi_
 
double deltaR2_
 Matching cuts. More...
 
double l1PhiOffset_
 offset to be added to the L1 phi before the match More...
 
L1Selector preselectionCut_
 Preselection cut to apply to L1 candidates before matching. More...
 
PropagateToMuon prop_
 
SortBy sortBy_
 
bool sortByDeltaPhi_
 Sort by deltaPhi instead of deltaR. More...
 
bool useStage2L1_
 

Detailed Description

Matcher of reconstructed objects to L1 Muons.

"HLTriggerOffline/Muon/interface/L1MuonMatcherAlgo.h"

Author
Giovanni Petrucciani
Giovanni Petrucciani
Version
Id
L1MuonMatcherAlgo.h,v 1.8 2010/07/01 07:40:52 gpetrucc Exp

Definition at line 26 of file L1MuonMatcherAlgo.h.

Member Typedef Documentation

◆ L1Selector [1/2]

Definition at line 166 of file L1MuonMatcherAlgo.h.

◆ L1Selector [2/2]

Definition at line 244 of file L1MuonMatcherAlgo.h.

Member Enumeration Documentation

◆ SortBy

Sort by deltaPhi or deltaEta instead of deltaR.

Enumerator
SortByDeltaR 
SortByDeltaPhi 
SortByDeltaEta 
SortByPt 
SortByQual 

Definition at line 252 of file L1MuonMatcherAlgo.h.

Constructor & Destructor Documentation

◆ L1MuonMatcherAlgo() [1/2]

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

Definition at line 5 of file L1MuonMatcherAlgo.cc.

6  : prop_(iConfig),
7  preselectionCut_(iConfig.existsAs<std::string>("preselection") ? iConfig.getParameter<std::string>("preselection")
8  : ""),
9  deltaR2_(std::pow(iConfig.getParameter<double>("maxDeltaR"), 2)),
10  deltaPhi_(iConfig.existsAs<double>("maxDeltaPhi") ? iConfig.getParameter<double>("maxDeltaPhi") : 10),
11  sortByDeltaPhi_(iConfig.existsAs<bool>("sortByDeltaPhi") ? iConfig.getParameter<bool>("sortByDeltaPhi") : false) {
12 }

◆ ~L1MuonMatcherAlgo() [1/2]

L1MuonMatcherAlgo::~L1MuonMatcherAlgo ( )

Definition at line 14 of file L1MuonMatcherAlgo.cc.

14 {}

◆ L1MuonMatcherAlgo() [2/2]

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

◆ ~L1MuonMatcherAlgo() [2/2]

L1MuonMatcherAlgo::~L1MuonMatcherAlgo ( )

Member Function Documentation

◆ extrapolate() [1/7]

TrajectoryStateOnSurface L1MuonMatcherAlgo::extrapolate ( const FreeTrajectoryState state) const
inline

Extrapolate a FreeTrajectoryState to the muon station 2, return an invalid TSOS if it fails

Definition at line 45 of file L1MuonMatcherAlgo.h.

45 { return prop_.extrapolate(state); }

References PropagateToMuon::extrapolate(), and prop_.

◆ extrapolate() [2/7]

TrajectoryStateOnSurface L1MuonMatcherAlgo::extrapolate ( const FreeTrajectoryState state) const
inline

Extrapolate a FreeTrajectoryState to the muon station 2, return an invalid TSOS if it fails.

Definition at line 48 of file L1MuonMatcherAlgo.h.

48 { return prop_.extrapolate(state); }

References PropagateToMuon::extrapolate(), and prop_.

◆ extrapolate() [3/7]

TrajectoryStateOnSurface L1MuonMatcherAlgo::extrapolate ( const reco::Candidate tk) const
inline

Extrapolate reco::Candidate to the muon station 2, return an invalid TSOS if it fails.

Definition at line 40 of file L1MuonMatcherAlgo.h.

40 { return prop_.extrapolate(tk); }

References PropagateToMuon::extrapolate(), and prop_.

◆ extrapolate() [4/7]

TrajectoryStateOnSurface L1MuonMatcherAlgo::extrapolate ( const reco::Candidate tk) const
inline

Extrapolate reco::Candidate to the muon station 2, return an invalid TSOS if it fails

Definition at line 41 of file L1MuonMatcherAlgo.h.

41 { return prop_.extrapolate(tk); }

References PropagateToMuon::extrapolate(), and prop_.

◆ extrapolate() [5/7]

TrajectoryStateOnSurface L1MuonMatcherAlgo::extrapolate ( const reco::Track tk) const
inline

Extrapolate reco::Track to the muon station 2, return an invalid TSOS if it fails.

Definition at line 37 of file L1MuonMatcherAlgo.h.

37 { return prop_.extrapolate(tk); }

References PropagateToMuon::extrapolate(), and prop_.

◆ extrapolate() [6/7]

TrajectoryStateOnSurface L1MuonMatcherAlgo::extrapolate ( const reco::Track tk) const
inline

Extrapolate reco::Track to the muon station 2, return an invalid TSOS if it fails

Definition at line 37 of file L1MuonMatcherAlgo.h.

37 { return prop_.extrapolate(tk); }

References PropagateToMuon::extrapolate(), and prop_.

Referenced by match(), and matchGeneric().

◆ extrapolate() [7/7]

TrajectoryStateOnSurface L1MuonMatcherAlgo::extrapolate ( const SimTrack tk,
const edm::SimVertexContainer vtx 
) const
inline

Extrapolate a SimTrack to the muon station 2, return an invalid TSOS if it fails. Requires SimVertices to know where to start from.

Definition at line 43 of file L1MuonMatcherAlgo.h.

43  {
44  return prop_.extrapolate(tk, vtx);
45  }

References PropagateToMuon::extrapolate(), prop_, and extraflags_cff::vtx.

◆ genericQuality()

template<class T >
int L1MuonMatcherAlgo::genericQuality ( const T cand) const
inlineprivate

Definition at line 270 of file L1MuonMatcherAlgo.h.

270  {
271  return 0;
272 }

◆ init() [1/2]

void L1MuonMatcherAlgo::init ( const edm::EventSetup iSetup)

Call this method at the beginning of each run, to initialize geometry, magnetic field and propagators

Definition at line 16 of file L1MuonMatcherAlgo.cc.

16 { prop_.init(iSetup); }

References PropagateToMuon::init(), and prop_.

Referenced by HLTMuonPlotter::beginRun().

◆ init() [2/2]

void L1MuonMatcherAlgo::init ( const edm::EventSetup iSetup)

Call this method at the beginning of each run, to initialize geometry, magnetic field and propagators.

◆ match() [1/18]

bool L1MuonMatcherAlgo::match ( const reco::Candidate c,
const l1extra::L1MuonParticle l1,
float &  deltaR,
float &  deltaPhi,
TrajectoryStateOnSurface propagated 
) const
inline

Try to match one track to one L1. Return true if succeeded (and update deltaR, deltaPhi and propagated TSOS accordingly) The preselection cut on L1, if specified in the config, is applied before the match

Definition at line 67 of file L1MuonMatcherAlgo.h.

71  {
72  propagated = extrapolate(c);
73  return propagated.isValid() ? match(propagated, l1, deltaR, deltaPhi) : false;
74  }

References c, SiPixelRawToDigiRegional_cfi::deltaPhi, PbPb_ZMuSkimMuonDPG_cff::deltaR, extrapolate(), TrajectoryStateOnSurface::isValid(), and match().

◆ match() [2/18]

bool L1MuonMatcherAlgo::match ( const reco::Candidate c,
const l1extra::L1MuonParticle l1,
float &  deltaR,
float &  deltaPhi,
TrajectoryStateOnSurface propagated 
) const
inline

Try to match one track to one L1. Return true if succeeded (and update deltaR, deltaPhi and propagated TSOS accordingly) The preselection cut on L1, if specified in the config, is applied before the match

Definition at line 68 of file L1MuonMatcherAlgo.h.

72  {
73  propagated = extrapolate(c);
74  return propagated.isValid() ? match(propagated, l1, deltaR, deltaPhi) : false;
75  }

References c, SiPixelRawToDigiRegional_cfi::deltaPhi, PbPb_ZMuSkimMuonDPG_cff::deltaR, extrapolate(), TrajectoryStateOnSurface::isValid(), and match().

◆ match() [3/18]

int L1MuonMatcherAlgo::match ( const reco::Candidate c,
const std::vector< l1extra::L1MuonParticle > &  l1,
float &  deltaR,
float &  deltaPhi,
TrajectoryStateOnSurface propagated 
) const
inline

Find the best match to L1, and return its index in the vector (and update deltaR, deltaPhi and propagated TSOS accordingly) Returns -1 if the match fails The preselection cut on L1, if specified in the config, is applied before the match

Definition at line 101 of file L1MuonMatcherAlgo.h.

105  {
106  propagated = extrapolate(c);
107  return propagated.isValid() ? match(propagated, l1, deltaR, deltaPhi) : -1;
108  }

References c, SiPixelRawToDigiRegional_cfi::deltaPhi, PbPb_ZMuSkimMuonDPG_cff::deltaR, extrapolate(), TrajectoryStateOnSurface::isValid(), and match().

◆ match() [4/18]

int L1MuonMatcherAlgo::match ( const reco::Candidate c,
const std::vector< l1extra::L1MuonParticle > &  l1,
float &  deltaR,
float &  deltaPhi,
TrajectoryStateOnSurface propagated 
) const
inline

Find the best match to L1, and return its index in the vector (and update deltaR, deltaPhi and propagated TSOS accordingly) Returns -1 if the match fails The preselection cut on L1, if specified in the config, is applied before the match

Definition at line 113 of file L1MuonMatcherAlgo.h.

117  {
118  propagated = extrapolate(c);
119  return propagated.isValid() ? match(propagated, l1, deltaR, deltaPhi) : -1;
120  }

References c, SiPixelRawToDigiRegional_cfi::deltaPhi, PbPb_ZMuSkimMuonDPG_cff::deltaR, extrapolate(), TrajectoryStateOnSurface::isValid(), and match().

◆ match() [5/18]

int L1MuonMatcherAlgo::match ( const reco::Candidate c,
const std::vector< l1t::Muon > &  l1,
float &  deltaR,
float &  deltaPhi,
TrajectoryStateOnSurface propagated 
) const
inline

Find the best match to stage2 L1, and return its index in the vector (and update deltaR, deltaPhi and propagated TSOS accordingly) Returns -1 if the match fails The preselection cut on stage2 L1, if specified in the config, is applied before the match

Definition at line 160 of file L1MuonMatcherAlgo.h.

164  {
165  propagated = extrapolate(c);
166  return propagated.isValid() ? match(propagated, l1, deltaR, deltaPhi) : -1;
167  }

References c, SiPixelRawToDigiRegional_cfi::deltaPhi, PbPb_ZMuSkimMuonDPG_cff::deltaR, extrapolate(), TrajectoryStateOnSurface::isValid(), and match().

◆ match() [6/18]

bool L1MuonMatcherAlgo::match ( const reco::Track tk,
const l1extra::L1MuonParticle l1,
float &  deltaR,
float &  deltaPhi,
TrajectoryStateOnSurface propagated 
) const
inline

Try to match one track to one L1. Return true if succeeded (and update deltaR, deltaPhi and propagated TSOS accordingly) The preselection cut on L1, if specified in the config, is applied before the match

Definition at line 55 of file L1MuonMatcherAlgo.h.

59  {
60  propagated = extrapolate(tk);
61  return propagated.isValid() ? match(propagated, l1, deltaR, deltaPhi) : false;
62  }

References SiPixelRawToDigiRegional_cfi::deltaPhi, PbPb_ZMuSkimMuonDPG_cff::deltaR, extrapolate(), and TrajectoryStateOnSurface::isValid().

Referenced by match(), and matchGeneric().

◆ match() [7/18]

bool L1MuonMatcherAlgo::match ( const reco::Track tk,
const l1extra::L1MuonParticle l1,
float &  deltaR,
float &  deltaPhi,
TrajectoryStateOnSurface propagated 
) const
inline

Try to match one track to one L1. Return true if succeeded (and update deltaR, deltaPhi and propagated TSOS accordingly) The preselection cut on L1, if specified in the config, is applied before the match

Definition at line 57 of file L1MuonMatcherAlgo.h.

61  {
62  propagated = extrapolate(tk);
63  return propagated.isValid() ? match(propagated, l1, deltaR, deltaPhi) : false;
64  }

References SiPixelRawToDigiRegional_cfi::deltaPhi, PbPb_ZMuSkimMuonDPG_cff::deltaR, extrapolate(), TrajectoryStateOnSurface::isValid(), and match().

◆ match() [8/18]

int L1MuonMatcherAlgo::match ( const reco::Track tk,
const std::vector< l1extra::L1MuonParticle > &  l1,
float &  deltaR,
float &  deltaPhi,
TrajectoryStateOnSurface propagated 
) const
inline

Find the best match to L1, and return its index in the vector (and update deltaR, deltaPhi and propagated TSOS accordingly) Returns -1 if the match fails The preselection cut on L1, if specified in the config, is applied before the match

Definition at line 88 of file L1MuonMatcherAlgo.h.

92  {
93  propagated = extrapolate(tk);
94  return propagated.isValid() ? match(propagated, l1, deltaR, deltaPhi) : -1;
95  }

References SiPixelRawToDigiRegional_cfi::deltaPhi, PbPb_ZMuSkimMuonDPG_cff::deltaR, extrapolate(), TrajectoryStateOnSurface::isValid(), and match().

◆ match() [9/18]

int L1MuonMatcherAlgo::match ( const reco::Track tk,
const std::vector< l1extra::L1MuonParticle > &  l1,
float &  deltaR,
float &  deltaPhi,
TrajectoryStateOnSurface propagated 
) const
inline

Find the best match to L1, and return its index in the vector (and update deltaR, deltaPhi and propagated TSOS accordingly) Returns -1 if the match fails The preselection cut on L1, if specified in the config, is applied before the match

Definition at line 101 of file L1MuonMatcherAlgo.h.

105  {
106  propagated = extrapolate(tk);
107  return propagated.isValid() ? match(propagated, l1, deltaR, deltaPhi) : -1;
108  }

References SiPixelRawToDigiRegional_cfi::deltaPhi, PbPb_ZMuSkimMuonDPG_cff::deltaR, extrapolate(), TrajectoryStateOnSurface::isValid(), and match().

◆ match() [10/18]

int L1MuonMatcherAlgo::match ( const reco::Track tk,
const std::vector< l1t::Muon > &  l1,
float &  deltaR,
float &  deltaPhi,
TrajectoryStateOnSurface propagated 
) const
inline

Find the best match to stage2 L1, and return its index in the vector (and update deltaR, deltaPhi and propagated TSOS accordingly) Returns -1 if the match fails The preselection cut on stage2 L1, if specified in the config, is applied before the match

Definition at line 148 of file L1MuonMatcherAlgo.h.

152  {
153  propagated = extrapolate(tk);
154  return propagated.isValid() ? match(propagated, l1, deltaR, deltaPhi) : -1;
155  }

References SiPixelRawToDigiRegional_cfi::deltaPhi, PbPb_ZMuSkimMuonDPG_cff::deltaR, extrapolate(), TrajectoryStateOnSurface::isValid(), and match().

◆ match() [11/18]

bool L1MuonMatcherAlgo::match ( const SimTrack tk,
const edm::SimVertexContainer vtxs,
const l1extra::L1MuonParticle l1,
float &  deltaR,
float &  deltaPhi,
TrajectoryStateOnSurface propagated 
) const
inline

Try to match one simtrack to one L1. Return true if succeeded (and update deltaR, deltaPhi and propagated TSOS accordingly) The preselection cut on L1, if specified in the config, is applied before the match

Definition at line 79 of file L1MuonMatcherAlgo.h.

84  {
85  propagated = extrapolate(tk, vtxs);
86  return propagated.isValid() ? match(propagated, l1, deltaR, deltaPhi) : false;
87  }

References SiPixelRawToDigiRegional_cfi::deltaPhi, PbPb_ZMuSkimMuonDPG_cff::deltaR, extrapolate(), TrajectoryStateOnSurface::isValid(), and match().

◆ match() [12/18]

int L1MuonMatcherAlgo::match ( const SimTrack tk,
const edm::SimVertexContainer vtxs,
const std::vector< l1extra::L1MuonParticle > &  l1,
float &  deltaR,
float &  deltaPhi,
TrajectoryStateOnSurface propagated 
) const
inline

Find the best match to L1, and return its index in the vector (and update deltaR, deltaPhi and propagated TSOS accordingly) Returns -1 if the match fails The preselection cut on L1, if specified in the config, is applied before the match

Definition at line 125 of file L1MuonMatcherAlgo.h.

130  {
131  propagated = extrapolate(tk, vtxs);
132  return propagated.isValid() ? match(propagated, l1, deltaR, deltaPhi) : -1;
133  }

References SiPixelRawToDigiRegional_cfi::deltaPhi, PbPb_ZMuSkimMuonDPG_cff::deltaR, extrapolate(), TrajectoryStateOnSurface::isValid(), and match().

◆ match() [13/18]

int L1MuonMatcherAlgo::match ( const SimTrack tk,
const edm::SimVertexContainer vtxs,
const std::vector< l1t::Muon > &  l1,
float &  deltaR,
float &  deltaPhi,
TrajectoryStateOnSurface propagated 
) const
inline

Find the best match to stage2 L1, and return its index in the vector (and update deltaR, deltaPhi and propagated TSOS accordingly) Returns -1 if the match fails The preselection cut on stage 2 L1, if specified in the config, is applied before the match

Definition at line 172 of file L1MuonMatcherAlgo.h.

177  {
178  propagated = extrapolate(tk, vtxs);
179  return propagated.isValid() ? match(propagated, l1, deltaR, deltaPhi) : -1;
180  }

References SiPixelRawToDigiRegional_cfi::deltaPhi, PbPb_ZMuSkimMuonDPG_cff::deltaR, extrapolate(), TrajectoryStateOnSurface::isValid(), and match().

◆ match() [14/18]

bool L1MuonMatcherAlgo::match ( TrajectoryStateOnSurface propagated,
const l1extra::L1MuonParticle l1,
float &  deltaR,
float &  deltaPhi 
) const

Try to match one track to one L1. Return true if succeeded (and update deltaR, deltaPhi accordingly) The preselection cut on L1, if specified in the config, is applied before the match

Definition at line 18 of file L1MuonMatcherAlgo.cc.

21  {
22  if (preselectionCut_(l1)) {
23  GlobalPoint pos = propagated.globalPosition();
24  double thisDeltaPhi = ::deltaPhi(double(pos.phi()), l1.phi());
25  double thisDeltaR2 = ::deltaR2(double(pos.eta()), double(pos.phi()), l1.eta(), l1.phi());
26  if ((fabs(thisDeltaPhi) < deltaPhi_) && (thisDeltaR2 < deltaR2_)) {
27  deltaR = std::sqrt(thisDeltaR2);
28  deltaPhi = thisDeltaPhi;
29  return true;
30  }
31  }
32  return false;
33 }

References SiPixelRawToDigiRegional_cfi::deltaPhi, deltaPhi_, PbPb_ZMuSkimMuonDPG_cff::deltaR, HLTMuonOfflineAnalyzer_cfi::deltaR2, deltaR2_, reco::LeafCandidate::eta(), TrajectoryStateOnSurface::globalPosition(), reco::LeafCandidate::phi(), preselectionCut_, and mathSSE::sqrt().

◆ match() [15/18]

bool L1MuonMatcherAlgo::match ( TrajectoryStateOnSurface propagated,
const l1extra::L1MuonParticle l1,
float &  deltaR,
float &  deltaPhi 
) const

Try to match one track to one L1. Return true if succeeded (and update deltaR, deltaPhi accordingly) The preselection cut on L1, if specified in the config, is applied before the match

◆ match() [16/18]

int L1MuonMatcherAlgo::match ( TrajectoryStateOnSurface propagated,
const std::vector< l1extra::L1MuonParticle > &  l1,
float &  deltaR,
float &  deltaPhi 
) const

Find the best match to L1, and return its index in the vector (and update deltaR, deltaPhi accordingly) Returns -1 if the match fails The preselection cut on L1, if specified in the config, is applied before the match

Definition at line 35 of file L1MuonMatcherAlgo.cc.

38  {
39  return matchGeneric(propagated, l1s, preselectionCut_, deltaR, deltaPhi);
40  /*
41  int match = -1;
42  double minDeltaPhi = deltaPhi_;
43  double minDeltaR2 = deltaR2_;
44  GlobalPoint pos = propagated.globalPosition();
45  for (int i = 0, n = l1s.size(); i < n; ++i) {
46  const l1extra::L1MuonParticle &l1 = l1s[i];
47  if (preselectionCut_(l1)) {
48  double thisDeltaPhi = ::deltaPhi(double(pos.phi()), l1.phi());
49  double thisDeltaR2 = ::deltaR2(double(pos.eta()),
50  double(pos.phi()), l1.eta(), l1.phi()); if ((fabs(thisDeltaPhi) <
51  deltaPhi_) && (thisDeltaR2 < deltaR2_)) { // check both if (sortByDeltaPhi_
52  ? (fabs(thisDeltaPhi) < fabs(minDeltaPhi)) : (thisDeltaR2 < minDeltaR2)) {
53  // sort on one match = i; deltaR = std::sqrt(thisDeltaR2); deltaPhi =
54  thisDeltaPhi; if (sortByDeltaPhi_) minDeltaPhi = thisDeltaPhi; else
55  minDeltaR2 = thisDeltaR2;
56  }
57  }
58  }
59  }
60  return match;
61  */
62 }

References SiPixelRawToDigiRegional_cfi::deltaPhi, PbPb_ZMuSkimMuonDPG_cff::deltaR, matchGeneric(), and preselectionCut_.

◆ match() [17/18]

int L1MuonMatcherAlgo::match ( TrajectoryStateOnSurface propagated,
const std::vector< l1extra::L1MuonParticle > &  l1,
float &  deltaR,
float &  deltaPhi 
) const

Find the best match to L1, and return its index in the vector (and update deltaR, deltaPhi accordingly) Returns -1 if the match fails The preselection cut on L1, if specified in the config, is applied before the match

◆ match() [18/18]

int L1MuonMatcherAlgo::match ( TrajectoryStateOnSurface propagated,
const std::vector< l1t::Muon > &  l1,
float &  deltaR,
float &  deltaPhi 
) const

Find the best match to stage 2 L1, and return its index in the vector (and update deltaR, deltaPhi accordingly) Returns -1 if the match fails The preselection cut on stage 2 L1, if specified in the config, is applied before the match

Definition at line 97 of file L1MuonMatcherAlgo.cc.

100  {
101  return matchGeneric(propagated, l1s, preselectionCut_, deltaR, deltaPhi);
102 }

References SiPixelRawToDigiRegional_cfi::deltaPhi, PbPb_ZMuSkimMuonDPG_cff::deltaR, matchGeneric(), and preselectionCut_.

◆ matchGeneric() [1/6]

template<typename Collection , typename Selector >
int L1MuonMatcherAlgo::matchGeneric ( const reco::Candidate c,
const Collection &  l1,
const Selector sel,
float &  deltaR,
float &  deltaPhi,
TrajectoryStateOnSurface propagated 
) const
inline

Find the best match to L1, and return its index in the vector (and update deltaR, deltaPhi and propagated TSOS accordingly) Returns -1 if the match fails Only the objects passing the selector will be allowed for the match. If you don't need a selector, just use an AnySelector (CommonTools/Utils) which accepts everything

Definition at line 141 of file L1MuonMatcherAlgo.h.

146  {
147  propagated = extrapolate(c);
148  return propagated.isValid() ? matchGeneric(propagated, l1, sel, deltaR, deltaPhi) : -1;
149  }

References c, SiPixelRawToDigiRegional_cfi::deltaPhi, PbPb_ZMuSkimMuonDPG_cff::deltaR, extrapolate(), TrajectoryStateOnSurface::isValid(), matchGeneric(), and EgammaValidation_Wenu_cff::sel.

◆ matchGeneric() [2/6]

template<typename Collection , typename Selector >
int L1MuonMatcherAlgo::matchGeneric ( const reco::Candidate c,
const Collection &  l1,
const Selector sel,
float &  deltaR,
float &  deltaPhi,
TrajectoryStateOnSurface propagated 
) const
inline

Find the best match to L1, and return its index in the vector (and update deltaR, deltaPhi and propagated TSOS accordingly) Returns -1 if the match fails Only the objects passing the selector will be allowed for the match. If you don't need a selector, just use an AnySelector (CommonTools/Utils) which accepts everything

Definition at line 212 of file L1MuonMatcherAlgo.h.

217  {
218  propagated = extrapolate(c);
219  return propagated.isValid() ? matchGeneric(propagated, l1, sel, deltaR, deltaPhi) : -1;
220  }

References c, SiPixelRawToDigiRegional_cfi::deltaPhi, PbPb_ZMuSkimMuonDPG_cff::deltaR, extrapolate(), TrajectoryStateOnSurface::isValid(), matchGeneric(), and EgammaValidation_Wenu_cff::sel.

◆ matchGeneric() [3/6]

template<typename Collection , typename Selector >
int L1MuonMatcherAlgo::matchGeneric ( const reco::Track tk,
const Collection &  l1,
const Selector sel,
float &  deltaR,
float &  deltaPhi,
TrajectoryStateOnSurface propagated 
) const
inline

Find the best match to L1, and return its index in the vector (and update deltaR, deltaPhi and propagated TSOS accordingly) Returns -1 if the match fails Only the objects passing the selector will be allowed for the match. If you don't need a selector, just use an AnySelector (CommonTools/Utils) which accepts everything

Definition at line 125 of file L1MuonMatcherAlgo.h.

130  {
131  propagated = extrapolate(tk);
132  return propagated.isValid() ? matchGeneric(propagated, l1, sel, deltaR, deltaPhi) : -1;
133  }

References SiPixelRawToDigiRegional_cfi::deltaPhi, PbPb_ZMuSkimMuonDPG_cff::deltaR, extrapolate(), TrajectoryStateOnSurface::isValid(), and EgammaValidation_Wenu_cff::sel.

Referenced by match(), and matchGeneric().

◆ matchGeneric() [4/6]

template<typename Collection , typename Selector >
int L1MuonMatcherAlgo::matchGeneric ( const reco::Track tk,
const Collection &  l1,
const Selector sel,
float &  deltaR,
float &  deltaPhi,
TrajectoryStateOnSurface propagated 
) const
inline

Find the best match to L1, and return its index in the vector (and update deltaR, deltaPhi and propagated TSOS accordingly) Returns -1 if the match fails Only the objects passing the selector will be allowed for the match. If you don't need a selector, just use an AnySelector (CommonTools/Utils) which accepts everything

Definition at line 197 of file L1MuonMatcherAlgo.h.

202  {
203  propagated = extrapolate(tk);
204  return propagated.isValid() ? matchGeneric(propagated, l1, sel, deltaR, deltaPhi) : -1;
205  }

References SiPixelRawToDigiRegional_cfi::deltaPhi, PbPb_ZMuSkimMuonDPG_cff::deltaR, extrapolate(), TrajectoryStateOnSurface::isValid(), matchGeneric(), and EgammaValidation_Wenu_cff::sel.

◆ matchGeneric() [5/6]

template<typename Collection , typename Selector >
int L1MuonMatcherAlgo::matchGeneric ( TrajectoryStateOnSurface propagated,
const Collection &  l1,
const Selector sel,
float &  deltaR,
float &  deltaPhi 
) const

Find the best match to L1, and return its index in the vector (and update deltaR, deltaPhi accordingly) Returns -1 if the match fails Only the objects passing the selector will be allowed for the match. The selector defaults to an AnySelector (CommonTools/Utils) which just accepts everything

Definition at line 178 of file L1MuonMatcherAlgo.h.

182  {
183  typedef typename Collection::value_type obj;
184  int match = -1;
185  double minDeltaPhi = deltaPhi_;
186  double minDeltaR2 = deltaR2_;
187  GlobalPoint pos = propagated.globalPosition();
188  for (int i = 0, n = l1s.size(); i < n; ++i) {
189  const obj &l1 = l1s[i];
190  if (sel(l1)) {
191  double thisDeltaPhi = ::deltaPhi(double(pos.phi()), l1.phi());
192  double thisDeltaR2 = ::deltaR2(double(pos.eta()), double(pos.phi()), l1.eta(), l1.phi());
193  if ((fabs(thisDeltaPhi) < deltaPhi_) && (thisDeltaR2 < deltaR2_)) { // check both
194  if (sortByDeltaPhi_ ? (fabs(thisDeltaPhi) < fabs(minDeltaPhi)) : (thisDeltaR2 < minDeltaR2)) { // sort on one
195  match = i;
196  deltaR = std::sqrt(thisDeltaR2);
197  deltaPhi = thisDeltaPhi;
198  if (sortByDeltaPhi_)
199  minDeltaPhi = thisDeltaPhi;
200  else
201  minDeltaR2 = thisDeltaR2;
202  }
203  }
204  }
205  }
206  return match;
207 }

References SiPixelRawToDigiRegional_cfi::deltaPhi, deltaPhi_, PbPb_ZMuSkimMuonDPG_cff::deltaR, HLTMuonOfflineAnalyzer_cfi::deltaR2, deltaR2_, TrajectoryStateOnSurface::globalPosition(), mps_fire::i, match(), VBFGenJetFilter_cfi::minDeltaPhi, dqmiodumpmetadata::n, getGTfromDQMFile::obj, EgammaValidation_Wenu_cff::sel, sortByDeltaPhi_, and mathSSE::sqrt().

◆ matchGeneric() [6/6]

template<typename Collection , typename Selector >
int L1MuonMatcherAlgo::matchGeneric ( TrajectoryStateOnSurface propagated,
const Collection &  l1,
const Selector sel,
float &  deltaR,
float &  deltaPhi 
) const

Find the best match to L1, and return its index in the vector (and update deltaR, deltaPhi accordingly) Returns -1 if the match fails Only the objects passing the selector will be allowed for the match. The selector defaults to an AnySelector (CommonTools/Utils) which just accepts everything

◆ propagatorToMuon() [1/4]

PropagateToMuon& L1MuonMatcherAlgo::propagatorToMuon ( )
inline

Return the propagator to second muon station (in case it's needed)

Definition at line 48 of file L1MuonMatcherAlgo.h.

48 { return prop_; }

References prop_.

◆ propagatorToMuon() [2/4]

PropagateToMuon& L1MuonMatcherAlgo::propagatorToMuon ( )
inline

Return the propagator to second muon station (in case it's needed)

Definition at line 51 of file L1MuonMatcherAlgo.h.

51 { return prop_; }

References prop_.

◆ propagatorToMuon() [3/4]

const PropagateToMuon& L1MuonMatcherAlgo::propagatorToMuon ( ) const
inline

Return the propagator to second muon station (in case it's needed)

Definition at line 50 of file L1MuonMatcherAlgo.h.

50 { return prop_; }

References prop_.

◆ propagatorToMuon() [4/4]

const PropagateToMuon& L1MuonMatcherAlgo::propagatorToMuon ( ) const
inline

Return the propagator to second muon station (in case it's needed)

Definition at line 53 of file L1MuonMatcherAlgo.h.

53 { return prop_; }

References prop_.

◆ setL1PhiOffset()

void L1MuonMatcherAlgo::setL1PhiOffset ( double  l1PhiOffset)
inline

Add this offset to the L1 phi before doing the match, to correct for different scales in L1 vs offline.

Definition at line 234 of file L1MuonMatcherAlgo.h.

References muonL1Match_cfi::l1PhiOffset, and l1PhiOffset_.

Member Data Documentation

◆ deltaEta_

double L1MuonMatcherAlgo::deltaEta_
private

Definition at line 249 of file L1MuonMatcherAlgo.h.

◆ deltaPhi_

double L1MuonMatcherAlgo::deltaPhi_
private

Definition at line 171 of file L1MuonMatcherAlgo.h.

Referenced by match(), and matchGeneric().

◆ deltaR2_

double L1MuonMatcherAlgo::deltaR2_
private

Matching cuts.

Definition at line 171 of file L1MuonMatcherAlgo.h.

Referenced by match(), and matchGeneric().

◆ l1PhiOffset_

double L1MuonMatcherAlgo::l1PhiOffset_
private

offset to be added to the L1 phi before the match

Definition at line 256 of file L1MuonMatcherAlgo.h.

Referenced by setL1PhiOffset().

◆ preselectionCut_

L1Selector L1MuonMatcherAlgo::preselectionCut_
private

Preselection cut to apply to L1 candidates before matching.

Definition at line 168 of file L1MuonMatcherAlgo.h.

Referenced by match().

◆ prop_

PropagateToMuon L1MuonMatcherAlgo::prop_
private

Definition at line 164 of file L1MuonMatcherAlgo.h.

Referenced by extrapolate(), init(), and propagatorToMuon().

◆ sortBy_

SortBy L1MuonMatcherAlgo::sortBy_
private

Definition at line 253 of file L1MuonMatcherAlgo.h.

◆ sortByDeltaPhi_

bool L1MuonMatcherAlgo::sortByDeltaPhi_
private

Sort by deltaPhi instead of deltaR.

Definition at line 174 of file L1MuonMatcherAlgo.h.

Referenced by matchGeneric().

◆ useStage2L1_

bool L1MuonMatcherAlgo::useStage2L1_
private

Definition at line 242 of file L1MuonMatcherAlgo.h.

mps_fire.i
i
Definition: mps_fire.py:428
funct::false
false
Definition: Factorize.h:29
L1MuonMatcherAlgo::matchGeneric
int matchGeneric(const reco::Track &tk, const Collection &l1, const Selector &sel, float &deltaR, float &deltaPhi, TrajectoryStateOnSurface &propagated) const
Definition: L1MuonMatcherAlgo.h:125
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
L1MuonMatcherAlgo::preselectionCut_
L1Selector preselectionCut_
Preselection cut to apply to L1 candidates before matching.
Definition: L1MuonMatcherAlgo.h:168
PropagateToMuon::init
void init(const edm::EventSetup &iSetup)
Definition: PropagateToMuon.cc:56
L1MuonMatcherAlgo::sortByDeltaPhi_
bool sortByDeltaPhi_
Sort by deltaPhi instead of deltaR.
Definition: L1MuonMatcherAlgo.h:174
muonL1Match_cfi.l1PhiOffset
l1PhiOffset
Definition: muonL1Match_cfi.py:25
L1MuonMatcherAlgo::prop_
PropagateToMuon prop_
Definition: L1MuonMatcherAlgo.h:164
TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
pos
Definition: PixelAliasList.h:18
edm::ParameterSet::existsAs
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:171
L1MuonMatcherAlgo::SortByDeltaEta
Definition: L1MuonMatcherAlgo.h:252
SiPixelRawToDigiRegional_cfi.deltaPhi
deltaPhi
Definition: SiPixelRawToDigiRegional_cfi.py:9
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
Point3DBase< float, GlobalTag >
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
PbPb_ZMuSkimMuonDPG_cff.deltaR
deltaR
Definition: PbPb_ZMuSkimMuonDPG_cff.py:63
L1MuonMatcherAlgo::match
bool match(const reco::Track &tk, const l1extra::L1MuonParticle &l1, float &deltaR, float &deltaPhi, TrajectoryStateOnSurface &propagated) const
Definition: L1MuonMatcherAlgo.h:55
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
L1MuonMatcherAlgo::deltaPhi_
double deltaPhi_
Definition: L1MuonMatcherAlgo.h:171
L1MuonMatcherAlgo::SortByQual
Definition: L1MuonMatcherAlgo.h:252
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition: LeafCandidate.h:152
L1MuonMatcherAlgo::SortByPt
Definition: L1MuonMatcherAlgo.h:252
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
L1MuonMatcherAlgo::extrapolate
TrajectoryStateOnSurface extrapolate(const reco::Track &tk) const
Definition: L1MuonMatcherAlgo.h:37
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition: LeafCandidate.h:148
RunInfoPI::state
state
Definition: RunInfoPayloadInspectoHelper.h:16
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:18
HLTMuonOfflineAnalyzer_cfi.deltaR2
deltaR2
Definition: HLTMuonOfflineAnalyzer_cfi.py:105
l1s
Definition: L1Scalers.h:16
L1MuonMatcherAlgo::l1PhiOffset_
double l1PhiOffset_
offset to be added to the L1 phi before the match
Definition: L1MuonMatcherAlgo.h:256
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
PropagateToMuon::extrapolate
TrajectoryStateOnSurface extrapolate(const reco::Track &tk) const
Definition: PropagateToMuon.h:40
EgammaValidation_Wenu_cff.sel
sel
Definition: EgammaValidation_Wenu_cff.py:33
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
VBFGenJetFilter_cfi.minDeltaPhi
minDeltaPhi
Definition: VBFGenJetFilter_cfi.py:13
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
L1MuonMatcherAlgo::SortByDeltaPhi
Definition: L1MuonMatcherAlgo.h:252
L1MuonMatcherAlgo::deltaR2_
double deltaR2_
Matching cuts.
Definition: L1MuonMatcherAlgo.h:171
L1MuonMatcherAlgo::SortByDeltaR
Definition: L1MuonMatcherAlgo.h:252