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