118 std::vector<DDSolid> segments;
123 if (s1.phi !=
s2.phi) {
128 double phi1 = s1.phi;
129 double phi2 =
s2.phi;
137 double P1_z_l = s1.z_l;
138 double P1_z_t = s1.z_t;
139 double P2_z_l =
s2.z_l;
140 double P2_z_t =
s2.z_t;
142 double P1_x_t =
cos(phi1) *
r;
143 double P1_x_l =
cos(phi1) *
r;
144 double P1_y_t =
sin(phi1) *
r;
145 double P1_y_l =
sin(phi1) *
r;
147 double P2_x_t =
cos(phi2) *
r;
148 double P2_x_l =
cos(phi2) *
r;
149 double P2_y_t =
sin(phi2) *
r;
150 double P2_y_l =
sin(phi2) *
r;
154 double P3_z_l = (P1_z_l + P2_z_l) / 2;
155 double P3_z_t = (P1_z_t + P2_z_t) / 2;
160 double dz = (P3_z_t - P3_z_l) / 2;
161 double offset = (P3_z_t + P3_z_l) / 2;
165 double D1_z_l = P1_z_l - P3_z_l;
166 double D2_z_l = P2_z_l - P3_z_l;
169 double n_x_l = (P1_y_l * D2_z_l) - (D1_z_l * P2_y_l);
170 double n_y_l = (D1_z_l * P2_x_l) - (P1_x_l * D2_z_l);
171 double n_z_l = (P1_x_l * P2_y_l) - (P1_y_l * P2_x_l);
181 double D1_z_t = P1_z_t - P3_z_t;
182 double D2_z_t = P2_z_t - P3_z_t;
184 double n_x_t = (P1_y_t * D2_z_t) - (D1_z_t * P2_y_t);
185 double n_y_t = (D1_z_t * P2_x_t) - (P1_x_t * D2_z_t);
186 double n_z_t = (P1_x_t * P2_y_t) - (P1_y_t * P2_x_t);
194 double dphi = phi2 - phi1;
197 DDSolidFactory::cuttubs(segname, dz,
r_min,
r_max, phi1, dphi, n_x_l, n_y_l, n_z_l, n_x_t, n_y_t, n_z_t);
198 segments.emplace_back(seg);
199 offsets.emplace_back(offset);
204 assert(segments.size() >= 2);
208 double shift = offsets[0];
210 for (
unsigned i = 1;
i < segments.size() - 1;
i++) {
219 segments[segments.size() - 1],
224 double offset = -shift + (min_z + (max_z - min_z) / 2);
std::vector< Section > sections
Sin< T >::type sin(const T &t)
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)
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string ©no, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
static unsigned int const shift
static DDSolid unionSolid(const DDName &name, const DDSolid &a, const DDSolid &b, const DDTranslation &t, const DDRotation &r)
ROOT::Math::Rotation3D DDRotation
const std::string & name() const
Returns the name.