CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
DDTIDModuleAlgo.cc File Reference
#include "DD4hep/DetFactoryHelper.h"
#include "DataFormats/Math/interface/CMSUnits.h"
#include "DetectorDescription/DDCMS/interface/DDPlugins.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"

Go to the source code of this file.

Functions

static long algorithm (Detector &, cms::DDParsingContext &ctxt, xml_h e)
 
 DD4HEP_OPEN_PLUGIN (dd4hep, ddcms_det_element_DDCMS_track_DDTIDModuleAlgo)
 

Function Documentation

static long algorithm ( Detector &  ,
cms::DDParsingContext ctxt,
xml_h  e 
)
static

Definition at line 11 of file DDTIDModuleAlgo.cc.

References cms::DDNamespace::addSolidNS(), cms::DDNamespace::addVolumeNS(), writedatasetfile::args, angle_units::operators::convertRadToDeg(), funct::cos(), cms::DDAlgoArguments::dble(), PVValHelper::dx, PVValHelper::dy, PVValHelper::dz, mps_fire::i, cms::DDAlgoArguments::integer(), isotrackApplyRegressor::k, cms::DDNamespace::material(), mergeVDriftHistosByStation::name, cms::DDAlgoArguments::parentName(), PixelTestBeamValidation_cfi::Position, cms::DDNamespace::prepend(), makeMuonMisalignmentScenario::rot, cms::DDNamespace::rotation(), funct::sin(), cms::DDAlgoArguments::str(), AlCaHLTBitMon_QueryRunRegistry::string, cms::DDAlgoArguments::vecDble(), cms::DDAlgoArguments::vecStr(), and HGCalProperty::waferThick().

11  {
12  cms::DDNamespace ns(ctxt, e, true);
13  DDAlgoArguments args(ctxt, e);
14  string mother = args.parentName();
15  string genMat = args.str("GeneralMaterial"); //General material name
16  int detectorN = args.integer("DetectorNumber"); //Detector planes
17  double moduleThick = args.dble("ModuleThick"); //Module thickness
18  double detTilt = args.dble("DetTilt"); //Tilt of stereo detector
19  double fullHeight = args.dble("FullHeight"); //Height
20  double dlTop = args.dble("DlTop"); //Width at top of wafer
21  double dlBottom = args.dble("DlBottom"); //Width at bottom of wafer
22  double dlHybrid = args.dble("DlHybrid"); //Width at the hybrid end
23  bool doComponents = ::toupper(args.str("DoComponents")[0]) != 'N'; //Components to be made
24 
25  string boxFrameName = args.str("BoxFrameName"); //Top frame name
26  string boxFrameMat = args.str("BoxFrameMaterial"); // material
27  double boxFrameHeight = args.dble("BoxFrameHeight"); // height
28  double boxFrameThick = args.dble("BoxFrameThick"); // thickness
29  double boxFrameWidth = args.dble("BoxFrameWidth"); // extra width
30  double bottomFrameHeight = args.dble("BottomFrameHeight"); //Bottom of the frame
31  double bottomFrameOver = args.dble("BottomFrameOver"); // overlap
32  double topFrameHeight = args.dble("TopFrameHeight"); //Top of the frame
33  double topFrameOver = args.dble("TopFrameOver"); // overlap
34  vector<string> sideFrameName = args.vecStr("SideFrameName"); //Side frame name
35  string sideFrameMat = args.str("SideFrameMaterial"); // material
36  double sideFrameWidth = args.dble("SideFrameWidth"); // width
37  double sideFrameThick = args.dble("SideFrameThick"); // thickness
38  double sideFrameOver = args.dble("SideFrameOver"); // overlap (wrt wafer)
39  vector<string> holeFrameName = args.vecStr("HoleFrameName"); //Hole in the frame name
40  vector<string> holeFrameRot = args.vecStr("HoleFrameRotation"); // Rotation matrix
41 
42  vector<string> kaptonName = args.vecStr("KaptonName"); //Kapton circuit name
43  string kaptonMat = args.str("KaptonMaterial"); // material
44  double kaptonThick = args.dble("KaptonThick"); // thickness
45  double kaptonOver = args.dble("KaptonOver"); // overlap (wrt Wafer)
46  vector<string> holeKaptonName = args.vecStr("HoleKaptonName"); //Hole in the kapton circuit name
47  vector<string> holeKaptonRot = args.vecStr("HoleKaptonRotation"); // Rotation matrix
48 
49  vector<string> waferName = args.vecStr("WaferName"); //Wafer name
50  string waferMat = args.str("WaferMaterial"); // material
51  double sideWidthTop = args.dble("SideWidthTop"); // width on the side Top
52  double sideWidthBottom = args.dble("SideWidthBottom"); // Bottom
53  vector<string> activeName = args.vecStr("ActiveName"); //Sensitive name
54  string activeMat = args.str("ActiveMaterial"); // material
55  double activeHeight = args.dble("ActiveHeight"); // height
56  vector<double> waferThick =
57  args.vecDble("WaferThick"); // wafer thickness (active = wafer - backplane)
58  string activeRot = args.str("ActiveRotation"); // Rotation matrix
59  vector<double> backplaneThick = args.vecDble("BackPlaneThick"); // thickness
60  string hybridName = args.str("HybridName"); //Hybrid name
61  string hybridMat = args.str("HybridMaterial"); // material
62  double hybridHeight = args.dble("HybridHeight"); // height
63  double hybridWidth = args.dble("HybridWidth"); // width
64  double hybridThick = args.dble("HybridThick"); // thickness
65  vector<string> pitchName = args.vecStr("PitchName"); //Pitch adapter name
66  string pitchMat = args.str("PitchMaterial"); // material
67  double pitchHeight = args.dble("PitchHeight"); // height
68  double pitchThick = args.dble("PitchThick"); // thickness
69  double pitchStereoTol = args.dble("PitchStereoTolerance"); // tolerance in dimensions of the stereo
70  string coolName = args.str("CoolInsertName"); // Cool insert name
71  string coolMat = args.str("CoolInsertMaterial"); // material
72  double coolHeight = args.dble("CoolInsertHeight"); // height
73  double coolThick = args.dble("CoolInsertThick"); // thickness
74  double coolWidth = args.dble("CoolInsertWidth"); // width
75 
76  edm::LogVerbatim("TIDGeom") << "Parent " << mother << " General Material " << genMat << " Detector Planes "
77  << detectorN;
78 
79  edm::LogVerbatim("TIDGeom") << "ModuleThick " << moduleThick << " Detector Tilt " << convertRadToDeg(detTilt)
80  << " Height " << fullHeight << " dl(Top) " << dlTop << " dl(Bottom) " << dlBottom
81  << " dl(Hybrid) " << dlHybrid << " doComponents " << doComponents;
82  edm::LogVerbatim("TIDGeom") << "" << boxFrameName << " Material " << boxFrameMat << " Thickness " << boxFrameThick
83  << " width " << boxFrameWidth << " height " << boxFrameHeight
84  << " Extra Height at Bottom " << bottomFrameHeight << " Overlap " << bottomFrameOver;
85 
86  for (int i = 0; i < detectorN; i++)
87  edm::LogVerbatim("TIDGeom") << sideFrameName[i] << " Material " << sideFrameMat << " Width " << sideFrameWidth
88  << " Thickness " << sideFrameThick << " Overlap " << sideFrameOver << " Hole "
89  << holeFrameName[i];
90 
91  for (int i = 0; i < detectorN; i++)
92  edm::LogVerbatim("TIDGeom") << kaptonName[i] << " Material " << kaptonMat << " Thickness " << kaptonThick
93  << " Overlap " << kaptonOver << " Hole " << holeKaptonName[i];
94 
95  edm::LogVerbatim("TIDGeom") << "Wafer Material " << waferMat << " Side Width Top " << sideWidthTop
96  << " Side Width Bottom " << sideWidthBottom;
97  for (int i = 0; i < detectorN; i++)
98  edm::LogVerbatim("TIDGeom") << "\twaferName[" << i << "] = " << waferName[i];
99 
100  edm::LogVerbatim("TIDGeom") << "Active Material " << activeMat << " Height " << activeHeight << " rotated by "
101  << activeRot;
102  for (int i = 0; i < detectorN; i++)
103  edm::LogVerbatim("TIDGeom") << " translated by (0," << -0.5 * backplaneThick[i] << ",0)\tactiveName[" << i
104  << "] = " << activeName[i] << " of thickness " << waferThick[i] - backplaneThick[i];
105 
106  edm::LogVerbatim("TIDGeom") << "" << hybridName << " Material " << hybridMat << " Height " << hybridHeight
107  << " Width " << hybridWidth << " Thickness " << hybridThick;
108  edm::LogVerbatim("TIDGeom") << "Pitch Adapter Material " << pitchMat << " Height " << pitchHeight << " Thickness "
109  << pitchThick;
110  for (int i = 0; i < detectorN; i++)
111  edm::LogVerbatim("TIDGeom") << "\tpitchName[" << i << "] = " << pitchName[i];
112  edm::LogVerbatim("TIDGeom") << "Cool Element Material " << coolMat << " Height " << coolHeight << " Thickness "
113  << coolThick << " Width " << coolWidth;
114 
115  string name = mother;
116  double sidfr = sideFrameWidth - sideFrameOver; // width of side frame on the sides of module
117  double botfr; // width of side frame at the the bottom of the modules
118  double topfr; // width of side frame at the the top of the modules
119  double kaptonHeight;
120  if (dlHybrid > dlTop) {
121  // ring 1, ring 2
122  topfr = topFrameHeight - pitchHeight - topFrameOver;
123  botfr = bottomFrameHeight - bottomFrameOver;
124  kaptonHeight = fullHeight + botfr;
125  } else {
126  // ring 3
127  topfr = topFrameHeight - topFrameOver;
128  botfr = bottomFrameHeight - bottomFrameOver - pitchHeight;
129  kaptonHeight = fullHeight + topfr;
130  }
131 
132  double sideFrameHeight = fullHeight + pitchHeight + botfr + topfr;
133  double kaptonWidth = sidfr + kaptonOver;
134 
135  double dxbot = 0.5 * dlBottom + sidfr;
136  double dxtop = 0.5 * dlTop + sidfr;
137  double dxtopenv, dxbotenv; // top/bot width of the module envelope trap
138 
139  // Envelope
140  if (dlHybrid > dlTop) {
141  // ring 1, ring 2
142  dxtopenv = dxbot + (dxtop - dxbot) * (fullHeight + pitchHeight + topfr + hybridHeight) / fullHeight;
143  dxbotenv = dxtop - (dxtop - dxbot) * (fullHeight + botfr) / fullHeight;
144  } else {
145  // ring 3
146  dxtopenv = dxbot + (dxtop - dxbot) * (fullHeight + topfr) / fullHeight;
147  dxbotenv = dxbot;
148  }
149  double bl1 = dxbotenv;
150  double bl2 = dxtopenv;
151  double h1 = 0.5 * moduleThick;
152  double dx, dy;
153  double dz = 0.5 * (boxFrameHeight + sideFrameHeight);
154 
155  Solid solid = ns.addSolidNS(ns.prepend(name), Trap(dz, 0, 0, h1, bl1, bl1, 0, h1, bl2, bl2, 0));
156  /* Volume module = */ ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(genMat)));
157  edm::LogVerbatim("TIDGeom") << solid.name() << " Trap made of " << genMat << " of dimensions " << dz << ", 0, 0, "
158  << h1 << ", " << bl1 << ", " << bl1 << ", 0, " << h1 << ", " << bl2 << ", " << bl2
159  << ", 0";
160 
161  if (doComponents) {
162  //Box frame
163  name = boxFrameName;
164  dx = 0.5 * boxFrameWidth;
165  dy = 0.5 * boxFrameThick;
166  dz = 0.5 * boxFrameHeight;
167  solid = ns.addSolidNS(ns.prepend(name), Box(dx, dy, dz));
168  edm::LogVerbatim("TIDGeom") << solid.name() << " Box made of " << boxFrameMat << " of dimensions " << dx << ", "
169  << dy << ", " << dz;
170  /* Volume boxFrame = */ ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(boxFrameMat)));
171 
172  // Hybrid
173  name = hybridName;
174  dx = 0.5 * hybridWidth;
175  dy = 0.5 * hybridThick;
176  dz = 0.5 * hybridHeight;
177  solid = ns.addSolidNS(ns.prepend(name), Box(dx, dy, dz));
178  edm::LogVerbatim("TIDGeom") << solid.name() << " Box made of " << hybridMat << " of dimensions " << dx << ", " << dy
179  << ", " << dz;
180  /* Volume hybrid = */ ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(hybridMat)));
181 
182  // Cool Insert
183  name = coolName;
184  dx = 0.5 * coolWidth;
185  dy = 0.5 * coolThick;
186  dz = 0.5 * coolHeight;
187  solid = ns.addSolidNS(ns.prepend(name), Box(dx, dy, dz));
188  edm::LogVerbatim("TIDGeom") << solid.name() << " Box made of " << coolMat << " of dimensions " << dx << ", " << dy
189  << ", " << dz;
190  /* Volume cool = */ ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(coolMat)));
191 
192  // Loop over detectors to be placed
193  for (int k = 0; k < detectorN; k++) {
194  double bbl1, bbl2; // perhaps useless (bl1 enough)
195  // Frame Sides
196  name = sideFrameName[k];
197  if (dlHybrid > dlTop) {
198  // ring 1, ring 2
199  bbl1 = dxtop - (dxtop - dxbot) * (fullHeight + botfr) / fullHeight;
200  bbl2 = dxbot + (dxtop - dxbot) * (fullHeight + pitchHeight + topfr) / fullHeight;
201  } else {
202  // ring 3
203  bbl1 = dxtop - (dxtop - dxbot) * (fullHeight + pitchHeight + botfr) / fullHeight;
204  bbl2 = dxbot + (dxtop - dxbot) * (fullHeight + topfr) / fullHeight;
205  }
206  h1 = 0.5 * sideFrameThick;
207  dz = 0.5 * sideFrameHeight;
208  solid = ns.addSolidNS(ns.prepend(name), Trap(dz, 0., 0., h1, bbl1, bbl1, 0., h1, bbl2, bbl2, 0.));
209  edm::LogVerbatim("TIDGeom") << solid.name() << " Trap made of " << sideFrameMat << " of dimensions " << dz
210  << ", 0, 0, " << h1 << ", " << bbl1 << ", " << bbl1 << ", 0, " << h1 << ", " << bbl2
211  << ", " << bbl2 << ", 0";
212  Volume sideFrame = ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(sideFrameMat)));
213 
214  std::string rotstr, rotns;
215  Rotation3D rot;
216 
217  // Hole in the frame below the wafer
218  name = holeFrameName[k];
219  double xpos, zpos;
220  dz = fullHeight - bottomFrameOver - topFrameOver;
221  bbl1 = dxbot - sideFrameWidth + bottomFrameOver * (dxtop - dxbot) / fullHeight;
222  bbl2 = dxtop - sideFrameWidth - topFrameOver * (dxtop - dxbot) / fullHeight;
223  if (dlHybrid > dlTop) {
224  // ring 1, ring 2
225  zpos = -(topFrameHeight + 0.5 * dz - 0.5 * sideFrameHeight);
226  } else {
227  // ring 3
228  zpos = bottomFrameHeight + 0.5 * dz - 0.5 * sideFrameHeight;
229  }
230  dz /= 2.;
231  solid = ns.addSolidNS(ns.prepend(name), Trap(dz, 0, 0, h1, bbl1, bbl1, 0, h1, bbl2, bbl2, 0));
232  edm::LogVerbatim("TIDGeom") << solid.name() << " Trap made of " << genMat << " of dimensions " << dz << ", 0, 0, "
233  << h1 << ", " << bbl1 << ", " << bbl1 << ", 0, " << h1 << ", " << bbl2 << ", " << bbl2
234  << ", 0";
235  Volume holeFrame = ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(genMat)));
236 
237  rot = ns.rotation(holeFrameRot[k]);
238  sideFrame.placeVolume(holeFrame, 1, Transform3D(rot, Position(0e0, 0e0, zpos))); // copyNr=1
239  edm::LogVerbatim("TIDGeom") << holeFrame.name() << " number 1 positioned in " << sideFrame.name() << " at (0,0,"
240  << zpos << ") with no rotation";
241 
242  // Kapton circuit
243  double kaptonExtraHeight = 0; // kapton extra height in the stereo
244  if (dlHybrid > dlTop) {
245  // ring 1, ring 2
246  bbl1 = dxtop - (dxtop - dxbot) * (fullHeight + botfr) / fullHeight;
247  if (k == 1) {
248  kaptonExtraHeight = dlTop * sin(detTilt) - fullHeight * (1 - cos(detTilt));
249  kaptonExtraHeight = 0.5 * fabs(kaptonExtraHeight);
250  bbl2 = dxbot + (dxtop - dxbot) * (fullHeight + kaptonExtraHeight) / fullHeight;
251  } else {
252  bbl2 = dxtop;
253  }
254  } else {
255  // ring 3
256  bbl2 = dxbot + (dxtop - dxbot) * (fullHeight + topfr) / fullHeight;
257  if (k == 1) {
258  kaptonExtraHeight = dlBottom * sin(detTilt) - fullHeight * (1 - cos(detTilt));
259  kaptonExtraHeight = 0.5 * fabs(kaptonExtraHeight);
260  bbl1 = dxtop - (dxtop - dxbot) * (fullHeight + kaptonExtraHeight) / fullHeight;
261  } else {
262  bbl1 = dxbot;
263  }
264  }
265  h1 = 0.5 * kaptonThick;
266  dz = 0.5 * (kaptonHeight + kaptonExtraHeight);
267 
268  // For the stereo create the uncut solid, the solid to be removed and then the subtraction solid
269  if (k == 1) {
270  // Uncut solid
271  Solid solidUncut =
272  ns.addSolidNS(ns.prepend(kaptonName[k] + "Uncut"), Trap(dz, 0., 0., h1, bbl1, bbl1, 0., h1, bbl2, bbl2, 0));
273 
274  // Piece to be cut
275  dz = (dlHybrid > dlTop) ? 0.5 * dlTop : 0.5 * dlBottom;
276  h1 = 0.5 * kaptonThick;
277  bbl1 = fabs(dz * sin(detTilt));
278  bbl2 = bbl1 * 0.000001;
279  double thet = atan((bbl1 - bbl2) / (2 * dz));
280  Solid solidCut =
281  ns.addSolidNS(ns.prepend(kaptonName[k] + "Cut"), Trap(dz, thet, 0., h1, bbl1, bbl1, 0., h1, bbl2, bbl2, 0));
282 
283  // Subtraction Solid
284  name = kaptonName[k];
285  rot = ns.rotation("tidmodpar:9PYX");
286  xpos = -0.5 * fullHeight * sin(detTilt);
287  zpos = 0.5 * kaptonHeight - bbl2;
288  solid = ns.addSolidNS(ns.prepend(name),
289  SubtractionSolid(solidUncut, solidCut, Transform3D(rot, Position(xpos, 0.0, zpos))));
290  } else {
291  name = kaptonName[k];
292  solid = ns.addSolidNS(ns.prepend(name), Trap(dz, 0., 0., h1, bbl1, bbl1, 0., h1, bbl2, bbl2, 0.));
293  }
294 
295  Volume kapton = ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(kaptonMat)));
296  edm::LogVerbatim("TIDGeom") << solid.name() << " SUBTRACTION SOLID Trap made of " << kaptonMat
297  << " of dimensions " << dz << ", 0, 0, " << h1 << ", " << bbl1 << ", " << bbl1
298  << ", 0, " << h1 << ", " << bbl2 << ", " << bbl2 << ", 0";
299 
300  // Hole in the kapton below the wafer
301  name = holeKaptonName[k];
302  dz = fullHeight - kaptonOver;
303  xpos = 0;
304  if (dlHybrid > dlTop) {
305  // ring 1, ring 2
306  bbl1 = dxbot - kaptonWidth + kaptonOver * (dxtop - dxbot) / fullHeight;
307  bbl2 = dxtop - kaptonWidth;
308  zpos = 0.5 * (kaptonHeight - kaptonExtraHeight - dz);
309  if (k == 1) {
310  zpos -= 0.5 * kaptonOver * (1 - cos(detTilt));
311  xpos = -0.5 * kaptonOver * sin(detTilt);
312  }
313  } else {
314  // ring 3
315  bbl1 = dxbot - kaptonWidth;
316  bbl2 = dxtop - kaptonWidth - kaptonOver * (dxtop - dxbot) / fullHeight;
317  zpos = -0.5 * (kaptonHeight - kaptonExtraHeight - dz);
318  }
319  dz /= 2.;
320  solid = ns.addSolidNS(ns.prepend(name), Trap(dz, 0., 0., h1, bbl1, bbl1, 0., h1, bbl2, bbl2, 0.));
321  edm::LogVerbatim("TIDGeom") << solid.name() << " Trap made of " << genMat << " of dimensions " << dz << ", 0, 0, "
322  << h1 << ", " << bbl1 << ", " << bbl1 << ", 0, " << h1 << ", " << bbl2 << ", " << bbl2
323  << ", 0";
324  Volume holeKapton = ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(genMat)));
325 
326  rot = ns.rotation(holeKaptonRot[k]);
327  kapton.placeVolume(holeKapton, 1, Transform3D(rot, Position(xpos, 0.0, zpos)));
328  edm::LogVerbatim("TIDGeom") << holeKapton.name() << " number 1 positioned in " << kapton.name() << " at (0,0,"
329  << zpos << ") with no rotation";
330 
331  // Wafer
332  name = waferName[k];
333  if (k == 0 && dlHybrid < dlTop) {
334  bl1 = 0.5 * dlTop;
335  bl2 = 0.5 * dlBottom;
336  } else {
337  bl1 = 0.5 * dlBottom;
338  bl2 = 0.5 * dlTop;
339  }
340  h1 = 0.5 * waferThick[k];
341  dz = 0.5 * fullHeight;
342  solid = ns.addSolidNS(ns.prepend(name), Trap(dz, 0, 0, h1, bl1, bl1, 0, h1, bl2, bl2, 0));
343  edm::LogVerbatim("TIDGeom") << solid.name() << " Trap made of " << waferMat << " of dimensions " << dz
344  << ", 0, 0, " << h1 << ", " << bl1 << ", " << bl1 << ", 0, " << h1 << ", " << bl2
345  << ", " << bl2 << ", 0";
346  Volume wafer = ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(waferMat)));
347 
348  // Active
349  name = activeName[k];
350  if (k == 0 && dlHybrid < dlTop) {
351  bl1 -= sideWidthTop;
352  bl2 -= sideWidthBottom;
353  } else {
354  bl1 -= sideWidthBottom;
355  bl2 -= sideWidthTop;
356  }
357  dz = 0.5 * (waferThick[k] - backplaneThick[k]); // inactive backplane
358  h1 = 0.5 * activeHeight;
359  solid = ns.addSolidNS(ns.prepend(name), Trap(dz, 0, 0, h1, bl2, bl1, 0, h1, bl2, bl1, 0));
360  edm::LogVerbatim("TIDGeom") << solid.name() << " Trap made of " << activeMat << " of dimensions " << dz
361  << ", 0, 0, " << h1 << ", " << bl2 << ", " << bl1 << ", 0, " << h1 << ", " << bl2
362  << ", " << bl1 << ", 0";
363  Volume active = ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(activeMat)));
364  rot = ns.rotation(activeRot);
365  Position tran(0.0, -0.5 * backplaneThick[k], 0.0); // from the definition of the wafer local axes
366  wafer.placeVolume(active, 1, Transform3D(rot, tran)); // inactive backplane copyNr=1
367  edm::LogVerbatim("TIDGeom") << "DDTIDModuleAlgo test: " << active.name() << " number 1 positioned in "
368  << wafer.name() << " at " << tran << " with " << rot;
369 
370  //Pitch Adapter
371  name = pitchName[k];
372  if (dlHybrid > dlTop) {
373  dz = 0.5 * dlTop;
374  } else {
375  dz = 0.5 * dlBottom;
376  }
377  if (k == 0) {
378  dx = dz;
379  dy = 0.5 * pitchThick;
380  dz = 0.5 * pitchHeight;
381  solid = ns.addSolidNS(ns.prepend(name), Box(dx, dy, dz));
382  edm::LogVerbatim("TIDGeom") << solid.name() << " Box made of " << pitchMat << " of dimensions"
383  << " " << dx << ", " << dy << ", " << dz;
384  } else {
385  h1 = 0.5 * pitchThick;
386  bl1 = 0.5 * pitchHeight + 0.5 * dz * sin(detTilt);
387  bl2 = 0.5 * pitchHeight - 0.5 * dz * sin(detTilt);
388 
389  dz -= 0.5 * pitchStereoTol;
390  bl1 -= pitchStereoTol;
391  bl2 -= pitchStereoTol;
392 
393  double thet = atan((bl1 - bl2) / (2. * dz));
394  solid = ns.addSolidNS(ns.prepend(name), Trap(dz, thet, 0, h1, bl1, bl1, 0, h1, bl2, bl2, 0));
395  edm::LogVerbatim("TIDGeom") << solid.name() << " Trap made of " << pitchMat << " of "
396  << "dimensions " << dz << ", " << convertRadToDeg(thet) << ", 0, " << h1 << ", "
397  << bl1 << ", " << bl1 << ", 0, " << h1 << ", " << bl2 << ", " << bl2 << ", 0";
398  }
399  /* Volume pa = */ ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(pitchMat)));
400  }
401  }
402  edm::LogVerbatim("TIDGeom") << "<<== End of DDTIDModuleAlgo construction ...";
403  return 1;
404 }
Log< level::Info, true > LogVerbatim
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
int32_t waferThick(const int32_t property)
Definition: HGCalProperty.cc:9
dd4hep::Volume Volume
DD4HEP_OPEN_PLUGIN ( dd4hep  ,
ddcms_det_element_DDCMS_track_DDTIDModuleAlgo   
)

Definition at line 407 of file DDTIDModuleAlgo.cc.