CMS 3D CMS Logo

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