CMS 3D CMS Logo

ResidualRefitting.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include "ResidualRefitting.h"
3 #include <iomanip>
4 
5 //framework includes
12 
19 
23 
27 
29 
33 
35 
37  : outputFileName_(cfg.getUntrackedParameter<std::string>("histoutputFile")),
38  PropagatorSource_(cfg.getParameter<std::string>("propagator")),
39  muons_(cfg.getParameter<edm::InputTag>("muons")),
40  muonsRemake_(cfg.getParameter<edm::InputTag>("muonsRemake")), //This Feels Misalignment
41  muonsNoStation1_(cfg.getParameter<edm::InputTag>("muonsNoStation1")),
42  muonsNoStation2_(cfg.getParameter<edm::InputTag>("muonsNoStation2")),
43  muonsNoStation3_(cfg.getParameter<edm::InputTag>("muonsNoStation3")),
44  muonsNoStation4_(cfg.getParameter<edm::InputTag>("muonsNoStation4")),
45 
46  /*
47  muonsNoPXBLayer1_ ( cfg.getParameter<edm::InputTag>("muonsNoPXBLayer1" ) ),
48  muonsNoPXBLayer2_ ( cfg.getParameter<edm::InputTag>("muonsNoPXBLayer1" ) ),
49  muonsNoPXBLayer3_ ( cfg.getParameter<edm::InputTag>("muonsNoPXBLayer1" ) ),
50 
51  muonsNoTIBLayer1_ ( cfg.getParameter<edm::InputTag>("muonsNoTIBLayer1" ) ),
52  muonsNoTIBLayer2_ ( cfg.getParameter<edm::InputTag>("muonsNoTIBLayer2" ) ),
53  muonsNoTIBLayer3_ ( cfg.getParameter<edm::InputTag>("muonsNoTIBLayer3" ) ),
54  muonsNoTIBLayer4_ ( cfg.getParameter<edm::InputTag>("muonsNoTIBLayer4" ) ),
55 
56  muonsNoTOBLayer1_ ( cfg.getParameter<edm::InputTag>("muonsNoTOBLayer1" ) ),
57  muonsNoTOBLayer2_ ( cfg.getParameter<edm::InputTag>("muonsNoTOBLayer2" ) ),
58  muonsNoTOBLayer3_ ( cfg.getParameter<edm::InputTag>("muonsNoTOBLayer3" ) ),
59  muonsNoTOBLayer4_ ( cfg.getParameter<edm::InputTag>("muonsNoTOBLayer4" ) ),
60  muonsNoTOBLayer5_ ( cfg.getParameter<edm::InputTag>("muonsNoTOBLayer5" ) ),
61  muonsNoTOBLayer6_ ( cfg.getParameter<edm::InputTag>("muonsNoTOBLayer6" ) ),*/
62  debug_(cfg.getUntrackedParameter<bool>("doDebug")),
63  outputFile_(nullptr),
64  outputTree_(nullptr),
65  outputBranch_(nullptr),
66  theField(nullptr) {
67  eventInfo_.evtNum_ = 0;
68  eventInfo_.evtNum_ = 0;
69 
70  // service parameters
71  edm::ParameterSet serviceParameters = cfg.getParameter<edm::ParameterSet>("ServiceParameters");
72 
73  // the services
74  theService = new MuonServiceProxy(serviceParameters);
75 
76 } //The constructor
77 
79  if (debug_)
80  printf("STARTING EVENT\n");
81 
82  eventInfo_.evtNum_ = (int)event.id().run();
83  eventInfo_.runNum_ = (int)event.id().event();
84 
85  // Generator Collection
86 
87  // The original muon collection that is sitting in memory
89 
95 
96  event.getByLabel(muons_, muons); //set label to muons
97  event.getByLabel(muonsRemake_, muonTracks);
98  event.getByLabel(muonsNoStation1_, muonsNoSt1);
99  event.getByLabel(muonsNoStation2_, muonsNoSt2);
100  event.getByLabel(muonsNoStation3_, muonsNoSt3);
101  event.getByLabel(muonsNoStation4_, muonsNoSt4);
102 
103  /*
104 // std::cout<<"Muon Collection No PXB "<<std::endl;
105 //Tracker Barrel Pixel Refits
106  edm::Handle<MuonCollection> muonsNoPXBLayer1Coll;
107  event.getByLabel(muonsNoPXBLayer1_, muonsNoPXBLayer1Coll);
108  edm::Handle<MuonCollection> muonsNoPXBLayer2Coll;
109  event.getByLabel(muonsNoPXBLayer2_, muonsNoPXBLayer2Coll);
110  edm::Handle<MuonCollection> muonsNoPXBLayer3Coll;
111  event.getByLabel(muonsNoPXBLayer3_, muonsNoPXBLayer3Coll);
112 // std::cout<<"Muon Collection No TIB "<<std::endl;
113 // Tracker Inner Barrel Refits
114  edm::Handle<MuonCollection> muonsNoTIBLayer1Coll;
115  event.getByLabel(muonsNoTIBLayer1_, muonsNoTIBLayer1Coll);
116  edm::Handle<MuonCollection> muonsNoTIBLayer2Coll;
117  event.getByLabel(muonsNoTIBLayer2_, muonsNoTIBLayer2Coll);
118  edm::Handle<MuonCollection> muonsNoTIBLayer3Coll;
119  event.getByLabel(muonsNoTIBLayer3_, muonsNoTIBLayer3Coll);
120  edm::Handle<MuonCollection> muonsNoTIBLayer4Coll;
121  event.getByLabel(muonsNoTIBLayer4_, muonsNoTIBLayer4Coll);
122 
123 // std::cout<<"Muon Collection No TOB "<<std::endl;
124 
125 //Tracker outer barrel refits
126  edm::Handle<MuonCollection> muonsNoTOBLayer1Coll;
127  event.getByLabel(muonsNoTOBLayer1_, muonsNoTOBLayer1Coll);
128  edm::Handle<MuonCollection> muonsNoTOBLayer2Coll;
129  event.getByLabel(muonsNoTOBLayer2_, muonsNoTOBLayer2Coll);
130  edm::Handle<MuonCollection> muonsNoTOBLayer3Coll;
131  event.getByLabel(muonsNoTOBLayer3_, muonsNoTOBLayer3Coll);
132  edm::Handle<MuonCollection> muonsNoTOBLayer4Coll;
133  event.getByLabel(muonsNoTOBLayer4_, muonsNoTOBLayer4Coll);
134  edm::Handle<MuonCollection> muonsNoTOBLayer5Coll;
135  event.getByLabel(muonsNoTOBLayer5_, muonsNoTOBLayer5Coll);
136  edm::Handle<MuonCollection> muonsNoTOBLayer6Coll;
137  event.getByLabel(muonsNoTOBLayer6_, muonsNoTOBLayer6Coll);
138 */
139  //magnetic field information
141  edm::ESHandle<GlobalTrackingGeometry> globalTrackingGeometry;
142  eventSetup.get<IdealMagneticFieldRecord>().get(field);
143  eventSetup.get<GlobalTrackingGeometryRecord>().get(globalTrackingGeometry);
145  theField = &*field;
146 
147  theService->update(eventSetup);
148 
149  //Zero storage
150  zero_storage();
151 
152  //Do the Gmr Muons from the unModified Collection
153 
154  /*
155  int iGmr = 0;
156  if ( (muons->end() - muons->begin()) > 0) printf("Data Dump:: Original GMR Muons\n");
157  for ( MuonCollection::const_iterator muon = muons->begin(); muon!=muons->end(); muon++, iGmr++) {
158  if ( iGmr >= ResidualRefitting::N_MAX_STORED) break; // error checking
159  if (!debug
160 
161  dumpTrackRef(muon->combinedMuon(), "cmb");
162  dumpTrackRef(muon->standAloneMuon(), "sam");
163  dumpTrackRef(muon->track(), "trk");
164 
165 
166  }
167  storageGmrOld_.n_ = iGmr;
168  storageSamNew_.n_ = iGmr;
169 */
170 
171  //Refitted muons
172  if (debug_)
173  printf("Data Dump:: Rebuilt GMR Muon Track With TeV refitter default\n");
174  int iGmrRemake = 0;
175  for (reco::TrackCollection::const_iterator muon = muonTracks->begin(); muon != muonTracks->end();
176  muon++, iGmrRemake++) {
177  if (iGmrRemake >= ResidualRefitting::N_MAX_STORED)
178  break; // error checking
179  // from TrackInfoProducer/test/TrackInfoAnalyzerExample.cc
180  reco::TrackRef trackref = reco::TrackRef(muonTracks, iGmrRemake);
181 
182  if (debug_)
183  dumpTrackRef(trackref, "gmr");
184  muonInfo(storageGmrNew_, trackref, iGmrRemake);
185  }
186  storageGmrNew_.n_ = iGmrRemake;
187 
188  if (debug_)
189  printf("muons Remake");
190  if (debug_)
191  printf("-----------------------------------------\n");
192  CollectTrackHits(muonTracks, storageTrackExtrapRec_, eventSetup);
193 
194  if (true) {
195  printf("muons No Station 1");
196  printf("-----------------------------------------\n");
197  }
198  NewTrackMeasurements(muonTracks, muonsNoSt1, storageTrackExtrapRecNoSt1_);
199 
200  if (true) {
201  printf("muons No Station 2");
202  printf("-----------------------------------------\n");
203  }
204  NewTrackMeasurements(muonTracks, muonsNoSt2, storageTrackExtrapRecNoSt2_);
205 
206  if (true) {
207  printf("muons No Station 3");
208  printf("-----------------------------------------\n");
209  }
210  NewTrackMeasurements(muonTracks, muonsNoSt3, storageTrackExtrapRecNoSt3_);
211 
212  if (true) {
213  printf("muons No Station 4");
214  printf("-----------------------------------------\n");
215  }
216  NewTrackMeasurements(muonTracks, muonsNoSt4, storageTrackExtrapRecNoSt4_);
217 
218  // dumpMuonRecHits(storageRecMuon_);
219 
220  /****************************************************************************************************************************************/
221 
222  /*
223  * extrapolates track to a cylinder.
224  * commented for cosmic runs with no tracker in reco muons!!
225  *
226 */
227 
228  int iGmrCyl = 0;
229  for (reco::MuonCollection::const_iterator muon = muons->begin(); muon != muons->end(); muon++, iGmrCyl++) {
230  dumpTrackRef(muon->combinedMuon(), "cmb");
231  dumpTrackRef(muon->standAloneMuon(), "sam");
232  dumpTrackRef(muon->track(), "trk");
233 
234  cylExtrapTrkSam(iGmrCyl, muon->standAloneMuon(), samExtrap120_, 120.);
235  cylExtrapTrkSam(iGmrCyl, muon->track(), trackExtrap120_, 120.);
236  }
237  samExtrap120_.n_ = iGmrCyl;
238  trackExtrap120_.n_ = iGmrCyl;
239 
240  if (iGmrRemake > 0 || iGmrCyl > 0) {
241  outputTree_->Fill();
242  std::cout << "FILLING NTUPLE!" << std::endl;
243  std::cout << "Entries Recorded: " << outputTree_->GetEntries() << " Branch :: " << outputBranch_->GetEntries()
244  << std::endl
245  << std::endl;
246  } else
247  std::cout << "no tracks -- no fill!\n" << std::endl << std::endl;
248 
249  // /*************************************************************************************************************/
250  // //END OF ntuple dumper
251  // //END OF ntuple dumper
252  // /***********************************************************************************************************/
253 }
254 //end Analyze() main function
255 
256 //------------------------------------------------------------------------------
257 //
258 // Destructor
259 //
261  delete outputFile_;
262  delete theService;
263 }
264 //
265 // Track Collection Analysis
266 //
269  const edm::EventSetup& eventSetup) {
270  //Retrieve tracker topology from geometry
271  edm::ESHandle<TrackerTopology> tTopoHandle;
272  eventSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
273  const TrackerTopology* const tTopo = tTopoHandle.product();
274 
275  int iMuonHit = 0;
276  int iTrackHit = 0;
277  int numTracks = 0;
278 
279  for (reco::TrackCollection::const_iterator muon = trackColl->begin(); muon != trackColl->end(); muon++) {
280  int iTrack = muon - trackColl->begin();
281  reco::TrackRef trackref = reco::TrackRef(trackColl, iTrack);
283 
284  if (debug_)
285  dumpTrackRef(trackref, "CollectTrackHits Track");
286 
287  int iRec = 0;
288  for (auto const& rec : muon->recHits()) {
289  DetId detid = rec->geographicalId();
290 
291  if (detid.det() != DetId::Muon && detid.det() != DetId::Tracker) {
292  if (debug_)
293  printf("Rec Hit not from muon system or tracker... continuing...\n");
294  continue;
295  }
296  // numTracks++;
297  // Get Local and Global Position of Hits
298 
299  LocalPoint lp = rec->localPosition();
300  float lpX = lp.x();
301  float lpY = lp.y();
302  float lpZ = lp.z();
303 
305  theService->trackingGeometry()->idToDet(rec->geographicalId()), rec);
306 
307  GlobalPoint gp = mrhp->globalPosition();
308  float gpRecX = gp.x();
309  float gpRecY = gp.y();
310  float gpRecZ = gp.z();
311  float gpRecEta = gp.eta();
312  float gpRecPhi = gp.phi();
313 
314  if (detid.det() == DetId::Muon) {
315  int systemMuon = detid.subdetId(); // 1 DT; 2 CSC; 3 RPC
316  int endcap = -999;
317  int station = -999;
318  int ring = -999;
319  int chamber = -999;
320  int layer = -999;
321  int superLayer = -999;
322  int wheel = -999;
323  int sector = -999;
324  if (systemMuon == MuonSubdetId::CSC) {
325  CSCDetId id(detid.rawId());
326  endcap = id.endcap();
327  station = id.station();
328  ring = id.ring();
329  chamber = id.chamber();
330  layer = id.layer();
331  if (debug_)
332  printf("CSC\t[endcap][station][ringN][chamber][layer]:[%d][%d][%d][%d][%d]\t",
333  endcap,
334  station,
335  ring,
336  chamber,
337  layer);
338 
339  } else if (systemMuon == MuonSubdetId::DT) {
340  DTWireId id(detid.rawId());
341  station = id.station();
342  layer = id.layer();
343  superLayer = id.superLayer();
344  wheel = id.wheel();
345  sector = id.sector();
346  if (debug_)
347  printf("DT \t[station][layer][superlayer]:[%d][%d][%d]\n", station, layer, superLayer);
348 
349  } else if (systemMuon == MuonSubdetId::RPC) {
350  RPCDetId id(detid.rawId());
351  station = id.station();
352  if (debug_)
353  printf("RPC\t[station]:[%d]\n", station);
354  }
355 
356  storageRecMuon_.muonLink_[iMuonHit] = iTrack;
357  storageRecMuon_.system_[iMuonHit] = systemMuon;
358  storageRecMuon_.endcap_[iMuonHit] = endcap;
359  storageRecMuon_.station_[iMuonHit] = station;
360  storageRecMuon_.ring_[iMuonHit] = ring;
361  storageRecMuon_.chamber_[iMuonHit] = chamber;
362  storageRecMuon_.layer_[iMuonHit] = layer;
363  storageRecMuon_.superLayer_[iMuonHit] = superLayer;
364  storageRecMuon_.wheel_[iMuonHit] = wheel;
365  storageRecMuon_.sector_[iMuonHit] = sector;
366 
367  storageRecMuon_.gpX_[iMuonHit] = gpRecX;
368  storageRecMuon_.gpY_[iMuonHit] = gpRecY;
369  storageRecMuon_.gpZ_[iMuonHit] = gpRecZ;
370  storageRecMuon_.gpEta_[iMuonHit] = gpRecEta;
371  storageRecMuon_.gpPhi_[iMuonHit] = gpRecPhi;
372  storageRecMuon_.lpX_[iMuonHit] = lpX;
373  storageRecMuon_.lpY_[iMuonHit] = lpY;
374  storageRecMuon_.lpZ_[iMuonHit] = lpZ;
375  iMuonHit++;
376 
377  } else if (detid.det() == DetId::Tracker) {
378  if (debug_)
379  printf("Tracker\n");
380 
381  StoreTrackerRecHits(detid, tTopo, iTrack, iTrackHit);
382 
383  storageTrackHit_.gpX_[iTrackHit] = gpRecX;
384  storageTrackHit_.gpY_[iTrackHit] = gpRecY;
385  storageTrackHit_.gpZ_[iTrackHit] = gpRecZ;
386  storageTrackHit_.gpEta_[iTrackHit] = gpRecEta;
387  storageTrackHit_.gpPhi_[iTrackHit] = gpRecPhi;
388  storageTrackHit_.lpX_[iTrackHit] = lpX;
389  storageTrackHit_.lpY_[iTrackHit] = lpY;
390  storageTrackHit_.lpZ_[iTrackHit] = lpZ;
391  iTrackHit++;
392  } else
393  printf("THIS CAN NOT HAPPEN\n");
394 
395  trkExtrap(detid, numTracks, iTrack, iRec, recoStart, lp, trackExtrap);
396  numTracks++;
397 
398  if (debug_)
399  printf("\tLocal Positon: \tx = %2.2f\ty = %2.2f\tz = %2.2f\n", lpX, lpY, lpZ);
400  if (debug_)
401  printf("\tGlobal Position: \tx = %6.2f\ty = %6.2f\tz = %6.2f\teta = %4.2f\tphi = %3.2f\n",
402  gpRecX,
403  gpRecY,
404  gpRecZ,
405  gpRecEta,
406  gpRecPhi);
407 
408  ++iRec;
409  }
410  }
411 
412  storageRecMuon_.n_ = iMuonHit;
413  storageTrackHit_.n_ = iTrackHit;
414  trackExtrap.n_ = numTracks;
415 }
416 //
417 // Deal with Re-Fitted Track with some station omitted.
418 //
419 // This should take the new track, match it to its track before refitting with the hits dumped, and extrapolate out to the
420 // rec hits that were removed from the fit.
421 //
422 //
423 
427  int numTracks = 0;
428  int recCounter = 0;
429 
430  for (reco::TrackCollection::const_iterator muon = trackColl->begin(); muon != trackColl->end(); muon++) {
431  int iTrack = muon - trackColl->begin();
432 
433  reco::TrackRef trackref = reco::TrackRef(trackColl, iTrack);
435 
436  int iTrackLink = MatchTrackWithRecHits(muon, trackCollOrig);
437  reco::TrackRef ref = reco::TrackRef(trackCollOrig, iTrackLink);
438 
439  for (auto const& rec1 : ref->recHits()) {
440  bool unbiasedRec = true;
441 
442  for (auto const& rec2 : muon->recHits()) {
443  if (IsSameHit(*rec1, *rec2)) {
444  unbiasedRec = false;
445  break;
446  }
447  }
448  if (!unbiasedRec)
449  continue;
450 
451  DetId detid = rec1->geographicalId();
452 
454  theService->trackingGeometry()->idToDet(rec1->geographicalId()), rec1);
455 
456  trkExtrap(detid, numTracks, iTrackLink, recCounter, recoStart, rec1->localPosition(), trackExtrap);
457  numTracks++;
458  }
459  }
460 
461  trackExtrap.n_ = numTracks;
462 }
463 //
464 // Find the original track that corresponds to the re-fitted track
465 //
466 int ResidualRefitting::MatchTrackWithRecHits(reco::TrackCollection::const_iterator trackIt,
468  if (debug_)
469  printf("Matching a re-fitted track to the original track.\n");
470 
471  int TrackMatch = -1;
472 
473  for (auto const& rec : trackIt->recHits()) {
474  bool foundMatch = false;
475  for (reco::TrackCollection::const_iterator refIt = ref->begin(); refIt != ref->end(); refIt++) {
476  int iTrackMatch = refIt - ref->begin();
477  if (foundMatch && TrackMatch != iTrackMatch)
478  break;
479  for (auto const& recRef : refIt->recHits()) {
480  if (!IsSameHit(*rec, *recRef))
481  continue;
482 
483  foundMatch = true;
484  TrackMatch = iTrackMatch;
485  // printf("Rec hit match for original track %d\n", iTrackMatch);
486  }
487  }
488  if (!foundMatch) {
489  printf("SOMETHING WENT WRONG! Could not match Track with original track!");
490  exit(1);
491  }
492  }
493  if (debug_)
494  printf("Rec hit match for original track %d\n", TrackMatch);
495 
496  // reco::TrackRef trackref=reco::TrackRef(ref,TrackMatch);
497  return TrackMatch;
498 }
499 /*
500 //
501 // Match two tracks to see if one is a subset of the other
502 //
503 
504 bool ResidualRefitting::TrackSubset(reco::TrackRef trackSub, reco::TrackRef trackTop) {
505 
506 
507  bool matchAll = true;
508 
509  for (trackingRecHit_iterator recSub = trackSub->recHits().begin(); recSub!=trackSub->recHits().end(); recSub++) {
510 
511  bool matchSub = false;
512 
513 
514  for (trackingRecHit_iterator recTop = trackTop->recHits().begin(); recTop!=trackTop->recHits().end(); recTop++) {
515 
516  if ( recSub == recTop ) matchSub = true;
517  if (matchSub) break;
518 
519  }
520  if (!matchSub) return false;
521 
522  }
523 
524  return matchAll;
525 
526 }
527 */
528 
529 //
530 // Check to see if the rec hits are the same
531 //
533  double lpx1 = hit1.localPosition().x();
534  double lpy1 = hit1.localPosition().y();
535  double lpz1 = hit1.localPosition().z();
536 
537  double lpx2 = hit2.localPosition().x();
538  double lpy2 = hit2.localPosition().y();
539  double lpz2 = hit2.localPosition().z();
540  if (fabs(lpx1 - lpx2) > 1e-3)
541  return false;
542  // printf("Match lpx...\n");
543  if (fabs(lpy1 - lpy2) > 1e-3)
544  return false;
545  // printf("Match lpy...\n");
546  if (fabs(lpz1 - lpz2) > 1e-3)
547  return false;
548  // printf("Match lpz...\n");
549 
550  return true;
551 }
552 
553 //
554 // Store Tracker Rec Hits
555 //
556 void ResidualRefitting::StoreTrackerRecHits(DetId detid, const TrackerTopology* tTopo, int iTrack, int iRec) {
557  int detector = -1;
558  int subdetector = -1;
559  int blade = -1;
560  int disk = -1;
561  int ladder = -1;
562  int layer = -1;
563  int module = -1;
564  int panel = -1;
565  int ring = -1;
566  int side = -1;
567  int wheel = -1;
568 
569  //Detector Info
570 
571  detector = detid.det();
572  subdetector = detid.subdetId();
573 
574  if (detector != DetId::Tracker) {
575  std::cout << "OMFG NOT THE TRACKER\n" << std::endl;
576  return;
577  }
578 
579  if (debug_)
580  std::cout << "Tracker:: ";
581  if (subdetector == ResidualRefitting::PXB) {
582  layer = tTopo->pxbLayer(detid.rawId());
583  ladder = tTopo->pxbLadder(detid.rawId());
584  module = tTopo->pxbModule(detid.rawId());
585  if (debug_)
586  std::cout << "PXB"
587  << "\tlayer = " << layer << "\tladder = " << ladder << "\tmodule = " << module;
588 
589  } else if (subdetector == ResidualRefitting::PXF) {
590  side = tTopo->pxfSide(detid.rawId());
591  disk = tTopo->pxfDisk(detid.rawId());
592  blade = tTopo->pxfBlade(detid.rawId());
593  panel = tTopo->pxfPanel(detid.rawId());
594  module = tTopo->pxfModule(detid.rawId());
595  if (debug_)
596  std::cout << "PXF"
597  << "\tside = " << side << "\tdisk = " << disk << "\tblade = " << blade << "\tpanel = " << panel
598  << "\tmodule = " << module;
599 
600  } else if (subdetector == ResidualRefitting::TIB) {
601  layer = tTopo->tibLayer(detid.rawId());
602  module = tTopo->tibModule(detid.rawId());
603  if (debug_)
604  std::cout << "TIB"
605  << "\tlayer = " << layer << "\tmodule = " << module;
606  } else if (subdetector == ResidualRefitting::TID) {
607  side = tTopo->tidSide(detid.rawId());
608  wheel = tTopo->tidWheel(detid.rawId());
609  ring = tTopo->tidRing(detid.rawId());
610  if (debug_)
611  std::cout << "TID"
612  << "\tside = " << side << "\twheel = " << wheel << "\tring = " << ring;
613 
614  } else if (subdetector == ResidualRefitting::TOB) {
615  layer = tTopo->tobLayer(detid.rawId());
616  module = tTopo->tobModule(detid.rawId());
617  if (debug_)
618  std::cout << "TOB"
619  << "\tlayer = " << layer << "\tmodule = " << module;
620 
621  } else if (subdetector == ResidualRefitting::TEC) {
622  ring = tTopo->tecRing(detid.rawId());
623  module = tTopo->tecModule(detid.rawId());
624  if (debug_)
625  std::cout << "TEC"
626  << "\tring = " << ring << "\tmodule = " << module;
627  }
628 
629  //Do Storage
630 
631  storageTrackHit_.muonLink_[iRec] = iTrack;
634  storageTrackHit_.blade_[iRec] = blade;
635  storageTrackHit_.disk_[iRec] = disk;
637  storageTrackHit_.layer_[iRec] = layer;
638  storageTrackHit_.module_[iRec] = module;
639  storageTrackHit_.panel_[iRec] = panel;
640  storageTrackHit_.ring_[iRec] = ring;
641  storageTrackHit_.side_[iRec] = side;
642  storageTrackHit_.wheel_[iRec] = wheel;
643 }
644 
645 //
646 // Store Muon info on P, Pt, eta, phi
647 //
649  storeMuon.pt_[val] = muon->pt();
650  storeMuon.p_[val] = muon->p();
651  storeMuon.eta_[val] = muon->eta();
652  storeMuon.phi_[val] = muon->phi();
653  storeMuon.charge_[val] = muon->charge();
654  storeMuon.numRecHits_[val] = muon->numberOfValidHits();
655  storeMuon.chiSq_[val] = muon->chi2();
656  storeMuon.ndf_[val] = muon->ndof();
657  storeMuon.chiSqOvrNdf_[val] = muon->normalizedChi2();
658 }
659 //
660 // Fill a track extrapolation
661 //
663  int iTrk,
664  int iTrkLink,
665  int iRec,
666  const FreeTrajectoryState& freeTrajState,
667  const LocalPoint& recPoint,
668  storage_trackExtrap& storeTemp) {
669  bool dump_ = debug_;
670 
671  if (dump_)
672  std::cout << "In the trkExtrap function" << std::endl;
673 
674  float gpExtrapX = -99999;
675  float gpExtrapY = -99999;
676  float gpExtrapZ = -99999;
677  float gpExtrapEta = -99999;
678  float gpExtrapPhi = -99999;
679 
680  float lpX = -99999;
681  float lpY = -99999;
682  float lpZ = -99999;
683 
684  //
685  // Get the local positions for the recHits
686  //
687 
688  float recLpX = recPoint.x();
689  float recLpY = recPoint.y();
690  float recLpZ = recPoint.z();
691 
692  float resX = -9999;
693  float resY = -9999;
694  float resZ = -9999;
695 
696  const GeomDet* gdet = theService->trackingGeometry()->idToDet(detid);
697 
698  // TrajectoryStateOnSurface surfTest = prop.propagate(freeTrajState, gdet->surface());
699  TrajectoryStateOnSurface surfTest = thePropagator->propagate(freeTrajState, gdet->surface());
700 
701  if (surfTest.isValid()) {
702  GlobalPoint globTest = surfTest.globalPosition();
703  gpExtrapX = globTest.x();
704  gpExtrapY = globTest.y();
705  gpExtrapZ = globTest.z();
706  gpExtrapEta = globTest.eta();
707  gpExtrapPhi = globTest.phi();
708  LocalPoint loc = surfTest.localPosition();
709  if (detid.det() == DetId::Muon || detid.det() == DetId::Tracker) {
710  lpX = loc.x();
711  lpY = loc.y();
712  lpZ = loc.z();
713 
714  resX = lpX - recLpX;
715  resY = lpY - recLpY;
716  resZ = lpZ - recLpZ;
717  }
718  }
719  storeTemp.muonLink_[iTrk] = iTrkLink;
720  storeTemp.recLink_[iTrk] = iRec;
721  storeTemp.gpX_[iTrk] = gpExtrapX;
722  storeTemp.gpY_[iTrk] = gpExtrapY;
723  storeTemp.gpZ_[iTrk] = gpExtrapZ;
724  storeTemp.gpEta_[iTrk] = gpExtrapEta;
725  storeTemp.gpPhi_[iTrk] = gpExtrapPhi;
726  storeTemp.lpX_[iTrk] = lpX;
727  storeTemp.lpY_[iTrk] = lpY;
728  storeTemp.lpZ_[iTrk] = lpZ;
729  storeTemp.resX_[iTrk] = resX;
730  storeTemp.resY_[iTrk] = resY;
731  storeTemp.resZ_[iTrk] = resZ;
732 
733  printf("station: %d\tsector: %d\tresX storage: %4.2f\n", ReturnStation(detid), ReturnSector(detid), resX);
734 }
735 //
736 // Return the station
737 //
739  int station = -999;
740 
741  if (detid.det() == DetId::Muon) {
742  int systemMuon = detid.subdetId(); // 1 DT; 2 CSC; 3 RPC
743  if (systemMuon == MuonSubdetId::CSC) {
744  CSCDetId id(detid.rawId());
745  station = id.station();
746 
747  } else if (systemMuon == MuonSubdetId::DT) {
748  DTWireId id(detid.rawId());
749  station = id.station();
750 
751  } else if (systemMuon == MuonSubdetId::RPC) {
752  RPCDetId id(detid.rawId());
753  station = id.station();
754  }
755  }
756 
757  return station;
758 }
759 //
760 // Return the sector
761 //
763  int sector = -999;
764 
765  if (detid.det() == DetId::Muon) {
766  int systemMuon = detid.subdetId(); // 1 DT; 2 CSC; 3 RPC
767  if (systemMuon == MuonSubdetId::DT) {
768  DTWireId id(detid.rawId());
769  sector = id.sector();
770  }
771  }
772 
773  return sector;
774 }
775 
776 //
777 // Store the SAM and Track position info at a particular rho
778 //
782  double rho) {
783  Cylinder::PositionType pos(0, 0, 0);
785 
786  Cylinder::CylinderPointer myCylinder = Cylinder::build(pos, rot, rho);
787  // SteppingHelixPropagator inwardProp ( theField, oppositeToMomentum );
788  // SteppingHelixPropagator outwardProp ( theField, alongMomentum );
789  FreeTrajectoryState recoStart = freeTrajStateMuon(track);
790  // TrajectoryStateOnSurface recoProp = outwardProp.propagate(recoStart, *myCylinder);
791  TrajectoryStateOnSurface recoProp = thePropagator->propagate(recoStart, *myCylinder);
792 
793  double xVal = -9999;
794  double yVal = -9999;
795  double zVal = -9999;
796  double phiVal = -9999;
797  double etaVal = -9999;
798 
799  if (recoProp.isValid()) {
800  GlobalPoint recoPoint = recoProp.globalPosition();
801  xVal = recoPoint.x();
802  yVal = recoPoint.y();
803  zVal = recoPoint.z();
804  phiVal = recoPoint.phi();
805  etaVal = recoPoint.eta();
806  }
807  storage.muonLink_[recNum] = recNum;
808  storage.gpX_[recNum] = xVal;
809  storage.gpY_[recNum] = yVal;
810  storage.gpZ_[recNum] = zVal;
811  storage.gpEta_[recNum] = etaVal;
812  storage.gpPhi_[recNum] = phiVal;
813 
814  float rhoVal = sqrt(xVal * xVal + yVal * yVal);
815 
816  printf("Cylinder: rho = %4.2f\tphi = %4.2f\teta = %4.2f\n", rhoVal, phiVal, etaVal);
817  if (debug_)
818  printf("Cylinder: rho = %4.2f\tphi = %4.2f\teta = %4.2f\n", rhoVal, phiVal, etaVal);
819 }
821 //Pre-Job junk
823 
824 //
825 // zero storage
826 //
828  if (debug_)
829  printf("zero_storage\n");
830 
843  //zero out the tracker
847 
849 
854 
856 
863 
865 
869 
871 
876 
878 
885 
887 
894 
896 
898 
902 
904 
909 
916 
918 
920 
921  storageRecMuon_.n_ = 0;
922  storageTrackHit_.n_ = 0;
923 }
924 //
925 // Zero out a muon reference
926 //
928  str->n_ = 0;
929 
930  for (int i = 0; i < ResidualRefitting::N_MAX_STORED; i++) {
931  str->pt_[i] = -9999;
932  str->eta_[i] = -9999;
933  str->p_[i] = -9999;
934  str->phi_[i] = -9999;
935  str->numRecHits_[i] = -9999;
936  str->chiSq_[i] = -9999;
937  str->ndf_[i] = -9999;
938  str->chiSqOvrNdf_[i] = -9999;
939  }
940 }
941 //
942 // Zero track extrapolation
943 //
945  str->n_ = 0;
946  for (int i = 0; i < ResidualRefitting::N_MAX_STORED_HIT; i++) {
947  str->muonLink_[i] = -9999;
948  str->recLink_[i] = -9999;
949  str->gpX_[i] = -9999;
950  str->gpY_[i] = -9999;
951  str->gpZ_[i] = -9999;
952  str->gpEta_[i] = -9999;
953  str->gpPhi_[i] = -9999;
954  str->lpX_[i] = -9999;
955  str->lpY_[i] = -9999;
956  str->lpZ_[i] = -9999;
957  str->resX_[i] = -9999;
958  str->resY_[i] = -9999;
959  str->resZ_[i] = -9999;
960  }
961 }
962 //
963 // Begin Job
964 //
966  std::cout << "Creating file " << outputFileName_.c_str() << std::endl;
967 
968  outputFile_ = new TFile(outputFileName_.c_str(), "RECREATE");
969 
970  outputTree_ = new TTree("outputTree", "outputTree");
971 
972  outputTree_->Branch("eventInfo",
973  &eventInfo_,
974  "evtNum_/I:"
975  "runNum_/I");
976 
983 
989 
1007 
1024 
1025  outputBranch_ = outputTree_->Branch("recHitsNew",
1026  &storageRecMuon_,
1027 
1028  "n_/I:"
1029  "muonLink_[1000]/I:"
1030 
1031  "system_[1000]/I:"
1032  "endcap_[1000]/I:"
1033  "station_[1000]/I:"
1034  "ring_[1000]/I:"
1035  "chamber_[1000]/I:"
1036  "layer_[1000]/I:"
1037  "superLayer_[1000]/I:"
1038  "wheel_[1000]/I:"
1039  "sector_[1000]/I:"
1040 
1041  "gpX_[1000]/F:"
1042  "gpY_[1000]/F:"
1043  "gpZ_[1000]/F:"
1044  "gpEta_[1000]/F:"
1045  "gpPhi_[1000]/F:"
1046  "lpX_[1000]/F:"
1047  "lpY_[1000]/F:"
1048  "lpZ_[1000]/F");
1049 
1050  outputBranch_ = outputTree_->Branch("recHitsTracker",
1052 
1053  "n_/I:"
1054 
1055  "muonLink_[1000]/I:"
1056  "detector_[1000]/I:"
1057  "subdetector_[1000]/I:"
1058  "blade_[1000]/I:"
1059  "disk_[1000]/I:"
1060  "ladder_[1000]/I:"
1061  "layer_[1000]/I:"
1062  "module_[1000]/I:"
1063  "panel_[1000]/I:"
1064  "ring_[1000]/I:"
1065  "side_[1000]/I:"
1066  "wheel_[1000]/I:"
1067 
1068  "gpX_[1000]/F:"
1069  "gpY_[1000]/F:"
1070  "gpZ_[1000]/F:"
1071  "gpEta_[1000]/F:"
1072  "gpPhi_[1000]/F:"
1073  "lpX_[1000]/F:"
1074  "lpY_[1000]/F:"
1075  "lpZ_[1000]/F");
1076 
1082 
1100 
1103 }
1104 //
1105 // Set the Muon Branches
1106 //
1108  outputBranch_ = outputTree_->Branch(branchName.c_str(),
1109  &storageTmp,
1110  "n_/I:"
1111  "charge_[10]/I:"
1112  "pt_[10]/F:"
1113  "eta_[10]/F:"
1114  "p_[10]/F:"
1115  "phi_[10]/F:"
1116  "numRecHits_[10]/I:"
1117  "chiSq_[10]/F:"
1118  "ndf_[10]/F:"
1119  "chiSqOvrNdf_[10]/F"
1120 
1121  );
1122 }
1123 //
1124 // Set the Branches for Track Extrapolations
1125 //
1127  outputBranch_ = outputTree_->Branch(branchName.c_str(),
1128  &storageTmp,
1129  "n_/I:"
1130  "muonLink_[1000]/I:"
1131  "recLink_[1000]/I:"
1132  "gpX_[1000]/F:"
1133  "gpY_[1000]/F:"
1134  "gpZ_[1000]/F:"
1135  "gpEta_[1000]/F:"
1136  "gpPhi_[1000]/F:"
1137  "lpX_[1000]/F:"
1138  "lpY_[1000]/F:"
1139  "lpZ_[1000]/F:"
1140  "resX_[1000]/F:"
1141  "resY_[1000]/F:"
1142  "resZ_[1000]/F"
1143 
1144  );
1145 }
1146 //
1147 // End Job
1148 //
1150  outputFile_->Write();
1151 
1152  outputFile_->Close();
1153 }
1154 //
1155 // Return a Free Trajectory state for a muon track
1156 //
1158  math::XYZPoint innerPos = muon->referencePoint();
1159  math::XYZVector innerMom = muon->momentum();
1160  if (debug_)
1161  std::cout << "Inner Pos: "
1162  << "\tx = " << innerPos.X() << "\ty = " << innerPos.Y() << "\tz = " << innerPos.Z() << std::endl;
1163 
1164  GlobalPoint innerPoint(innerPos.X(), innerPos.Y(), innerPos.Z());
1165  GlobalVector innerVec(innerMom.X(), innerMom.Y(), innerMom.Z());
1166 
1167  FreeTrajectoryState recoStart(innerPoint, innerVec, muon->charge(), theField);
1168  return recoStart;
1169 }
1170 
1172 // nTuple value Dumps
1174 
1175 //
1176 // dump Track Extrapolation
1177 //
1179  std::cout << "\n\nExtrapolation Dump:\n";
1180  for (unsigned int i = 0; i < (unsigned int)track.n_; i++) {
1181  // double rho = sqrt( (float)track.gpX_[i] * (float)track.gpX_[i] + (float)track.gpY_[i] * (float)track.gpY_[i] );
1182 
1183  printf("%d\tmuonLink= %d", i, (int)track.muonLink_[i]);
1184  printf("\trecLink = %d", (int)track.recLink_[i]);
1185  // printf ("\tGlobal\tx = %0.3f" , (float)track.gpX_[i] );
1186  // printf ("\ty = %0.3f" , (float)track.gpY_[i] );
1187  // printf ("\tz = %0.3f" , (float)track.gpZ_[i] );
1188  // printf ("\trho =%0.3f" , rho );
1189  // printf ("\teta = %0.3f" , (float)track.gpEta_[i] );
1190  // printf ("\tphi = %0.3f" , (float)track.gpPhi_[i] );
1191  printf("\t\tLocal\tx = %0.3f", (float)track.lpX_[i]);
1192  printf("\ty = %0.3f", (float)track.lpY_[i]);
1193  printf("\tz = %0.3f\n", (float)track.lpZ_[i]);
1194  }
1195 }
1196 //
1197 // dump Muon Rec Hits
1198 //
1200  std::cout << "Muon Rec Hits Dump:\n";
1201  for (unsigned int i = 0; i < (unsigned int)hit.n_; i++) {
1202  // double rho = sqrt( (float)hit.gpX_[i] * (float)hit.gpX_[i] + (float)hit.gpY_[i] * (float)hit.gpY_[i] );
1203 
1204  printf("%d\tsubdetector = %d\t superLayer =%d", i, (int)hit.system_[i], (int)hit.superLayer_[i]);
1205  // printf ("\tGlobal\tx = %0.3f" , (float)hit.gpX_[i] );
1206  // printf ("\ty = %0.3f" , (float)hit.gpY_[i] );
1207  // printf ("\tz = %0.3f" , (float)hit.gpZ_[i] );
1208  // printf ("\trho =%0.3f" , rho );
1209  // printf ("\teta = %0.3f" , (float)hit.gpEta_[i] );
1210  // printf ("\tphi = %0.3f\n" , (float)hit.gpPhi_[i] );
1211  printf("\t\tLocal\tx = %0.3f", (float)hit.lpX_[i]);
1212  printf("\ty = %0.3f", (float)hit.lpY_[i]);
1213  printf("\tz = %0.3f\n", (float)hit.lpZ_[i]);
1214  }
1215 }
1216 //
1217 // dump Tracker Rec Hits
1218 //
1220  std::cout << "Tracker Rec Hits Dump:\n";
1221  for (unsigned int i = 0; i < (unsigned int)hit.n_; i++) {
1222  // double rho = sqrt( (float)hit.gpX_[i] * (float)hit.gpX_[i] + (float)hit.gpY_[i] * (float)hit.gpY_[i] );
1223 
1224  printf("%d\tsubdetector = %d", i, (int)hit.subdetector_[i]);
1225  printf("\tlayer = %d", (int)hit.layer_[i]);
1226  // printf ("\tGlobal\tx = %0.3f" , (float)hit.gpX_[i] );
1227  // printf ("\ty = %0.3f" , (float)hit.gpY_[i] );
1228  // printf ("\tz = %0.3f" , (float)hit.gpZ_[i] );
1229  // printf ("\trho =%0.3f" , rho );
1230  // printf ("\teta = %0.3f" , (float)hit.gpEta_[i] );
1231  // printf ("\tphi = %0.3f\n" , (float)hit.gpPhi_[i] );
1232  printf("\t\tLocal\tx = %0.3f", (float)hit.lpX_[i]);
1233  printf("\ty = %0.3f", (float)hit.lpY_[i]);
1234  printf("\tz = %0.3f\n", (float)hit.lpZ_[i]);
1235  }
1236 }
1237 //
1238 //Dump a TrackRef
1239 //
1241  float pt = muon->pt();
1242  float p = muon->p();
1243  float eta = muon->eta();
1244  float phi = muon->phi();
1245  printf("\t%s: \tp = %4.2f \t pt = %4.2f \t eta = %4.2f \t phi = %4.2f\n", str.c_str(), p, pt, eta, phi);
1246 }
1247 
1249 
1251 //Deprecated
void update(const edm::EventSetup &setup)
update the services each event
void CollectTrackHits(edm::Handle< reco::TrackCollection > trackColl, ResidualRefitting::storage_trackExtrap &trackExtrap, const edm::EventSetup &eventSetup)
RunNumber_t run() const
Definition: EventID.h:38
ResidualRefitting::storage_muon storageGmrNoTIBLayer4
int endcap_[N_MAX_STORED_HIT]
static const int TIB
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:40
ResidualRefitting::storage_muon storageTrkNoTOBLayer4
void zero_muon(ResidualRefitting::storage_muon *str)
static const int N_MAX_STORED
unsigned int tibLayer(const DetId &id) const
int ReturnStation(DetId detid)
unsigned int tidRing(const DetId &id) const
void dumpTrackRef(reco::TrackRef muon, std::string str)
ResidualRefitting::storage_muon storageGmrNoTOBLayer1
void dumpMuonRecHits(const ResidualRefitting::storage_hit &hit)
ResidualRefitting::storage_trackExtrap storageTrackNoTEC
ResidualRefitting::storage_muon storageGmrNoPXBLayer1
float lpZ_[N_MAX_STORED_HIT]
bool IsSameHit(TrackingRecHit const &hit1, TrackingRecHit const &hit2)
ResidualRefitting::storage_trackExtrap storageTrackNoPXBLayer1
ResidualRefitting::storage_muon storageGmrNoTID
ResidualRefitting::storage_muon storageTrkNoTOBLayer6
TString subdetector
unsigned int pxfDisk(const DetId &id) const
int ReturnSector(DetId detid)
ResidualRefitting::storage_muon storageGmrNoTIBLayer1
unsigned int tecRing(const DetId &id) const
ring id
static const int PXB
ResidualRefitting::storage_trackHit storageTrackHit_
std::string PropagatorSource_
const MagneticField * theField
void zero_trackExtrap(ResidualRefitting::storage_trackExtrap *str)
#define nullptr
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
unsigned int pxbLadder(const DetId &id) const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
T y() const
Definition: PV3DBase.h:60
void analyze(const edm::Event &, const edm::EventSetup &) override
ResidualRefitting::storage_trackExtrap storageTrackExtrapRecNoSt3_
ResidualRefitting::storage_muon storageTrkNoTOBLayer5
GlobalPoint globalPosition() const
static const int TOB
unsigned int tidWheel(const DetId &id) const
unsigned int pxbModule(const DetId &id) const
ResidualRefitting::storage_trackExtrap storageTrackNoTIBLayer2
static const int N_MAX_STORED_HIT
ResidualRefitting::storage_trackExtrap storageTrackNoTIBLayer4
ResidualRefitting::storage_muon storageTrkNoTIBLayer2
int sector_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageGmrNoTOBLayer2
void endJob() override
void NewTrackMeasurements(edm::Handle< reco::TrackCollection > trackCollOrig, edm::Handle< reco::TrackCollection > trackColl, ResidualRefitting::storage_trackExtrap &trackExtrap)
ResidualRefitting::storage_muon storageGmrNoSt1_
int layer_[N_MAX_STORED_HIT]
int chamber_[N_MAX_STORED_HIT]
ResidualRefitting::storage_trackExtrap storageTrackNoTOBLayer6
float lpY_[N_MAX_STORED_HIT]
ResidualRefitting::storage_trackExtrap storageTrackExtrapRecNoSt1_
void trkExtrap(const DetId &detid, int iTrkLink, int iTrk, int iRec, const FreeTrajectoryState &freeTrajState, const LocalPoint &recPoint, storage_trackExtrap &storeTemp)
ResidualRefitting::storage_muon storageGmrNoTOBLayer6
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
int muonLink_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageSamNew_
static const int TEC
ResidualRefitting::storage_trackExtrap storageTrackNoTOBLayer4
float gpEta_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageTrkNoTID
ResidualRefitting::storage_trackExtrap storageTrackExtrapTracker_
ResidualRefitting::storage_trackExtrap storageTrackExtrapRec_
static const int TID
ResidualRefitting::storage_muon storageGmrNoTOBLayer4
ResidualRefitting::storage_muon storageGmrNoSt4_
edm::InputTag muonsNoStation2_
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=0)
Definition: Cylinder.h:45
ResidualRefitting::storage_trackExtrap storageTrackExtrapRecNoSt4_
ResidualRefitting::storage_trackExtrap storageTrackNoTOBLayer2
void branchMuon(ResidualRefitting::storage_muon &storageTmp, std::string branchName)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
int MatchTrackWithRecHits(reco::TrackCollection::const_iterator trackIt, edm::Handle< reco::TrackCollection > ref)
unsigned int tidSide(const DetId &id) const
float lpX_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageSamNoSt4_
int wheel_[N_MAX_STORED_HIT]
void muonInfo(ResidualRefitting::storage_muon &storeMuon, reco::TrackRef muon, int val)
ResidualRefitting::storage_trackExtrap storageTrackExtrapRecNoSt2_
T sqrt(T t)
Definition: SSEVec.h:19
ResidualRefitting::storage_muon storageTrkNoPXBLayer2
T z() const
Definition: PV3DBase.h:61
edm::InputTag muonsNoStation1_
ResidualRefitting::storage_muon storageGmrNoSt2_
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
float gpY_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageGmrNoSt3_
MuonServiceProxy * theService
ResidualRefitting::storage_muon storageGmrNoPXBLayer2
void dumpTrackExtrap(const ResidualRefitting::storage_trackExtrap &track)
ResidualRefitting(const edm::ParameterSet &)
FreeTrajectoryState freeTrajStateMuon(reco::TrackRef muon)
virtual LocalPoint localPosition() const =0
~ResidualRefitting() override
ResidualRefitting::storage_muon storageGmrOld_
ResidualRefitting::storage_muon storageTrkNoPXF
ResidualRefitting::storage_muon storageGmrNoTEC
ResidualRefitting::storage_trackExtrap trackExtrap120_
unsigned int tibModule(const DetId &id) const
unsigned int pxfModule(const DetId &id) const
unsigned int pxbLayer(const DetId &id) const
unsigned int tecModule(const DetId &id) const
edm::InputTag muonsNoStation3_
Definition: DetId.h:17
ResidualRefitting::storage_muon storageGmrNoTIBLayer3
ResidualRefitting::storage_muon storageGmrNew_
float gpX_[N_MAX_STORED_HIT]
std::string outputFileName_
ResidualRefitting::storage_muon storageGmrNoTIBLayer2
int station_[N_MAX_STORED_HIT]
edm::InputTag muonsRemake_
void cylExtrapTrkSam(int recNum, reco::TrackRef track, ResidualRefitting::storage_trackExtrap &storage, double rho)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
float gpPhi_[N_MAX_STORED_HIT]
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
static constexpr int RPC
Definition: MuonSubdetId.h:13
static const int PXF
ResidualRefitting::storage_muon storageTrkNoTIBLayer3
int ring_[N_MAX_STORED_HIT]
edm::InputTag muons_
ResidualRefitting::storage_trackExtrap storageTrackNoTID
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
ResidualRefitting::storage_muon storageTrkNoTOBLayer2
unsigned int tobModule(const DetId &id) const
ResidualRefitting::storage_trackExtrap storageTrackNoPXBLayer3
ResidualRefitting::storage_trackExtrap storageTrackNoTOBLayer5
edm::ESHandle< GlobalTrackingGeometry > trackingGeometry() const
get the tracking geometry
T eta() const
Definition: PV3DBase.h:73
ResidualRefitting::storage_muon storageSamNoSt2_
void dumpTrackHits(const ResidualRefitting::storage_trackHit &hit)
ResidualRefitting::storage_trackExtrap storageTrackNoTOBLayer3
edm::EventID id() const
Definition: EventBase.h:59
ResidualRefitting::storage_muon storageTrkNoTOBLayer1
HLT enums.
float chiSqOvrNdf_[N_MAX_STORED]
ResidualRefitting::storage_muon storageGmrNoPXBLayer3
ResidualRefitting::storage_muon storageTrkNoTEC
ResidualRefitting::storage_muon storageSamNoSt3_
T get() const
Definition: EventSetup.h:73
const GeomDet * idToDet(DetId) const override
ResidualRefitting::storage_muon storageTrkNoPXBLayer1
float gpZ_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageTrkNoTIBLayer1
ResidualRefitting::storage_muon storageGmrNoTOBLayer3
ResidualRefitting::storage_trackExtrap storageTrackNoTIBLayer1
unsigned int pxfSide(const DetId &id) const
int superLayer_[N_MAX_STORED_HIT]
ResidualRefitting::storage_event eventInfo_
ResidualRefitting::storage_hit storageRecMuon_
ResidualRefitting::storage_muon storageTrkNoTOBLayer3
edm::ESHandle< Propagator > thePropagator
void StoreTrackerRecHits(DetId detid, const TrackerTopology *tTopo, int iTrack, int iRec)
static constexpr int DT
Definition: MuonSubdetId.h:11
ResidualRefitting::storage_muon storageTrkNew_
ResidualRefitting::storage_trackExtrap storageTrackNoPXF
ResidualRefitting::storage_muon storageSamNoSt1_
#define str(s)
static constexpr int CSC
Definition: MuonSubdetId.h:12
T x() const
Definition: PV3DBase.h:59
ResidualRefitting::storage_muon storageGmrNoTOBLayer5
ResidualRefitting::storage_trackExtrap storageTrackNoTIBLayer3
T const * product() const
Definition: ESHandle.h:86
Definition: vlib.h:198
static MuonRecHitPointer specificBuild(const GeomDet *geom, const TrackingRecHit *rh)
edm::InputTag muonsNoStation4_
void beginJob() override
int system_[N_MAX_STORED_HIT]
unsigned int pxfPanel(const DetId &id) const
unsigned int pxfBlade(const DetId &id) const
ResidualRefitting::storage_trackExtrap storageTrackNoTOBLayer1
void branchTrackExtrap(ResidualRefitting::storage_trackExtrap &storageTmp, std::string branchName)
ResidualRefitting::storage_muon storageGmrNoPXF
ResidualRefitting::storage_trackExtrap storageTrackNoPXBLayer2
unsigned int tobLayer(const DetId &id) const
Definition: event.py:1
ResidualRefitting::storage_muon storageTrkNoPXBLayer3
ResidualRefitting::storage_muon storageTrkNoTIBLayer4
def exit(msg="")
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
ResidualRefitting::storage_trackExtrap samExtrap120_