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

static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker<edm::ParameterSetDescriptionFiller< MuonsFromRefitTracksProducer > > s_filler__LINE__ ( "MuonsFromRefitTracksProducer"  )
static
static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< MuonsFromRefitTracksProducer > > s_maker__LINE__ ( "MuonsFromRefitTracksProducer"  )
static
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, delta, reco::Muon::globalTrack(), reco::Muon::InnerTrack, reco::Muon::innerTrack(), refitMuons_cfi::ptThreshold, and electronIdCutBased_cfi::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) : make_pair(combinedTrack,reco::Muon::CombinedTrack);
64 }
dbl * delta
Definition: mlp_gen.cc:36
virtual TrackRef innerTrack() const
Definition: Muon.h:48
Definition: Muon.py:1
fixed size matrix
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
Definition: Muon.h:54
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, edm::AssociationMap< Tag >::end(), edm::AssociationMap< Tag >::find(), reco::Muon::globalTrack(), reco::Muon::InnerTrack, 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().

22  {
23  const reco::TrackRef& combinedTrack = muon.globalTrack();
24  const reco::TrackRef& trackerTrack = muon.innerTrack();
25 
26  reco::TrackToTrackMap::const_iterator fmsTrack = fmsMap.find(combinedTrack);
27 
28  double probTK = 0;
29  double probFMS = 0;
30 
31  if (trackerTrack.isAvailable() && trackerTrack->numberOfValidHits())
32  probTK = muon::trackProbability(trackerTrack);
33  if (fmsTrack != fmsMap.end() && fmsTrack->val->numberOfValidHits())
34  probFMS = muon::trackProbability(fmsTrack->val);
35 
36  bool TKok = probTK > 0;
37  bool FMSok = probFMS > 0;
38 
39  if (TKok && FMSok) {
40  if (probFMS - probTK > cut)
41  return make_pair(trackerTrack,reco::Muon::InnerTrack);
42  else
43  return make_pair(fmsTrack->val,reco::Muon::TPFMS);
44  }
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 }
bool isAvailable() const
Definition: Ref.h:575
const_iterator end() const
last iterator over the map (read only)
virtual TrackRef innerTrack() const
Definition: Muon.h:48
const_iterator find(const key_type &k) const
find element with specified reference key
double trackProbability(const reco::TrackRef track)
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
Definition: Muon.h:54