CMS 3D CMS Logo

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