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_0__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_0__LINE__()

static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker<edm::ParameterSetDescriptionFiller< MuonsFromRefitTracksProducer > > s_filler_0__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.

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

Referenced by MuonsFromRefitTracksProducer::produce().

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 }
Definition: Muon.py:1
fixed size matrix

◆ tevOptimizedTMR()

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

Definition at line 21 of file MuonsFromRefitTracksProducer.cc.

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().

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 }
const_iterator find(const key_type &k) const
find element with specified reference key
const_iterator end() const
last iterator over the map (read only)
bool isAvailable() const
Definition: Ref.h:541
double trackProbability(const reco::TrackRef track)