58 static const double sqrt3 =
std::sqrt(3.0);
60 double RM2 = rM/sqrt3;
62 double r = 0.5*R*sqrt3;
65 std::vector<double> xM = {rM,0,-rM,-rM,0,rM};
66 std::vector<double> yM = {RM2,2*RM2,RM2,-RM2,-2*RM2,-RM2};
68 std::vector<double> zx(2,0), zy(2,0),
scale(2,1.0);
71 xM, yM, zw, zx, zy,
scale);
77 <<
" extruded polygon made of " << matName
78 <<
" z|x|y|s (0) " << zw[0] <<
":" << zx[0]
79 <<
":" << zy[0] <<
":" <<
scale[0]
80 <<
" z|x|y|s (1) " << zw[1] <<
":" << zx[1]
81 <<
":" << zy[1] <<
":" <<
scale[1] <<
" and " 82 << xM.size() <<
" edges";
83 for (
unsigned int k=0;
k<xM.size(); ++
k)
88 for (
int u=0; u<2*
nCells_; ++u) {
90 if (((
v-u) < nCells_) && (u-
v) <= nCells_) {
92 double yp = (u-0.5*
v-n2)*2*r;
95 if ((u == 0) && (
v == 0)) cell = 7;
96 else if ((u == 0) && (
v == nCells_-1)) cell = 8;
97 else if ((u == nCells_) && (
v == 2*nCells_-1)) cell = 9;
98 else if ((u == 2*nCells_-1) && (
v == 2*nCells_-1)) cell = 10;
99 else if ((u == 2*nCells_-1) && (
v == nCells_-1)) cell = 11;
100 else if ((u == nCells_) && (
v == 0)) cell = 12;
101 else if ((u == 0)) cell = 1;
102 else if (((
v-u) == (nCells_-1))) cell = 4;
103 else if ((
v == (2*nCells_-1))) cell = 2;
104 else if ((u == (2*nCells_-1))) cell = 5;
105 else if (((u-
v) == nCells_)) cell = 3;
106 else if ((
v == 0)) cell = 6;
112 <<
" number " << copy <<
" position in " 113 << glog.
name() <<
" at " << tran
DDMaterial is used to define and access material information.
DDName is used to identify DDD entities uniquely.
A DDSolid represents the shape of a part.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Represents a uniquely identifyable rotation matrix.
U second(std::pair< T, U > const &p)
std::vector< std::string > cellNames_
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
static DDSolid extrudedpolygon(const DDName &name, const std::vector< double > &x, const std::vector< double > &y, const std::vector< double > &z, const std::vector< double > &zx, const std::vector< double > &zy, const std::vector< double > &zscale)
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string ©no, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
auto zw(V v) -> Vec2< typename std::remove_reference< decltype(v[0])>::type >
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'