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

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

Definition at line 52 of file GlobalMuonRefitter.h.

Member Typedef Documentation

◆ ConstMuonRecHitContainer

Definition at line 62 of file GlobalMuonRefitter.h.

◆ ConstMuonRecHitPointer

Definition at line 60 of file GlobalMuonRefitter.h.

◆ ConstRecHitContainer

Definition at line 55 of file GlobalMuonRefitter.h.

◆ ConstRecHitPointer

Definition at line 57 of file GlobalMuonRefitter.h.

◆ MuonRecHitContainer

Definition at line 61 of file GlobalMuonRefitter.h.

◆ MuonRecHitPointer

Definition at line 59 of file GlobalMuonRefitter.h.

◆ RecHitContainer

Definition at line 54 of file GlobalMuonRefitter.h.

◆ RecHitPointer

Definition at line 56 of file GlobalMuonRefitter.h.

◆ TC

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

Definition at line 64 of file GlobalMuonRefitter.h.

◆ TI

typedef TC::const_iterator GlobalMuonRefitter::TI

Definition at line 65 of file GlobalMuonRefitter.h.

Member Enumeration Documentation

◆ RefitDirection

Enumerator
insideOut 
outsideIn 
undetermined 

Definition at line 106 of file GlobalMuonRefitter.h.

◆ subDetector

Enumerator
PXB 
PXF 
TIB 
TID 
TOB 
TEC 

Definition at line 67 of file GlobalMuonRefitter.h.

67 { PXB = 1, PXF = 2, TIB = 3, TID = 4, TOB = 5, TEC = 6 };

Constructor & Destructor Documentation

◆ GlobalMuonRefitter()

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.

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 }

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.

◆ ~GlobalMuonRefitter()

GlobalMuonRefitter::~GlobalMuonRefitter ( )
virtual

destructor

Definition at line 148 of file GlobalMuonRefitter.cc.

148 { delete dytInfo; }

References dytInfo.

Member Function Documentation

◆ checkMuonHits()

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.

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 }

References python.cmstools::all(), 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, MuonSubdetId::RPC, theCategory, theCSCRecHits, theDTRecHits, theGEMRecHits, and theME0RecHits.

Referenced by refit().

◆ checkRecHitsOrdering()

GlobalMuonRefitter::RefitDirection GlobalMuonRefitter::checkRecHitsOrdering ( const ConstRecHitContainer recHits) const
protected

Definition at line 695 of file GlobalMuonRefitter.cc.

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 }

References insideOut, outsideIn, FastTrackerRecHitMaskProducer_cfi::recHits, theCategory, and undetermined.

Referenced by transform().

◆ getDYTInfo()

const reco::DYTInfo* GlobalMuonRefitter::getDYTInfo ( )
inline

Definition at line 103 of file GlobalMuonRefitter.h.

103 { return dytInfo; }

References dytInfo.

◆ getFirstHits()

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.

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 }

References python.cmstools::all(), MuonSubdetId::CSC, MuonSubdetId::DT, dqmdumpme::first, 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().

◆ getRidOfSelectStationHits()

GlobalMuonRefitter::ConstRecHitContainer GlobalMuonRefitter::getRidOfSelectStationHits ( const ConstRecHitContainer hits,
const TrackerTopology tTopo 
) const

Definition at line 883 of file GlobalMuonRefitter.cc.

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;
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 }

References MuonSubdetId::CSC, MuonSubdetId::DT, MuonSubdetId::GEM, hfClusterShapes_cfi::hits, 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().

◆ printHits()

void GlobalMuonRefitter::printHits ( const ConstRecHitContainer hits) const
protected

print all RecHits of a trajectory

Definition at line 674 of file GlobalMuonRefitter.cc.

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 }

References hfClusterShapes_cfi::hits, LogTrace, mathSSE::sqrt(), and theCategory.

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

◆ refit() [1/2]

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.

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 }

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

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

◆ refit() [2/2]

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.

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 }

References all4DSegments, alongMomentum, checkMuonHits(), reco::DYTInfo::CopyFrom(), CSCSegments, dytInfo, DynamicTruncation::filter(), DynamicTruncation::getDYTInfo(), getFirstHits(), getRidOfSelectStationHits(), cutBasedMuonId_MuonPOG_V0_cff::globalTrack, LogTrace, 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, theMuonHitsOption, theService, HLT_2018_cff::track, and transform().

◆ selectMuonHits()

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.

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;
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();
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();
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();
640  }
641  // get station of hit if it is in RPC
642  else if ((*immrh).isRPC()) {
643  RPCDetId rpcid(id.rawId());
644  chamberId = rpcid;
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 }

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 remoteMonitoring_LED_IterMethod_cfg::threshold.

Referenced by refit().

◆ service()

const MuonServiceProxy* GlobalMuonRefitter::service ( ) const
inlineprotected

Definition at line 122 of file GlobalMuonRefitter.h.

122 { return theService; }

References theService.

◆ setEvent()

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.

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 }

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

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

◆ setServices()

void GlobalMuonRefitter::setServices ( const edm::EventSetup setup)

set the services needed by the TrackTransformer

Definition at line 163 of file GlobalMuonRefitter.cc.

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!";
174  hitCloner = static_cast<TkTransientTrackingRecHitBuilder const*>(theTrackerRecHitBuilder.product())->cloner();
175  }
176  theFitter->setHitCloner(&hitCloner);
177 }

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

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

◆ transform()

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.

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() <
755  track.innermostMeasurementState().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 }

References alongMomentum, PV3DBase< T, PVType, FrameType >::basicVector(), checkRecHitsOrdering(), Basic3DVector< T >::dot(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), reco::Track::innerDetId(), insideOut, LogDebug, LogTrace, oppositeToMomentum, reco::Track::outerDetId(), outsideIn, printHits(), groupFilesInBlocks::reverse, SurveyInfoScenario_cff::seed, theCategory, theCosmicFlag, theFitter, thePropagatorName, theRefitDirection, theRescaleErrorFactor, theService, HLT_2018_cff::track, and FastTrackerRecHitMaskProducer_cfi::trajectories.

Referenced by refit().

Member Data Documentation

◆ all4DSegments

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

Definition at line 191 of file GlobalMuonRefitter.h.

Referenced by refit(), and setEvent().

◆ all4DSegmentsToken

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

Definition at line 189 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and setEvent().

◆ CSCSegments

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

Definition at line 190 of file GlobalMuonRefitter.h.

Referenced by refit(), and setEvent().

◆ CSCSegmentsToken

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

Definition at line 188 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and setEvent().

◆ dytInfo

reco::DYTInfo* GlobalMuonRefitter::dytInfo
private

Definition at line 173 of file GlobalMuonRefitter.h.

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

◆ hitCloner

TkClonerImpl GlobalMuonRefitter::hitCloner
private

Definition at line 180 of file GlobalMuonRefitter.h.

Referenced by setServices().

◆ theCacheId_TRH

unsigned long long GlobalMuonRefitter::theCacheId_TRH
private

Definition at line 157 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and setServices().

◆ theCategory

std::string GlobalMuonRefitter::theCategory
protected

◆ theCosmicFlag

bool GlobalMuonRefitter::theCosmicFlag
private

Definition at line 138 of file GlobalMuonRefitter.h.

Referenced by transform().

◆ theCSCChi2Cut

float GlobalMuonRefitter::theCSCChi2Cut
private

Definition at line 134 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and selectMuonHits().

◆ theCSCRecHitLabel

edm::InputTag GlobalMuonRefitter::theCSCRecHitLabel
private

Definition at line 141 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter().

◆ theCSCRecHits

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

Definition at line 145 of file GlobalMuonRefitter.h.

Referenced by checkMuonHits(), and setEvent().

◆ theCSCRecHitToken

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

Definition at line 149 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and setEvent().

◆ theDTChi2Cut

float GlobalMuonRefitter::theDTChi2Cut
private

Definition at line 133 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and selectMuonHits().

◆ theDTRecHitLabel

edm::InputTag GlobalMuonRefitter::theDTRecHitLabel
private

Definition at line 140 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter().

◆ theDTRecHits

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

Definition at line 144 of file GlobalMuonRefitter.h.

Referenced by checkMuonHits(), and setEvent().

◆ theDTRecHitToken

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

Definition at line 148 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and setEvent().

◆ theDYTParThrsMode

bool GlobalMuonRefitter::theDYTParThrsMode
private

Definition at line 171 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and refit().

◆ theDYTselector

int GlobalMuonRefitter::theDYTselector
private

Definition at line 168 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and refit().

◆ theDYTthrs

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

Definition at line 167 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and refit().

◆ theDYTthrsParameters

edm::ParameterSet GlobalMuonRefitter::theDYTthrsParameters
private

Definition at line 172 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and refit().

◆ theDYTupdator

bool GlobalMuonRefitter::theDYTupdator
private

Definition at line 169 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and refit().

◆ theDYTuseAPE

bool GlobalMuonRefitter::theDYTuseAPE
private

Definition at line 170 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and refit().

◆ theEvent

const edm::Event* GlobalMuonRefitter::theEvent
private

Definition at line 186 of file GlobalMuonRefitter.h.

Referenced by refit(), and setEvent().

◆ theFitter

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

Definition at line 176 of file GlobalMuonRefitter.h.

Referenced by setServices(), and transform().

◆ theFitterName

std::string GlobalMuonRefitter::theFitterName
private

Definition at line 175 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and setServices().

◆ theGEMChi2Cut

float GlobalMuonRefitter::theGEMChi2Cut
private

Definition at line 136 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and selectMuonHits().

◆ theGEMRecHitLabel

edm::InputTag GlobalMuonRefitter::theGEMRecHitLabel
private

Definition at line 142 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter().

◆ theGEMRecHits

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

Definition at line 146 of file GlobalMuonRefitter.h.

Referenced by checkMuonHits(), and setEvent().

◆ theGEMRecHitToken

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

Definition at line 150 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and setEvent().

◆ theHitThreshold

int GlobalMuonRefitter::theHitThreshold
private

Definition at line 132 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and selectMuonHits().

◆ theME0Chi2Cut

float GlobalMuonRefitter::theME0Chi2Cut
private

Definition at line 137 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and selectMuonHits().

◆ theME0RecHitLabel

edm::InputTag GlobalMuonRefitter::theME0RecHitLabel
private

Definition at line 143 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter().

◆ theME0RecHits

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

Definition at line 147 of file GlobalMuonRefitter.h.

Referenced by checkMuonHits(), and setEvent().

◆ theME0RecHitToken

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

Definition at line 151 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and setEvent().

◆ theMuonHitsOption

int GlobalMuonRefitter::theMuonHitsOption
private

Definition at line 130 of file GlobalMuonRefitter.h.

Referenced by refit().

◆ theMuonRecHitBuilder

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

Definition at line 183 of file GlobalMuonRefitter.h.

Referenced by refit(), and setServices().

◆ theMuonRecHitBuilderName

std::string GlobalMuonRefitter::theMuonRecHitBuilderName
private

Definition at line 182 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and setServices().

◆ theProbCut

float GlobalMuonRefitter::theProbCut
private

Definition at line 131 of file GlobalMuonRefitter.h.

◆ thePropagatorName

std::string GlobalMuonRefitter::thePropagatorName
private

Definition at line 159 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and transform().

◆ thePtCut

float GlobalMuonRefitter::thePtCut
protected

Definition at line 127 of file GlobalMuonRefitter.h.

◆ theRefitDirection

RefitDirection GlobalMuonRefitter::theRefitDirection
private

Definition at line 165 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and transform().

◆ theRescaleErrorFactor

double GlobalMuonRefitter::theRescaleErrorFactor
private

Definition at line 163 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and transform().

◆ theRPCChi2Cut

float GlobalMuonRefitter::theRPCChi2Cut
private

Definition at line 135 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and selectMuonHits().

◆ theRPCInTheFit

bool GlobalMuonRefitter::theRPCInTheFit
private

Definition at line 161 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and refit().

◆ theService

const MuonServiceProxy* GlobalMuonRefitter::theService
private

Definition at line 185 of file GlobalMuonRefitter.h.

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

◆ theSkipStation

int GlobalMuonRefitter::theSkipStation
private

Definition at line 153 of file GlobalMuonRefitter.h.

Referenced by getRidOfSelectStationHits(), and GlobalMuonRefitter().

◆ theTkTrajsAvailableFlag

bool GlobalMuonRefitter::theTkTrajsAvailableFlag
protected

Definition at line 126 of file GlobalMuonRefitter.h.

◆ theTrackerRecHitBuilder

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

Definition at line 179 of file GlobalMuonRefitter.h.

Referenced by refit(), and setServices().

◆ theTrackerRecHitBuilderName

std::string GlobalMuonRefitter::theTrackerRecHitBuilderName
private

Definition at line 178 of file GlobalMuonRefitter.h.

Referenced by GlobalMuonRefitter(), and setServices().

◆ theTrackerSkipSection

int GlobalMuonRefitter::theTrackerSkipSection
private

Definition at line 155 of file GlobalMuonRefitter.h.

Referenced by getRidOfSelectStationHits(), and GlobalMuonRefitter().

◆ theTrackerSkipSystem

int GlobalMuonRefitter::theTrackerSkipSystem
private

Definition at line 154 of file GlobalMuonRefitter.h.

Referenced by getRidOfSelectStationHits(), and GlobalMuonRefitter().

GEMRecHitCollection
MuonSubdetId::GEM
static constexpr int GEM
Definition: MuonSubdetId.h:14
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
service
Definition: service.py:1
GlobalMuonRefitter::theRescaleErrorFactor
double theRescaleErrorFactor
Definition: GlobalMuonRefitter.h:163
GlobalMuonRefitter::transform
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
Definition: GlobalMuonRefitter.cc:727
cutBasedMuonId_MuonPOG_V0_cff.globalTrack
globalTrack
Definition: cutBasedMuonId_MuonPOG_V0_cff.py:135
MuonSubdetId::CSC
static constexpr int CSC
Definition: MuonSubdetId.h:12
GlobalMuonRefitter::theTrackerRecHitBuilderName
std::string theTrackerRecHitBuilderName
Definition: GlobalMuonRefitter.h:178
reco::Track::outerDetId
unsigned int outerDetId() const
DetId of the detector on which surface the outermost state is located.
Definition: Track.h:79
ZMuMuCategoriesSequences_cff.chi2Cut
chi2Cut
Definition: ZMuMuCategoriesSequences_cff.py:141
CSCRecHit2DCollection
mps_fire.i
i
Definition: mps_fire.py:355
GlobalMuonRefitter::theME0Chi2Cut
float theME0Chi2Cut
Definition: GlobalMuonRefitter.h:137
RPCDetId::station
int station() const
Definition: RPCDetId.h:78
GlobalMuonRefitter::theMuonRecHitBuilderName
std::string theMuonRecHitBuilderName
Definition: GlobalMuonRefitter.h:182
GlobalMuonRefitter::CSCSegments
edm::Handle< CSCSegmentCollection > CSCSegments
Definition: GlobalMuonRefitter.h:190
GlobalMuonRefitter::theME0RecHitToken
edm::EDGetTokenT< ME0SegmentCollection > theME0RecHitToken
Definition: GlobalMuonRefitter.h:151
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
GlobalMuonRefitter::theCategory
std::string theCategory
Definition: GlobalMuonRefitter.h:125
MuonRecHitContainer
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
Definition: CosmicMuonSmoother.h:31
GlobalMuonRefitter::checkMuonHits
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
Definition: GlobalMuonRefitter.cc:306
GlobalMuonRefitter::theGEMRecHitToken
edm::EDGetTokenT< GEMRecHitCollection > theGEMRecHitToken
Definition: GlobalMuonRefitter.h:150
relativeConstraints.station
station
Definition: relativeConstraints.py:67
GlobalMuonRefitter::theGEMRecHits
edm::Handle< GEMRecHitCollection > theGEMRecHits
Definition: GlobalMuonRefitter.h:146
globals_cff.id1
id1
Definition: globals_cff.py:32
RPCDetId
Definition: RPCDetId.h:16
TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
GlobalMuonRefitter::theDTRecHits
edm::Handle< DTRecHitCollection > theDTRecHits
Definition: GlobalMuonRefitter.h:144
pos
Definition: PixelAliasList.h:18
edm::LogInfo
Definition: MessageLogger.h:254
TransientRecHitRecord
Definition: TransientRecHitRecord.h:14
GlobalMuonRefitter::theRPCChi2Cut
float theRPCChi2Cut
Definition: GlobalMuonRefitter.h:135
oppositeToMomentum
Definition: PropagationDirection.h:4
bookConverter.results
results
Definition: bookConverter.py:144
FastTrackerRecHitMaskProducer_cfi.trajectories
trajectories
Definition: FastTrackerRecHitMaskProducer_cfi.py:7
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
CSCSegmentCollection
edm::ParameterSet::existsAs
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:160
MuonTransientTrackingRecHit
Definition: MuonTransientTrackingRecHit.h:19
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
GlobalMuonRefitter::theMuonRecHitBuilder
edm::ESHandle< TransientTrackingRecHitBuilder > theMuonRecHitBuilder
Definition: GlobalMuonRefitter.h:183
TransientTrackingRecHitBuilder::build
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
GlobalMuonRefitter::theDYTupdator
bool theDYTupdator
Definition: GlobalMuonRefitter.h:169
GlobalMuonRefitter::getFirstHits
void getFirstHits(const reco::Track &, ConstRecHitContainer &, ConstRecHitContainer &) const
get the RecHits in the tracker and the first muon chamber with hits
Definition: GlobalMuonRefitter.cc:529
GlobalMuonRefitter::theDYTthrs
std::vector< int > theDYTthrs
Definition: GlobalMuonRefitter.h:167
GlobalMuonRefitter::theDYTParThrsMode
bool theDYTParThrsMode
Definition: GlobalMuonRefitter.h:171
dqmdumpme.first
first
Definition: dqmdumpme.py:55
GlobalMuonRefitter::getRidOfSelectStationHits
ConstRecHitContainer getRidOfSelectStationHits(const ConstRecHitContainer &hits, const TrackerTopology *tTopo) const
Definition: GlobalMuonRefitter.cc:883
python.cmstools.all
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:26
TrackingRecHit::geographicalId
DetId geographicalId() const
Definition: TrackingRecHit.h:120
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
groupFilesInBlocks.reverse
reverse
Definition: groupFilesInBlocks.py:131
TrackerTopology::tidWheel
unsigned int tidWheel(const DetId &id) const
Definition: TrackerTopology.h:201
GlobalMuonRefitter::theFitterName
std::string theFitterName
Definition: GlobalMuonRefitter.h:175
TrackerTopology::pxbLayer
unsigned int pxbLayer(const DetId &id) const
Definition: TrackerTopology.h:144
GlobalMuonRefitter::PXF
Definition: GlobalMuonRefitter.h:67
DetId
Definition: DetId.h:17
TrajectoryFitter::clone
virtual std::unique_ptr< TrajectoryFitter > clone() const =0
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
reco::DYTInfo::CopyFrom
void CopyFrom(const DYTInfo &)
copy from another DYTInfo
Definition: DYTInfo.cc:14
reco::DYTInfo
Definition: DYTInfo.h:11
DTRecHitCollection
HLT_2018_cff.coneSize
coneSize
Definition: HLT_2018_cff.py:49353
GlobalMuonRefitter::theDYTselector
int theDYTselector
Definition: GlobalMuonRefitter.h:168
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
GlobalMuonRefitter::theFitter
std::unique_ptr< TrajectoryFitter > theFitter
Definition: GlobalMuonRefitter.h:176
edm::ESHandle< TrajectoryFitter >
Basic3DVector::dot
T dot(const Basic3DVector &rh) const
Scalar product, or "dot" product, with a vector of same type.
Definition: extBasic3DVector.h:189
TrajectoryFitterRecord
Definition: TrajectoryFitterRecord.h:12
GlobalMuonRefitter::theCSCRecHitToken
edm::EDGetTokenT< CSCRecHit2DCollection > theCSCRecHitToken
Definition: GlobalMuonRefitter.h:149
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:49
MuonSubdetId::DT
static constexpr int DT
Definition: MuonSubdetId.h:11
Point3DBase< float, GlobalTag >
DTRecSegment4DCollection
GlobalMuonRefitter::theTrackerSkipSection
int theTrackerSkipSection
Definition: GlobalMuonRefitter.h:155
DTLayerId
Definition: DTLayerId.h:12
edm::OwnVector::const_iterator
Definition: OwnVector.h:41
GlobalMuonRefitter::theCSCRecHitLabel
edm::InputTag theCSCRecHitLabel
Definition: GlobalMuonRefitter.h:141
GlobalMuonRefitter::theDTChi2Cut
float theDTChi2Cut
Definition: GlobalMuonRefitter.h:133
GlobalMuonRefitter::PXB
Definition: GlobalMuonRefitter.h:67
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
edm::LogWarning
Definition: MessageLogger.h:141
GlobalMuonRefitter::checkRecHitsOrdering
RefitDirection checkRecHitsOrdering(const ConstRecHitContainer &) const
Definition: GlobalMuonRefitter.cc:695
GlobalMuonRefitter::TOB
Definition: GlobalMuonRefitter.h:67
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::ParameterSet
Definition: ParameterSet.h:36
GlobalMuonRefitter::undetermined
Definition: GlobalMuonRefitter.h:106
edm::LogError
Definition: MessageLogger.h:183
DetId::Tracker
Definition: DetId.h:25
GlobalMuonRefitter::all4DSegmentsToken
edm::EDGetTokenT< DTRecSegment4DCollection > all4DSegmentsToken
Definition: GlobalMuonRefitter.h:189
GlobalMuonRefitter::theGEMRecHitLabel
edm::InputTag theGEMRecHitLabel
Definition: GlobalMuonRefitter.h:142
TrackingRecHit::ConstRecHitContainer
std::vector< ConstRecHitPointer > ConstRecHitContainer
Definition: TrackingRecHit.h:32
GlobalMuonRefitter::theSkipStation
int theSkipStation
Definition: GlobalMuonRefitter.h:153
GEMDetId
Definition: GEMDetId.h:17
edm::RangeMap::const_iterator
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
GlobalMuonRefitter::theGEMChi2Cut
float theGEMChi2Cut
Definition: GlobalMuonRefitter.h:136
GlobalMuonRefitter::outsideIn
Definition: GlobalMuonRefitter.h:106
CSCDetId
Definition: CSCDetId.h:26
GlobalMuonRefitter::theDYTthrsParameters
edm::ParameterSet theDYTthrsParameters
Definition: GlobalMuonRefitter.h:172
GlobalMuonRefitter::theService
const MuonServiceProxy * theService
Definition: GlobalMuonRefitter.h:185
GlobalMuonRefitter::theCosmicFlag
bool theCosmicFlag
Definition: GlobalMuonRefitter.h:138
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
GlobalMuonRefitter::TEC
Definition: GlobalMuonRefitter.h:67
GlobalMuonRefitter::theRefitDirection
RefitDirection theRefitDirection
Definition: GlobalMuonRefitter.h:165
RefitDirection
Definition: RefitDirection.h:13
ME0DetId::station
int station() const
Definition: ME0DetId.h:58
TrackerTopology::pxfDisk
unsigned int pxfDisk(const DetId &id) const
Definition: TrackerTopology.h:446
reco::Track::innerDetId
unsigned int innerDetId() const
DetId of the detector on which surface the innermost state is located.
Definition: Track.h:82
GlobalMuonRefitter::thePropagatorName
std::string thePropagatorName
Definition: GlobalMuonRefitter.h:159
GlobalMuonRefitter::hitCloner
TkClonerImpl hitCloner
Definition: GlobalMuonRefitter.h:180
GlobalMuonRefitter::theTrackerSkipSystem
int theTrackerSkipSystem
Definition: GlobalMuonRefitter.h:154
ME0DetId
Definition: ME0DetId.h:16
MuonSubdetId::ME0
static constexpr int ME0
Definition: MuonSubdetId.h:15
get
#define get
GlobalMuonRefitter::theDTRecHitLabel
edm::InputTag theDTRecHitLabel
Definition: GlobalMuonRefitter.h:140
GlobalMuonRefitter::theTrackerRecHitBuilder
edm::ESHandle< TransientTrackingRecHitBuilder > theTrackerRecHitBuilder
Definition: GlobalMuonRefitter.h:179
PV3DBase::basicVector
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
Trajectory::measurements
DataContainer const & measurements() const
Definition: Trajectory.h:178
GlobalMuonRefitter::CSCSegmentsToken
edm::EDGetTokenT< CSCSegmentCollection > CSCSegmentsToken
Definition: GlobalMuonRefitter.h:188
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
GlobalMuonRefitter::theME0RecHitLabel
edm::InputTag theME0RecHitLabel
Definition: GlobalMuonRefitter.h:143
RecHitLessByDet
Definition: RecHitLessByDet.h:16
TrajectoryStateOnSurface::globalMomentum
GlobalVector globalMomentum() const
Definition: TrajectoryStateOnSurface.h:66
mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: Basic3DVectorLD.h:127
TrackerTopology::tobLayer
unsigned int tobLayer(const DetId &id) const
Definition: TrackerTopology.h:147
edm::RangeMap::range
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:50
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
reco::TransientTrack
Definition: TransientTrack.h:19
ConstRecHitContainer
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
Definition: MillePedeAlignmentAlgorithm.cc:74
GlobalMuonRefitter::theRPCInTheFit
bool theRPCInTheFit
Definition: GlobalMuonRefitter.h:161
MuonSubdetId::RPC
static constexpr int RPC
Definition: MuonSubdetId.h:13
Exception
Definition: hltDiff.cc:246
PropagationDirection
PropagationDirection
Definition: PropagationDirection.h:4
GlobalMuonRefitter::printHits
void printHits(const ConstRecHitContainer &) const
print all RecHits of a trajectory
Definition: GlobalMuonRefitter.cc:674
GlobalMuonRefitter::theHitThreshold
int theHitThreshold
Definition: GlobalMuonRefitter.h:132
TrajectorySeed
Definition: TrajectorySeed.h:17
GlobalMuonRefitter::theCacheId_TRH
unsigned long long theCacheId_TRH
Definition: GlobalMuonRefitter.h:157
GlobalMuonRefitter::dytInfo
reco::DYTInfo * dytInfo
Definition: GlobalMuonRefitter.h:173
GlobalMuonRefitter::theME0RecHits
edm::Handle< ME0SegmentCollection > theME0RecHits
Definition: GlobalMuonRefitter.h:147
GlobalMuonRefitter::TID
Definition: GlobalMuonRefitter.h:67
GlobalMuonRefitter::theMuonHitsOption
int theMuonHitsOption
Definition: GlobalMuonRefitter.h:130
GlobalMuonRefitter::theCSCChi2Cut
float theCSCChi2Cut
Definition: GlobalMuonRefitter.h:134
GEMDetId::station
constexpr int station() const
Definition: GEMDetId.h:173
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
GlobalMuonRefitter::theEvent
const edm::Event * theEvent
Definition: GlobalMuonRefitter.h:186
DetId::Muon
Definition: DetId.h:26
DTChamberId
Definition: DTChamberId.h:14
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
GlobalMuonRefitter::TIB
Definition: GlobalMuonRefitter.h:67
PTrajectoryStateOnDet
Definition: PTrajectoryStateOnDet.h:10
CSCDetId::station
int station() const
Definition: CSCDetId.h:79
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:426
GlobalMuonRefitter::refit
std::vector< Trajectory > refit(const reco::Track &globalTrack, const int theMuonHitsOption, const TrackerTopology *tTopo) const
build combined trajectory from sta Track and tracker RecHits
Definition: GlobalMuonRefitter.cc:182
TrackerTopology::tecWheel
unsigned int tecWheel(const DetId &id) const
Definition: TrackerTopology.h:198
DynamicTruncation
Definition: DynamicTruncation.h:47
ME0SegmentCollection
event
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
keep
const int keep
Definition: GenParticlePruner.cc:48
GlobalMuonRefitter::all4DSegments
edm::Handle< DTRecSegment4DCollection > all4DSegments
Definition: GlobalMuonRefitter.h:191
edm::InputTag
Definition: InputTag.h:15
alongMomentum
Definition: PropagationDirection.h:4
GlobalMuonRefitter::selectMuonHits
ConstRecHitContainer selectMuonHits(const Trajectory &, const std::map< DetId, int > &) const
select muon hits compatible with trajectory; check hits in chambers with showers
Definition: GlobalMuonRefitter.cc:589
GlobalMuonRefitter::theCSCRecHits
edm::Handle< CSCRecHit2DCollection > theCSCRecHits
Definition: GlobalMuonRefitter.h:145
SurveyInfoScenario_cff.seed
seed
Definition: SurveyInfoScenario_cff.py:295
DTChamberId::station
int station() const
Return the station number.
Definition: DTChamberId.h:42
hit
Definition: SiStripHitEffFromCalibTree.cc:88
edm::OwnVector< TrackingRecHit >
GlobalMuonRefitter::theDTRecHitToken
edm::EDGetTokenT< DTRecHitCollection > theDTRecHitToken
Definition: GlobalMuonRefitter.h:148
TrackerTopology::tibLayer
unsigned int tibLayer(const DetId &id) const
Definition: TrackerTopology.h:150
GlobalMuonRefitter::insideOut
Definition: GlobalMuonRefitter.h:106
GlobalMuonRefitter::theDYTuseAPE
bool theDYTuseAPE
Definition: GlobalMuonRefitter.h:170