83 std::vector<DDSolid> segments;
84 std::vector<double> offsets;
88 if (s1.phi !=
s2.phi) {
98 if (
s2.z_l < min_z) min_z =
s2.z_l;
99 if (
s2.z_t > max_z) max_z =
s2.z_t;
101 double P1_z_l = s1.z_l;
102 double P1_z_t = s1.z_t;
103 double P2_z_l =
s2.z_l;
104 double P2_z_t =
s2.z_t;
106 double P1_x_t =
cos(phi1) *
r;
107 double P1_x_l =
cos(phi1) *
r;
108 double P1_y_t =
sin(phi1) *
r;
109 double P1_y_l =
sin(phi1) *
r;
111 double P2_x_t =
cos(phi2) *
r;
112 double P2_x_l =
cos(phi2) *
r;
113 double P2_y_t =
sin(phi2) *
r;
114 double P2_y_l =
sin(phi2) *
r;
118 double P3_z_l = (P1_z_l + P2_z_l) / 2;
119 double P3_z_t = (P1_z_t + P2_z_t) / 2;
124 double dz = (P3_z_t - P3_z_l) / 2;
125 double offset = (P3_z_t + P3_z_l) / 2;
129 double D1_z_l = P1_z_l - P3_z_l;
130 double D2_z_l = P2_z_l - P3_z_l;
133 double n_x_l = (P1_y_l * D2_z_l) - (D1_z_l * P2_y_l);
134 double n_y_l = (D1_z_l * P2_x_l) - (P1_x_l * D2_z_l);
135 double n_z_l = (P1_x_l * P2_y_l) - (P1_y_l * P2_x_l);
145 double D1_z_t = P1_z_t - P3_z_t;
146 double D2_z_t = P2_z_t - P3_z_t;
148 double n_x_t = (P1_y_t * D2_z_t) - (D1_z_t * P2_y_t);
149 double n_y_t = (D1_z_t * P2_x_t) - (P1_x_t * D2_z_t);
150 double n_z_t = (P1_x_t * P2_y_t) - (P1_y_t * P2_x_t);
158 double dphi = phi2 - phi1;
162 n_x_t, n_y_t, n_z_t);
163 segments.push_back(seg);
164 offsets.push_back(offset);
169 assert(segments.size() >= 2);
173 double shift = offsets[0];
175 for (
unsigned i = 1;
i < segments.size()-1;
i++) {
189 double offset = - shift + (min_z + (max_z-min_z)/2);
std::vector< Section > sections
Sin< T >::type sin(const T &t)
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
const std::string & ns() const
Returns the namespace.
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.
static DDSolid cuttubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi, double lx, double ly, double lz, double tx, double ty, double tz)
Cos< T >::type cos(const T &t)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
static double square(double x)
static unsigned int const shift
static DDSolid unionSolid(const DDName &name, const DDSolid &a, const DDSolid &b, const DDTranslation &t, const DDRotation &r)
const std::string & name() const
Returns the name.