14 #include <CLHEP/Units/GlobalPhysicalConstants.h> 15 #include <CLHEP/Units/SystemOfUnits.h> 61 LogDebug(
"TrackerGeom") <<
"DDCutTubsFromPoints info: Creating an instance";
71 r_min = nArgs[
"rMin"];
72 r_max = nArgs[
"rMax"];
73 z_pos = nArgs[
"zPos"];
76 auto phis_name =
DDName(sArgs[
"Phi"]);
77 auto z_ls_name =
DDName(sArgs[
"z_l"]);
78 auto z_ts_name =
DDName(sArgs[
"z_t"]);
86 for (
unsigned i = 0;
i < phis.
size();
i++) {
96 LogDebug(
"TrackerGeom") <<
"DDCutTubsFromPoints debug: Parent " << parentName <<
"\tSolid " <<
solidOutput 97 <<
" NameSpace " << idNameSpace <<
"\tnumber of sections " <<
sections.size();
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);
204 assert(segments.size() >= 2);
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);
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string ©no, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
size_t size() const
the size of the array of values
DDMaterial is used to define and access material information.
std::vector< Section > sections
Sin< T >::type sin(const T &t)
~DDCutTubsFromPoints() override
DDName is used to identify DDD entities uniquely.
static std::string & ns()
Compact representation of the geometrical detector hierarchy.
A DDSolid represents the shape of a part.
static std::string to_string(const XMLCh *ch)
Represents a uniquely identifyable rotation matrix.
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
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)
const std::string & name() const
Returns the name.
Cos< T >::type cos(const T &t)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
a named constant corresponding to the DDL-XML tag <Constant> and <ConstantsVector> ...
static double square(double x)
static unsigned int const shift
#define DEFINE_EDM_PLUGIN(factory, type, name)
static DDSolid unionSolid(const DDName &name, const DDSolid &a, const DDSolid &b, const DDTranslation &t, const DDRotation &r)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
void execute(DDCompactView &cpv) override
const std::string & ns() const
Returns the namespace.