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