CMS 3D CMS Logo

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

#include <GlobalMuonRefitter.h>

Public Types

typedef MuonTransientTrackingRecHit::ConstMuonRecHitContainer ConstMuonRecHitContainer
 
typedef MuonTransientTrackingRecHit::ConstMuonRecHitPointer ConstMuonRecHitPointer
 
typedef TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
 
typedef TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer
 
typedef MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
 
typedef MuonTransientTrackingRecHit::MuonRecHitPointer MuonRecHitPointer
 
typedef TransientTrackingRecHit::RecHitContainer RecHitContainer
 
typedef TransientTrackingRecHit::RecHitPointer RecHitPointer
 
enum  subDetector {
  PXB = 1, PXF = 2, TIB = 3, TID = 4,
  TOB = 5, TEC = 6
}
 
typedef std::vector< TrajectoryTC
 
typedef TC::const_iterator TI
 

Public Member Functions

const reco::DYTInfogetDYTInfo ()
 
ConstRecHitContainer getRidOfSelectStationHits (const ConstRecHitContainer &hits, const TrackerTopology *tTopo) const
 
 GlobalMuonRefitter (const edm::ParameterSet &, const MuonServiceProxy *, edm::ConsumesCollector &)
 constructor with Parameter Set and MuonServiceProxy More...
 
std::vector< Trajectoryrefit (const reco::Track &globalTrack, const int theMuonHitsOption, const TrackerTopology *tTopo) const
 build combined trajectory from sta Track and tracker RecHits More...
 
std::vector< Trajectoryrefit (const reco::Track &globalTrack, const reco::TransientTrack track, const TransientTrackingRecHit::ConstRecHitContainer &allRecHitsTemp, const int theMuonHitsOption, const TrackerTopology *tTopo) const
 build combined trajectory from subset of sta Track and tracker RecHits More...
 
virtual void setEvent (const edm::Event &)
 pass the Event to the algo at each event More...
 
void setServices (const edm::EventSetup &)
 set the services needed by the TrackTransformer More...
 
std::vector< Trajectorytransform (const reco::Track &newTrack, const reco::TransientTrack track, const TransientTrackingRecHit::ConstRecHitContainer &recHitsForReFit) const
 refit the track with a new set of RecHits More...
 
virtual ~GlobalMuonRefitter ()
 destructor More...
 

Protected Types

enum  RefitDirection { insideOut, outsideIn, undetermined }
 

Protected Member Functions

void checkMuonHits (const reco::Track &, ConstRecHitContainer &, std::map< DetId, int > &) const
 check muon RecHits, calculate chamber occupancy and select hits to be used in the final fit More...
 
RefitDirection checkRecHitsOrdering (const ConstRecHitContainer &) const
 
void getFirstHits (const reco::Track &, ConstRecHitContainer &, ConstRecHitContainer &) const
 get the RecHits in the tracker and the first muon chamber with hits More...
 
void printHits (const ConstRecHitContainer &) const
 print all RecHits of a trajectory More...
 
ConstRecHitContainer selectMuonHits (const Trajectory &, const std::map< DetId, int > &) const
 select muon hits compatible with trajectory; check hits in chambers with showers More...
 
const MuonServiceProxyservice () const
 

Protected Attributes

std::string theCategory
 
float thePtCut
 
bool theTkTrajsAvailableFlag
 

Private Attributes

edm::Handle< DTRecSegment4DCollectionall4DSegments
 
edm::EDGetTokenT< DTRecSegment4DCollectionall4DSegmentsToken
 
edm::Handle< CSCSegmentCollectionCSCSegments
 
edm::EDGetTokenT< CSCSegmentCollectionCSCSegmentsToken
 
reco::DYTInfodytInfo
 
TkClonerImpl hitCloner
 
unsigned long long theCacheId_TRH
 
bool theCosmicFlag
 
float theCSCChi2Cut
 
edm::InputTag theCSCRecHitLabel
 
edm::Handle< CSCRecHit2DCollectiontheCSCRecHits
 
edm::EDGetTokenT< CSCRecHit2DCollectiontheCSCRecHitToken
 
float theDTChi2Cut
 
edm::InputTag theDTRecHitLabel
 
edm::Handle< DTRecHitCollectiontheDTRecHits
 
edm::EDGetTokenT< DTRecHitCollectiontheDTRecHitToken
 
bool theDYTParThrsMode
 
int theDYTselector
 
std::vector< int > theDYTthrs
 
edm::ParameterSet theDYTthrsParameters
 
bool theDYTupdator
 
bool theDYTuseAPE
 
const edm::EventtheEvent
 
std::unique_ptr< TrajectoryFittertheFitter
 
std::string theFitterName
 
float theGEMChi2Cut
 
edm::InputTag theGEMRecHitLabel
 
edm::Handle< GEMRecHitCollectiontheGEMRecHits
 
edm::EDGetTokenT< GEMRecHitCollectiontheGEMRecHitToken
 
int theHitThreshold
 
float theME0Chi2Cut
 
edm::InputTag theME0RecHitLabel
 
edm::Handle< ME0SegmentCollectiontheME0RecHits
 
edm::EDGetTokenT< ME0SegmentCollectiontheME0RecHitToken
 
int theMuonHitsOption
 
edm::ESHandle< TransientTrackingRecHitBuildertheMuonRecHitBuilder
 
std::string theMuonRecHitBuilderName
 
float theProbCut
 
std::string thePropagatorName
 
RefitDirection theRefitDirection
 
double theRescaleErrorFactor
 
float theRPCChi2Cut
 
bool theRPCInTheFit
 
const MuonServiceProxytheService
 
int theSkipStation
 
edm::ESHandle< TransientTrackingRecHitBuildertheTrackerRecHitBuilder
 
std::string theTrackerRecHitBuilderName
 
int theTrackerSkipSection
 
int theTrackerSkipSystem
 

Detailed Description

class to build muon trajectory

Author
N. Neumeister Purdue University
C. Liu Purdue University
A. Everett Purdue University

by C. Calabria INFN & Universita Bari by D. Nash Northeastern University by C. Caputo UCLouvain

Definition at line 52 of file GlobalMuonRefitter.h.

Member Typedef Documentation

Definition at line 62 of file GlobalMuonRefitter.h.

Definition at line 60 of file GlobalMuonRefitter.h.

Definition at line 55 of file GlobalMuonRefitter.h.

Definition at line 57 of file GlobalMuonRefitter.h.

Definition at line 61 of file GlobalMuonRefitter.h.

Definition at line 59 of file GlobalMuonRefitter.h.

Definition at line 54 of file GlobalMuonRefitter.h.

Definition at line 56 of file GlobalMuonRefitter.h.

typedef std::vector<Trajectory> GlobalMuonRefitter::TC

Definition at line 64 of file GlobalMuonRefitter.h.

typedef TC::const_iterator GlobalMuonRefitter::TI

Definition at line 65 of file GlobalMuonRefitter.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

GlobalMuonRefitter::GlobalMuonRefitter ( const edm::ParameterSet par,
const MuonServiceProxy service,
edm::ConsumesCollector iC 
)

constructor with Parameter Set and MuonServiceProxy

Definition at line 75 of file GlobalMuonRefitter.cc.

References all4DSegmentsToken, edm::ConsumesCollector::consumes(), CSCSegmentsToken, dytInfo, Exception, edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), HLT_2018_cff::InputTag, insideOut, outsideIn, theCacheId_TRH, theCategory, theCSCChi2Cut, theCSCRecHitLabel, theCSCRecHitToken, theDTChi2Cut, theDTRecHitLabel, theDTRecHitToken, theDYTParThrsMode, theDYTselector, theDYTthrs, theDYTthrsParameters, theDYTupdator, theDYTuseAPE, theFitterName, theGEMChi2Cut, theGEMRecHitLabel, theGEMRecHitToken, theHitThreshold, theME0Chi2Cut, theME0RecHitLabel, theME0RecHitToken, theMuonRecHitBuilderName, thePropagatorName, theRefitDirection, theRescaleErrorFactor, theRPCChi2Cut, theRPCInTheFit, theSkipStation, theTrackerRecHitBuilderName, theTrackerSkipSection, and theTrackerSkipSystem.

78  : theCosmicFlag(par.getParameter<bool>("PropDirForCosmics")),
79  theDTRecHitLabel(par.getParameter<InputTag>("DTRecSegmentLabel")),
80  theCSCRecHitLabel(par.getParameter<InputTag>("CSCRecSegmentLabel")),
81  theGEMRecHitLabel(par.getParameter<InputTag>("GEMRecHitLabel")),
82  theME0RecHitLabel(par.getParameter<InputTag>("ME0RecHitLabel")),
84  theCategory = par.getUntrackedParameter<string>("Category", "Muon|RecoMuon|GlobalMuon|GlobalMuonRefitter");
85 
86  theHitThreshold = par.getParameter<int>("HitThreshold");
87  theDTChi2Cut = par.getParameter<double>("Chi2CutDT");
88  theCSCChi2Cut = par.getParameter<double>("Chi2CutCSC");
89  theRPCChi2Cut = par.getParameter<double>("Chi2CutRPC");
90  theGEMChi2Cut = par.getParameter<double>("Chi2CutGEM");
91  theME0Chi2Cut = par.getParameter<double>("Chi2CutME0");
92 
93  // Refit direction
94  string refitDirectionName = par.getParameter<string>("RefitDirection");
95 
96  if (refitDirectionName == "insideOut")
98  else if (refitDirectionName == "outsideIn")
100  else
101  throw cms::Exception("TrackTransformer constructor")
102  << "Wrong refit direction chosen in TrackTransformer ParameterSet"
103  << "\n"
104  << "Possible choices are:"
105  << "\n"
106  << "RefitDirection = insideOut or RefitDirection = outsideIn";
107 
108  theFitterName = par.getParameter<string>("Fitter");
109  thePropagatorName = par.getParameter<string>("Propagator");
110 
111  theSkipStation = par.getParameter<int>("SkipStation");
112  theTrackerSkipSystem = par.getParameter<int>("TrackerSkipSystem");
113  theTrackerSkipSection = par.getParameter<int>("TrackerSkipSection"); //layer, wheel, or disk depending on the system
114 
115  theTrackerRecHitBuilderName = par.getParameter<string>("TrackerRecHitBuilder");
116  theMuonRecHitBuilderName = par.getParameter<string>("MuonRecHitBuilder");
117 
118  theRPCInTheFit = par.getParameter<bool>("RefitRPCHits");
119 
120  theDYTthrs = par.getParameter<std::vector<int> >("DYTthrs");
121  theDYTselector = par.getParameter<int>("DYTselector");
122  theDYTupdator = par.getParameter<bool>("DYTupdator");
123  theDYTuseAPE = par.getParameter<bool>("DYTuseAPE");
124  theDYTParThrsMode = par.getParameter<bool>("DYTuseThrsParametrization");
125  if (theDYTParThrsMode)
126  theDYTthrsParameters = par.getParameter<edm::ParameterSet>("DYTthrsParameters");
127  dytInfo = new reco::DYTInfo();
128 
129  if (par.existsAs<double>("RescaleErrorFactor")) {
130  theRescaleErrorFactor = par.getParameter<double>("RescaleErrorFactor");
131  edm::LogWarning("GlobalMuonRefitter") << "using error rescale factor " << theRescaleErrorFactor;
132  } else
133  theRescaleErrorFactor = 1000.;
134 
135  theCacheId_TRH = 0;
142 }
std::string theMuonRecHitBuilderName
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:160
const MuonServiceProxy * theService
RefitDirection theRefitDirection
std::string thePropagatorName
edm::EDGetTokenT< CSCSegmentCollection > CSCSegmentsToken
std::vector< int > theDYTthrs
edm::EDGetTokenT< ME0SegmentCollection > theME0RecHitToken
edm::ParameterSet theDYTthrsParameters
edm::EDGetTokenT< DTRecHitCollection > theDTRecHitToken
edm::EDGetTokenT< CSCRecHit2DCollection > theCSCRecHitToken
edm::InputTag theDTRecHitLabel
edm::InputTag theGEMRecHitLabel
edm::InputTag theME0RecHitLabel
edm::EDGetTokenT< DTRecSegment4DCollection > all4DSegmentsToken
reco::DYTInfo * dytInfo
unsigned long long theCacheId_TRH
std::string theTrackerRecHitBuilderName
edm::InputTag theCSCRecHitLabel
edm::EDGetTokenT< GEMRecHitCollection > theGEMRecHitToken
GlobalMuonRefitter::~GlobalMuonRefitter ( )
virtual

destructor

Definition at line 148 of file GlobalMuonRefitter.cc.

References dytInfo.

148 { delete dytInfo; }
reco::DYTInfo * dytInfo

Member Function Documentation

void GlobalMuonRefitter::checkMuonHits ( const reco::Track muon,
ConstRecHitContainer all,
std::map< DetId, int > &  hitMap 
) const
protected

check muon RecHits, calculate chamber occupancy and select hits to be used in the final fit

Definition at line 306 of file GlobalMuonRefitter.cc.

References alongMomentum, CSCDetId::chamberId(), ME0DetId::chamberId(), GEMDetId::chamberId(), HLT_2018_cff::coneSize, MuonSubdetId::CSC, MuonSubdetId::DT, MuonSubdetId::GEM, globals_cff::id1, LogTrace, mag(), MuonSubdetId::ME0, DetId::Muon, DetId::rawId(), MuonSubdetId::RPC, theCategory, theCSCRecHits, theDTRecHits, theGEMRecHits, and theME0RecHits.

Referenced by refit().

308  {
309  LogTrace(theCategory) << " GlobalMuonRefitter::checkMuonHits " << endl;
310 
311  float coneSize = 20.0;
312 
313  // loop through all muon hits and calculate the maximum # of hits in each chamber
314  for (ConstRecHitContainer::const_iterator imrh = all.begin(); imrh != all.end(); imrh++) {
315  if ((*imrh != nullptr) && !(*imrh)->isValid())
316  continue;
317 
318  int detRecHits = 0;
319  MuonRecHitContainer dRecHits;
320 
321  DetId id = (*imrh)->geographicalId();
322  DetId chamberId;
323 
324  // Skip tracker hits
325  if (id.det() != DetId::Muon)
326  continue;
327 
328  if (id.subdetId() == MuonSubdetId::DT) {
329  DTChamberId did(id.rawId());
330  chamberId = did;
331 
332  if ((*imrh)->dimension() > 1) {
333  std::vector<const TrackingRecHit*> hits2d = (*imrh)->recHits();
334  for (std::vector<const TrackingRecHit*>::const_iterator hit2d = hits2d.begin(); hit2d != hits2d.end();
335  hit2d++) {
336  if ((*hit2d)->dimension() > 1) {
337  std::vector<const TrackingRecHit*> hits1d = (*hit2d)->recHits();
338  for (std::vector<const TrackingRecHit*>::const_iterator hit1d = hits1d.begin(); hit1d != hits1d.end();
339  hit1d++) {
340  DetId id1 = (*hit1d)->geographicalId();
341  DTLayerId lid(id1.rawId());
342  // Get the 1d DT RechHits from this layer
343  DTRecHitCollection::range dRecHits = theDTRecHits->get(lid);
344  int layerHits = 0;
345  for (DTRecHitCollection::const_iterator ir = dRecHits.first; ir != dRecHits.second; ir++) {
346  double rhitDistance = fabs(ir->localPosition().x() - (**hit1d).localPosition().x());
347  if (rhitDistance < coneSize)
348  layerHits++;
349  LogTrace(theCategory) << " " << (ir)->localPosition() << " " << (**hit1d).localPosition()
350  << " Distance: " << rhitDistance << " recHits: " << layerHits
351  << " SL: " << lid.superLayer() << endl;
352  }
353  if (layerHits > detRecHits)
354  detRecHits = layerHits;
355  }
356  } else {
357  DTLayerId lid(id.rawId());
358  // Get the 1d DT RechHits from this layer
359  DTRecHitCollection::range dRecHits = theDTRecHits->get(lid);
360  for (DTRecHitCollection::const_iterator ir = dRecHits.first; ir != dRecHits.second; ir++) {
361  double rhitDistance = fabs(ir->localPosition().x() - (**imrh).localPosition().x());
362  if (rhitDistance < coneSize)
363  detRecHits++;
364  LogTrace(theCategory) << " " << (ir)->localPosition() << " " << (**imrh).localPosition()
365  << " Distance: " << rhitDistance << " recHits: " << detRecHits << endl;
366  }
367  }
368  }
369 
370  } else {
371  DTLayerId lid(id.rawId());
372 
373  // Get the 1d DT RechHits from this layer
374  DTRecHitCollection::range dRecHits = theDTRecHits->get(lid);
375 
376  for (DTRecHitCollection::const_iterator ir = dRecHits.first; ir != dRecHits.second; ir++) {
377  double rhitDistance = fabs(ir->localPosition().x() - (**imrh).localPosition().x());
378  if (rhitDistance < coneSize)
379  detRecHits++;
380  LogTrace(theCategory) << " " << (ir)->localPosition() << " " << (**imrh).localPosition()
381  << " Distance: " << rhitDistance << " recHits: " << detRecHits << endl;
382  }
383  }
384  } // end of if DT
385  else if (id.subdetId() == MuonSubdetId::CSC) {
386  CSCDetId did(id.rawId());
387  chamberId = did.chamberId();
388 
389  if ((*imrh)->recHits().size() > 1) {
390  std::vector<const TrackingRecHit*> hits2d = (*imrh)->recHits();
391  for (std::vector<const TrackingRecHit*>::const_iterator hit2d = hits2d.begin(); hit2d != hits2d.end();
392  hit2d++) {
393  DetId id1 = (*hit2d)->geographicalId();
394  CSCDetId lid(id1.rawId());
395 
396  // Get the CSC Rechits from this layer
397  CSCRecHit2DCollection::range dRecHits = theCSCRecHits->get(lid);
398  int layerHits = 0;
399 
400  for (CSCRecHit2DCollection::const_iterator ir = dRecHits.first; ir != dRecHits.second; ir++) {
401  double rhitDistance = (ir->localPosition() - (**hit2d).localPosition()).mag();
402  if (rhitDistance < coneSize)
403  layerHits++;
404  LogTrace(theCategory) << ir->localPosition() << " " << (**hit2d).localPosition()
405  << " Distance: " << rhitDistance << " recHits: " << layerHits << endl;
406  }
407  if (layerHits > detRecHits)
408  detRecHits = layerHits;
409  }
410  } else {
411  // Get the CSC Rechits from this layer
412  CSCRecHit2DCollection::range dRecHits = theCSCRecHits->get(did);
413 
414  for (CSCRecHit2DCollection::const_iterator ir = dRecHits.first; ir != dRecHits.second; ir++) {
415  double rhitDistance = (ir->localPosition() - (**imrh).localPosition()).mag();
416  if (rhitDistance < coneSize)
417  detRecHits++;
418  LogTrace(theCategory) << ir->localPosition() << " " << (**imrh).localPosition()
419  << " Distance: " << rhitDistance << " recHits: " << detRecHits << endl;
420  }
421  }
422  } //end of CSC if
423  else if (id.subdetId() == MuonSubdetId::GEM) {
424  GEMDetId did(id.rawId());
425  chamberId = did.chamberId();
426 
427  if ((*imrh)->recHits().size() > 1) {
428  std::vector<const TrackingRecHit*> hits2d = (*imrh)->recHits();
429  for (std::vector<const TrackingRecHit*>::const_iterator hit2d = hits2d.begin(); hit2d != hits2d.end();
430  hit2d++) {
431  DetId id1 = (*hit2d)->geographicalId();
432  GEMDetId lid(id1.rawId());
433 
434  // Get the GEM Rechits from this layer
435  GEMRecHitCollection::range dRecHits = theGEMRecHits->get(lid);
436  int layerHits = 0;
437 
438  for (GEMRecHitCollection::const_iterator ir = dRecHits.first; ir != dRecHits.second; ir++) {
439  double rhitDistance = (ir->localPosition() - (**hit2d).localPosition()).mag();
440  if (rhitDistance < coneSize)
441  layerHits++;
442  LogTrace(theCategory) << ir->localPosition() << " " << (**hit2d).localPosition()
443  << " Distance: " << rhitDistance << " recHits: " << layerHits << endl;
444  }
445  if (layerHits > detRecHits)
446  detRecHits = layerHits;
447  }
448  } else {
449  // Get the GEM Rechits from this layer
450  GEMRecHitCollection::range dRecHits = theGEMRecHits->get(did);
451 
452  for (GEMRecHitCollection::const_iterator ir = dRecHits.first; ir != dRecHits.second; ir++) {
453  double rhitDistance = (ir->localPosition() - (**imrh).localPosition()).mag();
454  if (rhitDistance < coneSize)
455  detRecHits++;
456  LogTrace(theCategory) << ir->localPosition() << " " << (**imrh).localPosition()
457  << " Distance: " << rhitDistance << " recHits: " << detRecHits << endl;
458  }
459  }
460  } //end of GEM if
461  else if (id.subdetId() == MuonSubdetId::ME0) {
462  ME0DetId did(id.rawId());
463  chamberId = did.chamberId();
464 
465  if ((*imrh)->recHits().size() > 1) {
466  std::vector<const TrackingRecHit*> hits2d = (*imrh)->recHits();
467  for (std::vector<const TrackingRecHit*>::const_iterator hit2d = hits2d.begin(); hit2d != hits2d.end();
468  hit2d++) {
469  DetId id1 = (*hit2d)->geographicalId();
470  ME0DetId lid(id1.rawId());
471 
472  // Get the ME0 Rechits from this layer
473  ME0SegmentCollection::range dRecHits = theME0RecHits->get(lid);
474  int layerHits = 0;
475 
476  for (ME0SegmentCollection::const_iterator ir = dRecHits.first; ir != dRecHits.second; ir++) {
477  double rhitDistance = (ir->localPosition() - (**hit2d).localPosition()).mag();
478  if (rhitDistance < coneSize)
479  layerHits++;
480  LogTrace(theCategory) << ir->localPosition() << " " << (**hit2d).localPosition()
481  << " Distance: " << rhitDistance << " recHits: " << layerHits << endl;
482  }
483  if (layerHits > detRecHits)
484  detRecHits = layerHits;
485  }
486  } else {
487  // Get the ME0 Rechits from this layer
488  ME0SegmentCollection::range dRecHits = theME0RecHits->get(did);
489 
490  for (ME0SegmentCollection::const_iterator ir = dRecHits.first; ir != dRecHits.second; ir++) {
491  double rhitDistance = (ir->localPosition() - (**imrh).localPosition()).mag();
492  if (rhitDistance < coneSize)
493  detRecHits++;
494  LogTrace(theCategory) << ir->localPosition() << " " << (**imrh).localPosition()
495  << " Distance: " << rhitDistance << " recHits: " << detRecHits << endl;
496  }
497  }
498  } //end of ME0 if
499  else {
500  if (id.subdetId() != MuonSubdetId::RPC)
501  LogError(theCategory) << " Wrong Hit Type ";
502  continue;
503  }
504 
505  map<DetId, int>::iterator imap = hitMap.find(chamberId);
506  if (imap != hitMap.end()) {
507  if (detRecHits > imap->second)
508  imap->second = detRecHits;
509  } else
510  hitMap[chamberId] = detRecHits;
511 
512  } // end of loop over muon rechits
513 
514  for (map<DetId, int>::iterator imap = hitMap.begin(); imap != hitMap.end(); imap++)
515  LogTrace(theCategory) << " Station " << imap->first.rawId() << ": " << imap->second << endl;
516 
517  LogTrace(theCategory) << "CheckMuonHits: " << all.size();
518 
519  // check order of muon measurements
520  if ((all.size() > 1) && (all.front()->globalPosition().mag() > all.back()->globalPosition().mag())) {
521  LogTrace(theCategory) << "reverse order: ";
522  stable_sort(all.begin(), all.end(), RecHitLessByDet(alongMomentum));
523  }
524 }
edm::Handle< DTRecHitCollection > theDTRecHits
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:50
static constexpr int GEM
Definition: MuonSubdetId.h:14
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
edm::Handle< GEMRecHitCollection > theGEMRecHits
edm::Handle< ME0SegmentCollection > theME0RecHits
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
edm::Handle< CSCRecHit2DCollection > theCSCRecHits
static constexpr int ME0
Definition: MuonSubdetId.h:15
#define LogTrace(id)
Definition: DetId.h:17
static constexpr int RPC
Definition: MuonSubdetId.h:13
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
static constexpr int DT
Definition: MuonSubdetId.h:11
static constexpr int CSC
Definition: MuonSubdetId.h:12
GlobalMuonRefitter::RefitDirection GlobalMuonRefitter::checkRecHitsOrdering ( const ConstRecHitContainer recHits) const
protected

Definition at line 695 of file GlobalMuonRefitter.cc.

References insideOut, outsideIn, theCategory, and undetermined.

Referenced by transform().

696  {
697  if (!recHits.empty()) {
698  ConstRecHitContainer::const_iterator frontHit = recHits.begin();
699  ConstRecHitContainer::const_iterator backHit = recHits.end() - 1;
700  while (!(*frontHit)->isValid() && frontHit != backHit) {
701  frontHit++;
702  }
703  while (!(*backHit)->isValid() && backHit != frontHit) {
704  backHit--;
705  }
706 
707  double rFirst = (*frontHit)->globalPosition().mag();
708  double rLast = (*backHit)->globalPosition().mag();
709 
710  if (rFirst < rLast)
711  return insideOut;
712  else if (rFirst > rLast)
713  return outsideIn;
714  else {
715  LogError(theCategory) << "Impossible determine the rechits order" << endl;
716  return undetermined;
717  }
718  } else {
719  LogError(theCategory) << "Impossible determine the rechits order" << endl;
720  return undetermined;
721  }
722 }
const reco::DYTInfo* GlobalMuonRefitter::getDYTInfo ( )
inline

Definition at line 103 of file GlobalMuonRefitter.h.

103 { return dytInfo; }
reco::DYTInfo * dytInfo
void GlobalMuonRefitter::getFirstHits ( const reco::Track muon,
ConstRecHitContainer all,
ConstRecHitContainer first 
) const
protected

get the RecHits in the tracker and the first muon chamber with hits

Definition at line 529 of file GlobalMuonRefitter.cc.

References MuonSubdetId::CSC, MuonSubdetId::DT, MuonSubdetId::GEM, mps_fire::i, LogTrace, MuonSubdetId::ME0, DetId::Muon, DetId::rawId(), MuonSubdetId::RPC, DTChamberId::station(), ME0DetId::station(), relativeConstraints::station, RPCDetId::station(), CSCDetId::station(), GEMDetId::station(), and theCategory.

Referenced by refit().

531  {
532  LogTrace(theCategory) << " GlobalMuonRefitter::getFirstHits\nall rechits length:" << all.size() << endl;
533  first.clear();
534 
535  int station_to_keep = 999;
536  vector<int> stations;
537  for (ConstRecHitContainer::const_iterator ihit = all.begin(); ihit != all.end(); ++ihit) {
538  int station = 0;
539  bool use_it = true;
540  DetId id = (*ihit)->geographicalId();
541  unsigned raw_id = id.rawId();
542  if (!(*ihit)->isValid())
543  station = -1;
544  else {
545  if (id.det() == DetId::Muon) {
546  switch (id.subdetId()) {
547  case MuonSubdetId::DT:
548  station = DTChamberId(raw_id).station();
549  break;
550  case MuonSubdetId::CSC:
551  station = CSCDetId(raw_id).station();
552  break;
553  case MuonSubdetId::GEM:
554  station = GEMDetId(raw_id).station();
555  break;
556  case MuonSubdetId::ME0:
557  station = ME0DetId(raw_id).station();
558  break;
559  case MuonSubdetId::RPC:
560  station = RPCDetId(raw_id).station();
561  use_it = false;
562  break;
563  }
564  }
565  }
566 
567  if (use_it && station > 0 && station < station_to_keep)
568  station_to_keep = station;
569  stations.push_back(station);
570  LogTrace(theCategory) << "rawId: " << raw_id << " station = " << station << " station_to_keep is now "
571  << station_to_keep;
572  }
573 
574  if (station_to_keep <= 0 || station_to_keep > 4 || stations.size() != all.size())
575  LogInfo(theCategory) << "failed to getFirstHits (all muon hits are outliers/bad ?)! station_to_keep = "
576  << station_to_keep << " stations.size " << stations.size() << " all.size " << all.size();
577 
578  for (unsigned i = 0; i < stations.size(); ++i)
579  if (stations[i] >= 0 && stations[i] <= station_to_keep)
580  first.push_back(all[i]);
581 
582  return;
583 }
static constexpr int GEM
Definition: MuonSubdetId.h:14
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
int station() const
Definition: ME0DetId.h:58
int station() const
Definition: GEMDetId.h:173
static constexpr int ME0
Definition: MuonSubdetId.h:15
#define LogTrace(id)
Definition: DetId.h:17
static constexpr int RPC
Definition: MuonSubdetId.h:13
int station() const
Definition: CSCDetId.h:79
static constexpr int DT
Definition: MuonSubdetId.h:11
int station() const
Return the station number.
Definition: DTChamberId.h:42
static constexpr int CSC
Definition: MuonSubdetId.h:12
int station() const
Definition: RPCDetId.h:78
GlobalMuonRefitter::ConstRecHitContainer GlobalMuonRefitter::getRidOfSelectStationHits ( const ConstRecHitContainer hits,
const TrackerTopology tTopo 
) const

Definition at line 883 of file GlobalMuonRefitter.cc.

References MuonSubdetId::CSC, MuonSubdetId::DT, MuonSubdetId::GEM, MuonSubdetId::ME0, DetId::Muon, PXB, TrackerTopology::pxbLayer(), PXF, TrackerTopology::pxfDisk(), bookConverter::results, MuonSubdetId::RPC, DTChamberId::station(), ME0DetId::station(), relativeConstraints::station, RPCDetId::station(), CSCDetId::station(), GEMDetId::station(), TEC, TrackerTopology::tecWheel(), theSkipStation, theTrackerSkipSection, theTrackerSkipSystem, TIB, TrackerTopology::tibLayer(), TID, TrackerTopology::tidWheel(), TOB, TrackerTopology::tobLayer(), DetId::Tracker, and makeMuonMisalignmentScenario::wheel.

Referenced by refit().

884  {
886  ConstRecHitContainer::const_iterator it = hits.begin();
887  for (; it != hits.end(); it++) {
888  DetId id = (*it)->geographicalId();
889 
890  //Check that this is a Muon hit that we're toying with -- else pass on this because the hacker is a moron / not careful
891 
892  if (id.det() == DetId::Tracker && theTrackerSkipSystem > 0) {
893  int layer = -999;
894  int disk = -999;
895  int wheel = -999;
896  if (id.subdetId() == theTrackerSkipSystem) {
897  // continue; //caveat that just removes the whole system from refitting
898 
899  if (theTrackerSkipSystem == PXB) {
900  layer = tTopo->pxbLayer(id);
901  }
902  if (theTrackerSkipSystem == TIB) {
903  layer = tTopo->tibLayer(id);
904  }
905 
906  if (theTrackerSkipSystem == TOB) {
907  layer = tTopo->tobLayer(id);
908  }
909  if (theTrackerSkipSystem == PXF) {
910  disk = tTopo->pxfDisk(id);
911  }
912  if (theTrackerSkipSystem == TID) {
913  wheel = tTopo->tidWheel(id);
914  }
915  if (theTrackerSkipSystem == TEC) {
916  wheel = tTopo->tecWheel(id);
917  }
918  if (theTrackerSkipSection >= 0 && layer == theTrackerSkipSection)
919  continue;
920  if (theTrackerSkipSection >= 0 && disk == theTrackerSkipSection)
921  continue;
922  if (theTrackerSkipSection >= 0 && wheel == theTrackerSkipSection)
923  continue;
924  }
925  }
926 
927  if (id.det() == DetId::Muon && theSkipStation) {
928  int station = -999;
929  //UNUSED: int wheel = -999;
930  if (id.subdetId() == MuonSubdetId::DT) {
931  DTChamberId did(id.rawId());
932  station = did.station();
933  //UNUSED: wheel = did.wheel();
934  } else if (id.subdetId() == MuonSubdetId::CSC) {
935  CSCDetId did(id.rawId());
936  station = did.station();
937  } else if (id.subdetId() == MuonSubdetId::GEM) {
938  GEMDetId did(id.rawId());
939  station = did.station();
940  } else if (id.subdetId() == MuonSubdetId::ME0) {
941  ME0DetId did(id.rawId());
942  station = did.station();
943  } else if (id.subdetId() == MuonSubdetId::RPC) {
944  RPCDetId rpcid(id.rawId());
945  station = rpcid.station();
946  }
947  if (station == theSkipStation)
948  continue;
949  }
950  results.push_back(*it);
951  }
952  return results;
953 }
static constexpr int GEM
Definition: MuonSubdetId.h:14
unsigned int tibLayer(const DetId &id) const
unsigned int pxfDisk(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
static constexpr int ME0
Definition: MuonSubdetId.h:15
unsigned int pxbLayer(const DetId &id) const
Definition: DetId.h:17
static constexpr int RPC
Definition: MuonSubdetId.h:13
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
static constexpr int DT
Definition: MuonSubdetId.h:11
static constexpr int CSC
Definition: MuonSubdetId.h:12
unsigned int tecWheel(const DetId &id) const
unsigned int tobLayer(const DetId &id) const
void GlobalMuonRefitter::printHits ( const ConstRecHitContainer hits) const
protected

print all RecHits of a trajectory

Definition at line 674 of file GlobalMuonRefitter.cc.

References LogTrace, mathSSE::sqrt(), theCategory, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by ntuplePrintersDiff.TrackingParticlePrinter::__call__(), ntuplePrintersDiff.SeedPrinter::diff(), ntuplePrintersDiff.TrackPrinter::diff(), ntuplePrintersDiff.TrackingParticlePrinter::diff(), ntuplePrintersDiff.SeedPrinter::printSeed(), ntuplePrintersDiff.TrackPrinter::printTrack(), and transform().

674  {
675  LogTrace(theCategory) << "Used RecHits: " << hits.size();
676  for (ConstRecHitContainer::const_iterator ir = hits.begin(); ir != hits.end(); ir++) {
677  if (!(*ir)->isValid()) {
678  LogTrace(theCategory) << "invalid RecHit";
679  continue;
680  }
681 
682  const GlobalPoint& pos = (*ir)->globalPosition();
683 
684  LogTrace(theCategory) << "r = " << sqrt(pos.x() * pos.x() + pos.y() * pos.y()) << " z = " << pos.z()
685  << " dimension = " << (*ir)->dimension()
686  << " det = " << (*ir)->det()->geographicalId().det()
687  << " subdet = " << (*ir)->det()->subDetector()
688  << " raw id = " << (*ir)->det()->geographicalId().rawId();
689  }
690 }
T y() const
Definition: PV3DBase.h:60
T sqrt(T t)
Definition: SSEVec.h:19
T z() const
Definition: PV3DBase.h:61
#define LogTrace(id)
T x() const
Definition: PV3DBase.h:59
vector< Trajectory > GlobalMuonRefitter::refit ( const reco::Track globalTrack,
const int  theMuonHitsOption,
const TrackerTopology tTopo 
) const

build combined trajectory from sta Track and tracker RecHits

Definition at line 182 of file GlobalMuonRefitter.cc.

References TransientTrackingRecHitBuilder::build(), watchdog::const, LogTrace, DetId::Muon, edm::ESHandle< T >::product(), theCategory, theMuonRecHitBuilder, theRPCInTheFit, theService, theTrackerRecHitBuilder, HLT_2018_cff::track, and DetId::Tracker.

Referenced by GlobalTrajectoryBuilderBase::build(), and GlobalTrackQualityProducer::produce().

184  {
185  LogTrace(theCategory) << " *** GlobalMuonRefitter *** option " << theMuonHitsOption << endl;
186 
187  ConstRecHitContainer allRecHitsTemp; // all muon rechits temp
188 
189  reco::TransientTrack track(globalTrack, &*(theService->magneticField()), theService->trackingGeometry());
190 
191  auto tkbuilder = static_cast<TkTransientTrackingRecHitBuilder const*>(theTrackerRecHitBuilder.product());
192 
193  for (trackingRecHit_iterator hit = track.recHitsBegin(); hit != track.recHitsEnd(); ++hit)
194  if ((*hit)->isValid()) {
195  if ((*hit)->geographicalId().det() == DetId::Tracker)
196  allRecHitsTemp.push_back((**hit).cloneForFit(*tkbuilder->geometry()->idToDet((**hit).geographicalId())));
197  else if ((*hit)->geographicalId().det() == DetId::Muon) {
198  if ((*hit)->geographicalId().subdetId() == 3 && !theRPCInTheFit) {
199  LogTrace(theCategory) << "RPC Rec Hit discarged";
200  continue;
201  }
202  allRecHitsTemp.push_back(theMuonRecHitBuilder->build(&**hit));
203  }
204  }
205  vector<Trajectory> refitted = refit(globalTrack, track, allRecHitsTemp, theMuonHitsOption, tTopo);
206  return refitted;
207 }
const MuonServiceProxy * theService
edm::ESHandle< TransientTrackingRecHitBuilder > theTrackerRecHitBuilder
edm::ESHandle< TransientTrackingRecHitBuilder > theMuonRecHitBuilder
#define LogTrace(id)
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
T const * product() const
Definition: ESHandle.h:86
std::vector< Trajectory > refit(const reco::Track &globalTrack, const int theMuonHitsOption, const TrackerTopology *tTopo) const
build combined trajectory from sta Track and tracker RecHits
vector< Trajectory > GlobalMuonRefitter::refit ( const reco::Track globalTrack,
const reco::TransientTrack  track,
const TransientTrackingRecHit::ConstRecHitContainer allRecHitsTemp,
const int  theMuonHitsOption,
const TrackerTopology tTopo 
) const

build combined trajectory from subset of sta Track and tracker RecHits

Definition at line 212 of file GlobalMuonRefitter.cc.

References all4DSegments, alongMomentum, checkMuonHits(), reco::DYTInfo::CopyFrom(), CSCSegments, dytInfo, reco::TrackBase::eta(), DynamicTruncation::filter(), DynamicTruncation::getDYTInfo(), getFirstHits(), getRidOfSelectStationHits(), LogTrace, reco::TrackBase::p(), reco::TrackBase::pt(), selectMuonHits(), DynamicTruncation::setParThrsMode(), DynamicTruncation::setProd(), DynamicTruncation::setRecoEta(), DynamicTruncation::setRecoP(), DynamicTruncation::setSelector(), DynamicTruncation::setThr(), DynamicTruncation::setThrsMap(), DynamicTruncation::setUpdateState(), DynamicTruncation::setUseAPE(), theCategory, theDYTParThrsMode, theDYTselector, theDYTthrs, theDYTthrsParameters, theDYTupdator, theDYTuseAPE, theEvent, theService, and transform().

216  {
217  // MuonHitsOption: 0 - tracker only
218  // 1 - include all muon hits
219  // 2 - include only first muon hit(s)
220  // 3 - include only selected muon hits
221  // 4 - redo pattern recognition with dynamic truncation
222 
223  vector<int> stationHits(4, 0);
224  map<DetId, int> hitMap;
225 
226  ConstRecHitContainer allRecHits; // all muon rechits
227  ConstRecHitContainer fmsRecHits; // only first muon rechits
228  ConstRecHitContainer selectedRecHits; // selected muon rechits
229  ConstRecHitContainer DYTRecHits; // rec hits from dynamic truncation algorithm
230 
231  LogTrace(theCategory) << " *** GlobalMuonRefitter *** option " << theMuonHitsOption << endl;
232  LogTrace(theCategory) << " Track momentum before refit: " << globalTrack.pt() << endl;
233  LogTrace(theCategory) << " Hits size before : " << allRecHitsTemp.size() << endl;
234 
235  allRecHits = getRidOfSelectStationHits(allRecHitsTemp, tTopo);
236  // printHits(allRecHits);
237  LogTrace(theCategory) << " Hits size: " << allRecHits.size() << endl;
238 
239  vector<Trajectory> outputTraj;
240 
241  if ((theMuonHitsOption == 1) || (theMuonHitsOption == 3) || (theMuonHitsOption == 4)) {
242  // refit the full track with all muon hits
243  vector<Trajectory> globalTraj = transform(globalTrack, track, allRecHits);
244 
245  if (globalTraj.empty()) {
246  LogTrace(theCategory) << "No trajectory from the TrackTransformer!" << endl;
247  return vector<Trajectory>();
248  }
249 
250  LogTrace(theCategory) << " Initial trajectory state: "
251  << globalTraj.front().lastMeasurement().updatedState().freeState()->parameters() << endl;
252 
253  if (theMuonHitsOption == 1)
254  outputTraj.push_back(globalTraj.front());
255 
256  if (theMuonHitsOption == 3) {
257  checkMuonHits(globalTrack, allRecHits, hitMap);
258  selectedRecHits = selectMuonHits(globalTraj.front(), hitMap);
259  LogTrace(theCategory) << " Selected hits size: " << selectedRecHits.size() << endl;
260  outputTraj = transform(globalTrack, track, selectedRecHits);
261  }
262 
263  if (theMuonHitsOption == 4) {
264  //
265  // DYT 2.0
266  //
268  dytRefit.setProd(all4DSegments, CSCSegments);
269  dytRefit.setSelector(theDYTselector);
270  dytRefit.setThr(theDYTthrs);
271  dytRefit.setUpdateState(theDYTupdator);
272  dytRefit.setUseAPE(theDYTuseAPE);
273  if (theDYTParThrsMode) {
274  dytRefit.setParThrsMode(theDYTParThrsMode);
275  dytRefit.setThrsMap(theDYTthrsParameters);
276  dytRefit.setRecoP(globalTrack.p());
277  dytRefit.setRecoEta(globalTrack.eta());
278  }
279  DYTRecHits = dytRefit.filter(globalTraj.front());
280  dytInfo->CopyFrom(dytRefit.getDYTInfo());
281  if ((DYTRecHits.size() > 1) &&
282  (DYTRecHits.front()->globalPosition().mag() > DYTRecHits.back()->globalPosition().mag()))
283  stable_sort(DYTRecHits.begin(), DYTRecHits.end(), RecHitLessByDet(alongMomentum));
284  outputTraj = transform(globalTrack, track, DYTRecHits);
285  }
286 
287  } else if (theMuonHitsOption == 2) {
288  getFirstHits(globalTrack, allRecHits, fmsRecHits);
289  outputTraj = transform(globalTrack, track, fmsRecHits);
290  }
291 
292  if (!outputTraj.empty()) {
293  LogTrace(theCategory) << "Refitted pt: "
294  << outputTraj.front().firstMeasurement().updatedState().globalParameters().momentum().perp()
295  << endl;
296  return outputTraj;
297  } else {
298  LogTrace(theCategory) << "No refitted Tracks... " << endl;
299  return vector<Trajectory>();
300  }
301 }
double p() const
momentum vector magnitude
Definition: TrackBase.h:599
const MuonServiceProxy * theService
edm::Handle< CSCSegmentCollection > CSCSegments
void CopyFrom(const DYTInfo &)
copy from another DYTInfo
Definition: DYTInfo.cc:14
void checkMuonHits(const reco::Track &, ConstRecHitContainer &, std::map< DetId, int > &) const
check muon RecHits, calculate chamber occupancy and select hits to be used in the final fit ...
std::vector< int > theDYTthrs
void getFirstHits(const reco::Track &, ConstRecHitContainer &, ConstRecHitContainer &) const
get the RecHits in the tracker and the first muon chamber with hits
const edm::Event * theEvent
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:617
edm::Handle< DTRecSegment4DCollection > all4DSegments
ConstRecHitContainer selectMuonHits(const Trajectory &, const std::map< DetId, int > &) const
select muon hits compatible with trajectory; check hits in chambers with showers
ConstRecHitContainer getRidOfSelectStationHits(const ConstRecHitContainer &hits, const TrackerTopology *tTopo) const
double pt() const
track transverse momentum
Definition: TrackBase.h:602
edm::ParameterSet theDYTthrsParameters
#define LogTrace(id)
reco::DYTInfo * dytInfo
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
std::vector< Trajectory > transform(const reco::Track &newTrack, const reco::TransientTrack track, const TransientTrackingRecHit::ConstRecHitContainer &recHitsForReFit) const
refit the track with a new set of RecHits
GlobalMuonRefitter::ConstRecHitContainer GlobalMuonRefitter::selectMuonHits ( const Trajectory traj,
const std::map< DetId, int > &  hitMap 
) const
protected

select muon hits compatible with trajectory; check hits in chambers with showers

Definition at line 589 of file GlobalMuonRefitter.cc.

References CSCDetId::chamberId(), ME0DetId::chamberId(), GEMDetId::chamberId(), ZMuMuCategoriesSequences_cff::chi2Cut, TrackingRecHit::geographicalId(), keep, LogTrace, Trajectory::measurements(), DetId::Muon, groupFilesInBlocks::reverse, theCategory, theCSCChi2Cut, theDTChi2Cut, theGEMChi2Cut, theHitThreshold, theME0Chi2Cut, theRPCChi2Cut, and MessageLogger_cff::threshold.

Referenced by refit().

590  {
591  ConstRecHitContainer muonRecHits;
592  const double globalChi2Cut = 200.0;
593 
594  vector<TrajectoryMeasurement> muonMeasurements = traj.measurements();
595 
596  // loop through all muon hits and skip hits with bad chi2 in chambers with high occupancy
597  for (std::vector<TrajectoryMeasurement>::const_iterator im = muonMeasurements.begin(); im != muonMeasurements.end();
598  im++) {
599  if (!(*im).recHit()->isValid())
600  continue;
601  if ((*im).recHit()->det()->geographicalId().det() != DetId::Muon) {
602  // if ( ( chi2ndf < globalChi2Cut ) )
603  muonRecHits.push_back((*im).recHit());
604  continue;
605  }
606  const MuonTransientTrackingRecHit* immrh = dynamic_cast<const MuonTransientTrackingRecHit*>((*im).recHit().get());
607 
608  DetId id = immrh->geographicalId();
609  DetId chamberId;
610  int threshold = 0;
611  double chi2Cut = 0.0;
612 
613  // get station of hit if it is in DT
614  if ((*immrh).isDT()) {
615  DTChamberId did(id.rawId());
616  chamberId = did;
617  threshold = theHitThreshold;
618  chi2Cut = theDTChi2Cut;
619  }
620  // get station of hit if it is in CSC
621  else if ((*immrh).isCSC()) {
622  CSCDetId did(id.rawId());
623  chamberId = did.chamberId();
624  threshold = theHitThreshold;
625  chi2Cut = theCSCChi2Cut;
626  }
627  // get station of hit if it is in GEM
628  else if ((*immrh).isGEM()) {
629  GEMDetId did(id.rawId());
630  chamberId = did.chamberId();
631  threshold = theHitThreshold;
632  chi2Cut = theGEMChi2Cut;
633  }
634  // get station of hit if it is in ME0
635  else if ((*immrh).isME0()) {
636  ME0DetId did(id.rawId());
637  chamberId = did.chamberId();
638  threshold = theHitThreshold;
639  chi2Cut = theME0Chi2Cut;
640  }
641  // get station of hit if it is in RPC
642  else if ((*immrh).isRPC()) {
643  RPCDetId rpcid(id.rawId());
644  chamberId = rpcid;
645  threshold = theHitThreshold;
646  chi2Cut = theRPCChi2Cut;
647  } else
648  continue;
649 
650  double chi2ndf = (*im).estimate() / (*im).recHit()->dimension();
651 
652  bool keep = true;
653  map<DetId, int>::const_iterator imap = hitMap.find(chamberId);
654  if (imap != hitMap.end())
655  if (imap->second > threshold)
656  keep = false;
657 
658  if ((keep || (chi2ndf < chi2Cut)) && (chi2ndf < globalChi2Cut)) {
659  muonRecHits.push_back((*im).recHit());
660  } else {
661  LogTrace(theCategory) << "Skip hit: " << id.rawId() << " chi2=" << chi2ndf << " ( threshold: " << chi2Cut
662  << ") Det: " << imap->second << endl;
663  }
664  }
665 
666  // check order of rechits
667  reverse(muonRecHits.begin(), muonRecHits.end());
668  return muonRecHits;
669 }
DataContainer const & measurements() const
Definition: Trajectory.h:178
const int keep
#define LogTrace(id)
Definition: DetId.h:17
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
DetId geographicalId() const
const MuonServiceProxy* GlobalMuonRefitter::service ( ) const
inlineprotected

Definition at line 122 of file GlobalMuonRefitter.h.

122 { return theService; }
const MuonServiceProxy * theService
void GlobalMuonRefitter::setEvent ( const edm::Event event)
virtual

pass the Event to the algo at each event

Definition at line 153 of file GlobalMuonRefitter.cc.

References all4DSegments, all4DSegmentsToken, CSCSegments, CSCSegmentsToken, event(), theCSCRecHits, theCSCRecHitToken, theDTRecHits, theDTRecHitToken, theEvent, theGEMRecHits, theGEMRecHitToken, theME0RecHits, and theME0RecHitToken.

Referenced by GlobalTrackQualityProducer::produce(), and GlobalTrajectoryBuilderBase::setEvent().

153  {
154  theEvent = &event;
155  event.getByToken(theDTRecHitToken, theDTRecHits);
156  event.getByToken(theCSCRecHitToken, theCSCRecHits);
157  event.getByToken(theGEMRecHitToken, theGEMRecHits);
158  event.getByToken(theME0RecHitToken, theME0RecHits);
159  event.getByToken(CSCSegmentsToken, CSCSegments);
160  event.getByToken(all4DSegmentsToken, all4DSegments);
161 }
edm::Handle< DTRecHitCollection > theDTRecHits
edm::Handle< CSCSegmentCollection > CSCSegments
edm::Handle< GEMRecHitCollection > theGEMRecHits
edm::EDGetTokenT< CSCSegmentCollection > CSCSegmentsToken
edm::Handle< ME0SegmentCollection > theME0RecHits
const edm::Event * theEvent
edm::Handle< DTRecSegment4DCollection > all4DSegments
edm::EDGetTokenT< ME0SegmentCollection > theME0RecHitToken
edm::Handle< CSCRecHit2DCollection > theCSCRecHits
edm::EDGetTokenT< DTRecHitCollection > theDTRecHitToken
edm::EDGetTokenT< CSCRecHit2DCollection > theCSCRecHitToken
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
edm::EDGetTokenT< DTRecSegment4DCollection > all4DSegmentsToken
edm::EDGetTokenT< GEMRecHitCollection > theGEMRecHitToken
void GlobalMuonRefitter::setServices ( const edm::EventSetup setup)

set the services needed by the TrackTransformer

Definition at line 163 of file GlobalMuonRefitter.cc.

References TrajectoryFitter::clone(), watchdog::const, edm::EventSetup::get(), hitCloner, LogDebug, edm::ESHandle< T >::product(), theCacheId_TRH, theCategory, theFitter, theFitterName, theMuonRecHitBuilder, theMuonRecHitBuilderName, theService, theTrackerRecHitBuilder, and theTrackerRecHitBuilderName.

Referenced by GlobalTrackQualityProducer::produce(), and GlobalTrajectoryBuilderBase::setEvent().

163  {
165  theService->eventSetup().get<TrajectoryFitter::Record>().get(theFitterName, aFitter);
166  theFitter = aFitter->clone();
167 
168  // Transient Rechit Builders
169  unsigned long long newCacheId_TRH = setup.get<TransientRecHitRecord>().cacheIdentifier();
170  if (newCacheId_TRH != theCacheId_TRH) {
171  LogDebug(theCategory) << "TransientRecHitRecord changed!";
175  }
176  theFitter->setHitCloner(&hitCloner);
177 }
#define LogDebug(id)
std::string theMuonRecHitBuilderName
const MuonServiceProxy * theService
edm::ESHandle< TransientTrackingRecHitBuilder > theTrackerRecHitBuilder
std::unique_ptr< TrajectoryFitter > theFitter
edm::ESHandle< TransientTrackingRecHitBuilder > theMuonRecHitBuilder
virtual std::unique_ptr< TrajectoryFitter > clone() const =0
T get() const
Definition: EventSetup.h:73
unsigned long long theCacheId_TRH
std::string theTrackerRecHitBuilderName
T const * product() const
Definition: ESHandle.h:86
vector< Trajectory > GlobalMuonRefitter::transform ( const reco::Track newTrack,
const reco::TransientTrack  track,
const TransientTrackingRecHit::ConstRecHitContainer recHitsForReFit 
) const

refit the track with a new set of RecHits

Definition at line 727 of file GlobalMuonRefitter.cc.

References alongMomentum, PV3DBase< T, PVType, FrameType >::basicVector(), checkRecHitsOrdering(), Basic3DVector< T >::dot(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), reco::Track::innerDetId(), reco::TransientTrack::innermostMeasurementState(), insideOut, LogDebug, LogTrace, PV3DBase< T, PVType, FrameType >::mag(), LocalTrajectoryParameters::momentum(), TrajectorySeed::nHits(), oppositeToMomentum, reco::Track::outerDetId(), reco::TransientTrack::outermostMeasurementState(), outsideIn, PTrajectoryStateOnDet::parameters(), LocalTrajectoryParameters::position(), printHits(), groupFilesInBlocks::reverse, SurveyInfoScenario_cff::seed, TrajectorySeed::startingState(), theCategory, theCosmicFlag, theFitter, thePropagatorName, theRefitDirection, theRescaleErrorFactor, theService, and FastTrackerRecHitMaskProducer_cfi::trajectories.

Referenced by refit().

730  {
731  TransientTrackingRecHit::ConstRecHitContainer recHitsForReFit = urecHitsForReFit;
732  LogTrace(theCategory) << "GlobalMuonRefitter::transform: " << recHitsForReFit.size() << " hits:";
733  printHits(recHitsForReFit);
734 
735  if (recHitsForReFit.size() < 2)
736  return vector<Trajectory>();
737 
738  // Check the order of the rechits
739  RefitDirection recHitsOrder = checkRecHitsOrdering(recHitsForReFit);
740 
741  LogTrace(theCategory) << "checkRecHitsOrdering() returned " << recHitsOrder << ", theRefitDirection is "
742  << theRefitDirection << " (insideOut == " << insideOut << ", outsideIn == " << outsideIn << ")";
743 
744  // Reverse the order in the case of inconsistency between the fit direction and the rechit order
745  if (theRefitDirection != recHitsOrder)
746  reverse(recHitsForReFit.begin(), recHitsForReFit.end());
747 
748  // Even though we checked the rechits' ordering above, we may have
749  // already flipped them elsewhere (getFirstHits() is such a
750  // culprit). Use the global positions of the states and the desired
751  // refit direction to find the starting TSOS.
752  TrajectoryStateOnSurface firstTSOS, lastTSOS;
753  unsigned int innerId; //UNUSED: outerId;
754  bool order_swapped = track.outermostMeasurementState().globalPosition().mag() <
756  bool inner_is_first;
757  LogTrace(theCategory) << "order swapped? " << order_swapped;
758 
759  // Fill the starting state, depending on the ordering above.
760  if ((theRefitDirection == insideOut && !order_swapped) || (theRefitDirection == outsideIn && order_swapped)) {
761  innerId = newTrack.innerDetId();
762  //UNUSED: outerId = newTrack.outerDetId();
763  firstTSOS = track.innermostMeasurementState();
764  lastTSOS = track.outermostMeasurementState();
765  inner_is_first = true;
766  } else {
767  innerId = newTrack.outerDetId();
768  //UNUSED: outerId = newTrack.innerDetId();
769  firstTSOS = track.outermostMeasurementState();
770  lastTSOS = track.innermostMeasurementState();
771  inner_is_first = false;
772  }
773 
774  LogTrace(theCategory) << "firstTSOS: inner_is_first? " << inner_is_first << " globalPosition is "
775  << firstTSOS.globalPosition() << " innerId is " << innerId;
776 
777  if (!firstTSOS.isValid()) {
778  LogWarning(theCategory) << "Error wrong initial state!" << endl;
779  return vector<Trajectory>();
780  }
781 
782  firstTSOS.rescaleError(theRescaleErrorFactor);
783 
784  // This is the only way to get a TrajectorySeed with settable propagation direction
785  PTrajectoryStateOnDet garbage1;
787 
788  // These lines cause the code to ignore completely what was set
789  // above, and force propDir for tracks from collisions!
790  // if(propDir == alongMomentum && theRefitDirection == outsideIn) propDir=oppositeToMomentum;
791  // if(propDir == oppositeToMomentum && theRefitDirection == insideOut) propDir=alongMomentum;
792 
793  const TrajectoryStateOnSurface& tsosForDir = inner_is_first ? lastTSOS : firstTSOS;
794  PropagationDirection propDir =
795  (tsosForDir.globalPosition().basicVector().dot(tsosForDir.globalMomentum().basicVector()) > 0)
796  ? alongMomentum
798  LogTrace(theCategory) << "propDir based on firstTSOS x dot p is " << propDir << " (alongMomentum == " << alongMomentum
799  << ", oppositeToMomentum == " << oppositeToMomentum << ")";
800 
801  // Additional propagation diretcion determination logic for cosmic muons
802  if (theCosmicFlag) {
803  PropagationDirection propDir_first =
804  (firstTSOS.globalPosition().basicVector().dot(firstTSOS.globalMomentum().basicVector()) > 0)
805  ? alongMomentum
807  PropagationDirection propDir_last =
808  (lastTSOS.globalPosition().basicVector().dot(lastTSOS.globalMomentum().basicVector()) > 0) ? alongMomentum
810  LogTrace(theCategory) << "propDir_first " << propDir_first << ", propdir_last " << propDir_last << " : they "
811  << (propDir_first == propDir_last ? "agree" : "disagree");
812 
813  int y_count = 0;
814  for (TransientTrackingRecHit::ConstRecHitContainer::const_iterator it = recHitsForReFit.begin();
815  it != recHitsForReFit.end();
816  ++it) {
817  if ((*it)->globalPosition().y() > 0)
818  ++y_count;
819  else
820  --y_count;
821  }
822 
823  PropagationDirection propDir_ycount = alongMomentum;
824  if (y_count > 0) {
826  propDir_ycount = oppositeToMomentum;
827  else if (theRefitDirection == outsideIn)
828  propDir_ycount = alongMomentum;
829  } else {
831  propDir_ycount = alongMomentum;
832  else if (theRefitDirection == outsideIn)
833  propDir_ycount = oppositeToMomentum;
834  }
835 
836  LogTrace(theCategory) << "y_count = " << y_count << "; based on geometrically-outermost TSOS, propDir is "
837  << propDir << ": " << (propDir == propDir_ycount ? "agrees" : "disagrees")
838  << " with ycount determination";
839 
840  if (propDir_first != propDir_last) {
841  LogTrace(theCategory) << "since first/last disagreed, using y_count propDir";
842  propDir = propDir_ycount;
843  }
844  }
845 
846  TrajectorySeed seed(garbage1, garbage2, propDir);
847 
848  if (recHitsForReFit.front()->geographicalId() != DetId(innerId)) {
849  LogDebug(theCategory) << "Propagation occured" << endl;
850  LogTrace(theCategory) << "propagating firstTSOS at " << firstTSOS.globalPosition()
851  << " to first rechit with surface pos "
852  << recHitsForReFit.front()->det()->surface().toGlobal(LocalPoint(0, 0, 0));
853  firstTSOS =
854  theService->propagator(thePropagatorName)->propagate(firstTSOS, recHitsForReFit.front()->det()->surface());
855  if (!firstTSOS.isValid()) {
856  LogDebug(theCategory) << "Propagation error!" << endl;
857  return vector<Trajectory>();
858  }
859  }
860 
861  LogDebug(theCategory) << " GlobalMuonRefitter : theFitter " << propDir << endl;
862  LogDebug(theCategory) << " First TSOS: " << firstTSOS.globalPosition()
863  << " p=" << firstTSOS.globalMomentum() << " = " << firstTSOS.globalMomentum().mag() << endl;
864 
865  LogDebug(theCategory) << " Starting seed: "
866  << " nHits= " << seed.nHits() << " tsos: " << seed.startingState().parameters().position()
867  << " p=" << seed.startingState().parameters().momentum() << endl;
868 
869  LogDebug(theCategory) << " RecHits: " << recHitsForReFit.size() << endl;
870 
871  vector<Trajectory> trajectories = theFitter->fit(seed, recHitsForReFit, firstTSOS);
872 
873  if (trajectories.empty()) {
874  LogDebug(theCategory) << "No Track refitted!" << endl;
875  return vector<Trajectory>();
876  }
877  return trajectories;
878 }
#define LogDebug(id)
void printHits(const ConstRecHitContainer &) const
print all RecHits of a trajectory
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
const MuonServiceProxy * theService
RefitDirection theRefitDirection
std::string thePropagatorName
GlobalPoint globalPosition() const
PropagationDirection
std::unique_ptr< TrajectoryFitter > theFitter
TrajectoryStateOnSurface innermostMeasurementState() const
T mag() const
Definition: PV3DBase.h:64
unsigned int outerDetId() const
DetId of the detector on which surface the outermost state is located.
Definition: Track.h:79
RefitDirection checkRecHitsOrdering(const ConstRecHitContainer &) const
TrajectoryStateOnSurface outermostMeasurementState() const
#define LogTrace(id)
std::vector< ConstRecHitPointer > ConstRecHitContainer
Definition: DetId.h:17
GlobalVector globalMomentum() const
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
unsigned int innerDetId() const
DetId of the detector on which surface the innermost state is located.
Definition: Track.h:82
T dot(const Basic3DVector &rh) const
Scalar product, or "dot" product, with a vector of same type.

Member Data Documentation

edm::Handle<DTRecSegment4DCollection> GlobalMuonRefitter::all4DSegments
private

Definition at line 191 of file GlobalMuonRefitter.h.

Referenced by refit(), and setEvent().

edm::EDGetTokenT<DTRecSegment4DCollection> GlobalMuonRefitter::all4DSegmentsToken
private

Definition at line 189 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and setEvent().

edm::Handle<CSCSegmentCollection> GlobalMuonRefitter::CSCSegments
private

Definition at line 190 of file GlobalMuonRefitter.h.

Referenced by refit(), and setEvent().

edm::EDGetTokenT<CSCSegmentCollection> GlobalMuonRefitter::CSCSegmentsToken
private

Definition at line 188 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and setEvent().

reco::DYTInfo* GlobalMuonRefitter::dytInfo
private

Definition at line 173 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), refit(), and ~GlobalMuonRefitter().

TkClonerImpl GlobalMuonRefitter::hitCloner
private

Definition at line 180 of file GlobalMuonRefitter.h.

Referenced by setServices().

unsigned long long GlobalMuonRefitter::theCacheId_TRH
private

Definition at line 157 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and setServices().

std::string GlobalMuonRefitter::theCategory
protected
bool GlobalMuonRefitter::theCosmicFlag
private

Definition at line 138 of file GlobalMuonRefitter.h.

Referenced by transform().

float GlobalMuonRefitter::theCSCChi2Cut
private

Definition at line 134 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and selectMuonHits().

edm::InputTag GlobalMuonRefitter::theCSCRecHitLabel
private

Definition at line 141 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter().

edm::Handle<CSCRecHit2DCollection> GlobalMuonRefitter::theCSCRecHits
private

Definition at line 145 of file GlobalMuonRefitter.h.

Referenced by checkMuonHits(), and setEvent().

edm::EDGetTokenT<CSCRecHit2DCollection> GlobalMuonRefitter::theCSCRecHitToken
private

Definition at line 149 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and setEvent().

float GlobalMuonRefitter::theDTChi2Cut
private

Definition at line 133 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and selectMuonHits().

edm::InputTag GlobalMuonRefitter::theDTRecHitLabel
private

Definition at line 140 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter().

edm::Handle<DTRecHitCollection> GlobalMuonRefitter::theDTRecHits
private

Definition at line 144 of file GlobalMuonRefitter.h.

Referenced by checkMuonHits(), and setEvent().

edm::EDGetTokenT<DTRecHitCollection> GlobalMuonRefitter::theDTRecHitToken
private

Definition at line 148 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and setEvent().

bool GlobalMuonRefitter::theDYTParThrsMode
private

Definition at line 171 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and refit().

int GlobalMuonRefitter::theDYTselector
private

Definition at line 168 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and refit().

std::vector<int> GlobalMuonRefitter::theDYTthrs
private

Definition at line 167 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and refit().

edm::ParameterSet GlobalMuonRefitter::theDYTthrsParameters
private

Definition at line 172 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and refit().

bool GlobalMuonRefitter::theDYTupdator
private

Definition at line 169 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and refit().

bool GlobalMuonRefitter::theDYTuseAPE
private

Definition at line 170 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and refit().

const edm::Event* GlobalMuonRefitter::theEvent
private

Definition at line 186 of file GlobalMuonRefitter.h.

Referenced by refit(), and setEvent().

std::unique_ptr<TrajectoryFitter> GlobalMuonRefitter::theFitter
private

Definition at line 176 of file GlobalMuonRefitter.h.

Referenced by setServices(), and transform().

std::string GlobalMuonRefitter::theFitterName
private

Definition at line 175 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and setServices().

float GlobalMuonRefitter::theGEMChi2Cut
private

Definition at line 136 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and selectMuonHits().

edm::InputTag GlobalMuonRefitter::theGEMRecHitLabel
private

Definition at line 142 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter().

edm::Handle<GEMRecHitCollection> GlobalMuonRefitter::theGEMRecHits
private

Definition at line 146 of file GlobalMuonRefitter.h.

Referenced by checkMuonHits(), and setEvent().

edm::EDGetTokenT<GEMRecHitCollection> GlobalMuonRefitter::theGEMRecHitToken
private

Definition at line 150 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and setEvent().

int GlobalMuonRefitter::theHitThreshold
private

Definition at line 132 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and selectMuonHits().

float GlobalMuonRefitter::theME0Chi2Cut
private

Definition at line 137 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and selectMuonHits().

edm::InputTag GlobalMuonRefitter::theME0RecHitLabel
private

Definition at line 143 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter().

edm::Handle<ME0SegmentCollection> GlobalMuonRefitter::theME0RecHits
private

Definition at line 147 of file GlobalMuonRefitter.h.

Referenced by checkMuonHits(), and setEvent().

edm::EDGetTokenT<ME0SegmentCollection> GlobalMuonRefitter::theME0RecHitToken
private

Definition at line 151 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and setEvent().

int GlobalMuonRefitter::theMuonHitsOption
private

Definition at line 130 of file GlobalMuonRefitter.h.

edm::ESHandle<TransientTrackingRecHitBuilder> GlobalMuonRefitter::theMuonRecHitBuilder
private

Definition at line 183 of file GlobalMuonRefitter.h.

Referenced by refit(), and setServices().

std::string GlobalMuonRefitter::theMuonRecHitBuilderName
private

Definition at line 182 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and setServices().

float GlobalMuonRefitter::theProbCut
private

Definition at line 131 of file GlobalMuonRefitter.h.

std::string GlobalMuonRefitter::thePropagatorName
private

Definition at line 159 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and transform().

float GlobalMuonRefitter::thePtCut
protected

Definition at line 127 of file GlobalMuonRefitter.h.

RefitDirection GlobalMuonRefitter::theRefitDirection
private

Definition at line 165 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and transform().

double GlobalMuonRefitter::theRescaleErrorFactor
private

Definition at line 163 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and transform().

float GlobalMuonRefitter::theRPCChi2Cut
private

Definition at line 135 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and selectMuonHits().

bool GlobalMuonRefitter::theRPCInTheFit
private

Definition at line 161 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and refit().

const MuonServiceProxy* GlobalMuonRefitter::theService
private

Definition at line 185 of file GlobalMuonRefitter.h.

Referenced by refit(), setServices(), and transform().

int GlobalMuonRefitter::theSkipStation
private

Definition at line 153 of file GlobalMuonRefitter.h.

Referenced by getRidOfSelectStationHits(), and GlobalMuonRefitter().

bool GlobalMuonRefitter::theTkTrajsAvailableFlag
protected

Definition at line 126 of file GlobalMuonRefitter.h.

edm::ESHandle<TransientTrackingRecHitBuilder> GlobalMuonRefitter::theTrackerRecHitBuilder
private

Definition at line 179 of file GlobalMuonRefitter.h.

Referenced by refit(), and setServices().

std::string GlobalMuonRefitter::theTrackerRecHitBuilderName
private

Definition at line 178 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and setServices().

int GlobalMuonRefitter::theTrackerSkipSection
private

Definition at line 155 of file GlobalMuonRefitter.h.

Referenced by getRidOfSelectStationHits(), and GlobalMuonRefitter().

int GlobalMuonRefitter::theTrackerSkipSystem
private

Definition at line 154 of file GlobalMuonRefitter.h.

Referenced by getRidOfSelectStationHits(), and GlobalMuonRefitter().