CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackerRecHit.cc
Go to the documentation of this file.
3 
5  const TrackerGeometry* theGeometry,
6  const TrackerTopology* tTopo) :
7  theSplitHit(0),
8  theMatchedHit(theHit),
9  theSubDetId(0),
10  theLayerNumber(0),
11  theRingNumber(0),
12  theCylinderNumber(0),
13  theLocalError(0.),
14  theLargerError(0.)
15 
16 {
17  init(theGeometry, tTopo);
18 }
19 
21  const TrackerGeometry* theGeometry,
22  const TrackerTopology* tTopo ) :
23  theSplitHit(theHit),
24  theMatchedHit(0),
25  theSubDetId(0),
26  theLayerNumber(0),
27  theRingNumber(0),
28  theCylinderNumber(0),
29  theLocalError(0.),
30  theLargerError(0.)
31 
32 {
33  init(theGeometry,tTopo);
34 }
35 
36 void
37 TrackerRecHit::init(const TrackerGeometry* theGeometry, const TrackerTopology *tTopo) {
38 
39  const DetId& theDetId = hit()->geographicalId();
40  theGeomDet = theGeometry->idToDet(theDetId);
41  theSubDetId = theDetId.subdetId();
43 
44  theLayerNumber = tTopo->tibLayer(theDetId);
46  forward = false;
47  } else if ( theSubDetId == StripSubdetector::TOB ) {
48 
49  theLayerNumber = tTopo->tobLayer(theDetId);
51  forward = false;
52  } else if ( theSubDetId == StripSubdetector::TID) {
53 
54  theLayerNumber = tTopo->tidWheel(theDetId);
56  theRingNumber = tTopo->tidRing(theDetId);
57  forward = true;
58  } else if ( theSubDetId == StripSubdetector::TEC ) {
59 
60  theLayerNumber = tTopo->tecWheel(theDetId);
62  theRingNumber = tTopo->tecRing(theDetId);
63  forward = true;
64  } else if ( theSubDetId == PixelSubdetector::PixelBarrel ) {
65 
66  theLayerNumber = tTopo->pxbLayer(theDetId);
68  forward = false;
69  } else if ( theSubDetId == PixelSubdetector::PixelEndcap ) {
70 
71  theLayerNumber = tTopo->pxfDisk(theDetId);
73  forward = true;
74  }
75 
76 }
77 
78 bool
79 TrackerRecHit::isOnRequestedDet(const std::vector<std::vector<TrajectorySeedProducer::LayerSpec> >& theLayersInSets) const{
80 
81  for(unsigned int i=0; i<theLayersInSets.size(); ++i) {
82  if(theLayersInSets[i][0].subDet==theSubDetId && theLayersInSets[i][0].idLayer==theLayerNumber) return true;
83  }
84 
85  return false;
86 }
87 
88 bool
89 TrackerRecHit::isOnRequestedDet(const std::vector<std::vector<TrajectorySeedProducer::LayerSpec> >& theLayersInSets, const TrackerRecHit& theSeedHitSecond) const{
90 
91  for(unsigned int i=0; i<theLayersInSets.size(); ++i){
92  if( theLayersInSets[i][0].subDet==theSubDetId && theLayersInSets[i][0].idLayer==theLayerNumber &&
93  theLayersInSets[i][1].subDet==theSeedHitSecond.subDetId() && theLayersInSets[i][1].idLayer==theSeedHitSecond.layerNumber()
94  ) return true;
95  }
96  return false;
97 }
98 
99 bool
100 TrackerRecHit::isOnRequestedDet(const std::vector<std::vector<TrajectorySeedProducer::LayerSpec> >& theLayersInSets, const TrackerRecHit& theSeedHitSecond, const TrackerRecHit& theSeedHitThird) const{
101 
102  for(unsigned int i=0; i<theLayersInSets.size(); ++i){
103  if( theLayersInSets[i][0].subDet==theSubDetId && theLayersInSets[i][0].idLayer==theLayerNumber &&
104  theLayersInSets[i][1].subDet==theSeedHitSecond.subDetId() && theLayersInSets[i][1].idLayer==theSeedHitSecond.layerNumber() &&
105  theLayersInSets[i][2].subDet==theSeedHitThird.subDetId() && theLayersInSets[i][2].idLayer==theSeedHitThird.layerNumber()
106  ) return true;
107  }
108  return false;
109 }
110 
111 
112 bool
113 //TrackerRecHit::isOnRequestedDet(const std::vector<unsigned int>& whichDet) const {
114 TrackerRecHit::isOnRequestedDet(const std::vector<unsigned int>& whichDet, const std::string& seedingAlgo) const {
115 
116  bool isOnDet = false;
117 
118  for ( unsigned idet=0; idet<whichDet.size(); ++idet ) {
119 
120  switch ( whichDet[idet] ) {
121 
122  case 1:
123  //Pixel Barrel
124  isOnDet = theSubDetId==1;
125  break;
126 
127  case 2:
128  //Pixel Disks
129  isOnDet = theSubDetId==2;
130  break;
131 
132  case 3:
133  //Inner Barrel
134  isOnDet = theSubDetId==3 && theLayerNumber < 4;
135  break;
136 
137  case 4:
138  //Inner Disks
139  isOnDet = theSubDetId==4 && theRingNumber < 3;
140  break;
141 
142  case 5:
143  //Outer Barrel
144  if(seedingAlgo == "TobTecLayerPairs"){
145  isOnDet = theSubDetId==5 && theLayerNumber <3;
146  }else {
147  isOnDet = false;
148  }
149  break;
150 
151  case 6:
152  //Tracker EndCap
153  if(seedingAlgo == "PixelLessPairs"){
154  isOnDet = theSubDetId==6 && theLayerNumber < 6 && theRingNumber < 3;
155  }else if (seedingAlgo == "TobTecLayerPairs"){
156  // isOnDet = theSubDetId==6 && theLayerNumber < 8 && theRingNumber < 5;
157  isOnDet = theSubDetId==6 && theLayerNumber < 8 && theRingNumber == 5;
158  } else if (seedingAlgo == "MixedTriplets"){
159  // isOnDet = theSubDetId==6 && theLayerNumber == 2 && theRingNumber == 1;
160  isOnDet = theSubDetId==6 && theLayerNumber < 4 && theRingNumber == 1;
161  } else {
162  isOnDet = theSubDetId==6;
163  std::cout << "DEBUG - this should never happen" << std::endl;
164  }
165 
166  break;
167 
168  default:
169  // Should not happen
170  isOnDet = false;
171  break;
172 
173  }
174 
175  if ( isOnDet ) break;
176 
177  }
178 
179  return isOnDet;
180 }
181 
182 
183 
184 
185 
int i
Definition: DBlmapReader.cc:9
unsigned int theLayerNumber
unsigned int tibLayer(const DetId &id) const
unsigned int tidRing(const DetId &id) const
unsigned int pxfDisk(const DetId &id) const
unsigned int tecRing(const DetId &id) const
ring id
unsigned int tidWheel(const DetId &id) const
unsigned int theCylinderNumber
TrackerRecHit()
Default Constructor.
Definition: TrackerRecHit.h:29
unsigned int theRingNumber
void init(const TrackerGeometry *theGeometry, const TrackerTopology *tTopo)
Initialization at construction time.
unsigned int theSubDetId
const GeomDet * theGeomDet
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
virtual const GeomDet * idToDet(DetId) const
unsigned int pxbLayer(const DetId &id) const
Definition: DetId.h:18
unsigned int layerNumber() const
The Layer Number.
Definition: TrackerRecHit.h:84
const GSSiTrackerRecHit2DLocalPos * hit() const
Definition: TrackerRecHit.h:76
bool isOnRequestedDet(const std::vector< unsigned int > &whichDet, const std::string &seedingAlgo) const
Check if the hit is on one of the requested detector.
unsigned int subDetId() const
The subdet Id.
Definition: TrackerRecHit.h:81
tuple cout
Definition: gather_cfg.py:121
DetId geographicalId() const
unsigned int tecWheel(const DetId &id) const
unsigned int tobLayer(const DetId &id) const