CMS 3D CMS Logo

TGeoMgrFromDdd.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Geometry
4 // Class : TGeoMgrFromDdd
5 //
6 // Implementation:
7 // [Notes on implementation]
8 //
9 // Original Author:
10 // Created: Fri Jul 2 16:11:42 CEST 2010
11 //
12 
14 
20 
24 
26 
28 
29 #include "TGeoManager.h"
30 #include "TGeoMatrix.h"
31 #include "TGeoCompositeShape.h"
32 #include "TGeoPcon.h"
33 #include "TGeoPgon.h"
34 #include "TGeoCone.h"
35 #include "TGeoBoolNode.h"
36 #include "TGeoTube.h"
37 #include "TGeoArb8.h"
38 #include "TGeoTrd2.h"
39 #include "TGeoTorus.h"
40 #include "TGeoEltu.h"
41 #include "TGeoXtru.h"
42 
43 #include "Math/GenVector/RotationX.h"
44 #include "Math/GenVector/RotationZ.h"
45 
46 #include "CLHEP/Units/GlobalSystemOfUnits.h"
47 #include <cmath>
48 
50  : m_level( pset.getUntrackedParameter<int> ( "level", 10 )),
51  m_verbose( pset.getUntrackedParameter<bool>( "verbose", false ))
52 {
53  // The following line is needed to tell the framework what data is
54  // being produced.
55  setWhatProduced( this );
56 }
57 
59 {}
60 
61 //==============================================================================
62 // Local helpers
63 //==============================================================================
64 
65 namespace
66 {
67  TGeoCombiTrans* createPlacement(const DDRotationMatrix& iRot,
68  const DDTranslation& iTrans)
69  {
70  double elements[9];
71  iRot.GetComponents(elements);
72  TGeoRotation r;
73  r.SetMatrix(elements);
74 
75  TGeoTranslation t(iTrans.x()/cm,
76  iTrans.y()/cm,
77  iTrans.z()/cm);
78 
79  return new TGeoCombiTrans(t,r);
80  }
81 }
82 
83 
84 //==============================================================================
85 // public member functions
86 //==============================================================================
87 
90 {
91  using namespace edm;
92 
94  iRecord.getRecord<IdealGeometryRecord>().get(viewH);
95 
96  if ( ! viewH.isValid()) {
97  return std::shared_ptr<TGeoManager>();
98  }
99 
100  TGeoManager *geo_mgr = new TGeoManager("cmsGeo","CMS Detector");
101  // NOTE: the default constructor does not create the identity matrix
102  if (gGeoIdentity == nullptr)
103  {
104  gGeoIdentity = new TGeoIdentity("Identity");
105  }
106 
107  std::cout << "about to initialize the DDCompactView walker"
108  << " with a root node " << viewH->root() << std::endl;
109 
110  auto walker = viewH->walker();
111  auto info = walker.current();
112 
113  // The top most item is actually the volume holding both the
114  // geometry AND the magnetic field volumes!
115  walker.firstChild();
116  if( ! walker.firstChild()) {
117  return std::shared_ptr<TGeoManager>();
118  }
119 
120  TGeoVolume *top = createVolume(info.first.name().fullname(),
121  info.first.solid(),
122  info.first.material());
123 
124  if (top == nullptr) {
125  return std::shared_ptr<TGeoManager>();
126  }
127 
128  geo_mgr->SetTopVolume(top);
129  // ROOT chokes unless colors are assigned
130  top->SetVisibility(kFALSE);
131  top->SetLineColor(kBlue);
132 
133  std::vector<TGeoVolume*> parentStack;
134  parentStack.push_back(top);
135 
136  do
137  {
138  auto info = walker.current();
139 
140  if (m_verbose)
141  {
142  for(unsigned int i=0; i<parentStack.size();++i) {
143  std::cout <<" ";
144  }
145  std::cout << info.first.name() <<" "<<info.second->copyno()<<" "
146  << DDSolidShapesName::name(info.first.solid().shape())<<std::endl;
147  }
148 
149  bool childAlreadyExists = (nullptr != nameToVolume_[info.first.name().fullname()]);
150  TGeoVolume *child = createVolume(info.first.name().fullname(),
151  info.first.solid(),
152  info.first.material());
153  if (nullptr!=child && info.second != nullptr)
154  {
155  parentStack.back()->AddNode(child,
156  info.second->copyno(),
157  createPlacement(info.second->rotation(),
158  info.second->translation()));
159  child->SetLineColor(kBlue);
160  }
161  else
162  {
163  if ( info.second == nullptr ) {
164  break;
165  }
166  }
167  if (nullptr == child || childAlreadyExists || m_level == int(parentStack.size()))
168  {
169  if (nullptr!=child)
170  {
171  child->SetLineColor(kRed);
172  }
173  //stop descending
174  if ( ! walker.nextSibling())
175  {
176  while (walker.parent())
177  {
178  parentStack.pop_back();
179  if (walker.nextSibling()) {
180  break;
181  }
182  }
183  }
184  }
185  else
186  {
187  if (walker.firstChild())
188  {
189  parentStack.push_back(child);
190  }
191  else
192  {
193  if ( ! walker.nextSibling())
194  {
195  while (walker.parent())
196  {
197  parentStack.pop_back();
198  if (walker.nextSibling()) {
199  break;
200  }
201  }
202  }
203  }
204  }
205  } while ( ! parentStack.empty());
206 
207  geo_mgr->CloseGeometry();
208 
209  geo_mgr->DefaultColors();
210 
211  nameToShape_.clear();
212  nameToVolume_.clear();
213  nameToMaterial_.clear();
214  nameToMedium_.clear();
215 
216  return std::shared_ptr<TGeoManager>(geo_mgr);
217 }
218 
219 
220 //==============================================================================
221 // private member functions
222 //==============================================================================
223 
224 TGeoShape*
226  const DDSolid& iSolid)
227 {
228  LogDebug("TGeoMgrFromDdd::createShape") << "with name: " << iName << " and solid: " << iSolid;
229 
230  DDBase<DDName, DDI::Solid*>::def_type defined( iSolid.isDefined());
231  if( !defined.first ) throw cms::Exception("TGeoMgrFromDdd::createShape * solid " + iName + " is not declared * " );
232  if( !defined.second ) throw cms::Exception("TGeoMgrFromDdd::createShape * solid " + defined.first->name() + " is not defined *" );
233 
234  TGeoShape* rSolid= nameToShape_[iName];
235  if (rSolid == nullptr)
236  {
237  const std::vector<double>& params = iSolid.parameters();
238  switch(iSolid.shape())
239  {
240  case DDSolidShape::ddbox:
241  rSolid = new TGeoBBox(
242  iName.c_str(),
243  params[0]/cm,
244  params[1]/cm,
245  params[2]/cm);
246  break;
248  rSolid = new TGeoConeSeg(
249  iName.c_str(),
250  params[0]/cm,
251  params[1]/cm,
252  params[2]/cm,
253  params[3]/cm,
254  params[4]/cm,
255  params[5]/deg,
256  params[6]/deg+params[5]/deg
257  );
258  break;
260  //Order in params is zhalf,rIn,rOut,startPhi,deltaPhi
261  rSolid= new TGeoTubeSeg(
262  iName.c_str(),
263  params[1]/cm,
264  params[2]/cm,
265  params[0]/cm,
266  params[3]/deg,
267  params[3]/deg + params[4]/deg);
268  break;
270  //Order in params is zhalf,rIn,rOut,startPhi,deltaPhi,lx,ly,lz,tx,ty,tz
271  rSolid= new TGeoCtub(
272  iName.c_str(),
273  params[1]/cm,
274  params[2]/cm,
275  params[0]/cm,
276  params[3]/deg,
277  params[3]/deg + params[4]/deg,
278  params[5],params[6],params[7],
279  params[8],params[9],params[10]);
280  break;
282  rSolid =new TGeoTrap(
283  iName.c_str(),
284  params[0]/cm, //dz
285  params[1]/deg, //theta
286  params[2]/deg, //phi
287  params[3]/cm, //dy1
288  params[4]/cm, //dx1
289  params[5]/cm, //dx2
290  params[6]/deg, //alpha1
291  params[7]/cm, //dy2
292  params[8]/cm, //dx3
293  params[9]/cm, //dx4
294  params[10]/deg);//alpha2
295  break;
297  rSolid = new TGeoPcon(
298  iName.c_str(),
299  params[0]/deg,
300  params[1]/deg,
301  (params.size()-2)/3) ;
302  {
303  std::vector<double> temp(params.size()+1);
304  temp.reserve(params.size()+1);
305  temp[0]=params[0]/deg;
306  temp[1]=params[1]/deg;
307  temp[2]=(params.size()-2)/3;
308  std::copy(params.begin()+2,params.end(),temp.begin()+3);
309  for(std::vector<double>::iterator it=temp.begin()+3;
310  it != temp.end();
311  ++it) {
312  *it /=cm;
313  }
314  rSolid->SetDimensions(&(*(temp.begin())));
315  }
316  break;
318  rSolid = new TGeoPgon(
319  iName.c_str(),
320  params[1]/deg,
321  params[2]/deg,
322  static_cast<int>(params[0]),
323  (params.size()-3)/3);
324  {
325  std::vector<double> temp(params.size()+1);
326  temp[0]=params[1]/deg;
327  temp[1]=params[2]/deg;
328  temp[2]=params[0];
329  temp[3]=(params.size()-3)/3;
330  std::copy(params.begin()+3,params.end(),temp.begin()+4);
331  for(std::vector<double>::iterator it=temp.begin()+4;
332  it != temp.end();
333  ++it) {
334  *it /=cm;
335  }
336  rSolid->SetDimensions(&(*(temp.begin())));
337  }
338  break;
340  {
341  DDExtrudedPolygon extrPgon(iSolid);
342  std::vector<double> x = extrPgon.xVec();
343  std::transform(x.begin(), x.end(), x.begin(),[](double d) { return d/cm; });
344  std::vector<double> y = extrPgon.yVec();
345  std::transform(y.begin(), y.end(), y.begin(),[](double d) { return d/cm; });
346  std::vector<double> z = extrPgon.zVec();
347  std::vector<double> zx = extrPgon.zxVec();
348  std::vector<double> zy = extrPgon.zyVec();
349  std::vector<double> zscale = extrPgon.zscaleVec();
350 
351  TGeoXtru* mySolid = new TGeoXtru(z.size());
352  mySolid->DefinePolygon(x.size(), &(*x.begin()), &(*y.begin()));
353  for( size_t i = 0; i < params[0]; ++i )
354  {
355  mySolid->DefineSection( i, z[i]/cm, zx[i]/cm, zy[i]/cm, zscale[i]);
356  }
357 
358  rSolid = mySolid;
359  }
360  break;
362  {
363  //implementation taken from SimG4Core/Geometry/src/DDG4SolidConverter.cc
364  const static DDRotationMatrix s_rot( ROOT::Math::RotationX( 90.*deg ));
365  DDPseudoTrap pt( iSolid );
366 
367  double r = pt.radius();
368  bool atMinusZ = pt.atMinusZ();
369  double x = 0;
370  double h = 0;
371  bool intersec = false; // union or intersection solid
372 
373  if( atMinusZ )
374  {
375  x = pt.x1(); // tubs radius
376  }
377  else
378  {
379  x = pt.x2(); // tubs radius
380  }
381  double halfOpeningAngle = asin( x / std::abs( r ))/deg;
382  double displacement = 0;
383  double startPhi = 0;
384  /* calculate the displacement of the tubs w.r.t. to the trap,
385  determine the opening angle of the tubs */
386  double delta = sqrt( r * r - x * x );
387 
388  if( r < 0 && std::abs( r ) >= x )
389  {
390  intersec = true; // intersection solid
391  h = pt.y1() < pt.y2() ? pt.y2() : pt.y1(); // tubs half height
392  h += h/20.; // enlarge a bit - for subtraction solid
393  if( atMinusZ )
394  {
395  displacement = - pt.halfZ() - delta;
396  startPhi = 90. - halfOpeningAngle;
397  }
398  else
399  {
400  displacement = pt.halfZ() + delta;
401  startPhi = -90.- halfOpeningAngle;
402  }
403  }
404  else if( r > 0 && std::abs( r ) >= x )
405  {
406  if( atMinusZ )
407  {
408  displacement = - pt.halfZ() + delta;
409  startPhi = 270.- halfOpeningAngle;
410  h = pt.y1();
411  }
412  else
413  {
414  displacement = pt.halfZ() - delta;
415  startPhi = 90. - halfOpeningAngle;
416  h = pt.y2();
417  }
418  }
419  else
420  {
421  throw cms::Exception( "Check parameters of the PseudoTrap! name=" + pt.name().name());
422  }
423 
424  std::auto_ptr<TGeoShape> trap( new TGeoTrd2( pt.name().name().c_str(),
425  pt.x1()/cm,
426  pt.x2()/cm,
427  pt.y1()/cm,
428  pt.y2()/cm,
429  pt.halfZ()/cm ));
430 
431  std::auto_ptr<TGeoShape> tubs( new TGeoTubeSeg( pt.name().name().c_str(),
432  0.,
433  std::abs(r)/cm, // radius cannot be negative!!!
434  h/cm,
435  startPhi,
436  startPhi + halfOpeningAngle * 2. ));
437  if( intersec )
438  {
439  TGeoSubtraction* sub = new TGeoSubtraction( trap.release(),
440  tubs.release(),
441  nullptr,
442  createPlacement( s_rot,
443  DDTranslation( 0.,
444  0.,
445  displacement )));
446  rSolid = new TGeoCompositeShape( iName.c_str(),
447  sub );
448  }
449  else
450  {
451  std::auto_ptr<TGeoShape> box( new TGeoBBox( 1.1*x/cm, 1.1*h/cm, sqrt(r*r-x*x)/cm ));
452 
453  TGeoSubtraction* sub = new TGeoSubtraction( tubs.release(),
454  box.release(),
455  nullptr,
456  createPlacement( s_rot,
457  DDTranslation( 0.,
458  0.,
459  0. )));
460 
461  std::auto_ptr<TGeoShape> tubicCap( new TGeoCompositeShape( iName.c_str(), sub ));
462 
463  TGeoUnion* boolS = new TGeoUnion( trap.release(),
464  tubicCap.release(),
465  nullptr,
466  createPlacement( s_rot,
467  DDTranslation( 0.,
468  0.,
469  displacement )));
470 
471  rSolid = new TGeoCompositeShape( iName.c_str(),
472  boolS );
473  }
474 
475  break;
476  }
478  {
479  DDTorus solid( iSolid );
480  rSolid = new TGeoTorus( iName.c_str(),
481  solid.rTorus()/cm,
482  solid.rMin()/cm,
483  solid.rMax()/cm,
484  solid.startPhi()/deg,
485  solid.deltaPhi()/deg);
486  break;
487  }
489  {
490  DDBooleanSolid boolSolid(iSolid);
491  if(!boolSolid) {
492  throw cms::Exception("GeomConvert") <<"conversion to DDBooleanSolid failed";
493  }
494 
495  std::auto_ptr<TGeoShape> left( createShape(boolSolid.solidA().name().fullname(),
496  boolSolid.solidA()) );
497  std::auto_ptr<TGeoShape> right( createShape(boolSolid.solidB().name().fullname(),
498  boolSolid.solidB()));
499  if( nullptr != left.get() &&
500  nullptr != right.get() ) {
501  TGeoSubtraction* sub = new TGeoSubtraction(left.release(),right.release(),
502  nullptr,
503  createPlacement(
504  *(boolSolid.rotation().matrix()),
505  boolSolid.translation()));
506  rSolid = new TGeoCompositeShape(iName.c_str(),
507  sub);
508  }
509  break;
510  }
512  {
513  DDTruncTubs tt( iSolid );
514  if( !tt )
515  {
516  throw cms::Exception( "GeomConvert" ) << "conversion to DDTruncTubs failed";
517  }
518  double rIn( tt.rIn());
519  double rOut( tt.rOut());
520  double zHalf( tt.zHalf());
521  double startPhi( tt.startPhi());
522  double deltaPhi( tt.deltaPhi());
523  double cutAtStart( tt.cutAtStart());
524  double cutAtDelta( tt.cutAtDelta());
525  bool cutInside( bool( tt.cutInside()));
526  std::string name = tt.name().name();
527 
528  // check the parameters
529  if( rIn <= 0 || rOut <=0 || cutAtStart <=0 || cutAtDelta <= 0 )
530  {
531  std::string s = "TruncTubs " + std::string( tt.name().fullname()) + ": 0 <= rIn,cutAtStart,rOut,cutAtDelta,rOut violated!";
532  throw cms::Exception( s );
533  }
534  if( rIn >= rOut )
535  {
536  std::string s = "TruncTubs " + std::string( tt.name().fullname()) + ": rIn<rOut violated!";
537  throw cms::Exception(s);
538  }
539  if( startPhi != 0. )
540  {
541  std::string s= "TruncTubs " + std::string( tt.name().fullname()) + ": startPhi != 0 not supported!";
542  throw cms::Exception( s );
543  }
544 
545  startPhi = 0.;
546  double r( cutAtStart );
547  double R( cutAtDelta );
548 
549  // Note: startPhi is always 0.0
550  std::auto_ptr<TGeoShape> tubs( new TGeoTubeSeg( name.c_str(), rIn/cm, rOut/cm, zHalf/cm, startPhi, deltaPhi/deg ));
551 
552  double boxX( rOut ), boxY( rOut ); // exaggerate dimensions - does not matter, it's subtracted!
553 
554  // width of the box > width of the tubs
555  double boxZ( 1.1 * zHalf );
556 
557  // angle of the box w.r.t. tubs
558  double cath = r - R * cos( deltaPhi );
559  double hypo = sqrt( r * r + R * R - 2. * r * R * cos( deltaPhi ));
560  double cos_alpha = cath / hypo;
561  double alpha = -acos( cos_alpha );
562 
563  // rotationmatrix of box w.r.t. tubs
564  TGeoRotation rot;
565  rot.RotateX( 90 );
566  rot.RotateZ( alpha/deg );
567 
568  // center point of the box
569  double xBox;
570  if( !cutInside )
571  {
572  xBox = r + boxX / sin( fabs( alpha ));
573  }
574  else
575  {
576  xBox = - ( boxX / sin( fabs( alpha )) - r );
577  }
578  std::auto_ptr<TGeoShape> box( new TGeoBBox( name.c_str(), boxX/cm, boxZ/cm, boxY/cm ));
579 
580  TGeoTranslation trans( xBox/cm, 0., 0.);
581 
582  TGeoSubtraction* sub = new TGeoSubtraction( tubs.release(),
583  box.release(),
584  nullptr, new TGeoCombiTrans( trans, rot ));
585 
586  rSolid = new TGeoCompositeShape( iName.c_str(),
587  sub );
588  break;
589  }
591  {
592  DDBooleanSolid boolSolid(iSolid);
593  if(!boolSolid) {
594  throw cms::Exception("GeomConvert") <<"conversion to DDBooleanSolid failed";
595  }
596 
597  std::auto_ptr<TGeoShape> left( createShape(boolSolid.solidA().name().fullname(),
598  boolSolid.solidA()) );
599  std::auto_ptr<TGeoShape> right( createShape(boolSolid.solidB().name().fullname(),
600  boolSolid.solidB()));
601  //DEBUGGING
602  //break;
603  if( nullptr != left.get() &&
604  nullptr != right.get() ) {
605  TGeoUnion* boolS = new TGeoUnion(left.release(),right.release(),
606  nullptr,
607  createPlacement(
608  *(boolSolid.rotation().matrix()),
609  boolSolid.translation()));
610  rSolid = new TGeoCompositeShape(iName.c_str(),
611  boolS);
612  }
613  break;
614  }
616  {
617  DDBooleanSolid boolSolid(iSolid);
618  if(!boolSolid) {
619  throw cms::Exception("GeomConvert") <<"conversion to DDBooleanSolid failed";
620  }
621 
622  std::auto_ptr<TGeoShape> left( createShape(boolSolid.solidA().name().fullname(),
623  boolSolid.solidA()) );
624  std::auto_ptr<TGeoShape> right( createShape(boolSolid.solidB().name().fullname(),
625  boolSolid.solidB()));
626  if( nullptr != left.get() &&
627  nullptr != right.get() ) {
628  TGeoIntersection* boolS = new TGeoIntersection(left.release(),
629  right.release(),
630  nullptr,
631  createPlacement(
632  *(boolSolid.rotation().matrix()),
633  boolSolid.translation()));
634  rSolid = new TGeoCompositeShape(iName.c_str(),
635  boolS);
636  }
637  break;
638  }
640  {
641  DDEllipticalTube eSolid(iSolid);
642  if(!eSolid) {
643  throw cms::Exception("GeomConvert") <<"conversion to DDEllipticalTube failed";
644  }
645  rSolid = new TGeoEltu(iName.c_str(),
646  params[0]/cm,
647  params[1]/cm,
648  params[2]/cm);
649  break;
650  }
651  default:
652  break;
653  }
654  nameToShape_[iName]=rSolid;
655  }
656  if (rSolid == nullptr)
657  {
658  std::cerr <<"COULD NOT MAKE "<<iName<<" of a shape "<<iSolid<<std::endl;
659  }
660 
661  LogDebug("TGeoMgrFromDdd::createShape") << "solid " << iName << " has been created.";
662 
663  return rSolid;
664 }
665 
666 TGeoVolume*
668  const DDSolid& iSolid,
669  const DDMaterial& iMaterial)
670 {
671  TGeoVolume* v=nameToVolume_[iName];
672  if (v == nullptr)
673  {
674  TGeoShape* solid = createShape(iSolid.name().fullname(),
675  iSolid);
676  std::string mat_name = iMaterial.name().fullname();
677  TGeoMedium *geo_med = nameToMedium_[mat_name];
678  if (geo_med == nullptr)
679  {
680  TGeoMaterial *geo_mat = createMaterial(iMaterial);
681  geo_med = new TGeoMedium(mat_name.c_str(), 0, geo_mat);
682  nameToMedium_[mat_name] = geo_med;
683  }
684  if (solid)
685  {
686  v = new TGeoVolume(iName.c_str(),
687  solid,
688  geo_med);
689  }
690  nameToVolume_[iName] = v;
691  }
692  return v;
693 }
694 
695 TGeoMaterial*
697 {
698  std::string mat_name = iMaterial.name().fullname();
699  TGeoMaterial *mat = nameToMaterial_[mat_name];
700 
701  if (mat == nullptr)
702  {
703  if (iMaterial.noOfConstituents() > 0)
704  {
705  TGeoMixture *mix = new TGeoMixture(mat_name.c_str(),
706  iMaterial.noOfConstituents(),
707  iMaterial.density()*cm3/g);
708  for (int i = 0; i < iMaterial.noOfConstituents(); ++i)
709  {
710  mix->AddElement(createMaterial(iMaterial.constituent(i).first),
711  iMaterial.constituent(i).second);
712  }
713  mat = mix;
714  }
715  else
716  {
717  mat = new TGeoMaterial(mat_name.c_str(),
718  iMaterial.a()*mole/g, iMaterial.z(),
719  iMaterial.density()*cm3/g);
720  }
721  nameToMaterial_[mat_name] = mat;
722  }
723 
724  return mat;
725 }
726 
727 //
728 // const member functions
729 //
730 
731 //
732 // static member functions
733 //
#define LogDebug(id)
dbl * delta
Definition: mlp_gen.cc:36
Definition: DDBase.h:10
double a() const
returns the atomic mass
Definition: DDMaterial.cc:96
double cutAtStart(void) const
truncation at begin of the tube-section
Definition: DDSolid.cc:217
float alpha
Definition: AMPTWrapper.h:95
TGeoMaterial * createMaterial(const DDMaterial &iMaterial)
static const TGPicture * info(bool iBackgroundIsBlack)
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:134
const N & name() const
Definition: DDBase.h:78
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.
GraphWalker walker() const
double deltaPhi(void) const
angular span of the tube-section
Definition: DDSolid.cc:214
def copy(args, dbName)
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
double rTorus(void) const
Definition: DDSolid.cc:560
double cutAtDelta(void) const
truncation at end of the tube-section
Definition: DDSolid.cc:220
std::vector< double > yVec(void) const
Definition: DDSolid.cc:480
double rIn(void) const
inner radius
Definition: DDSolid.cc:205
std::vector< double > zyVec(void) const
Definition: DDSolid.cc:501
DDTranslation translation(void) const
Definition: DDSolid.cc:605
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
A DDSolid represents the shape of a part.
Definition: DDSolid.h:38
double y1(void) const
half length along y on -z
Definition: DDSolid.cc:244
DDSolid solidB(void) const
Definition: DDSolid.cc:617
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
double rMax(void) const
Definition: DDSolid.cc:557
~TGeoMgrFromDdd() override
std::vector< double > xVec(void) const
Definition: DDSolid.cc:473
double z() const
retruns the atomic number
Definition: DDMaterial.cc:102
static const char *const name(DDSolidShape s)
Definition: DDSolidShapes.h:17
DDRotation rotation(void) const
Definition: DDSolid.cc:599
TGeoVolume * createVolume(const std::string &iName, const DDSolid &iSolid, const DDMaterial &iMaterial)
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
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::map< std::string, TGeoShape * > nameToShape_
const std::string fullname() const
Definition: DDName.h:52
FractionV::value_type constituent(int i) const
returns the i-th compound material and its fraction-mass
Definition: DDMaterial.cc:90
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ReturnType produce(const DisplayGeomRecord &)
double rMin(void) const
Definition: DDSolid.cc:554
TGeoShape * createShape(const std::string &iName, const DDSolid &iSolid)
DDSolid solidA(void) const
Definition: DDSolid.cc:611
TGeoMgrFromDdd(const edm::ParameterSet &)
double startPhi(void) const
Definition: DDSolid.cc:563
std::vector< double > zVec(void) const
Definition: DDSolid.cc:487
std::vector< double > zxVec(void) const
Definition: DDSolid.cc:494
std::map< std::string, TGeoMaterial * > nameToMaterial_
double density() const
returns the density
Definition: DDMaterial.cc:108
double deltaPhi(void) const
Definition: DDSolid.cc:566
std::map< std::string, TGeoVolume * > nameToVolume_
int noOfConstituents() const
returns the number of compound materials or 0 for elementary materials
Definition: DDMaterial.cc:84
double startPhi(void) const
angular start of the tube-section
Definition: DDSolid.cc:211
HLT enums.
std::map< std::string, TGeoMedium * > nameToMedium_
const DDLogicalPart & root() const
returns the DDLogicalPart representing the root of the geometrical hierarchy
DDRotationMatrix * matrix()
Definition: DDTransform.h:95
double x2(void) const
half length along x on +z
Definition: DDSolid.cc:241
bool isValid() const
Definition: ESHandle.h:47
double rOut(void) const
outer radius
Definition: DDSolid.cc:208
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
std::vector< double > zscaleVec(void) const
Definition: DDSolid.cc:508
const std::string & name() const
Returns the name.
Definition: DDName.cc:88
double x1(void) const
half length along x on -z
Definition: DDSolid.cc:238
std::shared_ptr< TGeoManager > ReturnType
double radius(void) const
radius of the cut-out (neg.) or rounding (pos.)
Definition: DDSolid.cc:250