|
ATLAS Offline Software
|
#include <AGDD2GeoModelBuilder.h>
Definition at line 42 of file AGDD2GeoModelBuilder.h.
◆ AGDD2GeoModelBuilder()
◆ ~AGDD2GeoModelBuilder()
AGDD2GeoModelBuilder::~AGDD2GeoModelBuilder |
( |
| ) |
|
|
default |
◆ BuildAllVolumes()
void AGDD2GeoModelBuilder::BuildAllVolumes |
( |
| ) |
|
|
virtual |
Definition at line 561 of file AGDD2GeoModelBuilder.cxx.
563 AGDDVolumeMap::const_iterator
it;
576 GeoPhysVol *vvv=(GeoPhysVol*)(vol->
GetVolume());
582 log<<MSG::WARNING<<
"BuildAllVolumes() - mother not set!"<<
endmsg;
585 GeoTransform *gtrf=
new GeoTransform(
trf);
◆ BuildFromSection()
void AGDD2GeoModelBuilder::BuildFromSection |
( |
const std::string & |
s | ) |
|
|
overridevirtual |
Implements AGDDBuilder.
Definition at line 594 of file AGDD2GeoModelBuilder.cxx.
604 std::string topVolumeName=sect->
TopVolume();
605 if (topVolumeName!=
"useless" && !topVolumeName.empty())
610 if (vol->
GetName()==topVolumeName)
618 GeoPhysVol *vvv=(GeoPhysVol*)(vol->
GetVolume());
623 log<<MSG::WARNING<<
"BuildFromSection() - mother not set!"<<
endmsg;
626 GeoTransform *gtrf=
new GeoTransform(
trf);
645 GeoPhysVol *vvv=(GeoPhysVol*)(vol->
GetVolume());
650 log<<MSG::WARNING<<
"BuildFromSection() - mother not set (no top volume)!"<<
endmsg;
653 GeoTransform *gtrf=
new GeoTransform(
trf);
663 log<<MSG::WARNING<<
"BuildFromSection() - This section is flagged as not to be built!"<<
endmsg;
◆ BuildFromVolume()
void AGDD2GeoModelBuilder::BuildFromVolume |
( |
const std::string & |
s | ) |
|
|
overridevirtual |
Implements AGDDBuilder.
Definition at line 666 of file AGDD2GeoModelBuilder.cxx.
673 log<<MSG::WARNING<<
"BuildFromVolume() - Volume "<<
s<<
" not found in the store! Exiting..."<<
endmsg;
677 GeoPhysVol *vvv=(GeoPhysVol*)(vol->
GetVolume());
682 log<<MSG::WARNING<<
"BuildFromVolume() - mother not set!"<<
endmsg;
685 GeoTransform *gtrf=
new GeoTransform(
trf);
◆ CreateBolt()
void AGDD2GeoModelBuilder::CreateBolt |
( |
AGDDBolt * |
b | ) |
const |
|
overridevirtual |
Implements AGDDBuilder.
Definition at line 691 of file AGDD2GeoModelBuilder.cxx.
693 void *
p=
b->GetSolid();
699 s->addPlane(-
b->m_length/2.,0,
b->m_headDiameter/2.);
700 s->addPlane(-
b->m_length/2.+
b->m_headLength,0,
b->m_headDiameter/2.);
701 solid=
new GeoShapeUnion(solid,
s);
◆ CreateBox()
void AGDD2GeoModelBuilder::CreateBox |
( |
AGDDBox * |
v | ) |
const |
|
overridevirtual |
◆ CreateComposition()
Implements AGDDBuilder.
Definition at line 469 of file AGDD2GeoModelBuilder.cxx.
471 static const GeoMaterial *
const ether =
GetMMMaterial(
"special::Ether");
472 static const GeoIntrusivePtr<const GeoShape> fakeVol =
new GeoTubs(0.,500.,1000.,0.,2.0*
M_PI);
476 GeoLogVol *
a=
new GeoLogVol(
v->GetName(),&*fakeVol,ether);
477 GeoPhysVol *a_phys=
new GeoPhysVol(
a);
478 v->SetVolume(a_phys);
480 for (
int i=0;
i<
v->NrOfDaughter();
i++)
484 const std::string volName = vol->
GetName();
489 std::string detFullTag=
"";
495 log<<MSG::WARNING<<
"CreateComposition() - Cannot retrieve Detector element for "<<volName<<
endmsg;
498 if (
p) detFullTag=
p->ID.detectorAddress;
501 log<<MSG::WARNING<<
"CreateComposition() - AGDDDetectorPositioner is nullptr"<<
endmsg;
505 GeoTransform *geotrf=
new GeoTransform(
trf);
509 GeoFullPhysVol* detVol=NULL;
515 detVol=(GeoFullPhysVol*)(vol->
GetVolume());
516 if (
p)
p->theVolume=detVol;
525 detVol=(GeoFullPhysVol*)temp;
526 detVol=detVol->clone();
527 if (
p)
p->theVolume=detVol;
532 if (isDetElement) a_phys->add(detVol);
533 else a_phys->add((GeoPhysVol*)(vol->
GetVolume()));
◆ CreateCons()
void AGDD2GeoModelBuilder::CreateCons |
( |
AGDDCons * |
v | ) |
const |
|
overridevirtual |
◆ CreateElcyl()
void AGDD2GeoModelBuilder::CreateElcyl |
( |
AGDDElcyl * |
v | ) |
const |
|
overridevirtual |
◆ CreateElement()
GeoElement * AGDD2GeoModelBuilder::CreateElement |
( |
const std::string & |
name | ) |
|
◆ CreateElements()
void AGDD2GeoModelBuilder::CreateElements |
( |
| ) |
|
|
overridevirtual |
◆ CreateGvxy()
void AGDD2GeoModelBuilder::CreateGvxy |
( |
AGDDGvxy * |
v | ) |
const |
|
overridevirtual |
Implements AGDDBuilder.
Definition at line 341 of file AGDD2GeoModelBuilder.cxx.
343 void *
p=
v->GetSolid();
346 int nPoint=
v->NrOfPoints();
347 GeoSimplePolygonBrep* solid;
348 solid =
new GeoSimplePolygonBrep(
v->GetDz()/2.);
350 v->SetPoint(
v->GetPoint(0));
351 for (
int i=0;
i<nPoint;
i++)
354 area+=
v->GetPoint(
i).x()*
v->GetPoint(iplus).y()-
v->GetPoint(iplus).x()*
v->GetPoint(
i).y();
357 bool clockwise=
area<0?
true:
false;
360 for (
int i=0;
i<nPoint;
i++)
362 if (clockwise) pV=
v->GetPoint(nPoint-1-
i);
363 else pV=
v->GetPoint(
i);
364 solid->addVertex(pV.
x(),pV.
y());
◆ CreateIbeam()
void AGDD2GeoModelBuilder::CreateIbeam |
( |
AGDDIbeam * |
b | ) |
const |
|
overridevirtual |
Implements AGDDBuilder.
Definition at line 706 of file AGDD2GeoModelBuilder.cxx.
708 void *
p=
b->GetSolid();
711 GeoSimplePolygonBrep* solid;
712 solid =
new GeoSimplePolygonBrep(
b->GetLength()/2.);
713 solid->addVertex(
b->m_width/2.,
b->m_height/2);
714 solid->addVertex(-
b->m_width/2.,
b->m_height/2);
715 solid->addVertex(-
b->m_width/2.,
b->m_smallHeight/2);
716 solid->addVertex(-
b->m_smallWidth/2.,
b->m_smallHeight/2);
717 solid->addVertex(-
b->m_smallWidth/2.,-
b->m_smallHeight/2);
718 solid->addVertex(-
b->m_width/2.,-
b->m_smallHeight/2);
719 solid->addVertex(-
b->m_width/2.,-
b->m_height/2);
720 solid->addVertex(
b->m_width/2.,-
b->m_height/2);
721 solid->addVertex(
b->m_width/2.,-
b->m_smallHeight/2);
722 solid->addVertex(
b->m_smallWidth/2.,-
b->m_smallHeight/2);
723 solid->addVertex(
b->m_smallWidth/2.,
b->m_smallHeight/2);
724 solid->addVertex(
b->m_width/2.,
b->m_smallHeight/2);
◆ CreateIntersection()
Implements AGDDBuilder.
Definition at line 391 of file AGDD2GeoModelBuilder.cxx.
393 int nPos=
v->NrOfDaughter();
397 GeoShape *sV=(GeoShape*)(vol->
GetSolid());
398 sV=
new GeoShapeShift(sV,
pos->Transform());
399 for (
int i=1;
i<nPos;
i++)
403 vv->CreateSolid(*
this);
404 GeoShape *nsV=(GeoShape*)(
vv->GetSolid());
405 nsV=
new GeoShapeShift(nsV,pp->
Transform());
406 sV=
new GeoShapeIntersection(sV,nsV);
◆ CreateMaterial() [1/2]
void AGDD2GeoModelBuilder::CreateMaterial |
( |
| ) |
|
|
overridevirtual |
◆ CreateMaterial() [2/2]
const GeoMaterial * AGDD2GeoModelBuilder::CreateMaterial |
( |
const std::string & |
name | ) |
|
Definition at line 101 of file AGDD2GeoModelBuilder.cxx.
114 return (GeoMaterial*)(
mat->GetMaterial());
125 log<<MSG::WARNING<<
"CreateMaterial() - AGDDMaterial is nullptr"<<
endmsg;
133 g4mat->add((GeoElement*)(
el->GetElement()));
135 mat->SetMaterial(g4mat);
144 log<<MSG::WARNING<<
"CreateMaterial() - AGDDMolecule is nullptr"<<
endmsg;
154 mat->SetMaterial(g4mat);
164 log<<MSG::WARNING<<
"CreateMaterial() - AGDDMixture is nullptr"<<
endmsg;
174 mat->SetMaterial(g4mat);
181 log<<MSG::WARNING<<
"CreateMaterial() - Unknown material type "<<mtype<<
endmsg;
◆ CreatePcon()
void AGDD2GeoModelBuilder::CreatePcon |
( |
AGDDPcon * |
v | ) |
const |
|
overridevirtual |
◆ CreatePgon()
void AGDD2GeoModelBuilder::CreatePgon |
( |
AGDDPgon * |
v | ) |
const |
|
overridevirtual |
◆ CreateSnake()
void AGDD2GeoModelBuilder::CreateSnake |
( |
AGDDSnake * |
v | ) |
const |
|
overridevirtual |
Implements AGDDBuilder.
Definition at line 223 of file AGDD2GeoModelBuilder.cxx.
227 static const GeoIntrusivePtr<const GeoShape>
s1 = [&] {
230 return new GeoShapeShift (&*box1, ttt1);
232 static const GeoIntrusivePtr<const GeoShape>
s2 = [&] {
235 return new GeoShapeShift (&*box1, ttt2);
245 double angle2=std::abs(std::atan2(
axis.cross(axis2).norm(),
axis.dot(axis2)))/2;
248 double lengthnew=
length+delta_l2;
249 GeoShape* solid=
new GeoTubs(0.,
radius,lengthnew/2.,0.,2.0*
M_PI);
255 solid =
new GeoShapeSubtraction(solid,ssnew);
259 solid=
new GeoShapeShift(solid,tref);
264 for (
int i=1;
i<
v->NrOfPoints()-1;
i++)
266 axis0=
v->GetPoint(
i)-
v->GetPoint(
i+1);
267 axis=
v->GetPoint(
i+1)-
v->GetPoint(
i);
268 axis1=
v->GetPoint(
i)-
v->GetPoint(
i-1);
271 angle1=std::abs(std::atan2(
axis.cross(axis1).norm(),
axis.dot(axis1)))/2;
274 if (
i<(
v->NrOfPoints()-2))
276 axis2=
v->GetPoint(
i+2)-
v->GetPoint(
i+1);
277 angle2=std::abs(std::atan2(
axis.cross(axis2).norm(),
axis.dot(axis2)))/2;
281 lengthnew=
length+delta_l1+delta_l2;
286 GeoShape*
ss=
new GeoTubs(0.,
radius,lengthnew/2.,0.,2.0*
M_PI);
294 GeoShape *ssnew1=
new GeoShapeShift(&*
s2,ttt1);
295 ss =
new GeoShapeSubtraction(
ss,ssnew1);
296 if (
i<(
v->NrOfPoints()-2))
298 GeoShape *ssnew2=
new GeoShapeShift(&*
s1,ttt2);
299 ss =
new GeoShapeSubtraction(
ss,ssnew2);
302 ss=
new GeoShapeShift(
ss,ttref);
307 solid=
new GeoShapeUnion(solid,
ss);
◆ CreateSubtraction()
Implements AGDDBuilder.
Definition at line 411 of file AGDD2GeoModelBuilder.cxx.
413 int nPos=
v->NrOfDaughter();
417 GeoShape *sV=(GeoShape*)(vol->
GetSolid());
418 sV=
new GeoShapeShift(sV,
pos->Transform());
419 for (
int i=1;
i<nPos;
i++)
423 vv->CreateSolid(*
this);
424 GeoShape *nsV=(GeoShape*)(
vv->GetSolid());
425 nsV=
new GeoShapeShift(nsV,pp->
Transform());
426 sV=
new GeoShapeSubtraction(sV,nsV);
◆ CreateTrd()
void AGDD2GeoModelBuilder::CreateTrd |
( |
AGDDTrd * |
v | ) |
const |
|
overridevirtual |
◆ CreateTubs()
void AGDD2GeoModelBuilder::CreateTubs |
( |
AGDDTubs * |
v | ) |
const |
|
overridevirtual |
◆ CreateUbeam()
void AGDD2GeoModelBuilder::CreateUbeam |
( |
AGDDUbeam * |
b | ) |
const |
|
overridevirtual |
Implements AGDDBuilder.
Definition at line 729 of file AGDD2GeoModelBuilder.cxx.
731 void *
p=
b->GetSolid();
734 GeoSimplePolygonBrep* solid;
735 solid =
new GeoSimplePolygonBrep(
b->GetLength()/2.);
736 solid->addVertex(
b->m_width/2.,
b->m_smallHeight/2.);
737 solid->addVertex(-
b->m_width/2.,
b->m_smallHeight/2.);
738 solid->addVertex(-
b->m_width/2.,-
b->m_height+
b->m_smallHeight/2.);
739 solid->addVertex(-
b->m_width/2.+
b->m_smallWidth,-
b->m_height+
b->m_smallHeight/2.);
740 solid->addVertex(-
b->m_width/2.+
b->m_smallWidth,-
b->m_smallHeight/2.);
741 solid->addVertex(
b->m_width/2.-
b->m_smallWidth,-
b->m_smallHeight/2.);
742 solid->addVertex(
b->m_width/2.-
b->m_smallWidth,-
b->m_height+
b->m_smallHeight/2.);
743 solid->addVertex(
b->m_width/2.,-
b->m_height+
b->m_smallHeight/2.);
◆ CreateUnion()
void AGDD2GeoModelBuilder::CreateUnion |
( |
AGDDUnion * |
v | ) |
const |
|
overridevirtual |
Implements AGDDBuilder.
Definition at line 370 of file AGDD2GeoModelBuilder.cxx.
372 int nPos=
v->NrOfDaughter();
376 GeoShape *sV=(GeoShape*)(vol->
GetSolid());
377 sV=
new GeoShapeShift(sV,
pos->Transform());
378 for (
int i=1;
i<nPos;
i++)
382 vv->CreateSolid(*
this);
383 GeoShape *nsV=(GeoShape*)(
vv->GetSolid());
384 nsV=
new GeoShapeShift(nsV,pp->
Transform());
385 sV=
new GeoShapeUnion(sV,nsV);
◆ CreateVolume()
void AGDD2GeoModelBuilder::CreateVolume |
( |
AGDDVolume * |
v | ) |
|
|
overridevirtual |
Implements AGDDBuilder.
Definition at line 538 of file AGDD2GeoModelBuilder.cxx.
543 void*
p=
v->GetVolume();
546 GeoShape* sol=(GeoShape*)
v->GetSolid();
549 log<<MSG::WARNING<<
"CreateVolume() - solid is nullptr!"<<
endmsg;
553 GeoLogVol* lv=
new GeoLogVol(
v->GetName(),sol,
mat);
554 GeoPhysVol *lv_phys=
new GeoPhysVol(lv);
556 v->SetVolume(lv_phys);
◆ GetMaterialManager()
◆ GetMMMaterial()
const GeoMaterial * AGDD2GeoModelBuilder::GetMMMaterial |
( |
const std::string & |
name | ) |
const |
|
private |
◆ phi()
double AGDD2GeoModelBuilder::phi |
( |
const GeoTrf::Vector3D & |
vec | ) |
const |
|
inlineprivate |
◆ SetMotherVolume()
virtual void AGDD2GeoModelBuilder::SetMotherVolume |
( |
GeoPhysVol * |
v | ) |
|
|
inlinevirtual |
◆ theta()
double AGDD2GeoModelBuilder::theta |
( |
const GeoTrf::Vector3D & |
vec | ) |
const |
|
inlineprivate |
◆ m_as
◆ m_ds
◆ m_mother
GeoPhysVol* AGDD2GeoModelBuilder::m_mother |
|
private |
◆ m_ms
◆ m_ss
◆ m_vs
The documentation for this class was generated from the following files:
double Composition(int i) const
GeoElement * CreateElement(const std::string &)
std::string Alias(const std::string &)
volumeIterator VolumeEnd()
AGDDElementMap::const_iterator ElementIterator
double phi(const GeoTrf::Vector3D &vec) const
phi method (cf.
virtual StoredMaterialManager & GetMaterialManager() const override
const GeoTrf::Transform3D & Transform() const
AGDDSimpleMaterial * GetMaterial(std::string)
MaterialIterator MaterialBegin()
std::vector< size_t > vec
const GeoMaterial * GetMMMaterial(const std::string &) const
virtual void CreateVolume(AGDDBuilder &)
volumeIterator VolumeBegin()
AGDDDetector * GetDetector(const std::string &s)
IMessageSvc * getMessageSvc(bool quiet=false)
AGDDSection * GetSection(const std::string &)
AGDDVolume * GetVolume(std::string)
void TopVolume(const std::string &n)
const std::string & GetColor() const
void IsSensitiveVolume(bool v)
Eigen::Affine3d Transform3D
AGDDMaterialMap::const_iterator MaterialIterator
double GetDensity() const
virtual void CreateSolid(const AGDDBuilder &)
MaterialIterator MaterialEnd()
ElementIterator ElementEnd()
Eigen::Matrix< double, 3, 1 > Vector3D
AGDDSimpleMaterial * Material(int i)
Eigen::Translation< double, 3 > Translation3D
virtual const GeoMaterial * getMaterial(const std::string &name)=0
const std::string & GetName() const
This class holds one or more material managers and makes them storeable, under StoreGate.
volumeList::const_iterator volumeIterator
double theta(const GeoTrf::Vector3D &vec) const
theta method (cf.
virtual void CreateMaterial() override
AGDDElement * GetElement(std::string)
ElementIterator ElementBegin()
AGDDElement * Element(int i)
const std::string & GetName() const
int Composition(int i) const
const std::string & GetMaterial() const