CMS 3D CMS Logo

MuonTransientTrackingRecHitBreaker.cc
Go to the documentation of this file.
2 
4 
7 
8  const std::string metname = "Muon|RecoMuon|MuonTransientTrackingRecHitBreaker";
9 
11 
12  int subDet = muonRecHit->geographicalId().subdetId();
13 
14  switch(granularity){
15  case 0:
16  {
17  // Asking for 4D segments for the CSC/DT and a point for the RPC
18  recHitsForFit.push_back( muonRecHit );
19  break;
20  }
21  case 1:
22  {
23  if (subDet == MuonSubdetId::DT ||
24  subDet == MuonSubdetId::CSC)
25  // measurement->recHit() returns a 4D segment, then
26  // DT case: asking for 2D segments.
27  // CSC case: asking for 2D points.
28  recHitsForFit = muonRecHit->transientHits();
29 
30  else if(subDet == MuonSubdetId::RPC)
31  recHitsForFit.push_back( muonRecHit);
32 
33  break;
34  }
35 
36  case 2:
37  {
38  if (subDet == MuonSubdetId::DT ) {
39 
40  // Asking for 2D segments. measurement->recHit() returns a 4D segment
41  TransientTrackingRecHit::ConstRecHitContainer segments2D = muonRecHit->transientHits();
42 
43  // loop over segment
44  for (TransientTrackingRecHit::ConstRecHitContainer::const_iterator segment = segments2D.begin();
45  segment != segments2D.end();++segment ){
46 
47  // asking for 1D Rec Hit
48  TransientTrackingRecHit::ConstRecHitContainer rechit1D = (**segment).transientHits();
49 
50  // load them into the recHitsForFit container
51  copy(rechit1D.begin(),rechit1D.end(),back_inserter(recHitsForFit));
52  }
53  }
54 
55  else if(subDet == MuonSubdetId::RPC)
56  recHitsForFit.push_back(muonRecHit);
57 
58  else if(subDet == MuonSubdetId::CSC)
59  // Asking for 2D points. measurement->recHit() returns a 4D segment
60  recHitsForFit = (*muonRecHit).transientHits();
61 
62  break;
63  }
64 
65  default:
66  {
67  throw cms::Exception(metname) <<"Wrong granularity chosen!"
68  <<"it will be set to 0";
69  break;
70  }
71  }
72 
73  return recHitsForFit;
74 }
const std::string metname
static TransientTrackingRecHit::ConstRecHitContainer breakInSubRecHits(TransientTrackingRecHit::ConstRecHitPointer, int granularity)
takes a muon rechit and returns its sub-rechits given a certain granularity
static const int CSC
Definition: MuonSubdetId.h:13
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
std::vector< ConstRecHitPointer > ConstRecHitContainer
static const int RPC
Definition: MuonSubdetId.h:14
static const int DT
Definition: MuonSubdetId.h:12