ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
InDetDD::GenericTubeMaker Class Reference

#include <GenericTubeMaker.h>

Collaboration diagram for InDetDD::GenericTubeMaker:

Public Member Functions

 GenericTubeMaker (const IRDBRecord *)
 
const TubeVolDatavolData () const
 
std::string name () const
 
std::string materialName () const
 
const GeoShape * buildShape ()
 
void placeVolume (GeoPhysVol *parent, GeoVPhysVol *child, double zParent=0)
 
void placeVolume (GeoFullPhysVol *fullparent, GeoVPhysVol *child, double zParent=0)
 
void placeVolTwoSide (GeoPhysVol *parentPos, GeoPhysVol *parentNeg, GeoVPhysVol *child, double zParent=0)
 
void placeVolTwoSide (GeoFullPhysVol *fullparentPos, GeoFullPhysVol *fullparentNeg, GeoVPhysVol *child, double zParent=0)
 

Private Member Functions

void placeVolume (GeoPhysVol *parent, GeoFullPhysVol *fullparent, GeoVPhysVol *child, double zParent)
 
void placeVolTwoSide (GeoPhysVol *parentPos, GeoPhysVol *parentNeg, GeoFullPhysVol *fullparentPos, GeoFullPhysVol *fullparentNeg, GeoVPhysVol *child, double zParent)
 

Private Attributes

const IRDBRecordm_record
 
TubeVolData m_volData
 

Detailed Description

Definition at line 28 of file GenericTubeMaker.h.

Constructor & Destructor Documentation

◆ GenericTubeMaker()

InDetDD::GenericTubeMaker::GenericTubeMaker ( const IRDBRecord record)

Definition at line 21 of file GenericTubeMaker.cxx.

22  : m_record(record),
23  m_volData(record)
24  {}

Member Function Documentation

◆ buildShape()

const GeoShape * InDetDD::GenericTubeMaker::buildShape ( )

Definition at line 37 of file GenericTubeMaker.cxx.

37  {
38  const GeoShape* shape = nullptr;
39 
40  switch (m_volData.shape()) {
41  case TubeVolData::TUBE:
42  shape = new GeoTube(m_volData.rmin(), m_volData.rmax(), 0.5 * m_volData.length());
43  break;
44 
45  case TubeVolData::TUBS:
46  shape = new GeoTubs(m_volData.rmin(), m_volData.rmax(), 0.5 * m_volData.length(),
48  break;
49 
50  case TubeVolData::CONS:
51  shape = new GeoCons(m_volData.rmin(), m_volData.rmin2(), m_volData.rmax(), m_volData.rmax2(),
53  break;
54 
56  // This simulates the radial decrease in density.
57  double zstart = -0.5 * m_volData.length();
58  GeoPcon* shapeTmp = new GeoPcon(m_volData.phiStart(), m_volData.phiDelta());
59  shapeTmp->addPlane(zstart, m_volData.rmin(), m_volData.rmax());
60  double radialDelta = (m_volData.rmax() - m_volData.rmin()) / m_volData.radialDivisions();
61  for (int i = 0; i < m_volData.radialDivisions(); i++) {
62  double rIntermediate = m_volData.rmax() - i * radialDelta;
63  double reductionFactor = m_volData.rmin() / rIntermediate;
64  shapeTmp->addPlane(zstart + reductionFactor * m_volData.length(), m_volData.rmin(), rIntermediate);
65  }
66  shapeTmp->addPlane(zstart + m_volData.length(), m_volData.rmin(), m_volData.rmin());
67  shape = shapeTmp;
68  break;
69  }
70 
71  return shape;
72  }

◆ materialName()

std::string InDetDD::GenericTubeMaker::materialName ( ) const

Definition at line 27 of file GenericTubeMaker.cxx.

27  {
28  return m_record->getString("MATERIAL");
29  }

◆ name()

std::string InDetDD::GenericTubeMaker::name ( ) const

Definition at line 32 of file GenericTubeMaker.cxx.

32  {
33  return m_record->getString("NAME");
34  }

◆ placeVolTwoSide() [1/3]

void InDetDD::GenericTubeMaker::placeVolTwoSide ( GeoFullPhysVol *  fullparentPos,
GeoFullPhysVol *  fullparentNeg,
GeoVPhysVol *  child,
double  zParent = 0 
)

Definition at line 90 of file GenericTubeMaker.cxx.

91  {
92  placeVolTwoSide(nullptr, nullptr, fullparentPos, fullparentNeg, child, zParent);
93  }

◆ placeVolTwoSide() [2/3]

void InDetDD::GenericTubeMaker::placeVolTwoSide ( GeoPhysVol *  parentPos,
GeoPhysVol *  parentNeg,
GeoFullPhysVol *  fullparentPos,
GeoFullPhysVol *  fullparentNeg,
GeoVPhysVol *  child,
double  zParent 
)
private

Definition at line 130 of file GenericTubeMaker.cxx.

132  {
133  for (int iRepeat = 0; iRepeat < m_volData.nRepeat(); iRepeat++) {
134  double phi = m_volData.phiStep() * iRepeat;
135  double zOffset = m_volData.zMid() - zParent;
136  const bool newXform((zOffset != 0)or(iRepeat > 0));
137 
138  if (parentPos) {
139  if (newXform) {
140  parentPos->add(new GeoTransform(GeoTrf::TranslateZ3D(zOffset) * GeoTrf::RotateZ3D(phi)));
141  }
142  parentPos->add(child);
143  } else if (fullparentPos) {
144  if (newXform) {
145  fullparentPos->add(new GeoTransform(GeoTrf::TranslateZ3D(zOffset) * GeoTrf::RotateZ3D(phi)));
146  }
147  fullparentPos->add(child);
148  }
149 
150  // Place in negative z as well.
151  if (m_volData.bothZ()) {
152  GeoTransform* xformNeg = new GeoTransform(GeoTrf::RotateY3D(180 * Gaudi::Units::deg) * GeoTrf::TranslateZ3D(
153  zOffset) * GeoTrf::RotateZ3D(phi));
154  if (parentNeg) {
155  parentNeg->add(xformNeg);
156  parentNeg->add(child);
157  } else {
158  fullparentNeg->add(xformNeg);
159  fullparentNeg->add(child);
160  }
161  }
162  } // iRepeat loop
163  }

◆ placeVolTwoSide() [3/3]

void InDetDD::GenericTubeMaker::placeVolTwoSide ( GeoPhysVol *  parentPos,
GeoPhysVol *  parentNeg,
GeoVPhysVol *  child,
double  zParent = 0 
)

Definition at line 85 of file GenericTubeMaker.cxx.

85  {
86  placeVolTwoSide(parentPos, parentNeg, nullptr, nullptr, child, zParent);
87  }

◆ placeVolume() [1/3]

void InDetDD::GenericTubeMaker::placeVolume ( GeoFullPhysVol *  fullparent,
GeoVPhysVol *  child,
double  zParent = 0 
)

Definition at line 80 of file GenericTubeMaker.cxx.

80  {
81  placeVolume(nullptr, fullparent, child, zParent);
82  }

◆ placeVolume() [2/3]

void InDetDD::GenericTubeMaker::placeVolume ( GeoPhysVol *  parent,
GeoFullPhysVol *  fullparent,
GeoVPhysVol *  child,
double  zParent 
)
private

Definition at line 96 of file GenericTubeMaker.cxx.

96  {
97  for (int iRepeat = 0; iRepeat < m_volData.nRepeat(); iRepeat++) {
98  double phi = m_volData.phiStep() * iRepeat;
99 
100  GeoTransform* xform = nullptr;
101  double zOffset = m_volData.zMid() - zParent;
102  if (zOffset != 0 || iRepeat > 0) {
103  xform = new GeoTransform(GeoTrf::TranslateZ3D(zOffset) * GeoTrf::RotateZ3D(phi));
104  }
105 
106  if (parent) {
107  if (xform) parent->add(xform);
108  parent->add(child);
109  } else {
110  if (xform) fullparent->add(xform);
111  fullparent->add(child);
112  }
113 
114  // Place in negative z as well.
115  if (m_volData.bothZ()) {
116  GeoTransform* xformNeg = new GeoTransform(GeoTrf::RotateY3D(180 * Gaudi::Units::deg) * GeoTrf::TranslateZ3D(
117  zOffset) * GeoTrf::RotateZ3D(phi));
118  if (parent) {
119  parent->add(xformNeg);
120  parent->add(child);
121  } else {
122  fullparent->add(xformNeg);
123  fullparent->add(child);
124  }
125  }
126  } // iRepeat loop
127  }

◆ placeVolume() [3/3]

void InDetDD::GenericTubeMaker::placeVolume ( GeoPhysVol *  parent,
GeoVPhysVol *  child,
double  zParent = 0 
)

Definition at line 75 of file GenericTubeMaker.cxx.

75  {
76  placeVolume(parent, nullptr, child, zParent);
77  }

◆ volData()

const TubeVolData& InDetDD::GenericTubeMaker::volData ( ) const
inline

Definition at line 32 of file GenericTubeMaker.h.

32 {return m_volData;}

Member Data Documentation

◆ m_record

const IRDBRecord* InDetDD::GenericTubeMaker::m_record
private

Definition at line 49 of file GenericTubeMaker.h.

◆ m_volData

TubeVolData InDetDD::GenericTubeMaker::m_volData
private

Definition at line 50 of file GenericTubeMaker.h.


The documentation for this class was generated from the following files:
InDetDD::GenericTubeMaker::m_volData
TubeVolData m_volData
Definition: GenericTubeMaker.h:50
InDetDD::GenericTubeMaker::m_record
const IRDBRecord * m_record
Definition: GenericTubeMaker.h:49
InDetDD::TubeVolData::bothZ
bool bothZ() const
Definition: TubeVolData.h:33
InDetDD::GenericTubeMaker::placeVolTwoSide
void placeVolTwoSide(GeoPhysVol *parentPos, GeoPhysVol *parentNeg, GeoVPhysVol *child, double zParent=0)
Definition: GenericTubeMaker.cxx:85
InDetDD::TubeVolData::CONS
@ CONS
Definition: TubeVolData.h:19
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
IRDBRecord::getString
virtual const std::string & getString(const std::string &fieldName) const =0
Get string field value.
InDetDD::TubeVolData::TUBS
@ TUBS
Definition: TubeVolData.h:19
deg
#define deg
Definition: SbPolyhedron.cxx:17
InDetDD::TubeVolData::rmax
double rmax() const
Definition: TubeVolData.h:23
InDetDD::TubeVolData::length
double length() const
Definition: TubeVolData.h:26
lumiFormat.i
int i
Definition: lumiFormat.py:85
InDetDD::TubeVolData::rmax2
double rmax2() const
Definition: TubeVolData.h:25
InDetDD::TubeVolData::radialDivisions
int radialDivisions() const
Definition: TubeVolData.h:32
test_pyathena.parent
parent
Definition: test_pyathena.py:15
InDetDD::TubeVolData::TUBE
@ TUBE
Definition: TubeVolData.h:19
InDetDD::TubeVolData::rmin2
double rmin2() const
Definition: TubeVolData.h:24
InDetDD::TubeVolData::phiStep
double phiStep() const
Definition: TubeVolData.h:30
InDetDD::TubeVolData::phiDelta
double phiDelta() const
Definition: TubeVolData.h:29
InDetDD::TubeVolData::phiStart
double phiStart() const
Definition: TubeVolData.h:28
InDetDD::TubeVolData::RADIAL
@ RADIAL
Definition: TubeVolData.h:19
InDetDD::TubeVolData::shape
VolShape shape() const
Definition: TubeVolData.h:35
InDetDD::TubeVolData::nRepeat
int nRepeat() const
Definition: TubeVolData.h:31
InDetDD::TubeVolData::rmin
double rmin() const
Definition: TubeVolData.h:22
InDetDD::GenericTubeMaker::placeVolume
void placeVolume(GeoPhysVol *parent, GeoVPhysVol *child, double zParent=0)
Definition: GenericTubeMaker.cxx:75
InDetDD::TubeVolData::zMid
double zMid() const
Definition: TubeVolData.h:27