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 
36 
37 
39  outputFileName_ ( cfg.getUntrackedParameter<std::string>("histoutputFile") ),
40  PropagatorSource_ ( cfg.getParameter<std::string>("propagator")),
41  muons_ ( cfg.getParameter<edm::InputTag>( "muons" ) ),
42  muonsRemake_ ( cfg.getParameter<edm::InputTag>("muonsRemake" ) ), //This Feels Misalignment
43  muonsNoStation1_ ( cfg.getParameter<edm::InputTag>("muonsNoStation1") ),
44  muonsNoStation2_ ( cfg.getParameter<edm::InputTag>("muonsNoStation2") ),
45  muonsNoStation3_ ( cfg.getParameter<edm::InputTag>("muonsNoStation3") ),
46  muonsNoStation4_ ( cfg.getParameter<edm::InputTag>("muonsNoStation4") ),
47 
48 /*
49  muonsNoPXBLayer1_ ( cfg.getParameter<edm::InputTag>("muonsNoPXBLayer1" ) ),
50  muonsNoPXBLayer2_ ( cfg.getParameter<edm::InputTag>("muonsNoPXBLayer1" ) ),
51  muonsNoPXBLayer3_ ( cfg.getParameter<edm::InputTag>("muonsNoPXBLayer1" ) ),
52 
53  muonsNoTIBLayer1_ ( cfg.getParameter<edm::InputTag>("muonsNoTIBLayer1" ) ),
54  muonsNoTIBLayer2_ ( cfg.getParameter<edm::InputTag>("muonsNoTIBLayer2" ) ),
55  muonsNoTIBLayer3_ ( cfg.getParameter<edm::InputTag>("muonsNoTIBLayer3" ) ),
56  muonsNoTIBLayer4_ ( cfg.getParameter<edm::InputTag>("muonsNoTIBLayer4" ) ),
57 
58  muonsNoTOBLayer1_ ( cfg.getParameter<edm::InputTag>("muonsNoTOBLayer1" ) ),
59  muonsNoTOBLayer2_ ( cfg.getParameter<edm::InputTag>("muonsNoTOBLayer2" ) ),
60  muonsNoTOBLayer3_ ( cfg.getParameter<edm::InputTag>("muonsNoTOBLayer3" ) ),
61  muonsNoTOBLayer4_ ( cfg.getParameter<edm::InputTag>("muonsNoTOBLayer4" ) ),
62  muonsNoTOBLayer5_ ( cfg.getParameter<edm::InputTag>("muonsNoTOBLayer5" ) ),
63  muonsNoTOBLayer6_ ( cfg.getParameter<edm::InputTag>("muonsNoTOBLayer6" ) ),*/
64  debug_ ( cfg.getUntrackedParameter<bool>("doDebug" ) ),
65  outputFile_(nullptr),
66  outputTree_(nullptr),
67  outputBranch_(nullptr),
68  theField(nullptr)
69 {
70  eventInfo_.evtNum_ = 0;
71  eventInfo_.evtNum_ = 0;
72 
73 // service parameters
74  edm::ParameterSet serviceParameters = cfg.getParameter<edm::ParameterSet>("ServiceParameters");
75 
76 // the services
77  theService = new MuonServiceProxy(serviceParameters);
78 
79 } //The constructor
80 
82 
83  if(debug_) printf("STARTING EVENT\n");
84 
85  eventInfo_.evtNum_ = (int)event.id().run();
86  eventInfo_.runNum_ = (int)event.id().event();
87 
88  // Generator Collection
89 
90 // The original muon collection that is sitting in memory
92 
98 
99 
100  event.getByLabel(muons_ , muons ); //set label to muons
101  event.getByLabel(muonsRemake_ , muonTracks);
102  event.getByLabel(muonsNoStation1_ , muonsNoSt1);
103  event.getByLabel(muonsNoStation2_ , muonsNoSt2);
104  event.getByLabel(muonsNoStation3_ , muonsNoSt3);
105  event.getByLabel(muonsNoStation4_ , muonsNoSt4);
106 
107 
108 /*
109 // std::cout<<"Muon Collection No PXB "<<std::endl;
110 //Tracker Barrel Pixel Refits
111  edm::Handle<MuonCollection> muonsNoPXBLayer1Coll;
112  event.getByLabel(muonsNoPXBLayer1_, muonsNoPXBLayer1Coll);
113  edm::Handle<MuonCollection> muonsNoPXBLayer2Coll;
114  event.getByLabel(muonsNoPXBLayer2_, muonsNoPXBLayer2Coll);
115  edm::Handle<MuonCollection> muonsNoPXBLayer3Coll;
116  event.getByLabel(muonsNoPXBLayer3_, muonsNoPXBLayer3Coll);
117 // std::cout<<"Muon Collection No TIB "<<std::endl;
118 // Tracker Inner Barrel Refits
119  edm::Handle<MuonCollection> muonsNoTIBLayer1Coll;
120  event.getByLabel(muonsNoTIBLayer1_, muonsNoTIBLayer1Coll);
121  edm::Handle<MuonCollection> muonsNoTIBLayer2Coll;
122  event.getByLabel(muonsNoTIBLayer2_, muonsNoTIBLayer2Coll);
123  edm::Handle<MuonCollection> muonsNoTIBLayer3Coll;
124  event.getByLabel(muonsNoTIBLayer3_, muonsNoTIBLayer3Coll);
125  edm::Handle<MuonCollection> muonsNoTIBLayer4Coll;
126  event.getByLabel(muonsNoTIBLayer4_, muonsNoTIBLayer4Coll);
127 
128 // std::cout<<"Muon Collection No TOB "<<std::endl;
129 
130 //Tracker outer barrel refits
131  edm::Handle<MuonCollection> muonsNoTOBLayer1Coll;
132  event.getByLabel(muonsNoTOBLayer1_, muonsNoTOBLayer1Coll);
133  edm::Handle<MuonCollection> muonsNoTOBLayer2Coll;
134  event.getByLabel(muonsNoTOBLayer2_, muonsNoTOBLayer2Coll);
135  edm::Handle<MuonCollection> muonsNoTOBLayer3Coll;
136  event.getByLabel(muonsNoTOBLayer3_, muonsNoTOBLayer3Coll);
137  edm::Handle<MuonCollection> muonsNoTOBLayer4Coll;
138  event.getByLabel(muonsNoTOBLayer4_, muonsNoTOBLayer4Coll);
139  edm::Handle<MuonCollection> muonsNoTOBLayer5Coll;
140  event.getByLabel(muonsNoTOBLayer5_, muonsNoTOBLayer5Coll);
141  edm::Handle<MuonCollection> muonsNoTOBLayer6Coll;
142  event.getByLabel(muonsNoTOBLayer6_, muonsNoTOBLayer6Coll);
143 */
144  //magnetic field information
146  edm::ESHandle<GlobalTrackingGeometry> globalTrackingGeometry;
147  eventSetup.get<IdealMagneticFieldRecord>().get(field);
148  eventSetup.get<GlobalTrackingGeometryRecord>().get(globalTrackingGeometry);
150  theField = &*field;
151 
152 
153  theService->update(eventSetup);
154 
155 //Zero storage
156  zero_storage();
157 
158 
159 //Do the Gmr Muons from the unModified Collection
160 
161 /*
162  int iGmr = 0;
163  if ( (muons->end() - muons->begin()) > 0) printf("Data Dump:: Original GMR Muons\n");
164  for ( MuonCollection::const_iterator muon = muons->begin(); muon!=muons->end(); muon++, iGmr++) {
165  if ( iGmr >= ResidualRefitting::N_MAX_STORED) break; // error checking
166  if (!debug
167 
168  dumpTrackRef(muon->combinedMuon(), "cmb");
169  dumpTrackRef(muon->standAloneMuon(), "sam");
170  dumpTrackRef(muon->track(), "trk");
171 
172 
173  }
174  storageGmrOld_.n_ = iGmr;
175  storageSamNew_.n_ = iGmr;
176 */
177 
178 //Refitted muons
179  if (debug_) printf("Data Dump:: Rebuilt GMR Muon Track With TeV refitter default\n");
180  int iGmrRemake = 0;
181  for ( reco::TrackCollection::const_iterator muon = muonTracks->begin(); muon!=muonTracks->end(); muon++, iGmrRemake++) {
182  if ( iGmrRemake >= ResidualRefitting::N_MAX_STORED) break; // error checking
183  // from TrackInfoProducer/test/TrackInfoAnalyzerExample.cc
184  reco::TrackRef trackref=reco::TrackRef(muonTracks,iGmrRemake);
185 
186  if (debug_) dumpTrackRef(trackref, "gmr");
187  muonInfo(storageGmrNew_,trackref,iGmrRemake);
188 
189  }
190  storageGmrNew_.n_ = iGmrRemake;
191 
192 
193 
194  if (debug_) printf("muons Remake");
195  if (debug_) printf("-----------------------------------------\n");
196  CollectTrackHits(muonTracks, storageTrackExtrapRec_, eventSetup);
197 
198 
199  if (true) {
200  printf("muons No Station 1");
201  printf("-----------------------------------------\n");
202  }
203  NewTrackMeasurements(muonTracks, muonsNoSt1, storageTrackExtrapRecNoSt1_);
204 
205  if (true) {
206  printf("muons No Station 2");
207  printf("-----------------------------------------\n");
208  }
209  NewTrackMeasurements(muonTracks, muonsNoSt2, storageTrackExtrapRecNoSt2_);
210 
211  if (true) {
212  printf("muons No Station 3");
213  printf("-----------------------------------------\n");
214  }
215  NewTrackMeasurements(muonTracks, muonsNoSt3, storageTrackExtrapRecNoSt3_);
216 
217  if (true) {
218  printf("muons No Station 4");
219  printf("-----------------------------------------\n");
220  }
221  NewTrackMeasurements(muonTracks, muonsNoSt4, storageTrackExtrapRecNoSt4_);
222 
223 
224 // dumpMuonRecHits(storageRecMuon_);
225 
226 /****************************************************************************************************************************************/
227 
228 
229 /*
230  * extrapolates track to a cylinder.
231  * commented for cosmic runs with no tracker in reco muons!!
232  *
233 */
234 
235 
236  int iGmrCyl = 0;
237  for (reco::MuonCollection::const_iterator muon = muons->begin(); muon != muons->end(); muon++, iGmrCyl++) {
238 
239  dumpTrackRef(muon->combinedMuon(), "cmb");
240  dumpTrackRef(muon->standAloneMuon(), "sam");
241  dumpTrackRef(muon->track(), "trk");
242 
243  cylExtrapTrkSam(iGmrCyl, muon->standAloneMuon() , samExtrap120_ , 120.);
244  cylExtrapTrkSam(iGmrCyl, muon->track() , trackExtrap120_ , 120.);
245 
246  }
247  samExtrap120_.n_ = iGmrCyl;
248  trackExtrap120_.n_ = iGmrCyl;
249 
250 
251  if (iGmrRemake > 0 || iGmrCyl > 0) {
252  outputTree_ -> Fill();
253  std::cout << "FILLING NTUPLE!" << std::endl;
254  std::cout << "Entries Recorded: " << outputTree_ -> GetEntries() << " Branch :: " << outputBranch_ -> GetEntries() << std::endl<<std::endl;
255  } else std::cout<<"no tracks -- no fill!\n"<<std::endl<<std::endl;
256 
257 // /*************************************************************************************************************/
258 // //END OF ntuple dumper
259 // //END OF ntuple dumper
260 // /***********************************************************************************************************/
261 }
262 //end Analyze() main function
263 
264 //------------------------------------------------------------------------------
265 //
266 // Destructor
267 //
269  delete outputFile_;
270  delete theService;
271 }
272 //
273 // Track Collection Analysis
274 //
277  const edm::EventSetup& eventSetup) {
278 
279  //Retrieve tracker topology from geometry
280  edm::ESHandle<TrackerTopology> tTopoHandle;
281  eventSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
282  const TrackerTopology* const tTopo = tTopoHandle.product();
283 
284  int iMuonHit = 0;
285  int iTrackHit= 0;
286  int numTracks= 0;
287 
288  for ( reco::TrackCollection::const_iterator muon = trackColl->begin(); muon!=trackColl->end(); muon++) {
289 
290  int iTrack = muon - trackColl->begin();
291  reco::TrackRef trackref=reco::TrackRef(trackColl,iTrack);
293 
294  if (debug_) dumpTrackRef(trackref, "CollectTrackHits Track");
295 
296  int iRec = 0;
297  for(auto const& rec : muon->recHits()) {
298 
299  DetId detid = rec->geographicalId();
300 
301  if (detid.det() != DetId::Muon && detid.det() != DetId::Tracker) {
302  if (debug_) printf("Rec Hit not from muon system or tracker... continuing...\n");
303  continue;
304  }
305 // numTracks++;
306 // Get Local and Global Position of Hits
307 
308  LocalPoint lp = rec->localPosition();
309  float lpX = lp.x();
310  float lpY = lp.y();
311  float lpZ = lp.z();
312 
314  theService->trackingGeometry()->idToDet(rec->geographicalId()),rec);
315 
316  GlobalPoint gp = mrhp->globalPosition();
317  float gpRecX = gp.x();
318  float gpRecY = gp.y();
319  float gpRecZ = gp.z();
320  float gpRecEta = gp.eta();
321  float gpRecPhi = gp.phi();
322 
323  if (detid.det() == DetId::Muon) {
324 
325  int systemMuon = detid.subdetId(); // 1 DT; 2 CSC; 3 RPC
326  int endcap = -999;
327  int station = -999;
328  int ring = -999;
329  int chamber = -999;
330  int layer = -999;
331  int superLayer = -999;
332  int wheel = -999;
333  int sector = -999;
334  if ( systemMuon == MuonSubdetId::CSC) {
335  CSCDetId id(detid.rawId());
336  endcap = id.endcap();
337  station = id.station();
338  ring = id.ring();
339  chamber = id.chamber();
340  layer = id.layer();
341  if (debug_)printf("CSC\t[endcap][station][ringN][chamber][layer]:[%d][%d][%d][%d][%d]\t",
342  endcap, station, ring, chamber, layer);
343 
344  }
345  else if ( systemMuon == MuonSubdetId::DT ) {
346  DTWireId id(detid.rawId());
347  station = id.station();
348  layer = id.layer();
349  superLayer = id.superLayer();
350  wheel = id.wheel();
351  sector = id.sector();
352  if (debug_) printf("DT \t[station][layer][superlayer]:[%d][%d][%d]\n", station,layer,superLayer);
353 
354  }
355  else if ( systemMuon == MuonSubdetId::RPC) {
356  RPCDetId id(detid.rawId());
357  station = id.station();
358  if (debug_) printf("RPC\t[station]:[%d]\n", station);
359  }
360 
361 
362  storageRecMuon_.muonLink_ [iMuonHit] = iTrack;
363  storageRecMuon_.system_ [iMuonHit] = systemMuon;
364  storageRecMuon_.endcap_ [iMuonHit] = endcap;
365  storageRecMuon_.station_ [iMuonHit] = station;
366  storageRecMuon_.ring_ [iMuonHit] = ring;
367  storageRecMuon_.chamber_ [iMuonHit] = chamber;
368  storageRecMuon_.layer_ [iMuonHit] = layer;
369  storageRecMuon_.superLayer_ [iMuonHit] = superLayer;
370  storageRecMuon_.wheel_ [iMuonHit] = wheel;
371  storageRecMuon_.sector_ [iMuonHit] = sector;
372 
373  storageRecMuon_.gpX_ [iMuonHit] = gpRecX;
374  storageRecMuon_.gpY_ [iMuonHit] = gpRecY;
375  storageRecMuon_.gpZ_ [iMuonHit] = gpRecZ;
376  storageRecMuon_.gpEta_ [iMuonHit] = gpRecEta;
377  storageRecMuon_.gpPhi_ [iMuonHit] = gpRecPhi;
378  storageRecMuon_.lpX_ [iMuonHit] = lpX;
379  storageRecMuon_.lpY_ [iMuonHit] = lpY;
380  storageRecMuon_.lpZ_ [iMuonHit] = lpZ;
381  iMuonHit++;
382 
383  }
384  else if (detid.det() == DetId::Tracker) {
385 
386  if (debug_) printf("Tracker\n");
387 
388  StoreTrackerRecHits(detid, tTopo, iTrack, iTrackHit);
389 
390  storageTrackHit_.gpX_ [iTrackHit] = gpRecX;
391  storageTrackHit_.gpY_ [iTrackHit] = gpRecY;
392  storageTrackHit_.gpZ_ [iTrackHit] = gpRecZ;
393  storageTrackHit_.gpEta_ [iTrackHit] = gpRecEta;
394  storageTrackHit_.gpPhi_ [iTrackHit] = gpRecPhi;
395  storageTrackHit_.lpX_ [iTrackHit] = lpX;
396  storageTrackHit_.lpY_ [iTrackHit] = lpY;
397  storageTrackHit_.lpZ_ [iTrackHit] = lpZ;
398  iTrackHit++;
399  }
400  else printf("THIS CAN NOT HAPPEN\n");
401 
402  trkExtrap(detid, numTracks, iTrack, iRec, recoStart, lp, trackExtrap);
403  numTracks++;
404 
405  if (debug_) printf("\tLocal Positon: \tx = %2.2f\ty = %2.2f\tz = %2.2f\n",lpX, lpY, lpZ);
406  if (debug_) printf("\tGlobal Position: \tx = %6.2f\ty = %6.2f\tz = %6.2f\teta = %4.2f\tphi = %3.2f\n",
407  gpRecX,gpRecY,gpRecZ,gpRecEta,gpRecPhi);
408 
409 
410  ++iRec;
411  }
412 
413  }
414 
415  storageRecMuon_ .n_ = iMuonHit;
416  storageTrackHit_.n_ = iTrackHit;
417  trackExtrap .n_ = numTracks;
418 
419 }
420 //
421 // Deal with Re-Fitted Track with some station omitted.
422 //
423 // This should take the new track, match it to its track before refitting with the hits dumped, and extrapolate out to the
424 // rec hits that were removed from the fit.
425 //
426 //
427 
430 
431  int numTracks = 0;
432  int recCounter = 0;
433 
434  for ( reco::TrackCollection::const_iterator muon = trackColl->begin(); muon!=trackColl->end(); muon++) {
435 
436  int iTrack = muon - trackColl->begin();
437 
438  reco::TrackRef trackref=reco::TrackRef(trackColl,iTrack);
440 
441  int iTrackLink = MatchTrackWithRecHits(muon,trackCollOrig);
442  reco::TrackRef ref = reco::TrackRef(trackCollOrig, iTrackLink);
443 
444  for(auto const& rec1 : ref->recHits()) {
445 
446  bool unbiasedRec = true;
447 
448  for(auto const& rec2 : muon->recHits()) {
449 
450  if (IsSameHit(*rec1,*rec2)) {
451  unbiasedRec = false;
452  break;
453  }
454  }
455  if (!unbiasedRec) continue;
456 
457  DetId detid = rec1->geographicalId();
458 
460  theService->trackingGeometry()->idToDet(rec1->geographicalId()), rec1);
461 
462  trkExtrap(detid, numTracks, iTrackLink, recCounter, recoStart, rec1->localPosition(), trackExtrap);
463  numTracks++;
464 
465  }
466 
467  }
468 
469  trackExtrap.n_ = numTracks;
470 
471 }
472 //
473 // Find the original track that corresponds to the re-fitted track
474 //
475 int ResidualRefitting::MatchTrackWithRecHits(reco::TrackCollection::const_iterator trackIt,
477 
478  if (debug_) printf("Matching a re-fitted track to the original track.\n");
479 
480  int TrackMatch = -1;
481 
482  for(auto const& rec : trackIt->recHits()) {
483 
484  bool foundMatch = false;
485  for (reco::TrackCollection::const_iterator refIt = ref->begin(); refIt!=ref->end(); refIt++) {
486 
487  int iTrackMatch = refIt - ref->begin();
488  if (foundMatch && TrackMatch !=iTrackMatch) break;
489  for(auto const& recRef : refIt->recHits()) {
490 
491  if (!IsSameHit(*rec,*recRef)) continue;
492 
493  foundMatch = true;
494  TrackMatch = iTrackMatch;
495  // printf("Rec hit match for original track %d\n", iTrackMatch);
496 
497  }
498  }
499  if (!foundMatch) {
500  printf("SOMETHING WENT WRONG! Could not match Track with original track!");
501  exit(1);
502  }
503 
504  }
505  if (debug_) printf("Rec hit match for original track %d\n", TrackMatch);
506 
507 // reco::TrackRef trackref=reco::TrackRef(ref,TrackMatch);
508  return TrackMatch;
509 }
510 /*
511 //
512 // Match two tracks to see if one is a subset of the other
513 //
514 
515 bool ResidualRefitting::TrackSubset(reco::TrackRef trackSub, reco::TrackRef trackTop) {
516 
517 
518  bool matchAll = true;
519 
520  for (trackingRecHit_iterator recSub = trackSub->recHits().begin(); recSub!=trackSub->recHits().end(); recSub++) {
521 
522  bool matchSub = false;
523 
524 
525  for (trackingRecHit_iterator recTop = trackTop->recHits().begin(); recTop!=trackTop->recHits().end(); recTop++) {
526 
527  if ( recSub == recTop ) matchSub = true;
528  if (matchSub) break;
529 
530  }
531  if (!matchSub) return false;
532 
533  }
534 
535  return matchAll;
536 
537 }
538 */
539 
540 //
541 // Check to see if the rec hits are the same
542 //
544 
545 
546  double lpx1 = hit1.localPosition().x();
547  double lpy1 = hit1.localPosition().y();
548  double lpz1 = hit1.localPosition().z();
549 
550  double lpx2 = hit2.localPosition().x();
551  double lpy2 = hit2.localPosition().y();
552  double lpz2 = hit2.localPosition().z();
553  if ( fabs( lpx1 - lpx2) > 1e-3) return false;
554 // printf("Match lpx...\n");
555  if ( fabs( lpy1 - lpy2) > 1e-3) return false;
556 // printf("Match lpy...\n");
557  if ( fabs( lpz1 - lpz2) > 1e-3) return false;
558 // printf("Match lpz...\n");
559 
560  return true;
561 
562 }
563 
564 //
565 // Store Tracker Rec Hits
566 //
567 void ResidualRefitting::StoreTrackerRecHits(DetId detid, const TrackerTopology* tTopo, int iTrack, int iRec) {
568 
569 
570  int detector = -1;
571  int subdetector = -1;
572  int blade = -1;
573  int disk = -1;
574  int ladder = -1;
575  int layer = -1;
576  int module = -1;
577  int panel = -1;
578  int ring = -1;
579  int side = -1;
580  int wheel = -1;
581 
582 //Detector Info
583 
584  detector = detid.det();
585  subdetector = detid.subdetId();
586 
587  if (detector != DetId::Tracker) {
588  std::cout<<"OMFG NOT THE TRACKER\n"<<std::endl;
589  return;
590  }
591 
592  if (debug_) std::cout<<"Tracker:: ";
593  if (subdetector == ResidualRefitting::PXB) {
594  layer = tTopo->pxbLayer(detid.rawId());
595  ladder = tTopo->pxbLadder(detid.rawId());
596  module = tTopo->pxbModule(detid.rawId());
597  if (debug_) std::cout << "PXB"
598  << "\tlayer = " << layer
599  << "\tladder = " << ladder
600  << "\tmodule = " << module;
601 
602  }
603  else if (subdetector == ResidualRefitting::PXF) {
604  side = tTopo->pxfSide(detid.rawId());
605  disk = tTopo->pxfDisk(detid.rawId());
606  blade = tTopo->pxfBlade(detid.rawId());
607  panel = tTopo->pxfPanel(detid.rawId());
608  module = tTopo->pxfModule(detid.rawId());
609  if (debug_) std::cout << "PXF"
610  << "\tside = " << side
611  << "\tdisk = " << disk
612  << "\tblade = " << blade
613  << "\tpanel = " << panel
614  << "\tmodule = " << module;
615 
616  }
617  else if (subdetector == ResidualRefitting::TIB) {
618  layer = tTopo->tibLayer(detid.rawId());
619  module = tTopo->tibModule(detid.rawId());
620  if (debug_) std::cout << "TIB"
621  << "\tlayer = " << layer
622  << "\tmodule = "<< module;
623  }
624  else if (subdetector == ResidualRefitting::TID) {
625  side = tTopo->tidSide(detid.rawId());
626  wheel = tTopo->tidWheel(detid.rawId());
627  ring = tTopo->tidRing(detid.rawId());
628  if (debug_) std::cout <<"TID"
629  << "\tside = " << side
630  << "\twheel = " << wheel
631  << "\tring = " << ring;
632 
633  }
634  else if (subdetector == ResidualRefitting::TOB) {
635  layer = tTopo->tobLayer(detid.rawId());
636  module = tTopo->tobModule(detid.rawId());
637  if (debug_) std::cout <<"TOB"
638  <<"\tlayer = " << layer
639  <<"\tmodule = " << module;
640 
641  }
642  else if (subdetector == ResidualRefitting::TEC) {
643  ring = tTopo->tecRing(detid.rawId());
644  module = tTopo->tecModule(detid.rawId());
645  if (debug_) std::cout <<"TEC"
646  << "\tring = " << ring
647  << "\tmodule = "<< module;
648  }
649 
650 
651 //Do Storage
652 
653  storageTrackHit_.muonLink_ [iRec] =iTrack ;
656  storageTrackHit_.blade_ [iRec] =blade ;
657  storageTrackHit_.disk_ [iRec] =disk ;
659  storageTrackHit_.layer_ [iRec] =layer ;
660  storageTrackHit_.module_ [iRec] =module ;
661  storageTrackHit_.panel_ [iRec] =panel ;
662  storageTrackHit_.ring_ [iRec] =ring ;
663  storageTrackHit_.side_ [iRec] =side ;
664  storageTrackHit_.wheel_ [iRec] =wheel ;
665 
666 }
667 
668 //
669 // Store Muon info on P, Pt, eta, phi
670 //
672 
673 
674  storeMuon.pt_ [val] = muon->pt();
675  storeMuon.p_ [val] = muon->p();
676  storeMuon.eta_[val] = muon->eta();
677  storeMuon.phi_[val] = muon->phi();
678  storeMuon.charge_[val] = muon->charge();
679  storeMuon.numRecHits_[val] = muon->numberOfValidHits();
680  storeMuon.chiSq_[val] = muon->chi2();
681  storeMuon.ndf_[val] = muon->ndof();
682  storeMuon.chiSqOvrNdf_[val] = muon->normalizedChi2();
683 
684 }
685 //
686 // Fill a track extrapolation
687 //
688 void ResidualRefitting::trkExtrap(const DetId& detid, int iTrk, int iTrkLink, int iRec,
689  const FreeTrajectoryState& freeTrajState,
690  const LocalPoint& recPoint,
691  storage_trackExtrap& storeTemp){
692 
693  bool dump_ = debug_;
694 
695  if (dump_) std::cout<< "In the trkExtrap function"<<std::endl;
696 
697  float gpExtrapX = -99999;
698  float gpExtrapY = -99999;
699  float gpExtrapZ = -99999;
700  float gpExtrapEta = -99999;
701  float gpExtrapPhi = -99999;
702 
703  float lpX = -99999;
704  float lpY = -99999;
705  float lpZ = -99999;
706 
707  //
708  // Get the local positions for the recHits
709  //
710 
711  float recLpX = recPoint.x();
712  float recLpY = recPoint.y();
713  float recLpZ = recPoint.z();
714 
715  float resX = -9999;
716  float resY = -9999;
717  float resZ = -9999;
718 
719  const GeomDet* gdet = theService->trackingGeometry()->idToDet(detid);
720 
721 // TrajectoryStateOnSurface surfTest = prop.propagate(freeTrajState, gdet->surface());
722  TrajectoryStateOnSurface surfTest = thePropagator->propagate(freeTrajState, gdet->surface());
723 
724  if (surfTest.isValid()) {
725 
726  GlobalPoint globTest = surfTest.globalPosition();
727  gpExtrapX = globTest.x();
728  gpExtrapY = globTest.y();
729  gpExtrapZ = globTest.z();
730  gpExtrapEta = globTest.eta();
731  gpExtrapPhi = globTest.phi();
732  LocalPoint loc = surfTest.localPosition();
733  if (detid.det() == DetId::Muon || detid.det() == DetId::Tracker) {
734  lpX = loc.x();
735  lpY = loc.y();
736  lpZ = loc.z();
737 
738  resX = lpX - recLpX;
739  resY = lpY - recLpY;
740  resZ = lpZ - recLpZ;
741 
742  }
743 
744  }
745  storeTemp.muonLink_ [iTrk] = iTrkLink ;
746  storeTemp.recLink_ [iTrk] = iRec ;
747  storeTemp.gpX_ [iTrk] = gpExtrapX ;
748  storeTemp.gpY_ [iTrk] = gpExtrapY ;
749  storeTemp.gpZ_ [iTrk] = gpExtrapZ ;
750  storeTemp.gpEta_ [iTrk] = gpExtrapEta;
751  storeTemp.gpPhi_ [iTrk] = gpExtrapPhi;
752  storeTemp.lpX_ [iTrk] = lpX ;
753  storeTemp.lpY_ [iTrk] = lpY ;
754  storeTemp.lpZ_ [iTrk] = lpZ ;
755  storeTemp.resX_ [iTrk] = resX ;
756  storeTemp.resY_ [iTrk] = resY ;
757  storeTemp.resZ_ [iTrk] = resZ ;
758 
759  printf("station: %d\tsector: %d\tresX storage: %4.2f\n", ReturnStation(detid), ReturnSector(detid), resX);
760 
761 }
762 //
763 // Return the station
764 //
766 
767  int station = -999;
768 
769  if (detid.det() == DetId::Muon) {
770 
771  int systemMuon = detid.subdetId(); // 1 DT; 2 CSC; 3 RPC
772  if ( systemMuon == MuonSubdetId::CSC) {
773  CSCDetId id(detid.rawId());
774  station = id.station();
775 
776  }
777  else if ( systemMuon == MuonSubdetId::DT ) {
778  DTWireId id(detid.rawId());
779  station = id.station();
780 
781  }
782  else if ( systemMuon == MuonSubdetId::RPC) {
783  RPCDetId id(detid.rawId());
784  station = id.station();
785  }
786 
787  }
788 
789  return station;
790 }
791 //
792 // Return the sector
793 //
795 
796  int sector = -999;
797 
798  if (detid.det() == DetId::Muon) {
799 
800  int systemMuon = detid.subdetId(); // 1 DT; 2 CSC; 3 RPC
801  if ( systemMuon == MuonSubdetId::DT ) {
802  DTWireId id(detid.rawId());
803  sector = id.sector();
804 
805  }
806 
807  }
808 
809  return sector;
810 }
811 
812 //
813 // Store the SAM and Track position info at a particular rho
814 //
816 
819 
820  Cylinder::CylinderPointer myCylinder = Cylinder::build(pos, rot, rho);
821 // SteppingHelixPropagator inwardProp ( theField, oppositeToMomentum );
822 // SteppingHelixPropagator outwardProp ( theField, alongMomentum );
823  FreeTrajectoryState recoStart = freeTrajStateMuon(track);
824 // TrajectoryStateOnSurface recoProp = outwardProp.propagate(recoStart, *myCylinder);
825  TrajectoryStateOnSurface recoProp = thePropagator->propagate(recoStart, *myCylinder);
826 
827  double xVal = -9999;
828  double yVal = -9999;
829  double zVal = -9999;
830  double phiVal = -9999;
831  double etaVal = -9999;
832 
833  if(recoProp.isValid()) {
834  GlobalPoint recoPoint = recoProp.globalPosition();
835  xVal = recoPoint.x();
836  yVal = recoPoint.y();
837  zVal = recoPoint.z();
838  phiVal = recoPoint.phi();
839  etaVal = recoPoint.eta();
840  }
841  storage.muonLink_[recNum] = recNum;
842  storage.gpX_ [recNum] = xVal;
843  storage.gpY_ [recNum] = yVal;
844  storage.gpZ_ [recNum] = zVal;
845  storage.gpEta_ [recNum] = etaVal;
846  storage.gpPhi_ [recNum] = phiVal;
847 
848  float rhoVal = sqrt( xVal*xVal + yVal*yVal);
849 
850  printf("Cylinder: rho = %4.2f\tphi = %4.2f\teta = %4.2f\n", rhoVal, phiVal, etaVal);
851  if (debug_) printf("Cylinder: rho = %4.2f\tphi = %4.2f\teta = %4.2f\n", rhoVal, phiVal, etaVal);
852 
853 
854 }
856 //Pre-Job junk
858 
859 //
860 // zero storage
861 //
863  if (debug_) printf("zero_storage\n");
864 
877 //zero out the tracker
881 
883 
888 
890 
897 
899 
903 
905 
910 
912 
919 
921 
928 
930 
932 
936 
938 
943 
950 
952 
954 
955  storageRecMuon_ .n_ = 0;
956  storageTrackHit_ .n_ = 0;
957 
958 }
959 //
960 // Zero out a muon reference
961 //
963 
964  str->n_ = 0;
965 
966  for (int i = 0; i < ResidualRefitting::N_MAX_STORED; i++) {
967 
968  str->pt_ [i] = -9999;
969  str->eta_ [i] = -9999;
970  str->p_ [i] = -9999;
971  str->phi_ [i] = -9999;
972  str->numRecHits_ [i] = -9999;
973  str->chiSq_ [i] = -9999;
974  str->ndf_ [i] = -9999;
975  str->chiSqOvrNdf_ [i] = -9999;
976  }
977 
978 }
979 //
980 // Zero track extrapolation
981 //
983 
984  str->n_ = 0;
985  for (int i = 0; i < ResidualRefitting::N_MAX_STORED_HIT; i++) {
986 
987  str->muonLink_ [i] = -9999;
988  str->recLink_ [i] = -9999;
989  str->gpX_ [i] = -9999;
990  str->gpY_ [i] = -9999;
991  str->gpZ_ [i] = -9999;
992  str->gpEta_ [i] = -9999;
993  str->gpPhi_ [i] = -9999;
994  str->lpX_ [i] = -9999;
995  str->lpY_ [i] = -9999;
996  str->lpZ_ [i] = -9999;
997  str->resX_ [i] = -9999;
998  str->resY_ [i] = -9999;
999  str->resZ_ [i] = -9999;
1000  }
1001 
1002 }
1003 //
1004 // Begin Job
1005 //
1007 
1008  std::cout<<"Creating file "<< outputFileName_.c_str()<<std::endl;
1009 
1010  outputFile_ = new TFile( outputFileName_.c_str(), "RECREATE" ) ;
1011 
1012  outputTree_ = new TTree("outputTree","outputTree");
1013 
1014  outputTree_->Branch("eventInfo",&eventInfo_,
1015  "evtNum_/I:"
1016  "runNum_/I"
1017  );
1018 
1019 
1026 
1032 
1050 
1067 
1068  outputBranch_ = outputTree_ -> Branch("recHitsNew", &storageRecMuon_,
1069 
1070  "n_/I:"
1071  "muonLink_[1000]/I:"
1072 
1073  "system_[1000]/I:"
1074  "endcap_[1000]/I:"
1075  "station_[1000]/I:"
1076  "ring_[1000]/I:"
1077  "chamber_[1000]/I:"
1078  "layer_[1000]/I:"
1079  "superLayer_[1000]/I:"
1080  "wheel_[1000]/I:"
1081  "sector_[1000]/I:"
1082 
1083 
1084  "gpX_[1000]/F:"
1085  "gpY_[1000]/F:"
1086  "gpZ_[1000]/F:"
1087  "gpEta_[1000]/F:"
1088  "gpPhi_[1000]/F:"
1089  "lpX_[1000]/F:"
1090  "lpY_[1000]/F:"
1091  "lpZ_[1000]/F"
1092  );
1093 
1094 
1095  outputBranch_ = outputTree_ -> Branch("recHitsTracker", &storageTrackHit_,
1096 
1097  "n_/I:"
1098 
1099  "muonLink_[1000]/I:"
1100  "detector_[1000]/I:"
1101  "subdetector_[1000]/I:"
1102  "blade_[1000]/I:"
1103  "disk_[1000]/I:"
1104  "ladder_[1000]/I:"
1105  "layer_[1000]/I:"
1106  "module_[1000]/I:"
1107  "panel_[1000]/I:"
1108  "ring_[1000]/I:"
1109  "side_[1000]/I:"
1110  "wheel_[1000]/I:"
1111 
1112  "gpX_[1000]/F:"
1113  "gpY_[1000]/F:"
1114  "gpZ_[1000]/F:"
1115  "gpEta_[1000]/F:"
1116  "gpPhi_[1000]/F:"
1117  "lpX_[1000]/F:"
1118  "lpY_[1000]/F:"
1119  "lpZ_[1000]/F"
1120  );
1121 
1122 
1128 
1146 
1149 
1150 }
1151 //
1152 // Set the Muon Branches
1153 //
1155 
1156  outputBranch_ = outputTree_ -> Branch(branchName.c_str(), &storageTmp,
1157  "n_/I:"
1158  "charge_[10]/I:"
1159  "pt_[10]/F:"
1160  "eta_[10]/F:"
1161  "p_[10]/F:"
1162  "phi_[10]/F:"
1163  "numRecHits_[10]/I:"
1164  "chiSq_[10]/F:"
1165  "ndf_[10]/F:"
1166  "chiSqOvrNdf_[10]/F"
1167 
1168  );
1169 
1170 }
1171 //
1172 // Set the Branches for Track Extrapolations
1173 //
1175 
1176  outputBranch_ = outputTree_ -> Branch(branchName.c_str(), &storageTmp,
1177  "n_/I:"
1178  "muonLink_[1000]/I:"
1179  "recLink_[1000]/I:"
1180  "gpX_[1000]/F:"
1181  "gpY_[1000]/F:"
1182  "gpZ_[1000]/F:"
1183  "gpEta_[1000]/F:"
1184  "gpPhi_[1000]/F:"
1185  "lpX_[1000]/F:"
1186  "lpY_[1000]/F:"
1187  "lpZ_[1000]/F:"
1188  "resX_[1000]/F:"
1189  "resY_[1000]/F:"
1190  "resZ_[1000]/F"
1191 
1192  );
1193 
1194 }
1195 //
1196 // End Job
1197 //
1199 
1200 
1201  outputFile_ -> Write();
1202 
1203  outputFile_ -> Close() ;
1204 
1205 }
1206 //
1207 // Return a Free Trajectory state for a muon track
1208 //
1210 
1211  math::XYZPoint innerPos = muon -> referencePoint();
1212  math::XYZVector innerMom = muon -> momentum();
1213  if (debug_) std::cout << "Inner Pos: "
1214  << "\tx = " << innerPos.X()
1215  << "\ty = " << innerPos.Y()
1216  << "\tz = " << innerPos.Z()
1217  << std::endl;
1218 
1219  GlobalPoint innerPoint( innerPos.X(), innerPos.Y(), innerPos.Z());
1220  GlobalVector innerVec ( innerMom.X(), innerMom.Y(), innerMom.Z());
1221 
1222  FreeTrajectoryState recoStart( innerPoint, innerVec, muon ->charge(), theField );
1223  return recoStart;
1224 
1225 }
1226 
1228 // nTuple value Dumps
1230 
1231 //
1232 // dump Track Extrapolation
1233 //
1235  std::cout<<"\n\nExtrapolation Dump:\n";
1236  for (unsigned int i = 0; i < (unsigned int)track.n_; i++) {
1237 
1238 // double rho = sqrt( (float)track.gpX_[i] * (float)track.gpX_[i] + (float)track.gpY_[i] * (float)track.gpY_[i] );
1239 
1240  printf ("%d\tmuonLink= %d",i, (int)track.muonLink_[i]);
1241  printf ("\trecLink = %d", (int)track.recLink_[i] );
1242 // printf ("\tGlobal\tx = %0.3f" , (float)track.gpX_[i] );
1243 // printf ("\ty = %0.3f" , (float)track.gpY_[i] );
1244 // printf ("\tz = %0.3f" , (float)track.gpZ_[i] );
1245 // printf ("\trho =%0.3f" , rho );
1246 // printf ("\teta = %0.3f" , (float)track.gpEta_[i] );
1247 // printf ("\tphi = %0.3f" , (float)track.gpPhi_[i] );
1248  printf ("\t\tLocal\tx = %0.3f" , (float)track.lpX_[i] );
1249  printf ("\ty = %0.3f" , (float)track.lpY_[i] );
1250  printf ("\tz = %0.3f\n" , (float)track.lpZ_[i] );
1251 
1252  }
1253 
1254 }
1255 //
1256 // dump Muon Rec Hits
1257 //
1259  std::cout<<"Muon Rec Hits Dump:\n";
1260  for (unsigned int i = 0; i < (unsigned int)hit.n_; i++) {
1261 
1262 // double rho = sqrt( (float)hit.gpX_[i] * (float)hit.gpX_[i] + (float)hit.gpY_[i] * (float)hit.gpY_[i] );
1263 
1264  printf ("%d\tsubdetector = %d\t superLayer =%d" , i, (int)hit.system_[i], (int)hit.superLayer_[i] );
1265 // printf ("\tGlobal\tx = %0.3f" , (float)hit.gpX_[i] );
1266 // printf ("\ty = %0.3f" , (float)hit.gpY_[i] );
1267 // printf ("\tz = %0.3f" , (float)hit.gpZ_[i] );
1268 // printf ("\trho =%0.3f" , rho );
1269 // printf ("\teta = %0.3f" , (float)hit.gpEta_[i] );
1270 // printf ("\tphi = %0.3f\n" , (float)hit.gpPhi_[i] );
1271  printf ("\t\tLocal\tx = %0.3f" , (float)hit.lpX_[i] );
1272  printf ("\ty = %0.3f" , (float)hit.lpY_[i] );
1273  printf ("\tz = %0.3f\n" , (float)hit.lpZ_[i] );
1274 
1275  }
1276 
1277 }
1278 //
1279 // dump Tracker Rec Hits
1280 //
1282  std::cout<<"Tracker Rec Hits Dump:\n";
1283  for (unsigned int i = 0; i < (unsigned int)hit.n_; i++) {
1284 
1285 // double rho = sqrt( (float)hit.gpX_[i] * (float)hit.gpX_[i] + (float)hit.gpY_[i] * (float)hit.gpY_[i] );
1286 
1287  printf ("%d\tsubdetector = %d" , i, (int)hit.subdetector_[i] );
1288  printf ("\tlayer = %d" , (int)hit.layer_[i] );
1289 // printf ("\tGlobal\tx = %0.3f" , (float)hit.gpX_[i] );
1290 // printf ("\ty = %0.3f" , (float)hit.gpY_[i] );
1291 // printf ("\tz = %0.3f" , (float)hit.gpZ_[i] );
1292 // printf ("\trho =%0.3f" , rho );
1293 // printf ("\teta = %0.3f" , (float)hit.gpEta_[i] );
1294 // printf ("\tphi = %0.3f\n" , (float)hit.gpPhi_[i] );
1295  printf ("\t\tLocal\tx = %0.3f" , (float)hit.lpX_[i] );
1296  printf ("\ty = %0.3f" , (float)hit.lpY_[i] );
1297  printf ("\tz = %0.3f\n" , (float)hit.lpZ_[i] );
1298 
1299  }
1300 
1301 }
1302 //
1303 //Dump a TrackRef
1304 //
1306 
1307  float pt = muon->pt();
1308  float p = muon->p ();
1309  float eta = muon->eta();
1310  float phi = muon->phi();
1311  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);
1312 
1313 }
1314 
1316 
1317 
1319 //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:39
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:41
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:69
unsigned int pxbLadder(const DetId &id) const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
T y() const
Definition: PV3DBase.h:63
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:42
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:51
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_
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
T sqrt(T t)
Definition: SSEVec.h:18
ResidualRefitting::storage_muon storageTrkNoPXBLayer2
T z() const
Definition: PV3DBase.h:64
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:41
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:18
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:30
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:21
static constexpr int RPC
Definition: MuonSubdetId.h:14
static const int PXF
ResidualRefitting::storage_muon storageTrkNoTIBLayer3
edm::InputTag muons_
ResidualRefitting::storage_trackExtrap storageTrackNoTID
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:53
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:76
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:71
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:12
ResidualRefitting::storage_muon storageTrkNew_
ResidualRefitting::storage_trackExtrap storageTrackNoPXF
ResidualRefitting::storage_muon storageSamNoSt1_
#define str(s)
static constexpr int CSC
Definition: MuonSubdetId.h:13
T x() const
Definition: PV3DBase.h:62
ResidualRefitting::storage_muon storageGmrNoTOBLayer5
ResidualRefitting::storage_trackExtrap storageTrackNoTIBLayer3
T const * product() const
Definition: ESHandle.h:86
Definition: vlib.h:208
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
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39
ResidualRefitting::storage_trackExtrap samExtrap120_