CMS 3D CMS Logo

TrackerInteractionGeometry.cc
Go to the documentation of this file.
1 //Framework Headers
4 
5 //CMSSW Headers
11 
12 // Tracker/Tracking Headers
16 
17 //FAMOS Headers
19 
20 #include <iostream>
21 
23  const GeometricSearchTracker* theGeomSearchTracker) {
24  use_hardcoded = trackerMaterial.getParameter<bool>("use_hardcoded_geometry");
25 
26  if (!use_hardcoded) {
27  std::vector<double> disk_thickness = trackerMaterial.getParameter<std::vector<double> >("disk_thickness");
28  std::vector<double> disk_inner_radius = trackerMaterial.getParameter<std::vector<double> >("disk_inner_radius");
29  std::vector<double> disk_outer_radius = trackerMaterial.getParameter<std::vector<double> >("disk_outer_radius");
30  std::vector<double> disk_z = trackerMaterial.getParameter<std::vector<double> >("disk_z");
31 
32  assert(disk_inner_radius.size() == disk_outer_radius.size() && disk_inner_radius.size() == disk_z.size() &&
33  disk_inner_radius.size() == disk_thickness.size());
34  std::cout << "number of disk layers = " << disk_z.size() << std::endl;
35 
36  const Surface::RotationType theRotation2(1., 0., 0., 0., 1., 0., 0., 0., 1.);
37 
38  std::vector<double> barrel_thickness = trackerMaterial.getParameter<std::vector<double> >("barrel_thickness");
39  std::vector<double> barrel_radius = trackerMaterial.getParameter<std::vector<double> >("barrel_radius");
40  std::vector<double> barrel_length = trackerMaterial.getParameter<std::vector<double> >("barrel_length");
41 
42  assert(barrel_length.size() == barrel_radius.size() && barrel_length.size() == barrel_thickness.size());
43  std::cout << "number of barrel layers = " << barrel_length.size() << std::endl;
44 
45  const Surface::PositionType thePosition(0., 0., 0.);
46  const Surface::RotationType theRotation(1., 0., 0., 0., 1., 0., 0., 0., 1.);
47 
48  for (unsigned int i = 0, j = 0; i < barrel_length.size() || j < disk_z.size();) {
49  bool add_disk = false;
50  if (i < barrel_length.size() && j < disk_z.size()) {
52  add_disk = true;
53  else
54  add_disk = false;
55  } else if (i < barrel_length.size() && !(j < disk_z.size()))
56  add_disk = false;
57  else if (!(i < barrel_length.size()) && j < disk_z.size())
58  add_disk = true;
59  else
60  assert(0);
61 
62  if (add_disk) {
63  _mediumProperties.push_back(new MediumProperties(disk_thickness[j], 0.0001));
64 
65  const SimpleDiskBounds diskBounds(disk_inner_radius[j], disk_outer_radius[j], -0.0150, +0.0150);
66  const Surface::PositionType positionType(0., 0., disk_z[j]);
67 
68  unsigned layerNr = i + j;
69  BoundDisk* theDisk = new BoundDisk(positionType, theRotation2, diskBounds);
70  theDisk->setMediumProperties(*_mediumProperties[_mediumProperties.size() - 1]);
71  if (theDisk->mediumProperties().radLen() > 0.)
72  _theCylinders.push_back(TrackerLayer(
73  theDisk, true, layerNr, std::vector<double>(), std::vector<double>(), std::vector<double>()));
74  else
75  delete theDisk;
76 
77  j++;
78 
79  } else {
80  // Create the nest of cylinders
81 
82  const SimpleCylinderBounds cylBounds(
83  barrel_radius[i] - 0.0150, barrel_radius[i] + 0.0150, -barrel_length[i] / 2, +barrel_length[i] / 2);
84 
85  _mediumProperties.push_back(new MediumProperties(barrel_thickness[i], 0.0001));
86 
87  unsigned layerNr = i + j;
88  BoundCylinder* theCylinder = new BoundCylinder(thePosition, theRotation, cylBounds);
89  theCylinder->setMediumProperties(*_mediumProperties[_mediumProperties.size() - 1]);
90  if (theCylinder->mediumProperties().radLen() > 0.)
91  _theCylinders.push_back(TrackerLayer(
92  theCylinder, false, layerNr, std::vector<double>(), std::vector<double>(), std::vector<double>()));
93 
94  else
95  delete theCylinder;
96 
97  i++;
98  }
99  }
100  } else {
101  // Fraction of radiation length : had oc values to account
102  // for detectors, cables, support, ...
103  // Note : the second argument is not used in FAMOS
104  // Note : the first argument is tuned to reproduce the CMSIM material
105  // in terms or radiation length.
106 
107  // Thickness of all layers
108  // Version of the material description
109  version = trackerMaterial.getParameter<unsigned int>("TrackerMaterialVersion");
110  // Beam Pipe
111  beamPipeThickness = trackerMaterial.getParameter<std::vector<double> >("BeamPipeThickness");
112  // Pixel Barrel Layers 1-3
113  pxbThickness = trackerMaterial.getParameter<std::vector<double> >("PXBThickness");
114  // Pixel Barrel services at the end of layers 1-3
115  pxb1CablesThickness = trackerMaterial.getParameter<std::vector<double> >("PXB1CablesThickness");
116  pxb2CablesThickness = trackerMaterial.getParameter<std::vector<double> >("PXB2CablesThickness");
117  pxb3CablesThickness = trackerMaterial.getParameter<std::vector<double> >("PXB3CablesThickness");
118  // Pixel Barrel outside cables
119  pxbOutCables1Thickness = trackerMaterial.getParameter<std::vector<double> >("PXBOutCables1Thickness");
120  pxbOutCables2Thickness = trackerMaterial.getParameter<std::vector<double> >("PXBOutCables2Thickness");
121  // Pixel Disks 1-2
122  pxdThickness = trackerMaterial.getParameter<std::vector<double> >("PXDThickness");
123  // Pixel Endcap outside cables
124  pxdOutCables1Thickness = trackerMaterial.getParameter<std::vector<double> >("PXDOutCables1Thickness");
125  pxdOutCables2Thickness = trackerMaterial.getParameter<std::vector<double> >("PXDOutCables2Thickness");
126  // Tracker Inner barrel layers 1-4
127  tibLayer1Thickness = trackerMaterial.getParameter<std::vector<double> >("TIBLayer1Thickness");
128  tibLayer2Thickness = trackerMaterial.getParameter<std::vector<double> >("TIBLayer2Thickness");
129  tibLayer3Thickness = trackerMaterial.getParameter<std::vector<double> >("TIBLayer3Thickness");
130  tibLayer4Thickness = trackerMaterial.getParameter<std::vector<double> >("TIBLayer4Thickness");
131  // TIB outside services (endcap)
132  tibOutCables1Thickness = trackerMaterial.getParameter<std::vector<double> >("TIBOutCables1Thickness");
133  tibOutCables2Thickness = trackerMaterial.getParameter<std::vector<double> >("TIBOutCables2Thickness");
134  // Tracker Inner disks layers 1-3
135  tidLayer1Thickness = trackerMaterial.getParameter<std::vector<double> >("TIDLayer1Thickness");
136  tidLayer2Thickness = trackerMaterial.getParameter<std::vector<double> >("TIDLayer2Thickness");
137  tidLayer3Thickness = trackerMaterial.getParameter<std::vector<double> >("TIDLayer3Thickness");
138  // TID outside wall (endcap)
139  tidOutsideThickness = trackerMaterial.getParameter<std::vector<double> >("TIDOutsideThickness");
140  // TOB inside wall (barrel)
141  tobInsideThickness = trackerMaterial.getParameter<std::vector<double> >("TOBInsideThickness");
142  // Tracker Outer barrel layers 1-6
143  tobLayer1Thickness = trackerMaterial.getParameter<std::vector<double> >("TOBLayer1Thickness");
144  tobLayer2Thickness = trackerMaterial.getParameter<std::vector<double> >("TOBLayer2Thickness");
145  tobLayer3Thickness = trackerMaterial.getParameter<std::vector<double> >("TOBLayer3Thickness");
146  tobLayer4Thickness = trackerMaterial.getParameter<std::vector<double> >("TOBLayer4Thickness");
147  tobLayer5Thickness = trackerMaterial.getParameter<std::vector<double> >("TOBLayer5Thickness");
148  tobLayer6Thickness = trackerMaterial.getParameter<std::vector<double> >("TOBLayer6Thickness");
149  // TOB services (endcap)
150  tobOutsideThickness = trackerMaterial.getParameter<std::vector<double> >("TOBOutsideThickness");
151  // Tracker EndCap disks layers 1-9
152  tecLayerThickness = trackerMaterial.getParameter<std::vector<double> >("TECLayerThickness");
153  // TOB outside wall (barrel)
154  barrelCablesThickness = trackerMaterial.getParameter<std::vector<double> >("BarrelCablesThickness");
155  // TEC outside wall (endcap)
156  endcapCables1Thickness = trackerMaterial.getParameter<std::vector<double> >("EndcapCables1Thickness");
157  endcapCables2Thickness = trackerMaterial.getParameter<std::vector<double> >("EndcapCables2Thickness");
158 
159  // Position of dead material layers (cables, services, etc.)
160  // Beam pipe
161  beamPipeRadius = trackerMaterial.getParameter<std::vector<double> >("BeamPipeRadius");
162  beamPipeLength = trackerMaterial.getParameter<std::vector<double> >("BeamPipeLength");
163  // Cables and Services at the end of PIXB1,2,3 ("disk")
164  pxb1CablesInnerRadius = trackerMaterial.getParameter<std::vector<double> >("PXB1CablesInnerRadius");
165  pxb2CablesInnerRadius = trackerMaterial.getParameter<std::vector<double> >("PXB2CablesInnerRadius");
166  pxb3CablesInnerRadius = trackerMaterial.getParameter<std::vector<double> >("PXB3CablesInnerRadius");
167  // Pixel Barrel Outside walls and cables
168  pxbOutCables1InnerRadius = trackerMaterial.getParameter<std::vector<double> >("PXBOutCables1InnerRadius");
169  pxbOutCables1OuterRadius = trackerMaterial.getParameter<std::vector<double> >("PXBOutCables1OuterRadius");
170  pxbOutCables1ZPosition = trackerMaterial.getParameter<std::vector<double> >("PXBOutCables1ZPosition");
171  pxbOutCables2InnerRadius = trackerMaterial.getParameter<std::vector<double> >("PXBOutCables2InnerRadius");
172  pxbOutCables2OuterRadius = trackerMaterial.getParameter<std::vector<double> >("PXBOutCables2OuterRadius");
173  pxbOutCables2ZPosition = trackerMaterial.getParameter<std::vector<double> >("PXBOutCables2ZPosition");
174  // Pixel Outside walls and cables (barrel and endcaps)
175  pixelOutCablesRadius = trackerMaterial.getParameter<std::vector<double> >("PixelOutCablesRadius");
176  pixelOutCablesLength = trackerMaterial.getParameter<std::vector<double> >("PixelOutCablesLength");
177  pixelOutCablesInnerRadius = trackerMaterial.getParameter<std::vector<double> >("PixelOutCablesInnerRadius");
178  pixelOutCablesOuterRadius = trackerMaterial.getParameter<std::vector<double> >("PixelOutCablesOuterRadius");
179  pixelOutCablesZPosition = trackerMaterial.getParameter<std::vector<double> >("PixelOutCablesZPosition");
180  // Tracker Inner Barrel Outside Cables and walls (endcap)
181  tibOutCables1InnerRadius = trackerMaterial.getParameter<std::vector<double> >("TIBOutCables1InnerRadius");
182  tibOutCables1OuterRadius = trackerMaterial.getParameter<std::vector<double> >("TIBOutCables1OuterRadius");
183  tibOutCables1ZPosition = trackerMaterial.getParameter<std::vector<double> >("TIBOutCables1ZPosition");
184  tibOutCables2InnerRadius = trackerMaterial.getParameter<std::vector<double> >("TIBOutCables2InnerRadius");
185  tibOutCables2OuterRadius = trackerMaterial.getParameter<std::vector<double> >("TIBOutCables2OuterRadius");
186  tibOutCables2ZPosition = trackerMaterial.getParameter<std::vector<double> >("TIBOutCables2ZPosition");
187  // Tracker outer barrel Inside wall (barrel)
188  tobInCablesRadius = trackerMaterial.getParameter<std::vector<double> >("TOBInCablesRadius");
189  tobInCablesLength = trackerMaterial.getParameter<std::vector<double> >("TOBInCablesLength");
190  // Tracker Inner Disks Outside Cables and walls
191  tidOutCablesInnerRadius = trackerMaterial.getParameter<std::vector<double> >("TIDOutCablesInnerRadius");
192  tidOutCablesZPosition = trackerMaterial.getParameter<std::vector<double> >("TIDOutCablesZPosition");
193  // Tracker Outer Barrel Outside Cables and walls (barrel and endcaps)
194  tobOutCablesInnerRadius = trackerMaterial.getParameter<std::vector<double> >("TOBOutCablesInnerRadius");
195  tobOutCablesOuterRadius = trackerMaterial.getParameter<std::vector<double> >("TOBOutCablesOuterRadius");
196  tobOutCablesZPosition = trackerMaterial.getParameter<std::vector<double> >("TOBOutCablesZPosition");
197  tobOutCablesRadius = trackerMaterial.getParameter<std::vector<double> >("TOBOutCablesRadius");
198  tobOutCablesLength = trackerMaterial.getParameter<std::vector<double> >("TOBOutCablesLength");
199  // Tracker Endcaps Outside Cables and walls
200  tecOutCables1InnerRadius = trackerMaterial.getParameter<std::vector<double> >("TECOutCables1InnerRadius");
201  tecOutCables1OuterRadius = trackerMaterial.getParameter<std::vector<double> >("TECOutCables1OuterRadius");
202  tecOutCables1ZPosition = trackerMaterial.getParameter<std::vector<double> >("TECOutCables1ZPosition");
203  tecOutCables2InnerRadius = trackerMaterial.getParameter<std::vector<double> >("TECOutCables2InnerRadius");
204  tecOutCables2OuterRadius = trackerMaterial.getParameter<std::vector<double> >("TECOutCables2OuterRadius");
205  tecOutCables2ZPosition = trackerMaterial.getParameter<std::vector<double> >("TECOutCables2ZPosition");
206 
207  // Fudge factors for tracker layer material inhomogeneities
208  fudgeLayer = trackerMaterial.getParameter<std::vector<unsigned int> >("FudgeLayer");
209  fudgeMin = trackerMaterial.getParameter<std::vector<double> >("FudgeMin");
210  fudgeMax = trackerMaterial.getParameter<std::vector<double> >("FudgeMax");
211  fudgeFactor = trackerMaterial.getParameter<std::vector<double> >("FudgeFactor");
212 
213  // The previous std::vector must have the same size!
214  if (fudgeLayer.size() != fudgeMin.size() || fudgeLayer.size() != fudgeMax.size() ||
215  fudgeLayer.size() != fudgeFactor.size()) {
216  throw cms::Exception("FastSimulation/TrackerInteractionGeometry ")
217  << " WARNING with fudge factors ! You have " << fudgeLayer.size() << " layers, but " << fudgeMin.size()
218  << " min values, " << fudgeMax.size() << " max values and " << fudgeFactor.size() << " fudge factor values!"
219  << std::endl
220  << "Please make enter the same number of inputs "
221  << "in FastSimulation/TrackerInteractionGeometry/data/TrackerMaterial.cfi" << std::endl;
222  }
223 
224  // The Beam pipe
226  // The pixel barrel layers
228  // Pixel Barrel services at the end of layers 1-3
232  // Pixel Barrel outside cables
235  // The pixel endcap disks
237  // Pixel Endcap outside cables
240  // The tracker inner barrel layers 1-4
245  // TIB outside services (endcap)
248  // The tracker inner disks 1-3
252  // TID outside wall (endcap)
254  // TOB inside wall (barrel)
256  // The tracker outer barrel layers 1-6
263  // TOB services (endcap)
265  // The tracker endcap disks 1-9
267  // TOB outside wall (barrel)
269  // TEC outside wall (endcap)
272 
273  // Check that the Reco Tracker Geometry has been loaded
274  if (!theGeomSearchTracker)
275  throw cms::Exception("FastSimulation/TrackerInteractionGeometry")
276  << "The pointer to the GeometricSearchTracker was not set";
277 
278  // The vector of Barrel Tracker Layers
279  auto const& barrelLayers = theGeomSearchTracker->barrelLayers();
280 
281  // The vector of Forward Tracker Layers (positive z)
282  auto const& posForwardLayers = theGeomSearchTracker->posForwardLayers();
283 
284  // Local pointers
285  BoundCylinder* theCylinder;
286  BoundDisk* theDisk;
287 
288  // Create the nest of cylinders
289  const Surface::PositionType thePosition(0., 0., 0.);
290  const Surface::RotationType theRotation(1., 0., 0., 0., 1., 0., 0., 0., 1.);
291  // Beam Pipe
292  // const SimpleCylinderBounds PIPE( 0.997, 1.003, -300., 300.);
294  beamPipeRadius[version] + 0.003,
297 
298  // Take the active layer position from the Tracker Reco Geometry
299  // Pixel barrel
300  auto bl = barrelLayers.begin();
301  double maxLength = (**bl).specificSurface().bounds().length() / 2. + 1.7;
302  double maxRadius = (**bl).specificSurface().radius() + 0.01;
303  // First pixel barrel layer: r=4.41058, l=53.38
304  const SimpleCylinderBounds PIXB1(maxRadius - 0.005, maxRadius + 0.005, -maxLength, +maxLength);
305  // "Cables"
306  const SimpleDiskBounds PIXBOut1(pxb1CablesInnerRadius[version], maxRadius + 0.01, -0.5, 0.5);
307  const Surface::PositionType PPIXBOut1(0.0, 0.0, maxLength);
308 
309  // Second pixel barrel layer: r=7.30732, l=53.38
310  ++bl;
311  maxLength = std::max((**bl).specificSurface().bounds().length() / 2. + 1.7, maxLength + 0.000);
312  maxRadius = (**bl).specificSurface().radius();
313  const SimpleCylinderBounds PIXB2(maxRadius - 0.005, maxRadius + 0.005, -maxLength, +maxLength);
314 
315  // "Cables"
316  const SimpleDiskBounds PIXBOut2(pxb2CablesInnerRadius[version], maxRadius + 0.005, -0.5, 0.5);
317  const Surface::PositionType PPIXBOut2(0.0, 0.0, maxLength);
318 
319  // More cables
320  ++bl;
321  maxRadius = (**bl).specificSurface().radius();
322  const SimpleDiskBounds PIXBOut3(pxb3CablesInnerRadius[version], maxRadius, -0.5, 0.5);
323  const Surface::PositionType PPIXBOut3(0.0, 0.0, maxLength);
324 
325  // Third pixel barrel layer: r=10.1726, l=53.38
326  maxLength = std::max((**bl).specificSurface().bounds().length() / 2. + 1.7, maxLength + 0.000);
327  const SimpleCylinderBounds PIXB3(maxRadius - 0.005, maxRadius + 0.005, -maxLength, +maxLength);
328 
329  // Pixel Barrel Outside walls and cables
331  const Surface::PositionType PPIXBOut4(0.0, 0.0, pxbOutCables1ZPosition[version]);
332 
334  const Surface::PositionType PPIXBOut(0.0, 0.0, pxbOutCables2ZPosition[version]);
335 
336  const SimpleCylinderBounds PIXBOut5(pixelOutCablesRadius[version] - 0.1,
340 
342  const Surface::PositionType PPIXBOut6(0.0, 0.0, pixelOutCablesZPosition[version]);
343 
344  // Tracker Inner Barrel : thin detectors (300 microns)
345  // First TIB layer: r=25.6786, l=130.04
346  ++bl;
347  maxRadius = (**bl).specificSurface().radius();
348  maxLength = (**bl).specificSurface().bounds().length() / 2.;
349  const SimpleCylinderBounds TIB1(maxRadius - 0.0150, maxRadius + 0.0150, -maxLength, +maxLength);
350  // Second TIB layer: r=34.0341, l=131.999
351  ++bl;
352  maxRadius = (**bl).specificSurface().radius();
353  maxLength = std::max((**bl).specificSurface().bounds().length() / 2., maxLength + 0.000);
354  const SimpleCylinderBounds TIB2(maxRadius - 0.0150, maxRadius + 0.0150, -maxLength, +maxLength);
355  // Third TIB layer: r=41.9599, l=131.628 !!!! Needs to be larger than TIB2
356  ++bl;
357  maxRadius = (**bl).specificSurface().radius();
358  maxLength = std::max((**bl).specificSurface().bounds().length() / 2., maxLength + 0.000);
359  const SimpleCylinderBounds TIB3(maxRadius - 0.0150, maxRadius + 0.0150, -maxLength, +maxLength);
360  // Fourth TIB layer: r=49.8924, l=132.78
361  ++bl;
362  maxRadius = (**bl).specificSurface().radius();
363  maxLength = std::max((**bl).specificSurface().bounds().length() / 2., maxLength + 0.000);
364  const SimpleCylinderBounds TIB4(maxRadius - 0.0150, maxRadius + 0.0150, -maxLength, +maxLength);
365 
366  // Inner Barrel Cylinder & Ends : Cables and walls
368  const Surface::PositionType PTIBEOut(0.0, 0.0, tibOutCables1ZPosition[version]);
369 
371  const Surface::PositionType PTIBEOut2(0.0, 0.0, tibOutCables2ZPosition[version]);
372 
373  // Inner Tracker / Outer Barrel Wall
374  const SimpleCylinderBounds TOBCIn(tobInCablesRadius[version] - 0.5,
375  tobInCablesRadius[version] + 0.5,
378 
379  // First TOB layer: r=60.7671, l=216.576
380  ++bl;
381  maxRadius = (**bl).specificSurface().radius();
382  maxLength = (**bl).specificSurface().bounds().length() / 2. + 0.0;
383  const SimpleCylinderBounds TOB1(maxRadius - 0.0150, maxRadius + 0.0150, -maxLength, +maxLength);
384  // Second TOB layer: r=69.3966, l=216.576
385  ++bl;
386  maxRadius = (**bl).specificSurface().radius();
387  maxLength = std::max((**bl).specificSurface().bounds().length() / 2. + 0.0, maxLength + 0.000);
388  const SimpleCylinderBounds TOB2(maxRadius - 0.0150, maxRadius + 0.0150, -maxLength, +maxLength);
389  // Third TOB layer: r=78.0686, l=216.576
390  ++bl;
391  maxRadius = (**bl).specificSurface().radius();
392  maxLength = std::max((**bl).specificSurface().bounds().length() / 2. + 0.0, maxLength + 0.000);
393  const SimpleCylinderBounds TOB3(maxRadius - 0.0150, maxRadius + 0.0150, -maxLength, +maxLength);
394  // Fourth TOB layer: r=86.8618, l=216.576
395  ++bl;
396  maxRadius = (**bl).specificSurface().radius();
397  maxLength = std::max((**bl).specificSurface().bounds().length() / 2. + 0.0, maxLength + 0.000);
398  const SimpleCylinderBounds TOB4(maxRadius - 0.0150, maxRadius + 0.0150, -maxLength, +maxLength);
399  // Fifth TOB layer: r=96.5557, l=216.576
400  ++bl;
401  maxRadius = (**bl).specificSurface().radius();
402  maxLength = std::max((**bl).specificSurface().bounds().length() / 2. + 0.0, maxLength + 0.000);
403  const SimpleCylinderBounds TOB5(maxRadius - 0.0150, maxRadius + 0.0150, -maxLength, +maxLength);
404  // Sixth TOB layer: r=108.05, l=216.576
405  ++bl;
406  maxRadius = (**bl).specificSurface().radius();
407  maxLength = std::max((**bl).specificSurface().bounds().length() / 2. + 0.0, maxLength + 0.000);
408  const SimpleCylinderBounds TOB6(maxRadius - 0.0150, maxRadius + 0.0150, -maxLength, +maxLength);
409 
411  const Surface::PositionType PTOBEOut(0.0, 0.0, tobOutCablesZPosition[version]);
412 
413  const Surface::RotationType theRotation2(1., 0., 0., 0., 1., 0., 0., 0., 1.);
414 
415  // Outside : Barrel
420 
421  // And now the disks...
422  auto fl = posForwardLayers.begin();
423 
424  // Pixel disks
425  // First Pixel disk: Z pos 35.5 radii 5.42078, 16.0756
426  double innerRadius = (**fl).specificSurface().innerRadius() - 1.0;
427  double outerRadius = (**fl).specificSurface().outerRadius() + 2.0;
428  const SimpleDiskBounds PIXD1(innerRadius, outerRadius, -0.0150, +0.0150);
429  const Surface::PositionType PPIXD1(0.0, 0.0, (**fl).surface().position().z());
430  // Second Pixel disk: Z pos 48.5 radii 5.42078, 16.0756
431  ++fl;
432  innerRadius = (**fl).specificSurface().innerRadius() - 1.0;
433  outerRadius = std::max((**fl).specificSurface().outerRadius() + 2.0, outerRadius + 0.000);
434  const SimpleDiskBounds PIXD2(innerRadius, outerRadius, -0.0150, +0.0150);
435  const Surface::PositionType PPIXD2(0.0, 0.0, (**fl).surface().position().z());
436 
437  // Tracker Inner disks (add 3 cm for the outer radius to simulate cables,
438  // and remove 1cm to inner radius to allow for some extrapolation margin)
439  // First TID : Z pos 78.445 radii 23.14, 50.4337
440  ++fl;
441  innerRadius = (**fl).specificSurface().innerRadius() - 0.5;
442  outerRadius = (**fl).specificSurface().outerRadius() + 3.5;
443  const SimpleDiskBounds TID1(innerRadius, outerRadius, -0.0150, +0.0150);
444  const Surface::PositionType PTID1(0., 0., (**fl).surface().position().z());
445  // Second TID : Z pos 90.445 radii 23.14, 50.4337
446  ++fl;
447  innerRadius = (**fl).specificSurface().innerRadius() - 0.5;
448  outerRadius = std::max((**fl).specificSurface().outerRadius() + 3.5, outerRadius + 0.000);
449  const SimpleDiskBounds TID2(innerRadius, outerRadius, -0.0150, +0.0150);
450  const Surface::PositionType PTID2(0., 0., (**fl).surface().position().z());
451  // Third TID : Z pos 105.445 radii 23.14, 50.4337
452  ++fl;
453  innerRadius = (**fl).specificSurface().innerRadius() - 0.5;
454  outerRadius = std::max((**fl).specificSurface().outerRadius() + 3.5, outerRadius + 0.000);
455  const SimpleDiskBounds TID3(innerRadius, outerRadius, -0.0150, +0.0150);
456  const Surface::PositionType PTID3(0., 0., (**fl).surface().position().z());
457 
458  // TID Wall and cables
459  const SimpleDiskBounds TIDEOut(tidOutCablesInnerRadius[version], outerRadius + 1.0, -0.5, 0.5);
460  const Surface::PositionType PTIDEOut(0.0, 0.0, tidOutCablesZPosition[version]);
461 
462  // Tracker Endcaps : Add 11 cm to outer radius to correct for a bug, remove
463  // 5cm to the inner radius (TEC7,8,9) to correct for a simular bug, and
464  // remove other 2cm to inner radius to allow for some extrapolation margin
465  // First TEC: Z pos 131.892 radii 23.3749, 99.1967
466  ++fl;
467  innerRadius = (**fl).specificSurface().innerRadius() - 1.5;
468  outerRadius = (**fl).specificSurface().outerRadius() + 2.0;
469  const SimpleDiskBounds TEC1(innerRadius, outerRadius, -0.0150, +0.0150);
470  const Surface::PositionType PTEC1(0., 0, (**fl).surface().position().z());
471  // Second TEC: Z pos 145.892 radii 23.3749, 99.1967
472  ++fl;
473  innerRadius = (**fl).specificSurface().innerRadius() - 1.5;
474  outerRadius = std::max((**fl).specificSurface().outerRadius() + 2.0, outerRadius + 0.000);
475  const SimpleDiskBounds TEC2(innerRadius, outerRadius, -0.0150, +0.0150);
476  const Surface::PositionType PTEC2(0., 0., (**fl).surface().position().z());
477  // Third TEC: Z pos 159.892 radii 23.3749, 99.1967
478  ++fl;
479  innerRadius = (**fl).specificSurface().innerRadius() - 1.5;
480  outerRadius = std::max((**fl).specificSurface().outerRadius() + 2.0, outerRadius + 0.000);
481  const SimpleDiskBounds TEC3(innerRadius, outerRadius, -0.0150, +0.0150);
482  const Surface::PositionType PTEC3(0., 0., (**fl).surface().position().z());
483  // Fourth TEC: Z pos 173.892 radii 32.1263, 99.1967
484  ++fl;
485  innerRadius = (**fl).specificSurface().innerRadius() - 2.5;
486  outerRadius = std::max((**fl).specificSurface().outerRadius() + 2.0, outerRadius + 0.000);
487  const SimpleDiskBounds TEC4(innerRadius, outerRadius, -0.0150, +0.0150);
488  const Surface::PositionType PTEC4(0., 0., (**fl).surface().position().z());
489  // Fifth TEC: Z pos 187.892 radii 32.1263, 99.1967
490  ++fl;
491  innerRadius = (**fl).specificSurface().innerRadius() - 2.5;
492  outerRadius = std::max((**fl).specificSurface().outerRadius() + 2.0, outerRadius + 0.000);
493  const SimpleDiskBounds TEC5(innerRadius, outerRadius, -0.0150, +0.0150);
494  const Surface::PositionType PTEC5(0., 0., (**fl).surface().position().z());
495  // Sixth TEC: Z pos 205.392 radii 32.1263, 99.1967
496  ++fl;
497  innerRadius = (**fl).specificSurface().innerRadius() - 2.5;
498  outerRadius = std::max((**fl).specificSurface().outerRadius() + 2.0, outerRadius + 0.000);
499  const SimpleDiskBounds TEC6(innerRadius, outerRadius, -0.0150, +0.0150);
500  const Surface::PositionType PTEC6(0., 0., (**fl).surface().position().z());
501  // Seventh TEC: Z pos 224.121 radii 44.7432, 99.1967
502  ++fl;
503  innerRadius = (**fl).specificSurface().innerRadius() - 9.5;
504  outerRadius = std::max((**fl).specificSurface().outerRadius() + 2.0, outerRadius + 0.000);
505  const SimpleDiskBounds TEC7(innerRadius, outerRadius, -0.0150, +0.0150);
506  const Surface::PositionType PTEC7(0., 0., (**fl).surface().position().z());
507  // Eighth TEC: Z pos 244.621 radii 44.7432, 99.1967
508  ++fl;
509  innerRadius = (**fl).specificSurface().innerRadius() - 9.5;
510  outerRadius = std::max((**fl).specificSurface().outerRadius() + 2.0, outerRadius + 0.000);
511  const SimpleDiskBounds TEC8(innerRadius, outerRadius, -0.0150, +0.0150);
512  const Surface::PositionType PTEC8(0., 0., (**fl).surface().position().z());
513  // Nineth TEC: Z pos 266.121 radii 56.1781, 99.1967
514  ++fl;
515  innerRadius = (**fl).specificSurface().innerRadius() - 20.5;
516  outerRadius = std::max((**fl).specificSurface().outerRadius() + 2.0, outerRadius + 0.000);
517  const SimpleDiskBounds TEC9(innerRadius, outerRadius, -0.0150, +0.0150);
518  const Surface::PositionType PTEC9(0., 0., (**fl).surface().position().z());
519 
520  // Outside : Endcap
522  const Surface::PositionType PTEOut(0.0, 0.0, tecOutCables1ZPosition[version]);
523 
525  const Surface::PositionType PTEOut2(0.0, 0.0, tecOutCables2ZPosition[version]);
526 
527  // The ordering of disks and cylinders is essential here
528  // (from inside to outside)
529  // Do not change it thoughtlessly.
530 
531  // Beam Pipe
532 
533  unsigned layerNr = 100;
534  theCylinder = new BoundCylinder(thePosition, theRotation, PIPE);
535  theCylinder->setMediumProperties(*_theMPBeamPipe);
536  if (theCylinder->mediumProperties().radLen() > 0.)
537  _theCylinders.push_back(
538  TrackerLayer(theCylinder, false, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
539  else
540  delete theCylinder;
541 
542  // Pixels
543 
544  layerNr = TrackerInteractionGeometry::PXB + 1;
545  theCylinder = new BoundCylinder(thePosition, theRotation, PIXB1);
546  theCylinder->setMediumProperties(*_theMPPixelBarrel);
547  if (theCylinder->mediumProperties().radLen() > 0.)
548  _theCylinders.push_back(
549  TrackerLayer(theCylinder, false, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
550  else
551  delete theCylinder;
552 
553  layerNr = 101;
554  theDisk = new BoundDisk(PPIXBOut1, theRotation2, PIXBOut1);
555  theDisk->setMediumProperties(*_theMPPixelOutside1);
556  if (theDisk->mediumProperties().radLen() > 0.)
557  _theCylinders.push_back(
558  TrackerLayer(theDisk, true, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
559  else
560  delete theDisk;
561 
562  layerNr = TrackerInteractionGeometry::PXB + 2;
563  theCylinder = new BoundCylinder(thePosition, theRotation, PIXB2);
564  theCylinder->setMediumProperties(*_theMPPixelBarrel);
565  if (theCylinder->mediumProperties().radLen() > 0.)
566  _theCylinders.push_back(
567  TrackerLayer(theCylinder, false, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
568  else
569  delete theCylinder;
570 
571  layerNr = 102;
572  theDisk = new BoundDisk(PPIXBOut2, theRotation2, PIXBOut2);
573  theDisk->setMediumProperties(*_theMPPixelOutside2);
574  if (theDisk->mediumProperties().radLen() > 0.)
575  _theCylinders.push_back(
576  TrackerLayer(theDisk, true, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
577  else
578  delete theDisk;
579 
580  layerNr = 103;
581  theDisk = new BoundDisk(PPIXBOut3, theRotation2, PIXBOut3);
582  theDisk->setMediumProperties(*_theMPPixelOutside3);
583  if (theDisk->mediumProperties().radLen() > 0.)
584  _theCylinders.push_back(
585  TrackerLayer(theDisk, true, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
586  else
587  delete theDisk;
588 
589  layerNr = TrackerInteractionGeometry::PXB + 3;
590  theCylinder = new BoundCylinder(thePosition, theRotation, PIXB3);
591  theCylinder->setMediumProperties(*_theMPPixelBarrel);
592  if (theCylinder->mediumProperties().radLen() > 0.)
593  _theCylinders.push_back(
594  TrackerLayer(theCylinder, false, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
595  else
596  delete theCylinder;
597 
598  layerNr = 104;
599  theDisk = new BoundDisk(PPIXBOut4, theRotation2, PIXBOut4);
600  theDisk->setMediumProperties(*_theMPPixelOutside4);
601  if (theDisk->mediumProperties().radLen() > 0.)
602  _theCylinders.push_back(
603  TrackerLayer(theDisk, true, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
604  else
605  delete theDisk;
606 
607  layerNr = 105;
608  theDisk = new BoundDisk(PPIXBOut, theRotation2, PIXBOut);
609  theDisk->setMediumProperties(*_theMPPixelOutside);
610  if (theDisk->mediumProperties().radLen() > 0.)
611  _theCylinders.push_back(
612  TrackerLayer(theDisk, true, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
613  else
614  delete theDisk;
615 
616  layerNr = TrackerInteractionGeometry::PXD + 1;
617  theDisk = new BoundDisk(PPIXD1, theRotation2, PIXD1);
618  theDisk->setMediumProperties(*_theMPPixelEndcap);
619  if (theDisk->mediumProperties().radLen() > 0.)
620  _theCylinders.push_back(
621  TrackerLayer(theDisk, true, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
622  else
623  delete theDisk;
624 
625  layerNr = TrackerInteractionGeometry::PXD + 2;
626  theDisk = new BoundDisk(PPIXD2, theRotation2, PIXD2);
627  theDisk->setMediumProperties(*_theMPPixelEndcap);
628  if (theDisk->mediumProperties().radLen() > 0.)
629  _theCylinders.push_back(
630  TrackerLayer(theDisk, true, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
631  else
632  delete theDisk;
633 
634  layerNr = 106;
635  theCylinder = new BoundCylinder(thePosition, theRotation, PIXBOut5);
636  theCylinder->setMediumProperties(*_theMPPixelOutside5);
637  if (theCylinder->mediumProperties().radLen() > 0.)
638  _theCylinders.push_back(
639  TrackerLayer(theCylinder, false, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
640  else
641  delete theCylinder;
642 
643  layerNr = 107;
644  theDisk = new BoundDisk(PPIXBOut6, theRotation2, PIXBOut6);
645  theDisk->setMediumProperties(*_theMPPixelOutside6);
646  if (theDisk->mediumProperties().radLen() > 0.)
647  _theCylinders.push_back(
648  TrackerLayer(theDisk, true, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
649  else
650  delete theDisk;
651 
652  // Inner Barrel
653 
654  layerNr = TrackerInteractionGeometry::TIB + 1;
655  theCylinder = new BoundCylinder(thePosition, theRotation, TIB1);
656  theCylinder->setMediumProperties(*_theMPTIB1);
657  if (theCylinder->mediumProperties().radLen() > 0.)
658  _theCylinders.push_back(
659  TrackerLayer(theCylinder, false, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
660  else
661  delete theCylinder;
662 
663  layerNr = TrackerInteractionGeometry::TIB + 2;
664  theCylinder = new BoundCylinder(thePosition, theRotation, TIB2);
665  theCylinder->setMediumProperties(*_theMPTIB2);
666  if (theCylinder->mediumProperties().radLen() > 0.)
667  _theCylinders.push_back(
668  TrackerLayer(theCylinder, false, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
669  else
670  delete theCylinder;
671 
672  layerNr = TrackerInteractionGeometry::TIB + 3;
673  theCylinder = new BoundCylinder(thePosition, theRotation, TIB3);
674  theCylinder->setMediumProperties(*_theMPTIB3);
675  if (theCylinder->mediumProperties().radLen() > 0.)
676  _theCylinders.push_back(
677  TrackerLayer(theCylinder, false, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
678  else
679  delete theCylinder;
680 
681  layerNr = TrackerInteractionGeometry::TIB + 4;
682  theCylinder = new BoundCylinder(thePosition, theRotation, TIB4);
683  theCylinder->setMediumProperties(*_theMPTIB4);
684  if (theCylinder->mediumProperties().radLen() > 0.)
685  _theCylinders.push_back(
686  TrackerLayer(theCylinder, false, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
687  else
688  delete theCylinder;
689 
690  layerNr = 108;
691  theDisk = new BoundDisk(PTIBEOut, theRotation2, TIBEOut);
692  theDisk->setMediumProperties(*_theMPTIBEOutside1);
693  if (theDisk->mediumProperties().radLen() > 0.)
694  _theCylinders.push_back(
695  TrackerLayer(theDisk, true, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
696  else
697  delete theDisk;
698 
699  layerNr = 109;
700  theDisk = new BoundDisk(PTIBEOut2, theRotation2, TIBEOut2);
701  theDisk->setMediumProperties(*_theMPTIBEOutside2);
702  if (theDisk->mediumProperties().radLen() > 0.)
703  _theCylinders.push_back(
704  TrackerLayer(theDisk, true, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
705  else
706  delete theDisk;
707 
708  // Inner Endcaps
709 
710  layerNr = TrackerInteractionGeometry::TID + 1;
711  theDisk = new BoundDisk(PTID1, theRotation2, TID1);
712  theDisk->setMediumProperties(*_theMPInner1);
713  if (theDisk->mediumProperties().radLen() > 0.)
714  _theCylinders.push_back(TrackerLayer(theDisk, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
715  else
716  delete theDisk;
717 
718  layerNr = TrackerInteractionGeometry::TID + 2;
719  theDisk = new BoundDisk(PTID2, theRotation2, TID2);
720  theDisk->setMediumProperties(*_theMPInner2);
721  if (theDisk->mediumProperties().radLen() > 0.)
722  _theCylinders.push_back(TrackerLayer(theDisk, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
723 
724  else
725  delete theDisk;
726 
727  layerNr = TrackerInteractionGeometry::TID + 3;
728  theDisk = new BoundDisk(PTID3, theRotation2, TID3);
729  theDisk->setMediumProperties(*_theMPInner3);
730  if (theDisk->mediumProperties().radLen() > 0.)
731  _theCylinders.push_back(
732  TrackerLayer(theDisk, true, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
733  else
734  delete theDisk;
735 
736  layerNr = 110;
737  theDisk = new BoundDisk(PTIDEOut, theRotation2, TIDEOut);
738  theDisk->setMediumProperties(*_theMPTIDEOutside);
739  if (theDisk->mediumProperties().radLen() > 0.)
740  _theCylinders.push_back(
741  TrackerLayer(theDisk, true, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
742  else
743  delete theDisk;
744 
745  // Outer Barrel
746 
747  layerNr = 111;
748  theCylinder = new BoundCylinder(thePosition, theRotation, TOBCIn);
749  theCylinder->setMediumProperties(*_theMPTOBBInside);
750  if (theCylinder->mediumProperties().radLen() > 0.)
751  _theCylinders.push_back(
752  TrackerLayer(theCylinder, false, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
753  else
754  delete theCylinder;
755 
756  layerNr = TrackerInteractionGeometry::TOB + 1;
757  theCylinder = new BoundCylinder(thePosition, theRotation, TOB1);
758  theCylinder->setMediumProperties(*_theMPTOB1);
759  if (theCylinder->mediumProperties().radLen() > 0.)
760  _theCylinders.push_back(
761  TrackerLayer(theCylinder, false, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
762  else
763  delete theCylinder;
764 
765  layerNr = TrackerInteractionGeometry::TOB + 2;
766  theCylinder = new BoundCylinder(thePosition, theRotation, TOB2);
767  theCylinder->setMediumProperties(*_theMPTOB2);
768  if (theCylinder->mediumProperties().radLen() > 0.)
769  _theCylinders.push_back(
770  TrackerLayer(theCylinder, false, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
771  else
772  delete theCylinder;
773 
774  layerNr = TrackerInteractionGeometry::TOB + 3;
775  theCylinder = new BoundCylinder(thePosition, theRotation, TOB3);
776  theCylinder->setMediumProperties(*_theMPTOB3);
777  if (theCylinder->mediumProperties().radLen() > 0.)
778  _theCylinders.push_back(
779  TrackerLayer(theCylinder, false, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
780  else
781  delete theCylinder;
782 
783  layerNr = TrackerInteractionGeometry::TOB + 4;
784  theCylinder = new BoundCylinder(thePosition, theRotation, TOB4);
785  theCylinder->setMediumProperties(*_theMPTOB4);
786  if (theCylinder->mediumProperties().radLen() > 0.)
787  _theCylinders.push_back(
788  TrackerLayer(theCylinder, false, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
789  else
790  delete theCylinder;
791 
792  layerNr = TrackerInteractionGeometry::TOB + 5;
793  theCylinder = new BoundCylinder(thePosition, theRotation, TOB5);
794  theCylinder->setMediumProperties(*_theMPTOB5);
795  if (theCylinder->mediumProperties().radLen() > 0.)
796  _theCylinders.push_back(
797  TrackerLayer(theCylinder, false, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
798  else
799  delete theCylinder;
800 
801  layerNr = TrackerInteractionGeometry::TOB + 6;
802  theCylinder = new BoundCylinder(thePosition, theRotation, TOB6);
803  theCylinder->setMediumProperties(*_theMPTOB6);
804  if (theCylinder->mediumProperties().radLen() > 0.)
805  _theCylinders.push_back(
806  TrackerLayer(theCylinder, false, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
807  else
808  delete theCylinder;
809 
810  layerNr = 112;
811  theDisk = new BoundDisk(PTOBEOut, theRotation2, TOBEOut);
812  theDisk->setMediumProperties(*_theMPTOBEOutside);
813  if (theDisk->mediumProperties().radLen() > 0.)
814  _theCylinders.push_back(
815  TrackerLayer(theDisk, true, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
816  else
817  delete theDisk;
818 
819  // Outer Endcaps
820 
821  layerNr = TrackerInteractionGeometry::TEC + 1;
822  theDisk = new BoundDisk(PTEC1, theRotation2, TEC1);
823  theDisk->setMediumProperties(*_theMPEndcap);
824  if (theDisk->mediumProperties().radLen() > 0.)
825  _theCylinders.push_back(TrackerLayer(theDisk, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
826  else
827  delete theDisk;
828 
829  layerNr = TrackerInteractionGeometry::TEC + 2;
830  theDisk = new BoundDisk(PTEC2, theRotation2, TEC2);
831  theDisk->setMediumProperties(*_theMPEndcap);
832  if (theDisk->mediumProperties().radLen() > 0.)
833  _theCylinders.push_back(TrackerLayer(theDisk, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
834  else
835  delete theDisk;
836 
837  layerNr = TrackerInteractionGeometry::TEC + 3;
838  theDisk = new BoundDisk(PTEC3, theRotation2, TEC3);
839  theDisk->setMediumProperties(*_theMPEndcap);
840  if (theDisk->mediumProperties().radLen() > 0.)
841  _theCylinders.push_back(TrackerLayer(theDisk, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
842  else
843  delete theDisk;
844 
845  layerNr = TrackerInteractionGeometry::TEC + 4;
846  theDisk = new BoundDisk(PTEC4, theRotation2, TEC4);
847  theDisk->setMediumProperties(*_theMPEndcap);
848  if (theDisk->mediumProperties().radLen() > 0.)
849  _theCylinders.push_back(TrackerLayer(theDisk, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
850  else
851  delete theDisk;
852 
853  layerNr = TrackerInteractionGeometry::TEC + 5;
854  theDisk = new BoundDisk(PTEC5, theRotation2, TEC5);
855  theDisk->setMediumProperties(*_theMPEndcap);
856  if (theDisk->mediumProperties().radLen() > 0.)
857  _theCylinders.push_back(TrackerLayer(theDisk, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
858  else
859  delete theDisk;
860 
861  layerNr = TrackerInteractionGeometry::TEC + 6;
862  theDisk = new BoundDisk(PTEC6, theRotation2, TEC6);
863  theDisk->setMediumProperties(*_theMPEndcap);
864  if (theDisk->mediumProperties().radLen() > 0.)
865  _theCylinders.push_back(TrackerLayer(theDisk, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
866  else
867  delete theDisk;
868 
869  layerNr = TrackerInteractionGeometry::TEC + 7;
870  theDisk = new BoundDisk(PTEC7, theRotation2, TEC7);
871  theDisk->setMediumProperties(*_theMPEndcap);
872  if (theDisk->mediumProperties().radLen() > 0.)
873  _theCylinders.push_back(TrackerLayer(theDisk, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
874  else
875  delete theDisk;
876 
877  layerNr = TrackerInteractionGeometry::TEC + 8;
878  theDisk = new BoundDisk(PTEC8, theRotation2, TEC8);
879  theDisk->setMediumProperties(*_theMPEndcap);
880  if (theDisk->mediumProperties().radLen() > 0.)
881  _theCylinders.push_back(TrackerLayer(theDisk, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
882  else
883  delete theDisk;
884 
885  layerNr = TrackerInteractionGeometry::TEC + 9;
886  theDisk = new BoundDisk(PTEC9, theRotation2, TEC9);
887  theDisk->setMediumProperties(*_theMPEndcap);
888  if (theDisk->mediumProperties().radLen() > 0.)
889  _theCylinders.push_back(TrackerLayer(theDisk, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
890  else
891  delete theDisk;
892 
893  // Tracker Outside
894 
895  layerNr = 113;
896  theCylinder = new BoundCylinder(thePosition, theRotation, TBOut);
897  theCylinder->setMediumProperties(*_theMPBarrelOutside);
898  if (theCylinder->mediumProperties().radLen() > 0.)
899  _theCylinders.push_back(
900  TrackerLayer(theCylinder, false, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
901  else
902  delete theCylinder;
903 
904  layerNr = 114;
905  theDisk = new BoundDisk(PTEOut, theRotation2, TEOut);
906  theDisk->setMediumProperties(*_theMPEndcapOutside);
907  if (theDisk->mediumProperties().radLen() > 0.)
908  _theCylinders.push_back(
909  TrackerLayer(theDisk, true, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
910  else
911  delete theDisk;
912 
913  layerNr = 115;
914  theDisk = new BoundDisk(PTEOut2, theRotation2, TEOut2);
915  theDisk->setMediumProperties(*_theMPEndcapOutside2);
916  if (theDisk->mediumProperties().radLen() > 0.)
917  _theCylinders.push_back(
918  TrackerLayer(theDisk, true, layerNr, minDim(layerNr), maxDim(layerNr), fudgeFactors(layerNr)));
919  else
920  delete theDisk;
921  }
922 
923  // Check overall compatibility of cylinder dimensions
924  // (must be nested cylinders)
925  // Throw an exception if the test fails
926  double zin, rin;
927  double zout, rout;
928  unsigned nCyl = 0;
929  std::list<TrackerLayer>::const_iterator cyliterOut = cylinderBegin();
930  // Inner cylinder dimensions
931  if (cyliterOut->forward()) {
932  zin = cyliterOut->disk()->position().z();
933  rin = cyliterOut->disk()->outerRadius();
934  } else {
935  zin = cyliterOut->cylinder()->bounds().length() / 2.;
936  rin = cyliterOut->cylinder()->bounds().width() / 2.;
937  }
938  // Go to the next cylinder
939  ++cyliterOut;
940 
941  // And loop over all cylinders
942  while (cyliterOut != cylinderEnd()) {
943  // Outer cylinder dimensions
944  if (cyliterOut->forward()) {
945  zout = cyliterOut->disk()->position().z();
946  rout = cyliterOut->disk()->outerRadius();
947  } else {
948  zout = cyliterOut->cylinder()->bounds().length() / 2.;
949  rout = cyliterOut->cylinder()->bounds().width() / 2.;
950  }
951 
952  nCyl++;
953  if (zout < zin || rout < rin) {
954  throw cms::Exception("FastSimulation/TrackerInteractionGeometry ")
955  << " WARNING with cylinder number " << nCyl << " (Active Layer Number = " << cyliterOut->layerNumber()
956  << " Forward ? " << cyliterOut->forward() << " ) "
957  << " has dimensions smaller than previous cylinder : " << std::endl
958  << " zout/zin = " << zout << " " << zin << std::endl
959  << " rout/rin = " << rout << " " << rin << std::endl;
960  } else {
961  /*
962  std::cout << " Cylinder number " << nCyl
963  << " (Active Layer Number = " << cyliterOut->layerNumber()
964  << " Forward ? " << cyliterOut->forward() << " ) "
965  << " has dimensions of : "
966  << " zout = " << zout << "; "
967  << " rout = " << rout << std::endl;
968  */
969  }
970 
971  // Go to the next cylinder
972  cyliterOut++;
973  // Inner cylinder becomes outer cylinder
974  zin = zout;
975  rin = rout;
976  // End test
977  }
978 }
979 
980 std::vector<double> TrackerInteractionGeometry::minDim(unsigned layerNr) {
981  std::vector<double> min;
982  for (unsigned iLayer = 0; iLayer < fudgeFactor.size(); ++iLayer) {
983  if (layerNr != fudgeLayer[iLayer])
984  continue;
985  min.push_back(fudgeMin[iLayer]);
986  }
987  return min;
988 }
989 
990 std::vector<double> TrackerInteractionGeometry::maxDim(unsigned layerNr) {
991  std::vector<double> max;
992  for (unsigned iLayer = 0; iLayer < fudgeFactor.size(); ++iLayer) {
993  if (layerNr != fudgeLayer[iLayer])
994  continue;
995  max.push_back(fudgeMax[iLayer]);
996  }
997  return max;
998 }
999 
1000 std::vector<double> TrackerInteractionGeometry::fudgeFactors(unsigned layerNr) {
1001  std::vector<double> fudge;
1002  for (unsigned iLayer = 0; iLayer < fudgeFactor.size(); ++iLayer) {
1003  if (layerNr != fudgeLayer[iLayer])
1004  continue;
1005  fudge.push_back(fudgeFactor[iLayer]);
1006  }
1007  return fudge;
1008 }
1009 
1011  _theCylinders.clear();
1012  // _theRings.clear();
1013 
1014  if (use_hardcoded) {
1015  // The Beam pipe
1016  delete _theMPBeamPipe;
1017  // The pixel barrel layers
1018  delete _theMPPixelBarrel;
1019  // The pixel endcap disks
1020  delete _theMPPixelEndcap;
1021  // The various cables thicnesses for each layer / disks
1022  delete _theMPPixelOutside1;
1023  delete _theMPPixelOutside2;
1024  delete _theMPPixelOutside3;
1025  delete _theMPPixelOutside4;
1026  delete _theMPPixelOutside;
1027  delete _theMPPixelOutside5;
1028  delete _theMPPixelOutside6;
1029  // The tracker inner barrel layers
1030  delete _theMPTIB1;
1031  delete _theMPTIB2;
1032  delete _theMPTIB3;
1033  delete _theMPTIB4;
1034  // The tracker outer barrel layers
1035  delete _theMPTOB1;
1036  delete _theMPTOB2;
1037  delete _theMPTOB3;
1038  delete _theMPTOB4;
1039  delete _theMPTOB5;
1040  delete _theMPTOB6;
1041  // The tracker inner disks
1042  delete _theMPInner1;
1043  delete _theMPInner2;
1044  delete _theMPInner3;
1045  // The tracker endcap disks
1046  delete _theMPEndcap;
1047  // Various cable thicknesses
1048  delete _theMPTOBBInside;
1049  delete _theMPTIBEOutside1;
1050  delete _theMPTIBEOutside2;
1051  delete _theMPTIDEOutside;
1052  delete _theMPTOBEOutside;
1053  delete _theMPBarrelOutside;
1054  delete _theMPEndcapOutside;
1055  delete _theMPEndcapOutside2;
1056 
1057  } else {
1058  for (unsigned int i = 0; i < _mediumProperties.size(); i++) {
1059  delete _mediumProperties[i];
1060  }
1061  }
1062 }
std::vector< double > pixelOutCablesLength
MediumProperties * _theMPEndcap
The Tracker EndCap layers.
std::vector< double > tibOutCables2OuterRadius
std::vector< double > pxbOutCables2OuterRadius
MediumProperties * _theMPTOB3
The tracker outer barrel layer 3.
std::vector< double > tobLayer5Thickness
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::vector< double > pxdThickness
Pixel Disks 1-2.
std::vector< double > pxbThickness
Pixel Barrel Layers 1-3.
std::vector< double > pixelOutCablesOuterRadius
std::vector< double > pxbOutCables1Thickness
Pixel Barrel outside cables.
std::vector< double > tidLayer3Thickness
std::vector< double > tibOutCables1Thickness
TIB outside services (endcap)
MediumProperties * _theMPTOB4
The tracker outer barrel layer 4.
std::vector< double > pxb1CablesInnerRadius
Cables and Services at the end of PIXB1,2,3 ("disk")
std::vector< MediumProperties * > _mediumProperties
std::vector< double > tecOutCables2ZPosition
std::vector< double > pxbOutCables1ZPosition
std::list< TrackerLayer > _theCylinders
The list of tracker (sensistive or not) layers.
MediumProperties * _theMPPixelEndcap
The endcap pixel layers.
std::vector< double > beamPipeThickness
Beam Pipe.
std::vector< double > pxb3CablesThickness
std::vector< double > tibOutCables1OuterRadius
std::vector< double > pixelOutCablesZPosition
std::vector< double > pxbOutCables2InnerRadius
MediumProperties * _theMPTIDEOutside
Some material around the tracker inner disks (disk)
std::vector< double > pxb1CablesThickness
Pixel Barrel services at the end of layers 1-3.
std::vector< double > pxb3CablesInnerRadius
Cylinder BoundCylinder
Definition: BoundCylinder.h:17
std::vector< double > pixelOutCablesRadius
Pixel Outside walls and cables (barrel and endcaps)
MediumProperties * _theMPTOB1
The tracker outer barrel layer 1.
std::vector< double > tobOutCablesRadius
MediumProperties * _theMPBarrelOutside
Cables around the tracker (one barrel, two disks)
std::vector< double > tobLayer3Thickness
std::vector< double > tobOutCablesInnerRadius
Tracker Outer Barrel Outside Cables and walls (barrel and endcaps)
std::vector< double > tecOutCables2OuterRadius
std::vector< double > tibOutCables2InnerRadius
std::vector< double > tobInsideThickness
TOB inside wall (barrel)
std::vector< double > tidOutCablesZPosition
assert(be >=bs)
std::vector< double > pxb2CablesInnerRadius
MediumProperties * _theMPTOB6
The tracker outer barrel layer 6.
std::vector< double > tobOutCablesLength
MediumProperties * _theMPTOBEOutside
Some material around the tracker outer barrel (disk)
std::vector< double > minDim(unsigned layerNr)
std::vector< double > barrelCablesThickness
std::vector< double > pixelOutCablesInnerRadius
std::vector< double > pxdOutCables1Thickness
Pixel Endcap outside cables.
std::vector< double > tobLayer6Thickness
MediumProperties * _theMPTOB2
The tracker outer barrel layer 2.
std::vector< double > endcapCables2Thickness
std::vector< double > pxbOutCables1OuterRadius
MediumProperties * _theMPTIBEOutside1
Some material around the tracker inner barrel (disk)
std::vector< double > tibLayer2Thickness
std::vector< double > fudgeFactors(unsigned layerNr)
MediumProperties * _theMPPixelOutside1
A series of cables/walls to reproduce the full sim.
MediumProperties * _theMPPixelBarrel
The barrel pixel layers.
MediumProperties * _theMPTIB2
The tracker inner barrel layer 2.
std::vector< double > tibLayer4Thickness
std::vector< double > tibOutCables1ZPosition
MediumProperties * _theMPTIB1
The tracker inner barrel layer 1.
std::vector< double > tidLayer2Thickness
std::vector< double > tibLayer1Thickness
Tracker Inner barrel layers 1-4.
std::vector< double > tecOutCables1OuterRadius
std::vector< double > tobLayer1Thickness
Tracker Outer barrel layers 1-6.
std::list< TrackerLayer >::const_iterator cylinderEnd() const
Returns the last pointer in the cylinder list.
std::vector< double > tidOutsideThickness
TID outside wall (endcap)
MediumProperties * _theMPTOB5
The tracker outer barrel layer 5.
std::vector< double > tibLayer3Thickness
std::vector< ForwardDetLayer const * > const & posForwardLayers() const
std::vector< double > pxbOutCables2Thickness
std::vector< double > tibOutCables2Thickness
MediumProperties * _theMPInner1
The tracker inner disks.
std::vector< double > tobLayer4Thickness
std::vector< double > tecOutCables1ZPosition
std::vector< double > endcapCables1Thickness
std::vector< double > tibOutCables1InnerRadius
Tracker Inner Barrel Outside Cables and walls (endcap)
std::vector< double > pxbOutCables1InnerRadius
Pixel Barrel Outside walls and cables.
std::list< TrackerLayer >::const_iterator cylinderBegin() const
Returns the first pointer in the cylinder list.
std::vector< unsigned int > fudgeLayer
TrackerInteractionGeometry(const edm::ParameterSet &trackerMaterial, const GeometricSearchTracker *geomSearchTracker)
Constructor : get the configurable parameters.
std::vector< BarrelDetLayer const * > const & barrelLayers() const
std::vector< double > tobLayer2Thickness
std::vector< double > tobInCablesRadius
Tracker outer barrel Inside wall (barrel)
Disk BoundDisk
Definition: BoundDisk.h:54
std::vector< double > tobOutCablesZPosition
std::vector< double > pxbOutCables2ZPosition
std::vector< double > tidOutCablesInnerRadius
Tracker Inner Disks Outside Cables and walls.
std::vector< double > maxDim(unsigned layerNr)
std::vector< double > tecOutCables1InnerRadius
Tracker Endcaps Outside Cables and walls.
std::vector< double > tibOutCables2ZPosition
std::vector< double > pxdOutCables2Thickness
MediumProperties * _theMPTOBBInside
Some material in front of the tracker outer barrel (cylinder)
std::vector< double > tobOutsideThickness
MediumProperties * _theMPTIB4
The tracker inner barrel layer 4.
std::vector< double > tidLayer1Thickness
Tracker Inner disks layers 1-3.
std::vector< double > tecOutCables2InnerRadius
std::vector< double > pxb2CablesThickness
MediumProperties * _theMPTIB3
The tracker inner barrel layer 3.
std::vector< double > tobOutCablesOuterRadius