15 #include "CLHEP/Units/GlobalPhysicalConstants.h" 16 #include "CLHEP/Units/GlobalSystemOfUnits.h" 64 zBend = nArgs[
"ZBend"];
69 width = nArgs[
"Width"];
70 thick = nArgs[
"Thick"];
72 zposWheel = vArgs[
"ZPosWheel"];
73 zposRing = vArgs[
"ZPosRing"];
75 LogDebug(
"TIDGeom") <<
"DDTIDAxialCableAlgo debug: Parameters for creating " << (zposWheel.size() + 2)
76 <<
" axial cables and position" 77 <<
"ing " <<
angles.size() <<
" copies in Service volume" 78 <<
"\n zBend " << zBend <<
" zEnd " << zEnd <<
" rMin " <<
rMin 79 <<
" rMax " <<
rMax <<
" Cable width " <<
width / CLHEP::deg <<
" thickness " << thick
83 LogDebug(
"TIDGeom") <<
" Wheels " << zposWheel.size() <<
" at Z";
84 for (
int i = 0;
i < (
int)(zposWheel.size());
i++)
85 LogDebug(
"TIDGeom") <<
"\tzposWheel[" <<
i <<
"] = " << zposWheel[
i];
86 LogDebug(
"TIDGeom") <<
" each with " << zposRing.size() <<
" Rings at Z";
87 for (
int i = 0;
i < (
int)(zposRing.size());
i++)
88 LogDebug(
"TIDGeom") <<
"\tzposRing[" <<
i <<
"] = " << zposRing[
i];
91 childName = sArgs[
"ChildName"];
92 matIn = sArgs[
"MaterialIn"];
93 matOut = sArgs[
"MaterialOut"];
96 LogDebug(
"TIDGeom") <<
"DDTIDAxialCableAlgo debug: Parent " << parentName <<
"\tChild " << childName <<
" NameSpace " 97 << idNameSpace <<
"\tMaterial " << matIn <<
" and " << matOut;
103 double thk = thick / zposRing.size();
109 for (
int k = 0;
k < (
int)(zposWheel.size());
k++) {
110 vector<double> pconZ, pconRmin, pconRmax;
111 for (
int i = 0;
i < (
int)(zposRing.size());
i++) {
113 z = zposWheel[
k] + zposRing[
i] - 0.5 * thk;
115 pconZ.emplace_back(z);
116 pconRmin.emplace_back(r);
117 pconRmax.emplace_back(
rMax);
120 pconZ.emplace_back(z);
121 pconRmin.emplace_back(r);
122 pconRmax.emplace_back(
rMax);
124 pconZ.emplace_back(z);
125 pconRmin.emplace_back(r);
126 pconRmax.emplace_back(
rMax);
128 pconZ.emplace_back(z);
129 pconRmin.emplace_back(r);
130 pconRmax.emplace_back(
rMax);
132 if (
k >= ((
int)(zposWheel.size()) - 1))
135 z = zposWheel[
k + 1] + zposRing[0] - 0.5 * thk;
136 pconZ.emplace_back(z);
137 pconRmin.emplace_back(r);
138 pconRmax.emplace_back(
rMax);
143 LogDebug(
"TIDGeom") <<
"DDTIDAxialCableAlgo test: " <<
DDName(
name, idNameSpace) <<
" Polycone made of " << matIn
144 <<
" from " << -0.5 *
width / CLHEP::deg <<
" to " << 0.5 *
width / CLHEP::deg <<
" and with " 145 << pconZ.size() <<
" sections ";
146 for (
int i = 0;
i < (
int)(pconZ.size());
i++)
147 LogDebug(
"TIDGeom") <<
"\t[" <<
i <<
"]\tZ = " << pconZ[
i] <<
"\tRmin = " << pconRmin[
i]
148 <<
"\tRmax = " << pconRmax[
i];
157 vector<double> pconZ, pconRmin, pconRmax;
158 r = thktot *
rMax / rTop;
160 LogDebug(
"TIDGeom") <<
"DDTIDAxialCableAlgo test: Thk " << thk <<
" Total " << thktot <<
" rMax " <<
rMax <<
" rTop " 161 << rTop <<
" dR " << r <<
" z " << z;
162 pconZ.emplace_back(z);
163 pconRmin.emplace_back(
rMax);
164 pconRmax.emplace_back(
rMax);
166 pconZ.emplace_back(z);
167 pconRmin.emplace_back(
rMax);
168 pconRmax.emplace_back(rTop);
169 pconZ.emplace_back(zBend);
170 pconRmin.emplace_back(
rMax);
171 pconRmax.emplace_back(rTop);
176 LogDebug(
"TIDGeom") <<
"DDTIDAxialCableAlgo test: " <<
DDName(
name, idNameSpace) <<
" Polycone made of " << matIn
177 <<
" from " << -0.5 *
width / CLHEP::deg <<
" to " << 0.5 *
width / CLHEP::deg <<
" and with " 178 << pconZ.size() <<
" sections ";
179 for (
int i = 0;
i < (
int)(pconZ.size());
i++)
180 LogDebug(
"TIDGeom") <<
"\t[" <<
i <<
"]\tZ = " << pconZ[
i] <<
"\tRmin = " << pconRmin[
i]
181 <<
"\tRmax = " << pconRmax[
i];
191 LogDebug(
"TIDGeom") <<
"DDTIDAxialCableAlgo test: " <<
DDName(
name, idNameSpace) <<
" Tubs made of " << matOut
192 <<
" from " << -0.5 *
width / CLHEP::deg <<
" to " << 0.5 *
width / CLHEP::deg <<
" with Rin " 193 << r <<
" Rout " << rTop <<
" ZHalf " << 0.5 * (zEnd - zBend);
199 double theta = 90. * CLHEP::deg;
202 double phiy = phix + 90. * CLHEP::deg;
203 double phideg = phix / CLHEP::deg;
207 string rotstr = childName +
to_string(phideg * 10.);
210 LogDebug(
"TIDGeom") <<
"DDTIDAxialCableAlgo test: Creating a new " 211 <<
"rotation: " << rotstr <<
" " <<
theta / CLHEP::deg <<
", " << phix / CLHEP::deg <<
", " 212 <<
theta / CLHEP::deg <<
", " << phiy / CLHEP::deg <<
", 0, 0";
217 for (
int k = 0;
k < (
int)(logs.size());
k++) {
219 if (
k == ((
int)(logs.size()) - 1))
222 LogDebug(
"TIDGeom") <<
"DDTIDAxialCableAlgo test " << logs[
k] <<
" number " <<
i + 1 <<
" positioned in " 223 << mother <<
" at " << tran <<
" with " <<
rotation;
static AlgebraicMatrix initialize()
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string ©no, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
DDMaterial is used to define and access material information.
static DDSolid polycone(const DDName &name, double startPhi, double deltaPhi, const std::vector< double > &z, const std::vector< double > &rmin, const std::vector< double > &rmax)
Creates a polycone (refere to Geant3 or Geant4 documentation)
void execute(DDCompactView &cpv) override
DDName is used to identify DDD entities uniquely.
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
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.
vector< double > zposRing
U second(std::pair< T, U > const &p)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
~DDTIDAxialCableAlgo() override
vector< double > zposWheel
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
Geom::Theta< T > theta() const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation