CMS 3D CMS Logo

GlobalMuonRefitter.cc
Go to the documentation of this file.
1 
18 
19 //---------------
20 // C++ Headers --
21 //---------------
22 
23 #include <iostream>
24 #include <iomanip>
25 #include <algorithm>
26 
27 //-------------------------------
28 // Collaborating Class Headers --
29 //-------------------------------
30 
32 
42 
57 
67 
68 using namespace std;
69 using namespace edm;
70 
71 //----------------
72 // Constructors --
73 //----------------
74 
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")),
83  theService(service) {
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 }
143 
144 //--------------
145 // Destructor --
146 //--------------
147 
149 
150 //
151 // set Event
152 //
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 }
162 
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 }
178 
179 //
180 // build a combined tracker-muon trajectory
181 //
183  const int theMuonHitsOption,
184  const TrackerTopology* tTopo) const {
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 }
208 
209 //
210 // build a combined tracker-muon trajectory
211 //
214  const TransientTrackingRecHit::ConstRecHitContainer& allRecHitsTemp,
215  const int theMuonHitsOption,
216  const TrackerTopology* tTopo) const {
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) {
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 }
302 
303 //
304 //
305 //
308  map<DetId, int>& hitMap) const {
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 }
525 
526 //
527 // Get the hits from the first muon station (containing hits)
528 //
531  ConstRecHitContainer& first) const {
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 }
584 
585 //
586 // select muon hits compatible with trajectory;
587 // check hits in chambers with showers
588 //
590  const map<DetId, int>& hitMap) const {
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 }
670 
671 //
672 // print RecHits
673 //
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 }
691 
692 //
693 // add Trajectory* to TrackCand if not already present
694 //
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 }
723 
724 //
725 // Convert Tracks into Trajectories with a given set of hits
726 //
727 vector<Trajectory> GlobalMuonRefitter::transform(
728  const reco::Track& newTrack,
730  const TransientTrackingRecHit::ConstRecHitContainer& urecHitsForReFit) const {
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 }
879 
880 //
881 // Remove Selected Station Rec Hits
882 //
884  const ConstRecHitContainer& hits, const TrackerTopology* tTopo) const {
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 }
GEMRecHitCollection
MuonSubdetId::GEM
static constexpr int GEM
Definition: MuonSubdetId.h:14
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
DynamicTruncation::setUpdateState
void setUpdateState(bool)
Definition: DynamicTruncation.cc:128
TrajectoryStateOnSurface.h
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
electrons_cff.bool
bool
Definition: electrons_cff.py:372
CSCRecHit2DCollection
mps_fire.i
i
Definition: mps_fire.py:355
GlobalMuonRefitter.h
GlobalMuonRefitter::theME0Chi2Cut
float theME0Chi2Cut
Definition: GlobalMuonRefitter.h:137
MessageLogger.h
RPCDetId::station
int station() const
Definition: RPCDetId.h:78
TrackExtraFwd.h
GlobalMuonRefitter::theMuonRecHitBuilderName
std::string theMuonRecHitBuilderName
Definition: GlobalMuonRefitter.h:182
GlobalMuonRefitter::CSCSegments
edm::Handle< CSCSegmentCollection > CSCSegments
Definition: GlobalMuonRefitter.h:190
GEMRecHit.h
GlobalMuonRefitter::theME0RecHitToken
edm::EDGetTokenT< ME0SegmentCollection > theME0RecHitToken
Definition: GlobalMuonRefitter.h:151
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
DynamicTruncation::setThr
void setThr(const std::vector< int > &)
Definition: DynamicTruncation.cc:130
GlobalMuonRefitter::theCategory
std::string theCategory
Definition: GlobalMuonRefitter.h:125
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
muon
Definition: MuonCocktails.h:17
GlobalMuonRefitter::theGEMRecHitToken
edm::EDGetTokenT< GEMRecHitCollection > theGEMRecHitToken
Definition: GlobalMuonRefitter.h:150
DynamicTruncation::setProd
void setProd(const edm::Handle< DTRecSegment4DCollection > &DTSegProd, const edm::Handle< CSCSegmentCollection > &CSCSegProd)
Definition: DynamicTruncation.h:56
DynamicTruncation::setRecoP
void setRecoP(double p)
Definition: DynamicTruncation.h:68
relativeConstraints.station
station
Definition: relativeConstraints.py:67
edm
HLT enums.
Definition: AlignableModifier.h:19
TrackerTopology
Definition: TrackerTopology.h:16
GlobalMuonRefitter::theGEMRecHits
edm::Handle< GEMRecHitCollection > theGEMRecHits
Definition: GlobalMuonRefitter.h:146
TransientRecHitRecord.h
ME0DetId.h
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
DynamicTruncation.h
edm::LogInfo
Definition: MessageLogger.h:254
TransientRecHitRecord
Definition: TransientRecHitRecord.h:14
GlobalMuonRefitter::GlobalMuonRefitter
GlobalMuonRefitter(const edm::ParameterSet &, const MuonServiceProxy *, edm::ConsumesCollector &)
constructor with Parameter Set and MuonServiceProxy
Definition: GlobalMuonRefitter.cc:75
GlobalMuonRefitter::theRPCChi2Cut
float theRPCChi2Cut
Definition: GlobalMuonRefitter.h:135
oppositeToMomentum
Definition: PropagationDirection.h:4
ChiSquaredProbability.h
bookConverter.results
results
Definition: bookConverter.py:144
TrajectoryMeasurement.h
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
MuonTransientTrackingRecHit.h
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
GlobalMuonRefitter::theMuonRecHitBuilder
edm::ESHandle< TransientTrackingRecHitBuilder > theMuonRecHitBuilder
Definition: GlobalMuonRefitter.h:183
TransientTrack.h
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
MuonServiceProxy_cff.MuonServiceProxy
MuonServiceProxy
Definition: MuonServiceProxy_cff.py:15
CSCDetId.h
DynamicTruncation::setSelector
void setSelector(int)
Definition: DynamicTruncation.cc:117
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
DynamicTruncation::setRecoEta
void setRecoEta(double eta)
Definition: DynamicTruncation.h:69
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
TrackerTopology.h
reco::DYTInfo::CopyFrom
void CopyFrom(const DYTInfo &)
copy from another DYTInfo
Definition: DYTInfo.cc:14
reco::DYTInfo
Definition: DYTInfo.h:11
Track.h
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
reco::Track
Definition: Track.h:27
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
TrajectoryFitter.h
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
DTChamberId.h
DynamicTruncation::setUseAPE
void setUseAPE(bool)
Definition: DynamicTruncation.cc:126
DTLayerId
Definition: DTLayerId.h:12
DynamicTruncation::setParThrsMode
void setParThrsMode(bool dytParThrsMode)
Definition: DynamicTruncation.h:67
edm::OwnVector::const_iterator
Definition: OwnVector.h:41
GlobalMuonRefitter::theCSCRecHitLabel
edm::InputTag theCSCRecHitLabel
Definition: GlobalMuonRefitter.h:141
DTLayer.h
GlobalMuonRefitter::theDTChi2Cut
float theDTChi2Cut
Definition: GlobalMuonRefitter.h:133
DTGeometry.h
GlobalMuonRefitter::PXB
Definition: GlobalMuonRefitter.h:67
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
RPCDetId.h
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::RefitDirection
RefitDirection
Definition: GlobalMuonRefitter.h:106
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
Event.h
GlobalMuonRefitter::theGEMRecHitLabel
edm::InputTag theGEMRecHitLabel
Definition: GlobalMuonRefitter.h:142
TrackingRecHit::ConstRecHitContainer
std::vector< ConstRecHitPointer > ConstRecHitContainer
Definition: TrackingRecHit.h:32
MuonCandidate.h
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
DynamicTruncation::setThrsMap
void setThrsMap(const edm::ParameterSet &)
Definition: DynamicTruncation.cc:143
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
CSCDetId::chamberId
CSCDetId chamberId() const
Definition: CSCDetId.h:47
IdealGeometryRecord.h
GlobalMuonRefitter::theTrackerSkipSystem
int theTrackerSkipSystem
Definition: GlobalMuonRefitter.h:154
edm::EventSetup
Definition: EventSetup.h:57
ME0DetId
Definition: ME0DetId.h:16
ME0Segment.h
MuonSubdetId::ME0
static constexpr int ME0
Definition: MuonSubdetId.h:15
GlobalMuonRefitter::setServices
void setServices(const edm::EventSetup &)
set the services needed by the TrackTransformer
Definition: GlobalMuonRefitter.cc:163
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
ME0DetId::chamberId
ME0DetId chamberId() const
Return the corresponding ChamberId (mask layers)
Definition: ME0DetId.h:53
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
DynamicTruncation::filter
TransientTrackingRecHit::ConstRecHitContainer filter(const Trajectory &)
Definition: DynamicTruncation.cc:153
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
GEMDetId.h
edm::RangeMap::range
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:50
std
Definition: JetResolutionObject.h:76
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
GlobalMuonRefitter::setEvent
virtual void setEvent(const edm::Event &)
pass the Event to the algo at each event
Definition: GlobalMuonRefitter.cc:153
reco::TransientTrack
Definition: TransientTrack.h:19
CSCLayer.h
GlobalMuonRefitter::theRPCInTheFit
bool theRPCInTheFit
Definition: GlobalMuonRefitter.h:161
DetId.h
Trajectory
Definition: Trajectory.h:38
MuonDetLayerMeasurements.h
MuonSubdetId::RPC
static constexpr int RPC
Definition: MuonSubdetId.h:13
MuonTransientTrackingRecHitBuilder.h
TrackingComponentsRecord.h
GEMDetId::chamberId
constexpr GEMDetId chamberId() const
Definition: GEMDetId.h:193
Exception
Definition: hltDiff.cc:246
PropagationDirection
PropagationDirection
Definition: PropagationDirection.h:4
MuonServiceProxy.h
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
TrajectoryStateTransform.h
GlobalMuonRefitter::ConstRecHitContainer
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
Definition: GlobalMuonRefitter.h:55
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
CSCRecHit2D.h
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
DynamicTruncation::getDYTInfo
reco::DYTInfo getDYTInfo()
Definition: DynamicTruncation.h:78
CSCDetId::station
int station() const
Definition: CSCDetId.h:79
RecHitLessByDet.h
event
Definition: event.py:1
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
edm::Event
Definition: Event.h:73
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
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
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
GlobalMuonRefitter::MuonRecHitContainer
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
Definition: GlobalMuonRefitter.h:61
edm::OwnVector< TrackingRecHit >
GlobalMuonRefitter::~GlobalMuonRefitter
virtual ~GlobalMuonRefitter()
destructor
Definition: GlobalMuonRefitter.cc:148
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