CMS 3D CMS Logo

DDG4SolidConverter.cc
Go to the documentation of this file.
1 #include "G4VSolid.hh"
3 
5 
8 #include "G4ios.hh"
9 #include "G4SystemOfUnits.hh"
10 
11 //#define EDM_ML_DEBUG
12 
13 const std::vector<double> *DDG4SolidConverter::par_ = nullptr;
14 G4RotationMatrix *DDG4SolidConverter::rot = nullptr;
15 
17  // could also be done 'dynamically' from outside
18  // would then need to have a 'register' method ...
37 }
38 
40 
41 G4VSolid *DDG4SolidConverter::convert(const DDSolid &solid) {
42  if (!solid) {
43  edm::LogError("SimG4CoreGeometry") << " DDG4SolidConverter::convert(..) found an undefined DDSolid "
44  << solid.toString();
45  throw cms::Exception("SimG4CoreGeometry",
46  "DDG4SolidConverter::convert(..) found an undefined DDSolid " + solid.toString());
47  }
48  G4VSolid *result = nullptr;
49  par_ = &(solid.parameters());
50  std::map<DDSolidShape, FNPTR>::iterator it = convDispatch_.find(solid.shape());
51  if (it != convDispatch_.end()) {
52  result = it->second(solid);
53  } else {
54  throw cms::Exception("DetectorDescriptionFault")
55  << "DDG4SolidConverter::convert: conversion failed for s=" << solid
56  << "\n solid.shape()=" << DDSolidShapesName::name(solid.shape()) << G4endl;
57  }
58  return result;
59 }
60 
61 #include "G4Box.hh"
62 G4VSolid *DDG4SolidConverter::box(const DDSolid &solid) {
63  edm::LogVerbatim("SimG4CoreGeometry") << "DDG4SolidConverter: box = " << solid;
64  return new G4Box(solid.name().name(), (*par_)[0], (*par_)[1], (*par_)[2]);
65 }
66 
67 #include "G4Tubs.hh"
68 G4VSolid *DDG4SolidConverter::tubs(const DDSolid &solid) {
69  edm::LogVerbatim("SimG4CoreGeometry") << "DDG4SolidConverter: tubs = " << solid;
70  return new G4Tubs(solid.name().name(),
71  (*par_)[1], // rmin
72  (*par_)[2], // rmax
73  (*par_)[0], // dzHalf
74  (*par_)[3], // phiStart
75  (*par_)[4]); // deltaPhi
76 }
77 
78 #include "G4CutTubs.hh"
79 G4VSolid *DDG4SolidConverter::cuttubs(const DDSolid &solid) {
80  edm::LogVerbatim("SimG4CoreGeometry") << "DDG4SolidConverter: tubs = " << solid;
81  return new G4CutTubs(solid.name().name(),
82  (*par_)[1], // rmin
83  (*par_)[2], // rmax
84  (*par_)[0], // dzHalf
85  (*par_)[3], // phiStart
86  (*par_)[4], // deltaPhi
87  G4ThreeVector((*par_)[5], (*par_)[6], (*par_)[7]),
88  G4ThreeVector((*par_)[8], (*par_)[9], (*par_)[10]));
89 }
90 
91 #include "G4Trap.hh"
92 G4VSolid *DDG4SolidConverter::trap(const DDSolid &solid) {
93  edm::LogVerbatim("SimG4CoreGeometry") << "DDG4SolidConverter: trap = " << solid;
94  return new G4Trap(solid.name().name(),
95  (*par_)[0], // pDz
96  (*par_)[1], // theta
97  (*par_)[2], // phi
98  (*par_)[3], // y1
99  (*par_)[4], // x1
100  (*par_)[5], // x2
101  (*par_)[6], // alpha1
102  (*par_)[7], // y2
103  (*par_)[8], // x3
104  (*par_)[9], // x4
105  (*par_)[10]); // alpha2
106 }
107 
108 #include "G4Cons.hh"
109 G4VSolid *DDG4SolidConverter::cons(const DDSolid &solid) {
110  edm::LogVerbatim("SimG4CoreGeometry") << "DDG4SolidConverter: cons = " << solid;
111  return new G4Cons(solid.name().name(),
112  (*par_)[1], // rmin -z
113  (*par_)[2], // rmax -z
114  (*par_)[3], // rmin +z
115  (*par_)[4], // rmax +z
116  (*par_)[0], // zHalf
117  (*par_)[5], // phistart
118  (*par_)[6]); // deltaphi
119 }
120 
121 #include "G4Polycone.hh"
122 G4VSolid *DDG4SolidConverter::polycone_rz(const DDSolid &solid) {
123  edm::LogVerbatim("SimG4CoreGeometry") << "DDG4SolidConverter: pcon_rz = " << solid;
124  std::vector<double> r;
125  std::vector<double> z;
126  std::vector<double>::const_iterator i = (*par_).begin() + 2;
127  int count = 0;
128  for (; i != (*par_).end(); ++i) {
129  edm::LogVerbatim("SimG4CoreGeometry") << " z=" << *i / CLHEP::cm;
130  z.push_back(*i);
131  ++i;
132  edm::LogVerbatim("SimG4CoreGeometry") << " r=" << *i / CLHEP::cm;
133  r.push_back(*i);
134  count++;
135  }
136  edm::LogVerbatim("SimG4CoreGeometry") << "sp=" << (*par_)[0] / CLHEP::deg << " ep=" << (*par_)[1] / CLHEP::deg;
137 #ifdef EDM_ML_DEBUG
138  G4cout << "### Polycone_RZ: "
139  << "sp=" << (*par_)[0] / CLHEP::deg << " ep=" << (*par_)[1] / CLHEP::deg << " N= " << count << G4endl;
140  for (int i = 0; i < count; ++i) {
141  G4cout << " R= " << r[i] << " Z= " << z[i] << G4endl;
142  }
143 #endif
144  return new G4Polycone(solid.name().name(),
145  (*par_)[0],
146  (*par_)[1], // start,delta-phi
147  count, // numRZ
148  &(r[0]),
149  &(z[0]));
150 }
151 
152 G4VSolid *DDG4SolidConverter::polycone_rrz(const DDSolid &solid) {
153  edm::LogVerbatim("SimG4CoreGeometry") << "DDG4SolidConverter: pcon_rrz = " << solid;
154  std::vector<double> z_p;
155  std::vector<double> rmin_p;
156  std::vector<double> rmax_p;
157  std::vector<double>::const_iterator i = par_->begin() + 2;
158  int count = 0;
159  for (; i != par_->end(); ++i) {
160  edm::LogVerbatim("SimG4CoreGeometry") << "z=" << *i / CLHEP::cm;
161  z_p.push_back(*i);
162  ++i;
163  edm::LogVerbatim("SimG4CoreGeometry") << "rmin=" << *i / CLHEP::cm;
164  rmin_p.push_back(*i);
165  ++i;
166  edm::LogVerbatim("SimG4CoreGeometry") << "rmax=" << *i / CLHEP::cm;
167  rmax_p.push_back(*i);
168  count++;
169  }
170  edm::LogVerbatim("SimG4CoreGeometry") << "sp=" << (*par_)[0] / CLHEP::deg << " ep=" << (*par_)[1] / CLHEP::deg;
171 #ifdef EDM_ML_DEBUG
172  G4cout << "### Polycone_RRZ: "
173  << "sp=" << (*par_)[0] / CLHEP::deg << " ep=" << (*par_)[1] / CLHEP::deg << " N= " << count << G4endl;
174  for (int i = 0; i < count; ++i) {
175  G4cout << " R1= " << rmin_p[i] << " R1= " << rmax_p[i] << " Z= " << z_p[i] << G4endl;
176  }
177 #endif
178  return new G4Polycone(solid.name().name(),
179  (*par_)[0],
180  (*par_)[1], // start,delta-phi
181  count, // sections
182  &(z_p[0]),
183  &(rmin_p[0]),
184  &(rmax_p[0]));
185 }
186 
187 #include "G4Polyhedra.hh"
188 G4VSolid *DDG4SolidConverter::polyhedra_rz(const DDSolid &solid) {
189  edm::LogVerbatim("SimG4CoreGeometry") << "DDG4SolidConverter: phed_rz = " << solid;
190  std::vector<double> r;
191  std::vector<double> z;
192  std::vector<double>::const_iterator i = par_->begin() + 3;
193  int count = 0;
194 
195  for (; i != par_->end(); ++i) {
196  z.push_back(*i);
197  ++i;
198  r.push_back(*i);
199  count++;
200  }
201 
202  return new G4Polyhedra(solid.name().name(),
203  (*par_)[1],
204  (*par_)[2],
205  int((*par_)[0]), // start,delta-phi;sides
206  count, // numRZ
207  &(r[0]),
208  &(z[0]));
209 }
210 
212  edm::LogVerbatim("SimG4CoreGeometry") << "DDG4SolidConverter: phed_rrz = " << solid;
213  std::vector<double> z_p;
214  std::vector<double> rmin_p;
215  std::vector<double> rmax_p;
216  std::vector<double>::const_iterator i = par_->begin() + 3;
217  int count = 0;
218  for (; i != par_->end(); ++i) {
219  edm::LogVerbatim("SimG4CoreGeometry") << "z=" << *i / CLHEP::cm;
220  z_p.push_back(*i);
221  ++i;
222  edm::LogVerbatim("SimG4CoreGeometry") << "rmin=" << *i / CLHEP::cm;
223  rmin_p.push_back(*i);
224  ++i;
225  edm::LogVerbatim("SimG4CoreGeometry") << "rmax=" << *i / CLHEP::cm;
226  rmax_p.push_back(*i);
227  count++;
228  }
229  edm::LogVerbatim("SimG4CoreGeometry") << "sp=" << (*par_)[0] / CLHEP::deg << " ep=" << (*par_)[1] / CLHEP::deg;
230  return new G4Polyhedra(solid.name().name(),
231  (*par_)[1],
232  (*par_)[2],
233  int((*par_)[0]), // start,delta-phi,sides
234  count, // sections
235  &(z_p[0]),
236  &(rmin_p[0]),
237  &(rmax_p[0]));
238 }
239 
240 #include "G4ExtrudedSolid.hh"
242  edm::LogVerbatim("SimG4CoreGeometry") << "DDG4SolidConverter: extr_pgon = " << solid;
243  std::vector<double> x = static_cast<DDExtrudedPolygon>(solid).xVec();
244  std::vector<double> y = static_cast<DDExtrudedPolygon>(solid).yVec();
245  std::vector<double> z = static_cast<DDExtrudedPolygon>(solid).zVec();
246  std::vector<double> zx = static_cast<DDExtrudedPolygon>(solid).zxVec();
247  std::vector<double> zy = static_cast<DDExtrudedPolygon>(solid).zyVec();
248  std::vector<double> zs = static_cast<DDExtrudedPolygon>(solid).zscaleVec();
249 
250  std::vector<G4TwoVector> polygon;
251  std::vector<G4ExtrudedSolid::ZSection> zsections;
252  for (unsigned int it = 0; it < x.size(); ++it)
253  polygon.emplace_back(x[it], y[it]);
254  for (unsigned int it = 0; it < z.size(); ++it)
255  zsections.emplace_back(z[it], G4TwoVector(zx[it], zy[it]), zs[it]);
256  return new G4ExtrudedSolid(solid.name().name(), polygon, zsections);
257 }
258 
259 #include "G4Torus.hh"
260 G4VSolid *DDG4SolidConverter::torus(const DDSolid &solid) {
261  edm::LogVerbatim("SimG4CoreGeometry") << "DDG4SolidConverter: torus = " << solid;
262  return new G4Torus(solid.name().name(),
263  (*par_)[0], // rmin
264  (*par_)[1], // rmax
265  (*par_)[2], // Rtor
266  (*par_)[3], // phiStart
267  (*par_)[4]); // deltaPhi
268 }
269 
270 #include "G4UnionSolid.hh"
271 G4VSolid *DDG4SolidConverter::unionsolid(const DDSolid &solid) {
272  edm::LogVerbatim("SimG4CoreGeometry") << "DDG4SolidConverter: unionsolid = " << solid.name();
273  G4UnionSolid *us = nullptr;
274  DDBooleanSolid bs(solid);
275  if (bs) {
276  edm::LogVerbatim("SimG4CoreGeometry") << "SolidA=" << bs.solidA();
277  G4VSolid *sa = DDG4SolidConverter().convert(bs.solidA());
278  edm::LogVerbatim("SimG4CoreGeometry") << "SolidB=" << bs.solidB();
279  G4VSolid *sb = DDG4SolidConverter().convert(bs.solidB());
280  edm::LogVerbatim("SimG4CoreGeometry") << " name:" << solid.name() << " t=" << bs.translation() << std::flush;
281  edm::LogVerbatim("SimG4CoreGeometry") << " " << bs.rotation().rotation().Inverse() << std::flush;
282  std::vector<double> tdbl(9);
283  bs.rotation().rotation().Inverse().GetComponents(tdbl.begin(), tdbl.end());
284  CLHEP::HepRep3x3 temprep(tdbl[0], tdbl[1], tdbl[2], tdbl[3], tdbl[4], tdbl[5], tdbl[6], tdbl[7], tdbl[8]);
285  CLHEP::Hep3Vector temphvec(bs.translation().X(), bs.translation().Y(), bs.translation().Z());
286  us = new G4UnionSolid(solid.name().name(), sa, sb, new CLHEP::HepRotation(temprep), temphvec);
287 
288  } // else?
289  return us;
290 }
291 
292 #include "G4SubtractionSolid.hh"
293 #include <sstream>
294 G4VSolid *DDG4SolidConverter::subtraction(const DDSolid &solid) {
295  edm::LogVerbatim("SimG4CoreGeometry") << "DDG4SolidConverter: subtraction = " << solid;
296  G4SubtractionSolid *us = nullptr;
297  DDBooleanSolid bs(solid);
298  if (bs) {
299  G4VSolid *sa = DDG4SolidConverter().convert(bs.solidA());
300  G4VSolid *sb = DDG4SolidConverter().convert(bs.solidB());
301  edm::LogVerbatim("SimG4CoreGeometry") << " name:" << solid.name() << " t=" << bs.translation() << std::flush;
302  edm::LogVerbatim("SimG4CoreGeometry") << " " << bs.rotation().rotation().Inverse() << std::flush;
303  std::vector<double> tdbl(9);
304  bs.rotation().rotation().Inverse().GetComponents(tdbl.begin(), tdbl.end());
305  CLHEP::HepRep3x3 temprep(tdbl[0], tdbl[1], tdbl[2], tdbl[3], tdbl[4], tdbl[5], tdbl[6], tdbl[7], tdbl[8]);
306  CLHEP::Hep3Vector temphvec(bs.translation().X(), bs.translation().Y(), bs.translation().Z());
307  us = new G4SubtractionSolid(solid.name().name(), sa, sb, new CLHEP::HepRotation(temprep), temphvec);
308  }
309  return us;
310 }
311 
312 #include "G4IntersectionSolid.hh"
313 G4VSolid *DDG4SolidConverter::intersection(const DDSolid &solid) {
314  edm::LogVerbatim("SimG4CoreGeometry") << "DDG4SolidConverter: intersection = " << solid;
315  G4IntersectionSolid *us = nullptr;
316  DDBooleanSolid bs(solid);
317  if (bs) {
318  G4VSolid *sa = DDG4SolidConverter().convert(bs.solidA());
319  G4VSolid *sb = DDG4SolidConverter().convert(bs.solidB());
320  edm::LogVerbatim("SimG4CoreGeometry") << " name:" << solid.name() << " t=" << bs.translation() << std::flush;
321  edm::LogVerbatim("SimG4CoreGeometry") << " " << bs.rotation().rotation().Inverse() << std::flush;
322  std::vector<double> tdbl(9);
323  bs.rotation().rotation().Inverse().GetComponents(tdbl.begin(), tdbl.end());
324  CLHEP::HepRep3x3 temprep(tdbl[0], tdbl[1], tdbl[2], tdbl[3], tdbl[4], tdbl[5], tdbl[6], tdbl[7], tdbl[8]);
325  CLHEP::Hep3Vector temphvec(bs.translation().X(), bs.translation().Y(), bs.translation().Z());
326  us = new G4IntersectionSolid(solid.name().name(), sa, sb, new CLHEP::HepRotation(temprep), temphvec);
327  }
328  return us;
329 }
330 
331 #include "G4Trd.hh"
332 G4VSolid *DDG4SolidConverter::pseudotrap(const DDSolid &solid) {
333  if (nullptr == rot) {
334  rot = new G4RotationMatrix;
335  rot->rotateX(90. * deg);
336  }
337 
338  edm::LogVerbatim("SimG4CoreGeometry") << "DDG4SolidConverter: pseudoTrap = " << solid;
339  G4Trd *trap = nullptr;
340  G4Tubs *tubs = nullptr;
341  G4VSolid *result = nullptr;
342  DDPseudoTrap pt(solid); // pt...PseudoTrap
343  double r = pt.radius();
344  bool atMinusZ = pt.atMinusZ();
345  double x = 0;
346  double h = 0;
347  bool intersec = false; // union or intersection solid
348  if (pt.atMinusZ()) {
349  x = pt.x1(); // tubs radius
350  } else {
351  x = pt.x2(); // tubs radius
352  }
353  double openingAngle = 2. * asin(x / std::abs(r));
354  // trap = new G4Trd(solid.name().name(),
355  double displacement = 0;
356  double startPhi = 0;
357  /* calculate the displacement of the tubs w.r.t. to the trap,
358  determine the opening angle of the tubs */
359  double delta = sqrt(r * r - x * x);
360  if (r < 0 && std::abs(r) >= x) {
361  intersec = true; // intersection solid
362  h = pt.y1() < pt.y2() ? pt.y2() : pt.y1(); // tubs half height
363  h += h / 20.; // enlarge a bit - for subtraction solid
364  if (atMinusZ) {
365  displacement = -pt.halfZ() - delta;
366  startPhi = 270. * deg - openingAngle / 2.;
367  } else {
368  displacement = pt.halfZ() + delta;
369  startPhi = 90. * deg - openingAngle / 2.;
370  }
371  } else if (r > 0 && std::abs(r) >= x) {
372  if (atMinusZ) {
373  displacement = -pt.halfZ() + delta;
374  startPhi = 90. * deg - openingAngle / 2.;
375  h = pt.y1();
376  } else {
377  displacement = pt.halfZ() - delta;
378  startPhi = 270. * deg - openingAngle / 2.;
379  h = pt.y2();
380  }
381  } else {
382  throw cms::Exception("DetectorDescriptionFault", "Check parameters of the PseudoTrap! name=" + pt.name().name());
383  }
384  G4ThreeVector displ(0., 0.,
385  displacement); // displacement of the tubs w.r.t. trap
386  edm::LogVerbatim("SimG4CoreGeometry") << "DDSolidConverter::pseudotrap(): displacement=" << displacement
387  << " openingAngle=" << openingAngle / deg << " x=" << x << " h=" << h;
388 
389  // Now create two solids (trd & tubs), and a boolean solid out of them
390  std::string name = pt.name().name();
391  trap = new G4Trd(name, pt.x1(), pt.x2(), pt.y1(), pt.y2(), pt.halfZ());
392  tubs = new G4Tubs(name,
393  0., // rMin
394  std::abs(r), // rMax
395  h, // half height
396  startPhi, // start angle
397  openingAngle);
398  if (intersec) {
399  result = new G4SubtractionSolid(name, trap, tubs, rot, displ);
400  } else {
401  G4VSolid *tubicCap = new G4SubtractionSolid(
402  name, tubs, new G4Box(name, 1.1 * x, sqrt(r * r - x * x), 1.1 * h), nullptr, G4ThreeVector());
403  result = new G4UnionSolid(name, trap, tubicCap, rot, displ);
404  }
405  return result;
406 }
407 
408 G4VSolid *DDG4SolidConverter::trunctubs(const DDSolid &solid) {
409  // truncated tube-section: a boolean subtraction solid:
410  // from a tube-section a box is subtracted according
411  // to the given parameters
412  edm::LogVerbatim("SimG4CoreGeometry") << "MantisConverter: solidshape=" << DDSolidShapesName::name(solid.shape())
413  << " " << solid;
414  edm::LogVerbatim("SimG4CoreGeometry") << "before";
415  DDTruncTubs tt(solid);
416  edm::LogVerbatim("SimG4CoreGeometry") << "after";
417  double rIn(tt.rIn()), rOut(tt.rOut()), zHalf(tt.zHalf()), startPhi(tt.startPhi()), deltaPhi(tt.deltaPhi()),
418  cutAtStart(tt.cutAtStart()), cutAtDelta(tt.cutAtDelta());
419  bool cutInside(bool(tt.cutInside()));
420  std::string name = tt.name().name();
421 
422  // check the parameters
423  if (rIn <= 0 || rOut <= 0 || cutAtStart <= 0 || cutAtDelta <= 0) {
424  throw cms::Exception(
425  "DetectorDescriptionFault",
426  "TruncTubs " + std::string(tt.name().fullname()) + ": 0 <= rIn,cutAtStart,rOut,cutAtDelta,rOut violated!");
427  }
428  if (rIn >= rOut) {
429  throw cms::Exception("DetectorDescriptionFault",
430  "TruncTubs " + std::string(tt.name().fullname()) + ": rIn<rOut violated!");
431  }
432  if (startPhi != 0.) {
433  throw cms::Exception("DetectorDescriptionFault",
434  "TruncTubs " + std::string(tt.name().fullname()) + ": startPhi != 0 not supported!");
435  }
436 
437  startPhi = 0.;
438  double r(cutAtStart), R(cutAtDelta);
439  G4VSolid *result(nullptr);
440  G4VSolid *tubs = new G4Tubs(name, rIn, rOut, zHalf, startPhi, deltaPhi);
441  edm::LogVerbatim("SimG4CoreGeometry") << "G4Tubs: " << rIn / CLHEP::cm << ' ' << rOut / CLHEP::cm << ' '
442  << zHalf / CLHEP::cm << ' ' << startPhi / CLHEP::deg << ' '
443  << deltaPhi / CLHEP::deg;
444  edm::LogVerbatim("SimG4CoreGeometry") << solid;
445  // length & hight of the box
446  double boxX(rOut * std::sqrt(2) * 1.1),
447  boxY(rOut * std::sqrt(2) * 1.1); // exaggerate dimensions - does not matter, it's subtracted!
448 
449  // width of the box > width of the tubs
450  double boxZ(1.1 * zHalf);
451 
452  // angle of the box w.r.t. tubs
453  double cath = r - R * cos(deltaPhi);
454  double hypo = sqrt(r * r + R * R - 2. * r * R * cos(deltaPhi));
455  double cos_alpha = cath / hypo;
456 
457  double alpha = -acos(cos_alpha);
458  edm::LogVerbatim("SimG4CoreGeometry") << "cath=" << cath / CLHEP::cm;
459  edm::LogVerbatim("SimG4CoreGeometry") << "hypo=" << hypo / CLHEP::cm;
460  edm::LogVerbatim("SimG4CoreGeometry") << "al=" << acos(cath / hypo) / CLHEP::deg;
461  edm::LogVerbatim("SimG4CoreGeometry") << "deltaPhi=" << deltaPhi / CLHEP::deg << "\n"
462  << "r=" << r / CLHEP::cm << "\n"
463  << "R=" << R / CLHEP::cm;
464 
465  edm::LogVerbatim("SimG4CoreGeometry") << "alpha=" << alpha / CLHEP::deg;
466 
467  // rotationmatrix of box w.r.t. tubs
468  G4RotationMatrix *rot = new G4RotationMatrix;
469  rot->rotateZ(-alpha);
470  edm::LogVerbatim("SimG4CoreGeometry") << (*rot);
471 
472  // center point of the box
473  double xBox;
474  if (!cutInside) {
475  xBox = r + boxY / sin(std::abs(alpha));
476  } else {
477  xBox = -(boxY / sin(std::abs(alpha)) - r);
478  }
479 
480  G4ThreeVector trans(xBox, 0., 0.);
481  edm::LogVerbatim("SimG4CoreGeometry") << "trans=" << trans;
482 
483  G4VSolid *box = new G4Box(name, boxX, boxY, boxZ);
484  result = new G4SubtractionSolid(name, tubs, box, rot, trans);
485 
486  return result;
487 }
488 
489 #include "G4Sphere.hh"
490 G4VSolid *DDG4SolidConverter::sphere(const DDSolid &solid) {
491  edm::LogVerbatim("SimG4CoreGeometry") << "DDG4SolidConverter: sphere = " << solid;
492  DDSphere sp(solid);
493  return new G4Sphere(solid.name().name(),
494  sp.innerRadius(),
495  sp.outerRadius(),
496  sp.startPhi(),
497  sp.deltaPhi(),
498  sp.startTheta(),
499  sp.deltaTheta());
500 }
501 
502 #include "G4EllipticalTube.hh"
504  edm::LogVerbatim("SimG4CoreGeometry") << "DDG4SolidConverter: ellipticaltube = " << solid;
505  DDEllipticalTube sp(solid);
506  return new G4EllipticalTube(solid.name().name(), sp.xSemiAxis(), sp.ySemiAxis(), sp.zHeight());
507 }
Log< level::Info, true > LogVerbatim
static G4VSolid * polyhedra_rrz(const DDSolid &)
float alpha
Definition: AMPTWrapper.h:105
double zHeight(void) const
Definition: DDSolid.cc:506
static G4RotationMatrix * rot
A truncated tube section.
Definition: DDSolid.h:139
double outerRadius(void) const
Definition: DDSolid.cc:484
static G4VSolid * trap(const DDSolid &)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
double deltaPhi(void) const
Definition: DDSolid.cc:488
static G4VSolid * cons(const DDSolid &)
double ySemiAxis(void) const
Definition: DDSolid.cc:504
double innerRadius(void) const
Definition: DDSolid.cc:482
static G4VSolid * tubs(const DDSolid &)
static G4VSolid * sphere(const DDSolid &)
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:125
Log< level::Error, false > LogError
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
static G4VSolid * cuttubs(const DDSolid &)
double startTheta(void) const
Definition: DDSolid.cc:490
static const char *const name(DDSolidShape s)
Definition: DDSolidShapes.h:33
Definition: TTTypes.h:54
const std::string & name() const
Returns the name.
Definition: DDName.cc:41
static G4VSolid * pseudotrap(const DDSolid &s)
T sqrt(T t)
Definition: SSEVec.h:19
static const std::vector< double > * par_
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static G4VSolid * box(const DDSolid &)
std::string toString() const
Definition: DDBase.h:63
DDSolidShape shape(void) const
The type of the solid.
Definition: DDSolid.cc:123
const N & name() const
Definition: DDBase.h:59
double deltaTheta(void) const
Definition: DDSolid.cc:492
static G4VSolid * ellipticaltube(const DDSolid &)
static G4VSolid * polycone_rz(const DDSolid &)
static G4VSolid * intersection(const DDSolid &)
G4VSolid * convert(const DDSolid &)
static G4VSolid * unionsolid(const DDSolid &)
static G4VSolid * extrudedpolygon(const DDSolid &)
std::map< DDSolidShape, FNPTR > convDispatch_
static G4VSolid * trunctubs(const DDSolid &)
double xSemiAxis(void) const
Definition: DDSolid.cc:502
static G4VSolid * torus(const DDSolid &)
static G4VSolid * polyhedra_rz(const DDSolid &)
static G4VSolid * polycone_rrz(const DDSolid &)
double startPhi(void) const
Definition: DDSolid.cc:486
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
static G4VSolid * subtraction(const DDSolid &)