CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ResidualRefitting.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include "ResidualRefitting.h"
3 #include <iomanip>
4 
5 //framework includes
17 
18 
25 
29 
33 
35 
39 
41 
42 
43 
45  outputFileName_ ( cfg.getUntrackedParameter<std::string>("histoutputFile") ),
46  PropagatorSource_ ( cfg.getParameter<std::string>("propagator")),
47  muons_ ( cfg.getParameter<edm::InputTag>( "muons" ) ),
48  muonsRemake_ ( cfg.getParameter<edm::InputTag>("muonsRemake" ) ), //This Feels Misalignment
49  muonsNoStation1_ ( cfg.getParameter<edm::InputTag>("muonsNoStation1") ),
50  muonsNoStation2_ ( cfg.getParameter<edm::InputTag>("muonsNoStation2") ),
51  muonsNoStation3_ ( cfg.getParameter<edm::InputTag>("muonsNoStation3") ),
52  muonsNoStation4_ ( cfg.getParameter<edm::InputTag>("muonsNoStation4") ),
53 
54 /*
55  muonsNoPXBLayer1_ ( cfg.getParameter<edm::InputTag>("muonsNoPXBLayer1" ) ),
56  muonsNoPXBLayer2_ ( cfg.getParameter<edm::InputTag>("muonsNoPXBLayer1" ) ),
57  muonsNoPXBLayer3_ ( cfg.getParameter<edm::InputTag>("muonsNoPXBLayer1" ) ),
58 
59  muonsNoTIBLayer1_ ( cfg.getParameter<edm::InputTag>("muonsNoTIBLayer1" ) ),
60  muonsNoTIBLayer2_ ( cfg.getParameter<edm::InputTag>("muonsNoTIBLayer2" ) ),
61  muonsNoTIBLayer3_ ( cfg.getParameter<edm::InputTag>("muonsNoTIBLayer3" ) ),
62  muonsNoTIBLayer4_ ( cfg.getParameter<edm::InputTag>("muonsNoTIBLayer4" ) ),
63 
64  muonsNoTOBLayer1_ ( cfg.getParameter<edm::InputTag>("muonsNoTOBLayer1" ) ),
65  muonsNoTOBLayer2_ ( cfg.getParameter<edm::InputTag>("muonsNoTOBLayer2" ) ),
66  muonsNoTOBLayer3_ ( cfg.getParameter<edm::InputTag>("muonsNoTOBLayer3" ) ),
67  muonsNoTOBLayer4_ ( cfg.getParameter<edm::InputTag>("muonsNoTOBLayer4" ) ),
68  muonsNoTOBLayer5_ ( cfg.getParameter<edm::InputTag>("muonsNoTOBLayer5" ) ),
69  muonsNoTOBLayer6_ ( cfg.getParameter<edm::InputTag>("muonsNoTOBLayer6" ) ),*/
70  debug_ ( cfg.getUntrackedParameter<bool>("doDebug" ) )
71 {
72 // service parameters
73  edm::ParameterSet serviceParameters = cfg.getParameter<edm::ParameterSet>("ServiceParameters");
74 
75 // the services
76  theService = new MuonServiceProxy(serviceParameters);
77 
78 } //The constructor
79 
81 
82  if(debug_) printf("STARTING EVENT\n");
83 
84  eventInfo_.evtNum_ = (int)event.id().run();
85  eventInfo_.runNum_ = (int)event.id().event();
86 
87  // Generator Collection
88 
89 // The original muon collection that is sitting in memory
91 
97 
98 
99  event.getByLabel(muons_ , muons ); //set label to muons
100  event.getByLabel(muonsRemake_ , muonTracks);
101  event.getByLabel(muonsNoStation1_ , muonsNoSt1);
102  event.getByLabel(muonsNoStation2_ , muonsNoSt2);
103  event.getByLabel(muonsNoStation3_ , muonsNoSt3);
104  event.getByLabel(muonsNoStation4_ , muonsNoSt4);
105 
106 
107 /*
108 // std::cout<<"Muon Collection No PXB "<<std::endl;
109 //Tracker Barrel Pixel Refits
110  edm::Handle<MuonCollection> muonsNoPXBLayer1Coll;
111  event.getByLabel(muonsNoPXBLayer1_, muonsNoPXBLayer1Coll);
112  edm::Handle<MuonCollection> muonsNoPXBLayer2Coll;
113  event.getByLabel(muonsNoPXBLayer2_, muonsNoPXBLayer2Coll);
114  edm::Handle<MuonCollection> muonsNoPXBLayer3Coll;
115  event.getByLabel(muonsNoPXBLayer3_, muonsNoPXBLayer3Coll);
116 // std::cout<<"Muon Collection No TIB "<<std::endl;
117 // Tracker Inner Barrel Refits
118  edm::Handle<MuonCollection> muonsNoTIBLayer1Coll;
119  event.getByLabel(muonsNoTIBLayer1_, muonsNoTIBLayer1Coll);
120  edm::Handle<MuonCollection> muonsNoTIBLayer2Coll;
121  event.getByLabel(muonsNoTIBLayer2_, muonsNoTIBLayer2Coll);
122  edm::Handle<MuonCollection> muonsNoTIBLayer3Coll;
123  event.getByLabel(muonsNoTIBLayer3_, muonsNoTIBLayer3Coll);
124  edm::Handle<MuonCollection> muonsNoTIBLayer4Coll;
125  event.getByLabel(muonsNoTIBLayer4_, muonsNoTIBLayer4Coll);
126 
127 // std::cout<<"Muon Collection No TOB "<<std::endl;
128 
129 //Tracker outer barrel refits
130  edm::Handle<MuonCollection> muonsNoTOBLayer1Coll;
131  event.getByLabel(muonsNoTOBLayer1_, muonsNoTOBLayer1Coll);
132  edm::Handle<MuonCollection> muonsNoTOBLayer2Coll;
133  event.getByLabel(muonsNoTOBLayer2_, muonsNoTOBLayer2Coll);
134  edm::Handle<MuonCollection> muonsNoTOBLayer3Coll;
135  event.getByLabel(muonsNoTOBLayer3_, muonsNoTOBLayer3Coll);
136  edm::Handle<MuonCollection> muonsNoTOBLayer4Coll;
137  event.getByLabel(muonsNoTOBLayer4_, muonsNoTOBLayer4Coll);
138  edm::Handle<MuonCollection> muonsNoTOBLayer5Coll;
139  event.getByLabel(muonsNoTOBLayer5_, muonsNoTOBLayer5Coll);
140  edm::Handle<MuonCollection> muonsNoTOBLayer6Coll;
141  event.getByLabel(muonsNoTOBLayer6_, muonsNoTOBLayer6Coll);
142 */
143  //magnetic field information
145  edm::ESHandle<GlobalTrackingGeometry> globalTrackingGeometry;
146  eventSetup.get<IdealMagneticFieldRecord>().get(field);
147  eventSetup.get<GlobalTrackingGeometryRecord>().get(globalTrackingGeometry);
149  theField = &*field;
150 
151 
152  theService->update(eventSetup);
153 
154 //Zero storage
155  zero_storage();
156 
157 
158 //Do the Gmr Muons from the unModified Collection
159 
160 /*
161  int iGmr = 0;
162  if ( (muons->end() - muons->begin()) > 0) printf("Data Dump:: Original GMR Muons\n");
163  for ( MuonCollection::const_iterator muon = muons->begin(); muon!=muons->end(); muon++, iGmr++) {
164  if ( iGmr >= ResidualRefitting::N_MAX_STORED) break; // error checking
165  if (!debug
166 
167  dumpTrackRef(muon->combinedMuon(), "cmb");
168  dumpTrackRef(muon->standAloneMuon(), "sam");
169  dumpTrackRef(muon->track(), "trk");
170 
171 
172  }
173  storageGmrOld_.n_ = iGmr;
174  storageSamNew_.n_ = iGmr;
175 */
176 
177 //Refitted muons
178  if (debug_) printf("Data Dump:: Rebuilt GMR Muon Track With TeV refitter default\n");
179  int iGmrRemake = 0;
180  for ( reco::TrackCollection::const_iterator muon = muonTracks->begin(); muon!=muonTracks->end(); muon++, iGmrRemake++) {
181  if ( iGmrRemake >= ResidualRefitting::N_MAX_STORED) break; // error checking
182  // from TrackInfoProducer/test/TrackInfoAnalyzerExample.cc
183  reco::TrackRef trackref=reco::TrackRef(muonTracks,iGmrRemake);
184 
185  if (debug_) dumpTrackRef(trackref, "gmr");
186  muonInfo(storageGmrNew_,trackref,iGmrRemake);
187 
188  }
189  storageGmrNew_.n_ = iGmrRemake;
190 
191 
192 
193  if (debug_) printf("muons Remake");
194  if (debug_) printf("-----------------------------------------\n");
196 
197 
198  if (true) {
199  printf("muons No Station 1");
200  printf("-----------------------------------------\n");
201  }
202  NewTrackMeasurements(muonTracks, muonsNoSt1, storageTrackExtrapRecNoSt1_);
203 
204  if (true) {
205  printf("muons No Station 2");
206  printf("-----------------------------------------\n");
207  }
208  NewTrackMeasurements(muonTracks, muonsNoSt2, storageTrackExtrapRecNoSt2_);
209 
210  if (true) {
211  printf("muons No Station 3");
212  printf("-----------------------------------------\n");
213  }
214  NewTrackMeasurements(muonTracks, muonsNoSt3, storageTrackExtrapRecNoSt3_);
215 
216  if (true) {
217  printf("muons No Station 4");
218  printf("-----------------------------------------\n");
219  }
220  NewTrackMeasurements(muonTracks, muonsNoSt4, storageTrackExtrapRecNoSt4_);
221 
222 
223 // dumpMuonRecHits(storageRecMuon_);
224 
225 /****************************************************************************************************************************************/
226 
227 
228 /*
229  * extrapolates track to a cylinder.
230  * commented for cosmic runs with no tracker in reco muons!!
231  *
232 */
233 
234 
235  int iGmrCyl = 0;
236  for (reco::MuonCollection::const_iterator muon = muons->begin(); muon != muons->end(); muon++, iGmrCyl++) {
237 
238  dumpTrackRef(muon->combinedMuon(), "cmb");
239  dumpTrackRef(muon->standAloneMuon(), "sam");
240  dumpTrackRef(muon->track(), "trk");
241 
242  cylExtrapTrkSam(iGmrCyl, muon->standAloneMuon() , samExtrap120_ , 120.);
243  cylExtrapTrkSam(iGmrCyl, muon->track() , trackExtrap120_ , 120.);
244 
245  }
246  samExtrap120_.n_ = iGmrCyl;
247  trackExtrap120_.n_ = iGmrCyl;
248 
249 
250  if (iGmrRemake > 0 || iGmrCyl > 0) {
251  outputTree_ -> Fill();
252  std::cout << "FILLING NTUPLE!" << std::endl;
253  std::cout << "Entries Recorded: " << outputTree_ -> GetEntries() << " Branch :: " << outputBranch_ -> GetEntries() << std::endl<<std::endl;
254  } else std::cout<<"no tracks -- no fill!\n"<<std::endl<<std::endl;
255 
256 // /*************************************************************************************************************/
257 // //END OF ntuple dumper
258 // //END OF ntuple dumper
259 // /***********************************************************************************************************/
260 }
261 //end Analyze() main function
262 
263 //------------------------------------------------------------------------------
264 //
265 // Destructor
266 //
268  delete outputFile_;
269 }
270 //
271 // Track Collection Analysis
272 //
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 
281  int iTrack = muon - trackColl->begin();
282  reco::TrackRef trackref=reco::TrackRef(trackColl,iTrack);
284 
285  if (debug_) dumpTrackRef(trackref, "CollectTrackHits Track");
286 
287  for (trackingRecHit_iterator rec = muon->recHitsBegin(); rec != muon->recHitsEnd(); rec++) {
288 
289  int iRec = rec - muon->recHitsBegin();
290  DetId detid = (*rec)->geographicalId();
291 
292  if (detid.det() != DetId::Muon && detid.det() != DetId::Tracker) {
293  if (debug_) 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  MuonTransientTrackingRecHit::specificBuild(theService->trackingGeometry()->idToDet((**rec).geographicalId())
306  ,&(**rec));
307 
308  GlobalPoint gp = mrhp->globalPosition();
309  float gpRecX = gp.x();
310  float gpRecY = gp.y();
311  float gpRecZ = gp.z();
312  float gpRecEta = gp.eta();
313  float gpRecPhi = gp.phi();
314 
315  if (detid.det() == DetId::Muon) {
316 
317  int systemMuon = detid.subdetId(); // 1 DT; 2 CSC; 3 RPC
318  int endcap = -999;
319  int station = -999;
320  int ring = -999;
321  int chamber = -999;
322  int layer = -999;
323  int superLayer = -999;
324  int wheel = -999;
325  int sector = -999;
326  if ( systemMuon == MuonSubdetId::CSC) {
327  CSCDetId id(detid.rawId());
328  endcap = id.endcap();
329  station = id.station();
330  ring = id.ring();
331  chamber = id.chamber();
332  layer = id.layer();
333  if (debug_)printf("CSC\t[endcap][station][ringN][chamber][layer]:[%d][%d][%d][%d][%d]\t",
334  endcap, station, ring, chamber, layer);
335 
336  }
337  else if ( systemMuon == MuonSubdetId::DT ) {
338  DTWireId id(detid.rawId());
339  station = id.station();
340  layer = id.layer();
341  superLayer = id.superLayer();
342  wheel = id.wheel();
343  sector = id.sector();
344  if (debug_) printf("DT \t[station][layer][superlayer]:[%d][%d][%d]\n", station,layer,superLayer);
345 
346  }
347  else if ( systemMuon == MuonSubdetId::RPC) {
348  RPCDetId id(detid.rawId());
349  station = id.station();
350  if (debug_) printf("RPC\t[station]:[%d]\n", station);
351  }
352 
353 
354  storageRecMuon_.muonLink_ [iMuonHit] = iTrack;
355  storageRecMuon_.system_ [iMuonHit] = systemMuon;
356  storageRecMuon_.endcap_ [iMuonHit] = endcap;
357  storageRecMuon_.station_ [iMuonHit] = station;
358  storageRecMuon_.ring_ [iMuonHit] = ring;
359  storageRecMuon_.chamber_ [iMuonHit] = chamber;
360  storageRecMuon_.layer_ [iMuonHit] = layer;
361  storageRecMuon_.superLayer_ [iMuonHit] = superLayer;
362  storageRecMuon_.wheel_ [iMuonHit] = wheel;
363  storageRecMuon_.sector_ [iMuonHit] = sector;
364 
365  storageRecMuon_.gpX_ [iMuonHit] = gpRecX;
366  storageRecMuon_.gpY_ [iMuonHit] = gpRecY;
367  storageRecMuon_.gpZ_ [iMuonHit] = gpRecZ;
368  storageRecMuon_.gpEta_ [iMuonHit] = gpRecEta;
369  storageRecMuon_.gpPhi_ [iMuonHit] = gpRecPhi;
370  storageRecMuon_.lpX_ [iMuonHit] = lpX;
371  storageRecMuon_.lpY_ [iMuonHit] = lpY;
372  storageRecMuon_.lpZ_ [iMuonHit] = lpZ;
373  iMuonHit++;
374 
375  }
376  else if (detid.det() == DetId::Tracker) {
377 
378  if (debug_) printf("Tracker\n");
379 
380  StoreTrackerRecHits(detid, iTrack, iTrackHit);
381 
382  storageTrackHit_.gpX_ [iTrackHit] = gpRecX;
383  storageTrackHit_.gpY_ [iTrackHit] = gpRecY;
384  storageTrackHit_.gpZ_ [iTrackHit] = gpRecZ;
385  storageTrackHit_.gpEta_ [iTrackHit] = gpRecEta;
386  storageTrackHit_.gpPhi_ [iTrackHit] = gpRecPhi;
387  storageTrackHit_.lpX_ [iTrackHit] = lpX;
388  storageTrackHit_.lpY_ [iTrackHit] = lpY;
389  storageTrackHit_.lpZ_ [iTrackHit] = lpZ;
390  iTrackHit++;
391  }
392  else printf("THIS CAN NOT HAPPEN\n");
393 
394  trkExtrap(detid, numTracks, iTrack, iRec, recoStart, lp, trackExtrap);
395  numTracks++;
396 
397  if (debug_) printf("\tLocal Positon: \tx = %2.2f\ty = %2.2f\tz = %2.2f\n",lpX, lpY, lpZ);
398  if (debug_) printf("\tGlobal Position: \tx = %6.2f\ty = %6.2f\tz = %6.2f\teta = %4.2f\tphi = %3.2f\n",
399  gpRecX,gpRecY,gpRecZ,gpRecEta,gpRecPhi);
400 
401 
402  }
403 
404  }
405 
406  storageRecMuon_ .n_ = iMuonHit;
407  storageTrackHit_.n_ = iTrackHit;
408  trackExtrap .n_ = numTracks;
409 
410 }
411 //
412 // Deal with Re-Fitted Track with some station omitted.
413 //
414 // This should take the new track, match it to its track before refitting with the hits dumped, and extrapolate out to the
415 // rec hits that were removed from the fit.
416 //
417 //
418 
421 
422  int numTracks = 0;
423  int recCounter = 0;
424 
425  for ( reco::TrackCollection::const_iterator muon = trackColl->begin(); muon!=trackColl->end(); muon++) {
426 
427  int iTrack = muon - trackColl->begin();
428 
429  reco::TrackRef trackref=reco::TrackRef(trackColl,iTrack);
431 
432  int iTrackLink = MatchTrackWithRecHits(muon,trackCollOrig);
433  reco::TrackRef ref = reco::TrackRef(trackCollOrig, iTrackLink);
434 
435  for (trackingRecHit_iterator rec1 = ref->recHitsBegin(); rec1!= ref->recHitsEnd(); rec1++, recCounter++) {
436 
437  //int iRec = rec1 - ref->recHitsBegin();
438 
439  bool unbiasedRec = true;
440 
441  for ( trackingRecHit_iterator rec2 = muon->recHitsBegin(); rec2!=muon->recHitsEnd();rec2++) {
442 
443  if (IsSameHit(rec1,rec2)) {
444  unbiasedRec = false;
445  break;
446  }
447  }
448  if (!unbiasedRec) continue;
449 
450  DetId detid = (*rec1)->geographicalId();
451 
453  MuonTransientTrackingRecHit::specificBuild(theService->trackingGeometry()->idToDet((**rec1).geographicalId())
454  ,&(**rec1));
455 
456  trkExtrap(detid, numTracks, iTrackLink, recCounter, recoStart, (*rec1)->localPosition(), trackExtrap);
457  numTracks++;
458 
459  }
460 
461  }
462 
463  trackExtrap.n_ = numTracks;
464 
465 }
466 //
467 // Find the original track that corresponds to the re-fitted track
468 //
469 int ResidualRefitting::MatchTrackWithRecHits(reco::TrackCollection::const_iterator trackIt,
471 
472  if (debug_) printf("Matching a re-fitted track to the original track.\n");
473 
474  int TrackMatch = -1;
475 
476  for (trackingRecHit_iterator rec = trackIt->recHitsBegin(); rec!=trackIt->recHitsEnd(); rec++) {
477 
478  bool foundMatch = false;
479  for (reco::TrackCollection::const_iterator refIt = ref->begin(); refIt!=ref->end(); refIt++) {
480 
481  int iTrackMatch = refIt - ref->begin();
482  if (foundMatch && TrackMatch !=iTrackMatch) break;
483  for (trackingRecHit_iterator recRef = refIt->recHitsBegin(); recRef!=refIt->recHitsEnd(); recRef++) {
484 
485  if (!IsSameHit(rec,recRef)) continue;
486 
487  foundMatch = true;
488  TrackMatch = iTrackMatch;
489  // printf("Rec hit match for original track %d\n", iTrackMatch);
490 
491  }
492  }
493  if (!foundMatch) {
494  printf("SOMETHING WENT WRONG! Could not match Track with original track!");
495  exit(1);
496  }
497 
498  }
499  if (debug_) printf("Rec hit match for original track %d\n", TrackMatch);
500 
501 // reco::TrackRef trackref=reco::TrackRef(ref,TrackMatch);
502  return TrackMatch;
503 }
504 /*
505 //
506 // Match two tracks to see if one is a subset of the other
507 //
508 
509 bool ResidualRefitting::TrackSubset(reco::TrackRef trackSub, reco::TrackRef trackTop) {
510 
511 
512  bool matchAll = true;
513 
514  for (trackingRecHit_iterator recSub = trackSub->recHitsBegin(); recSub!=trackSub->recHitsEnd(); recSub++) {
515 
516  bool matchSub = false;
517 
518 
519  for (trackingRecHit_iterator recTop = trackTop->recHitsBegin(); recTop!=trackTop->recHitsEnd(); recTop++) {
520 
521  if ( recSub == recTop ) matchSub = true;
522  if (matchSub) break;
523 
524  }
525  if (!matchSub) return false;
526 
527  }
528 
529  return matchAll;
530 
531 }
532 */
533 
534 //
535 // Check to see if the rec hits are the same
536 //
538 
539 
540  double lpx1 = (*hit1)->localPosition().x();
541  double lpy1 = (*hit1)->localPosition().y();
542  double lpz1 = (*hit1)->localPosition().z();
543 
544  double lpx2 = (*hit2)->localPosition().x();
545  double lpy2 = (*hit2)->localPosition().y();
546  double lpz2 = (*hit2)->localPosition().z();
547  if ( fabs( lpx1 - lpx2) > 1e-3) return false;
548 // printf("Match lpx...\n");
549  if ( fabs( lpy1 - lpy2) > 1e-3) return false;
550 // printf("Match lpy...\n");
551  if ( fabs( lpz1 - lpz2) > 1e-3) return false;
552 // printf("Match lpz...\n");
553 
554  return true;
555 
556 }
557 
558 //
559 // Store Tracker Rec Hits
560 //
562 
563 
564  int detector = -1;
565  int subdetector = -1;
566  int blade = -1;
567  int disk = -1;
568  int ladder = -1;
569  int layer = -1;
570  int module = -1;
571  int panel = -1;
572  int ring = -1;
573  int side = -1;
574  int wheel = -1;
575 
576 //Detector Info
577 
578  detector = detid.det();
579  subdetector = detid.subdetId();
580 
581  if (detector != DetId::Tracker) {
582  std::cout<<"OMFG NOT THE TRACKER\n"<<std::endl;
583  return;
584  }
585 
586  if (debug_) std::cout<<"Tracker:: ";
587  if (subdetector == ResidualRefitting::PXB) {
588  PXBDetId id(detid.rawId());
589  layer = id.layer();
590  ladder = id.ladder();
591  module = id.module();
592  if (debug_) std::cout << "PXB"
593  << "\tlayer = " << layer
594  << "\tladder = " << ladder
595  << "\tmodule = " << module;
596 
597  }
598  else if (subdetector == ResidualRefitting::PXF) {
599  PXFDetId id(detid.rawId());
600  side = id.side();
601  disk = id.disk();
602  blade = id.blade();
603  panel = id.panel();
604  module = id.module();
605  if (debug_) std::cout << "PXF"
606  << "\tside = " << side
607  << "\tdisk = " << disk
608  << "\tblade = " << blade
609  << "\tpanel = " << panel
610  << "\tmodule = " << module;
611 
612  }
613  else if (subdetector == ResidualRefitting::TIB) {
614  TIBDetId id(detid.rawId());
615  layer = id.layer();
616  module = id.module();
617  if (debug_) std::cout << "TIB"
618  << "\tlayer = " << layer
619  << "\tmodule = "<< module;
620  }
621  else if (subdetector == ResidualRefitting::TID) {
622  TIDDetId id(detid.rawId());
623  side = id.side();
624  wheel = id.wheel();
625  ring = id.ring();
626  if (debug_) std::cout <<"TID"
627  << "\tside = " << side
628  << "\twheel = " << wheel
629  << "\tring = " << ring;
630 
631  }
632  else if (subdetector == ResidualRefitting::TOB) {
633  TOBDetId id(detid.rawId());
634  layer = id.layer();
635  module = id.module();
636  if (debug_) std::cout <<"TOB"
637  <<"\tlayer = " << layer
638  <<"\tmodule = " << module;
639 
640  }
641  else if (subdetector == ResidualRefitting::TEC) {
642  TECDetId id(detid.rawId());
643  ring = id.ring();
644  module = id.module();
645  if (debug_) std::cout <<"TEC"
646  << "\tring = " << ring
647  << "\tmodule = "<< module;
648  }
649 
650 
651 //Do Storage
652 
653  storageTrackHit_.muonLink_ [iRec] =iTrack ;
655  storageTrackHit_.subdetector_ [iRec] =subdetector ;
656  storageTrackHit_.blade_ [iRec] =blade ;
657  storageTrackHit_.disk_ [iRec] =disk ;
658  storageTrackHit_.ladder_ [iRec] =ladder ;
659  storageTrackHit_.layer_ [iRec] =layer ;
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(DetId detid, int iTrk, int iTrkLink, int iRec,
689  FreeTrajectoryState freeTrajState,
690  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 endcap = -999;
768  int station = -999;
769  int ring = -999;
770  int chamber = -999;
771  int layer = -999;
772  int superLayer = -999;
773  int wheel = -999;
774  int sector = -999;
775 
776  if (detid.det() == DetId::Muon) {
777 
778  int systemMuon = detid.subdetId(); // 1 DT; 2 CSC; 3 RPC
779  if ( systemMuon == MuonSubdetId::CSC) {
780  CSCDetId id(detid.rawId());
781  endcap = id.endcap();
782  station = id.station();
783  ring = id.ring();
784  chamber = id.chamber();
785  layer = id.layer();
786 
787  }
788  else if ( systemMuon == MuonSubdetId::DT ) {
789  DTWireId id(detid.rawId());
790  station = id.station();
791  layer = id.layer();
792  superLayer = id.superLayer();
793  wheel = id.wheel();
794  sector = id.sector();
795 
796  }
797  else if ( systemMuon == MuonSubdetId::RPC) {
798  RPCDetId id(detid.rawId());
799  station = id.station();
800  }
801 
802  }
803 
804  return station;
805 }
806 //
807 // Return the sector
808 //
810 
811  int endcap = -999;
812  int station = -999;
813  int ring = -999;
814  int chamber = -999;
815  int layer = -999;
816  int superLayer = -999;
817  int wheel = -999;
818  int sector = -999;
819 
820  if (detid.det() == DetId::Muon) {
821 
822  int systemMuon = detid.subdetId(); // 1 DT; 2 CSC; 3 RPC
823  if ( systemMuon == MuonSubdetId::CSC) {
824  CSCDetId id(detid.rawId());
825  endcap = id.endcap();
826  station = id.station();
827  ring = id.ring();
828  chamber = id.chamber();
829  layer = id.layer();
830 
831  }
832  else if ( systemMuon == MuonSubdetId::DT ) {
833  DTWireId id(detid.rawId());
834  station = id.station();
835  layer = id.layer();
836  superLayer = id.superLayer();
837  wheel = id.wheel();
838  sector = id.sector();
839 
840  }
841  else if ( systemMuon == MuonSubdetId::RPC) {
842  RPCDetId id(detid.rawId());
843  station = id.station();
844  }
845 
846  }
847 
848  return sector;
849 }
850 
851 //
852 // Store the SAM and Track position info at a particular rho
853 //
855 
858 
859  Cylinder::CylinderPointer myCylinder = Cylinder::build(pos, rot, rho);
860 // SteppingHelixPropagator inwardProp ( theField, oppositeToMomentum );
861 // SteppingHelixPropagator outwardProp ( theField, alongMomentum );
862  FreeTrajectoryState recoStart = freeTrajStateMuon(track);
863 // TrajectoryStateOnSurface recoProp = outwardProp.propagate(recoStart, *myCylinder);
864  TrajectoryStateOnSurface recoProp = thePropagator->propagate(recoStart, *myCylinder);
865 
866  double xVal = -9999;
867  double yVal = -9999;
868  double zVal = -9999;
869  double phiVal = -9999;
870  double etaVal = -9999;
871 
872  if(recoProp.isValid()) {
873  GlobalPoint recoPoint = recoProp.globalPosition();
874  xVal = recoPoint.x();
875  yVal = recoPoint.y();
876  zVal = recoPoint.z();
877  phiVal = recoPoint.phi();
878  etaVal = recoPoint.eta();
879  }
880  storage.muonLink_[recNum] = recNum;
881  storage.gpX_ [recNum] = xVal;
882  storage.gpY_ [recNum] = yVal;
883  storage.gpZ_ [recNum] = zVal;
884  storage.gpEta_ [recNum] = etaVal;
885  storage.gpPhi_ [recNum] = phiVal;
886 
887  float rhoVal = sqrt( xVal*xVal + yVal*yVal);
888 
889  printf("Cylinder: rho = %4.2f\tphi = %4.2f\teta = %4.2f\n", rhoVal, phiVal, etaVal);
890  if (debug_) printf("Cylinder: rho = %4.2f\tphi = %4.2f\teta = %4.2f\n", rhoVal, phiVal, etaVal);
891 
892 
893 }
895 //Pre-Job junk
897 
898 //
899 // zero storage
900 //
902  if (debug_) printf("zero_storage\n");
903 
916 //zero out the tracker
920 
922 
927 
929 
936 
938 
942 
944 
949 
951 
958 
960 
967 
969 
971 
975 
977 
982 
989 
991 
993 
994  storageRecMuon_ .n_ = 0;
995  storageTrackHit_ .n_ = 0;
996 
997 }
998 //
999 // Zero out a muon reference
1000 //
1002 
1003  str->n_ = 0;
1004 
1005  for (int i = 0; i < ResidualRefitting::N_MAX_STORED; i++) {
1006 
1007  str->pt_ [i] = -9999;
1008  str->eta_ [i] = -9999;
1009  str->p_ [i] = -9999;
1010  str->phi_ [i] = -9999;
1011  str->numRecHits_ [i] = -9999;
1012  str->chiSq_ [i] = -9999;
1013  str->ndf_ [i] = -9999;
1014  str->chiSqOvrNdf_ [i] = -9999;
1015  }
1016 
1017 }
1018 //
1019 // Zero track extrapolation
1020 //
1022 
1023  str->n_ = 0;
1024  for (int i = 0; i < ResidualRefitting::N_MAX_STORED_HIT; i++) {
1025 
1026  str->muonLink_ [i] = -9999;
1027  str->recLink_ [i] = -9999;
1028  str->gpX_ [i] = -9999;
1029  str->gpY_ [i] = -9999;
1030  str->gpZ_ [i] = -9999;
1031  str->gpEta_ [i] = -9999;
1032  str->gpPhi_ [i] = -9999;
1033  str->lpX_ [i] = -9999;
1034  str->lpY_ [i] = -9999;
1035  str->lpZ_ [i] = -9999;
1036  str->resX_ [i] = -9999;
1037  str->resY_ [i] = -9999;
1038  str->resZ_ [i] = -9999;
1039  }
1040 
1041 }
1042 //
1043 // Begin Job
1044 //
1046 
1047  std::cout<<"Creating file "<< outputFileName_.c_str()<<std::endl;
1048 
1049  outputFile_ = new TFile( outputFileName_.c_str(), "RECREATE" ) ;
1050 
1051  outputTree_ = new TTree("outputTree","outputTree");
1052 
1053  outputTree_->Branch("eventInfo",&eventInfo_,
1054  "evtNum_/I:"
1055  "runNum_/I"
1056  );
1057 
1058 
1065 
1071 
1089 
1106 
1107  outputBranch_ = outputTree_ -> Branch("recHitsNew", &storageRecMuon_,
1108 
1109  "n_/I:"
1110  "muonLink_[1000]/I:"
1111 
1112  "system_[1000]/I:"
1113  "endcap_[1000]/I:"
1114  "station_[1000]/I:"
1115  "ring_[1000]/I:"
1116  "chamber_[1000]/I:"
1117  "layer_[1000]/I:"
1118  "superLayer_[1000]/I:"
1119  "wheel_[1000]/I:"
1120  "sector_[1000]/I:"
1121 
1122 
1123  "gpX_[1000]/F:"
1124  "gpY_[1000]/F:"
1125  "gpZ_[1000]/F:"
1126  "gpEta_[1000]/F:"
1127  "gpPhi_[1000]/F:"
1128  "lpX_[1000]/F:"
1129  "lpY_[1000]/F:"
1130  "lpZ_[1000]/F"
1131  );
1132 
1133 
1134  outputBranch_ = outputTree_ -> Branch("recHitsTracker", &storageTrackHit_,
1135 
1136  "n_/I:"
1137 
1138  "muonLink_[1000]/I:"
1139  "detector_[1000]/I:"
1140  "subdetector_[1000]/I:"
1141  "blade_[1000]/I:"
1142  "disk_[1000]/I:"
1143  "ladder_[1000]/I:"
1144  "layer_[1000]/I:"
1145  "module_[1000]/I:"
1146  "panel_[1000]/I:"
1147  "ring_[1000]/I:"
1148  "side_[1000]/I:"
1149  "wheel_[1000]/I:"
1150 
1151  "gpX_[1000]/F:"
1152  "gpY_[1000]/F:"
1153  "gpZ_[1000]/F:"
1154  "gpEta_[1000]/F:"
1155  "gpPhi_[1000]/F:"
1156  "lpX_[1000]/F:"
1157  "lpY_[1000]/F:"
1158  "lpZ_[1000]/F"
1159  );
1160 
1161 
1167 
1185 
1188 
1189 }
1190 //
1191 // Set the Muon Branches
1192 //
1193 void ResidualRefitting::branchMuon(ResidualRefitting::storage_muon& storageTmp, std::string branchName){
1194 
1195  outputBranch_ = outputTree_ -> Branch(branchName.c_str(), &storageTmp,
1196  "n_/I:"
1197  "charge_[10]/I:"
1198  "pt_[10]/F:"
1199  "eta_[10]/F:"
1200  "p_[10]/F:"
1201  "phi_[10]/F:"
1202  "numRecHits_[10]/I:"
1203  "chiSq_[10]/F:"
1204  "ndf_[10]/F:"
1205  "chiSqOvrNdf_[10]/F"
1206 
1207  );
1208 
1209 }
1210 //
1211 // Set the Branches for Track Extrapolations
1212 //
1214 
1215  outputBranch_ = outputTree_ -> Branch(branchName.c_str(), &storageTmp,
1216  "n_/I:"
1217  "muonLink_[1000]/I:"
1218  "recLink_[1000]/I:"
1219  "gpX_[1000]/F:"
1220  "gpY_[1000]/F:"
1221  "gpZ_[1000]/F:"
1222  "gpEta_[1000]/F:"
1223  "gpPhi_[1000]/F:"
1224  "lpX_[1000]/F:"
1225  "lpY_[1000]/F:"
1226  "lpZ_[1000]/F:"
1227  "resX_[1000]/F:"
1228  "resY_[1000]/F:"
1229  "resZ_[1000]/F"
1230 
1231  );
1232 
1233 }
1234 //
1235 // End Job
1236 //
1238 
1239 
1240  outputFile_ -> Write();
1241 
1242  outputFile_ -> Close() ;
1243 
1244 }
1245 //
1246 // Return a Free Trajectory state for a muon track
1247 //
1249 
1250  math::XYZPoint innerPos = muon -> referencePoint();
1251  math::XYZVector innerMom = muon -> momentum();
1252  if (debug_) std::cout << "Inner Pos: "
1253  << "\tx = " << innerPos.X()
1254  << "\ty = " << innerPos.Y()
1255  << "\tz = " << innerPos.Z()
1256  << std::endl;
1257 
1258  GlobalPoint innerPoint( innerPos.X(), innerPos.Y(), innerPos.Z());
1259  GlobalVector innerVec ( innerMom.X(), innerMom.Y(), innerMom.Z());
1260 
1261  FreeTrajectoryState recoStart( innerPoint, innerVec, muon ->charge(), theField );
1262  return recoStart;
1263 
1264 }
1265 
1267 // nTuple value Dumps
1269 
1270 //
1271 // dump Track Extrapolation
1272 //
1274  std::cout<<"\n\nExtrapolation Dump:\n";
1275  for (unsigned int i = 0; i < (unsigned int)track.n_; i++) {
1276 
1277 // double rho = sqrt( (float)track.gpX_[i] * (float)track.gpX_[i] + (float)track.gpY_[i] * (float)track.gpY_[i] );
1278 
1279  printf ("%d\tmuonLink= %d",i, (int)track.muonLink_[i]);
1280  printf ("\trecLink = %d", (int)track.recLink_[i] );
1281 // printf ("\tGlobal\tx = %0.3f" , (float)track.gpX_[i] );
1282 // printf ("\ty = %0.3f" , (float)track.gpY_[i] );
1283 // printf ("\tz = %0.3f" , (float)track.gpZ_[i] );
1284 // printf ("\trho =%0.3f" , rho );
1285 // printf ("\teta = %0.3f" , (float)track.gpEta_[i] );
1286 // printf ("\tphi = %0.3f" , (float)track.gpPhi_[i] );
1287  printf ("\t\tLocal\tx = %0.3f" , (float)track.lpX_[i] );
1288  printf ("\ty = %0.3f" , (float)track.lpY_[i] );
1289  printf ("\tz = %0.3f\n" , (float)track.lpZ_[i] );
1290 
1291  }
1292 
1293 }
1294 //
1295 // dump Muon Rec Hits
1296 //
1298  std::cout<<"Muon Rec Hits Dump:\n";
1299  for (unsigned int i = 0; i < (unsigned int)hit.n_; i++) {
1300 
1301 // double rho = sqrt( (float)hit.gpX_[i] * (float)hit.gpX_[i] + (float)hit.gpY_[i] * (float)hit.gpY_[i] );
1302 
1303  printf ("%d\tsubdetector = %d\t superLayer =%d" , i, (int)hit.system_[i], (int)hit.superLayer_[i] );
1304 // printf ("\tGlobal\tx = %0.3f" , (float)hit.gpX_[i] );
1305 // printf ("\ty = %0.3f" , (float)hit.gpY_[i] );
1306 // printf ("\tz = %0.3f" , (float)hit.gpZ_[i] );
1307 // printf ("\trho =%0.3f" , rho );
1308 // printf ("\teta = %0.3f" , (float)hit.gpEta_[i] );
1309 // printf ("\tphi = %0.3f\n" , (float)hit.gpPhi_[i] );
1310  printf ("\t\tLocal\tx = %0.3f" , (float)hit.lpX_[i] );
1311  printf ("\ty = %0.3f" , (float)hit.lpY_[i] );
1312  printf ("\tz = %0.3f\n" , (float)hit.lpZ_[i] );
1313 
1314  }
1315 
1316 }
1317 //
1318 // dump Tracker Rec Hits
1319 //
1321  std::cout<<"Tracker Rec Hits Dump:\n";
1322  for (unsigned int i = 0; i < (unsigned int)hit.n_; i++) {
1323 
1324 // double rho = sqrt( (float)hit.gpX_[i] * (float)hit.gpX_[i] + (float)hit.gpY_[i] * (float)hit.gpY_[i] );
1325 
1326  printf ("%d\tsubdetector = %d" , i, (int)hit.subdetector_[i] );
1327  printf ("\tlayer = %d" , (int)hit.layer_[i] );
1328 // printf ("\tGlobal\tx = %0.3f" , (float)hit.gpX_[i] );
1329 // printf ("\ty = %0.3f" , (float)hit.gpY_[i] );
1330 // printf ("\tz = %0.3f" , (float)hit.gpZ_[i] );
1331 // printf ("\trho =%0.3f" , rho );
1332 // printf ("\teta = %0.3f" , (float)hit.gpEta_[i] );
1333 // printf ("\tphi = %0.3f\n" , (float)hit.gpPhi_[i] );
1334  printf ("\t\tLocal\tx = %0.3f" , (float)hit.lpX_[i] );
1335  printf ("\ty = %0.3f" , (float)hit.lpY_[i] );
1336  printf ("\tz = %0.3f\n" , (float)hit.lpZ_[i] );
1337 
1338  }
1339 
1340 }
1341 //
1342 //Dump a TrackRef
1343 //
1345 
1346  float pt = muon->pt();
1347  float p = muon->p ();
1348  float eta = muon->eta();
1349  float phi = muon->phi();
1350  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);
1351 
1352 }
1353 
1355 
1356 
1358 //Deprecated
void update(const edm::EventSetup &setup)
update the services each event
RunNumber_t run() const
Definition: EventID.h:42
ResidualRefitting::storage_muon storageGmrNoTIBLayer4
int layer_[N_MAX_STORED_HIT]
static const int TIB
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:44
ResidualRefitting::storage_muon storageTrkNoTOBLayer4
int i
Definition: DBlmapReader.cc:9
int module() const
Definition: HLTadd.h:12
void zero_muon(ResidualRefitting::storage_muon *str)
float gpPhi_[N_MAX_STORED_HIT]
static const int N_MAX_STORED
int ReturnStation(DetId detid)
void dumpTrackRef(reco::TrackRef muon, std::string str)
ResidualRefitting::storage_muon storageGmrNoTOBLayer1
ResidualRefitting::storage_trackExtrap storageTrackNoTEC
float gpY_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageGmrNoPXBLayer1
ResidualRefitting::storage_trackExtrap storageTrackNoPXBLayer1
ResidualRefitting::storage_muon storageGmrNoTID
ResidualRefitting::storage_muon storageTrkNoTOBLayer6
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
int superLayer_[N_MAX_STORED_HIT]
int endcap_[N_MAX_STORED_HIT]
int ReturnSector(DetId detid)
ResidualRefitting::storage_muon storageGmrNoTIBLayer1
static const int PXB
ResidualRefitting::storage_trackHit storageTrackHit_
std::string PropagatorSource_
Definition: DDAxes.h:10
const MagneticField * theField
void zero_trackExtrap(ResidualRefitting::storage_trackExtrap *str)
int muonLink_[N_MAX_STORED_HIT]
Geom::Phi< T > phi() const
Definition: PV3DBase.h:63
T y() const
Definition: PV3DBase.h:57
ResidualRefitting::storage_trackExtrap storageTrackExtrapRecNoSt3_
ResidualRefitting::storage_muon storageTrkNoTOBLayer5
GlobalPoint globalPosition() const
static const int TOB
ResidualRefitting::storage_trackExtrap storageTrackNoTIBLayer2
static const int N_MAX_STORED_HIT
ResidualRefitting::storage_trackExtrap storageTrackNoTIBLayer4
ResidualRefitting::storage_muon storageTrkNoTIBLayer2
ResidualRefitting::storage_muon storageGmrNoTOBLayer2
float lpZ_[N_MAX_STORED_HIT]
virtual void analyze(const edm::Event &, const edm::EventSetup &)
void NewTrackMeasurements(edm::Handle< reco::TrackCollection > trackCollOrig, edm::Handle< reco::TrackCollection > trackColl, ResidualRefitting::storage_trackExtrap &trackExtrap)
ResidualRefitting::storage_muon storageGmrNoSt1_
ResidualRefitting::storage_trackExtrap storageTrackNoTOBLayer6
ResidualRefitting::storage_trackExtrap storageTrackExtrapRecNoSt1_
ResidualRefitting::storage_muon storageGmrNoTOBLayer6
double charge(const std::vector< uint8_t > &Ampls)
T eta() const
ResidualRefitting::storage_muon storageSamNew_
static const int TEC
ResidualRefitting::storage_trackExtrap storageTrackNoTOBLayer4
ResidualRefitting::storage_muon storageTrkNoTID
ResidualRefitting::storage_trackExtrap storageTrackExtrapTracker_
ResidualRefitting::storage_trackExtrap storageTrackExtrapRec_
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
static const int TID
ResidualRefitting::storage_muon storageGmrNoTOBLayer4
void dumpTrackHits(ResidualRefitting::storage_trackHit hit)
ResidualRefitting::storage_muon storageGmrNoSt4_
edm::InputTag muonsNoStation2_
ResidualRefitting::storage_trackExtrap storageTrackExtrapRecNoSt4_
ResidualRefitting::storage_trackExtrap storageTrackNoTOBLayer2
void branchMuon(ResidualRefitting::storage_muon &storageTmp, std::string branchName)
int chamber_[N_MAX_STORED_HIT]
static const int CSC
Definition: MuonSubdetId.h:15
int MatchTrackWithRecHits(reco::TrackCollection::const_iterator trackIt, edm::Handle< reco::TrackCollection > ref)
ResidualRefitting::storage_muon storageSamNoSt4_
int station_[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:28
ResidualRefitting::storage_muon storageTrkNoPXBLayer2
T z() const
Definition: PV3DBase.h:58
edm::InputTag muonsNoStation1_
ResidualRefitting::storage_muon storageGmrNoSt2_
ResidualRefitting::storage_muon storageGmrNoSt3_
float gpEta_[N_MAX_STORED_HIT]
MuonServiceProxy * theService
ResidualRefitting::storage_muon storageGmrNoPXBLayer2
ResidualRefitting(const edm::ParameterSet &)
FreeTrajectoryState freeTrajStateMuon(reco::TrackRef muon)
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
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
ResidualRefitting::storage_muon storageGmrOld_
void dumpMuonRecHits(ResidualRefitting::storage_hit hit)
ResidualRefitting::storage_muon storageTrkNoPXF
ResidualRefitting::storage_muon storageGmrNoTEC
ResidualRefitting::storage_trackExtrap trackExtrap120_
edm::InputTag muonsNoStation3_
Definition: DetId.h:20
ResidualRefitting::storage_muon storageGmrNoTIBLayer3
void dumpTrackExtrap(ResidualRefitting::storage_trackExtrap track)
ResidualRefitting::storage_muon storageGmrNew_
std::string outputFileName_
ResidualRefitting::storage_muon storageGmrNoTIBLayer2
float gpX_[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:13
float gpZ_[N_MAX_STORED_HIT]
const T & get() const
Definition: EventSetup.h:55
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:14
static const int PXF
ResidualRefitting::storage_muon storageTrkNoTIBLayer3
edm::InputTag muons_
ResidualRefitting::storage_trackExtrap storageTrackNoTID
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, MediumProperties *mp=0)
Definition: Cylinder.h:29
void StoreTrackerRecHits(DetId detid, int iTrack, int iRec)
ResidualRefitting::storage_muon storageTrkNoTOBLayer2
bool IsSameHit(trackingRecHit_iterator hit1, trackingRecHit_iterator hit2)
ResidualRefitting::storage_trackExtrap storageTrackNoPXBLayer3
ResidualRefitting::storage_trackExtrap storageTrackNoTOBLayer5
edm::ESHandle< GlobalTrackingGeometry > trackingGeometry() const
get the tracking geometry
float lpY_[N_MAX_STORED_HIT]
T eta() const
Definition: PV3DBase.h:70
ResidualRefitting::storage_muon storageSamNoSt2_
ResidualRefitting::storage_trackExtrap storageTrackNoTOBLayer3
edm::EventID id() const
Definition: EventBase.h:56
ResidualRefitting::storage_muon storageTrkNoTOBLayer1
ResidualRefitting::storage_muon storageGmrNoPXBLayer3
ResidualRefitting::storage_muon storageTrkNoTEC
static const int RPC
Definition: MuonSubdetId.h:16
ResidualRefitting::storage_muon storageSamNoSt3_
ResidualRefitting::storage_muon storageTrkNoPXBLayer1
void CollectTrackHits(edm::Handle< reco::TrackCollection > trackColl, ResidualRefitting::storage_trackExtrap &trackExtrap)
ResidualRefitting::storage_muon storageTrkNoTIBLayer1
ResidualRefitting::storage_muon storageGmrNoTOBLayer3
ResidualRefitting::storage_trackExtrap storageTrackNoTIBLayer1
ResidualRefitting::storage_event eventInfo_
void trkExtrap(DetId detid, int iTrkLink, int iTrk, int iRec, FreeTrajectoryState freeTrajState, LocalPoint recPoint, storage_trackExtrap &storeTemp)
ResidualRefitting::storage_hit storageRecMuon_
tuple cout
Definition: gather_cfg.py:41
static const int DT
Definition: MuonSubdetId.h:14
ResidualRefitting::storage_muon storageTrkNoTOBLayer3
edm::ESHandle< Propagator > thePropagator
int system_[N_MAX_STORED_HIT]
ResidualRefitting::storage_muon storageTrkNew_
ResidualRefitting::storage_trackExtrap storageTrackNoPXF
ResidualRefitting::storage_muon storageSamNoSt1_
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
float lpX_[N_MAX_STORED_HIT]
T x() const
Definition: PV3DBase.h:56
ResidualRefitting::storage_muon storageGmrNoTOBLayer5
ResidualRefitting::storage_trackExtrap storageTrackNoTIBLayer3
int sector_[N_MAX_STORED_HIT]
virtual void beginJob()
Definition: vlib.h:209
static MuonRecHitPointer specificBuild(const GeomDet *geom, const TrackingRecHit *rh)
edm::InputTag muonsNoStation4_
int wheel_[N_MAX_STORED_HIT]
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
ResidualRefitting::storage_trackExtrap storageTrackNoTOBLayer1
void branchTrackExtrap(ResidualRefitting::storage_trackExtrap &storageTmp, std::string branchName)
ResidualRefitting::storage_muon storageGmrNoPXF
ResidualRefitting::storage_trackExtrap storageTrackNoPXBLayer2
ResidualRefitting::storage_muon storageTrkNoPXBLayer3
ResidualRefitting::storage_muon storageTrkNoTIBLayer4
ResidualRefitting::storage_trackExtrap samExtrap120_
Definition: DDAxes.h:10