CMS 3D CMS Logo

Classes | Functions
MuonsFromRefitTracksProducer.cc File Reference
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/stream/EDProducer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "DataFormats/MuonReco/interface/Muon.h"
#include "DataFormats/MuonReco/interface/MuonFwd.h"
#include "DataFormats/MuonReco/interface/MuonCocktails.h"
#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/TrackReco/interface/TrackFwd.h"
#include "DataFormats/TrackReco/interface/TrackToTrackMap.h"

Go to the source code of this file.

Classes

class  MuonsFromRefitTracksProducer
 

Functions

static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker< edm::ParameterSetDescriptionFiller< MuonsFromRefitTracksProducer > > s_filler__LINE__ ("MuonsFromRefitTracksProducer")
 
static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< MuonsFromRefitTracksProducer > > s_maker__LINE__ ("MuonsFromRefitTracksProducer")
 
reco::Muon::MuonTrackTypePair sigmaSwitch (const reco::Muon &muon, const double nSigma, const double ptThreshold)
 
reco::Muon::MuonTrackTypePair tevOptimizedTMR (const reco::Muon &muon, const reco::TrackToTrackMap &fmsMap, const double cut)
 

Function Documentation

◆ s_filler__LINE__()

static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker<edm::ParameterSetDescriptionFiller< MuonsFromRefitTracksProducer > > s_filler__LINE__ ( "MuonsFromRefitTracksProducer"  )
static

◆ s_maker__LINE__()

static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< MuonsFromRefitTracksProducer > > s_maker__LINE__ ( "MuonsFromRefitTracksProducer"  )
static

◆ sigmaSwitch()

reco::Muon::MuonTrackTypePair sigmaSwitch ( const reco::Muon muon,
const double  nSigma,
const double  ptThreshold 
)

Definition at line 53 of file MuonsFromRefitTracksProducer.cc.

53  {
54  const reco::TrackRef& combinedTrack = muon.globalTrack();
55  const reco::TrackRef& trackerTrack = muon.innerTrack();
56 
57  if (combinedTrack->pt() < ptThreshold || trackerTrack->pt() < ptThreshold)
58  return make_pair(trackerTrack, reco::Muon::InnerTrack);
59 
60  double delta = fabs(trackerTrack->qoverp() - combinedTrack->qoverp());
61  double threshold = nSigma * trackerTrack->qoverpError();
62 
63  return delta > threshold ? make_pair(trackerTrack, reco::Muon::InnerTrack)
64  : make_pair(combinedTrack, reco::Muon::CombinedTrack);
65 }

References reco::Muon::CombinedTrack, dumpMFGeometry_cfg::delta, reco::Muon::InnerTrack, HLTSiStripMonitoring_cff::nSigma, ewkMuLumiMonitorDQM_cfi::ptThreshold, and remoteMonitoring_LED_IterMethod_cfg::threshold.

Referenced by MuonsFromRefitTracksProducer::produce().

◆ tevOptimizedTMR()

reco::Muon::MuonTrackTypePair tevOptimizedTMR ( const reco::Muon muon,
const reco::TrackToTrackMap fmsMap,
const double  cut 
)

Definition at line 21 of file MuonsFromRefitTracksProducer.cc.

23  {
24  const reco::TrackRef& combinedTrack = muon.globalTrack();
25  const reco::TrackRef& trackerTrack = muon.innerTrack();
26 
27  reco::TrackToTrackMap::const_iterator fmsTrack = fmsMap.find(combinedTrack);
28 
29  double probTK = 0;
30  double probFMS = 0;
31 
32  if (trackerTrack.isAvailable() && trackerTrack->numberOfValidHits())
33  probTK = muon::trackProbability(trackerTrack);
34  if (fmsTrack != fmsMap.end() && fmsTrack->val->numberOfValidHits())
35  probFMS = muon::trackProbability(fmsTrack->val);
36 
37  bool TKok = probTK > 0;
38  bool FMSok = probFMS > 0;
39 
40  if (TKok && FMSok) {
41  if (probFMS - probTK > cut)
42  return make_pair(trackerTrack, reco::Muon::InnerTrack);
43  else
44  return make_pair(fmsTrack->val, reco::Muon::TPFMS);
45  } else if (FMSok)
46  return make_pair(fmsTrack->val, reco::Muon::TPFMS);
47  else if (TKok)
48  return make_pair(trackerTrack, reco::Muon::InnerTrack);
49 
50  return make_pair(combinedTrack, reco::Muon::CombinedTrack);
51 }

References reco::Muon::CombinedTrack, TkAlMuonSelectors_cfi::cut, edm::AssociationMap< Tag >::end(), edm::AssociationMap< Tag >::find(), reco::Muon::InnerTrack, edm::Ref< C, T, F >::isAvailable(), reco::Muon::TPFMS, muon::trackProbability(), and edm::helpers::KeyVal< K, V >::val.

Referenced by MuonsFromRefitTracksProducer::produce().

ewkMuLumiMonitorDQM_cfi.ptThreshold
ptThreshold
Definition: ewkMuLumiMonitorDQM_cfi.py:13
reco::Muon::CombinedTrack
Definition: Muon.h:36
edm::AssociationMap::find
const_iterator find(const key_type &k) const
find element with specified reference key
Definition: AssociationMap.h:173
TkAlMuonSelectors_cfi.cut
cut
Definition: TkAlMuonSelectors_cfi.py:5
muon
Definition: MuonCocktails.h:17
reco::Muon::TPFMS
Definition: Muon.h:36
edm::Ref::isAvailable
bool isAvailable() const
Definition: Ref.h:537
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
Muon
Definition: Muon.py:1
edm::Ref< TrackCollection >
edm::AssociationMap::end
const_iterator end() const
last iterator over the map (read only)
Definition: AssociationMap.h:171
muon::trackProbability
double trackProbability(const reco::TrackRef track)
Definition: MuonCocktails.cc:122
edm::helpers::KeyVal::val
V val
Definition: AssociationMapHelpers.h:33
dumpMFGeometry_cfg.delta
delta
Definition: dumpMFGeometry_cfg.py:25
reco::Muon::InnerTrack
Definition: Muon.h:36
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:426
edm::AssociationMap::const_iterator
const iterator
Definition: AssociationMap.h:76
HLTSiStripMonitoring_cff.nSigma
nSigma
Definition: HLTSiStripMonitoring_cff.py:151