CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions
MuonsFromRefitTracksProducer.cc File Reference
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/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
edm::ParameterSetDescriptionFillerPluginFactory::PMaker
< edm::ParameterSetDescriptionFiller
< MuonsFromRefitTracksProducer > > 
s_filler__LINE__ ("MuonsFromRefitTracksProducer")
 
static
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 edm::ParameterSetDescriptionFillerPluginFactory::PMaker<edm::ParameterSetDescriptionFiller< MuonsFromRefitTracksProducer > > s_filler__LINE__ ( "MuonsFromRefitTracksProducer"  )
static
static 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 54 of file MuonsFromRefitTracksProducer.cc.

References reco::Muon::CombinedTrack, delta, reco::Muon::globalTrack(), reco::Muon::InnerTrack, reco::Muon::innerTrack(), and dtDQMClient_cfg::threshold.

Referenced by MuonsFromRefitTracksProducer::produce().

54  {
55  const reco::TrackRef& combinedTrack = muon.globalTrack();
56  const reco::TrackRef& trackerTrack = muon.innerTrack();
57 
58  if (combinedTrack->pt() < ptThreshold || trackerTrack->pt() < ptThreshold)
59  return make_pair(trackerTrack,reco::Muon::InnerTrack);
60 
61  double delta = fabs(trackerTrack->qoverp() - combinedTrack->qoverp());
62  double threshold = nSigma * trackerTrack->qoverpError();
63 
64  return delta > threshold ? make_pair(trackerTrack,reco::Muon::InnerTrack) : make_pair(combinedTrack,reco::Muon::CombinedTrack);
65 }
dbl * delta
Definition: mlp_gen.cc:36
virtual TrackRef innerTrack() const
Definition: Muon.h:49
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
Definition: Muon.h:55
reco::Muon::MuonTrackTypePair tevOptimizedTMR ( const reco::Muon muon,
const reco::TrackToTrackMap fmsMap,
const double  cut 
)

Definition at line 22 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().

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  }
46  else if (FMSok)
47  return make_pair(fmsTrack->val,reco::Muon::TPFMS);
48  else if (TKok)
49  return make_pair(trackerTrack,reco::Muon::InnerTrack);
50 
51  return make_pair(combinedTrack,reco::Muon::CombinedTrack);
52 }
const_iterator end() const
last iterator over the map (read only)
virtual TrackRef innerTrack() const
Definition: Muon.h:49
const_iterator find(const key_type &k) const
find element with specified reference key
bool isAvailable() const
Definition: Ref.h:276
double trackProbability(const reco::TrackRef track)
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
Definition: Muon.h:55