Definition at line 75 of file DDTIDAxialCableAlgo.cc.
References angles, childName, dbl_to_string(), DDpos(), DDrot(), DDSplit(), first, i, idNameSpace, int, k, LogDebug, matIn, matOut, name, dbtoconf::parent, DDSolidFactory::polycone(), r, rMax, rMin, rTop, edm::second(), theta, thick, DDSolidFactory::tubs(), width, z, zBend, zEnd, zposRing, and zposWheel.
00075 {
00076
00077 DDName mother = parent().name();
00078 std::vector<DDName> logs;
00079 double thk = thick/zposRing.size();
00080 double r = rMin;
00081 double thktot = 0;
00082 double z;
00083
00084
00085 for (int k=0; k<(int)(zposWheel.size()); k++) {
00086
00087 std::vector<double> pconZ, pconRmin, pconRmax;
00088 for (int i=0; i<(int)(zposRing.size()); i++) {
00089 thktot += thk;
00090 z = zposWheel[k] + zposRing[i] - 0.5*thk;
00091 if (i != 0) {
00092 pconZ.push_back(z);
00093 pconRmin.push_back(r);
00094 pconRmax.push_back(rMax);
00095 }
00096 r = rMin;
00097 pconZ.push_back(z);
00098 pconRmin.push_back(r);
00099 pconRmax.push_back(rMax);
00100 z += thk;
00101 pconZ.push_back(z);
00102 pconRmin.push_back(r);
00103 pconRmax.push_back(rMax);
00104 r = rMax - thktot;
00105 pconZ.push_back(z);
00106 pconRmin.push_back(r);
00107 pconRmax.push_back(rMax);
00108 }
00109 if (k >= ((int)(zposWheel.size())-1)) z = zBend;
00110 else z = zposWheel[k+1] + zposRing[0] - 0.5*thk;
00111 pconZ.push_back(z);
00112 pconRmin.push_back(r);
00113 pconRmax.push_back(rMax);
00114
00115 std::string name = childName + dbl_to_string(k);
00116 DDSolid solid = DDSolidFactory::polycone(DDName(name, idNameSpace),
00117 -0.5*width, width, pconZ,
00118 pconRmin, pconRmax);
00119
00120 LogDebug("TIDGeom") << "DDTIDAxialCableAlgo test: "
00121 << DDName(name,idNameSpace) << " Polycone made of "
00122 << matIn << " from " << -0.5*width/deg << " to "
00123 << 0.5*width/deg << " and with " << pconZ.size()
00124 << " sections ";
00125 for (int i = 0; i <(int)(pconZ.size()); i++)
00126 LogDebug("TIDGeom") << "\t[" << i << "]\tZ = " << pconZ[i]
00127 << "\tRmin = "<< pconRmin[i] << "\tRmax = "
00128 << pconRmax[i];
00129
00130 DDName mat(DDSplit(matIn).first, DDSplit(matIn).second);
00131 DDMaterial matter(mat);
00132 DDLogicalPart genlogic(DDName(name, idNameSpace), matter, solid);
00133 logs.push_back(DDName(name, idNameSpace));
00134 }
00135
00136
00137 std::vector<double> pconZ, pconRmin, pconRmax;
00138 r = thktot*rMax/rTop;
00139 z = zBend - thktot;
00140 LogDebug("TIDGeom") << "DDTIDAxialCableAlgo test: Thk " << thk
00141 << " Total " << thktot << " rMax " << rMax
00142 << " rTop " << rTop << " dR " << r << " z " << z;
00143 pconZ.push_back(z);
00144 pconRmin.push_back(rMax);
00145 pconRmax.push_back(rMax);
00146 z = zBend - r;
00147 pconZ.push_back(z);
00148 pconRmin.push_back(rMax);
00149 pconRmax.push_back(rTop);
00150 pconZ.push_back(zBend);
00151 pconRmin.push_back(rMax);
00152 pconRmax.push_back(rTop);
00153
00154 std::string name = childName + dbl_to_string(zposWheel.size());
00155 DDSolid solid = DDSolidFactory::polycone(DDName(name, idNameSpace),
00156 -0.5*width, width, pconZ,
00157 pconRmin, pconRmax);
00158
00159 LogDebug("TIDGeom") << "DDTIDAxialCableAlgo test: "
00160 << DDName(name, idNameSpace) << " Polycone made of "
00161 << matIn << " from " << -0.5*width/deg << " to "
00162 << 0.5*width/deg << " and with " << pconZ.size()
00163 << " sections ";
00164 for (int i = 0; i < (int)(pconZ.size()); i++)
00165 LogDebug("TIDGeom") << "\t[" << i << "]\tZ = " << pconZ[i]
00166 << "\tRmin = "<< pconRmin[i] << "\tRmax = "
00167 << pconRmax[i];
00168
00169 DDName mat(DDSplit(matIn).first, DDSplit(matIn).second);
00170 DDMaterial matter(mat);
00171 DDLogicalPart genlogic(DDName(name, idNameSpace), matter, solid);
00172 logs.push_back(DDName(name, idNameSpace));
00173
00174
00175 name = childName + dbl_to_string(zposWheel.size()+1);
00176 r = rTop-r;
00177 solid = DDSolidFactory::tubs(DDName(name, idNameSpace), 0.5*(zEnd-zBend),
00178 r, rTop, -0.5*width, width);
00179 LogDebug("TIDGeom") << "DDTIDAxialCableAlgo test: "
00180 << DDName(name, idNameSpace) << " Tubs made of "
00181 << matOut << " from " << -0.5*width/deg << " to "
00182 << 0.5*width/deg << " with Rin " << r << " Rout "
00183 << rTop << " ZHalf " << 0.5*(zEnd-zBend);
00184 mat = DDName(DDSplit(matOut).first, DDSplit(matOut).second);
00185 matter = DDMaterial(mat);
00186 genlogic = DDLogicalPart(DDName(name, idNameSpace), matter, solid);
00187 logs.push_back(DDName(name, idNameSpace));
00188
00189
00190 double theta = 90.*deg;
00191 for (int i=0; i<(int)(angles.size()); i++) {
00192 double phix = angles[i];
00193 double phiy = phix + 90.*deg;
00194 double phideg = phix/deg;
00195
00196 DDRotation rotation;
00197 if (phideg != 0) {
00198 std::string rotstr = childName + dbl_to_string(phideg*10.);
00199 rotation = DDRotation(DDName(rotstr, idNameSpace));
00200 if (!rotation) {
00201 LogDebug("TIDGeom") << "DDTIDAxialCableAlgo test: Creating a new "
00202 << "rotation: " << rotstr << " " << theta/deg
00203 << ", " << phix/deg << ", " << theta/deg
00204 << ", " << phiy/deg << ", 0, 0";
00205 rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta,
00206 phiy, 0., 0.);
00207 }
00208 }
00209
00210 for (int k=0; k<(int)(logs.size()); k++) {
00211 DDTranslation tran(0,0,0);
00212 if (k == ((int)(logs.size())-1))
00213 tran = DDTranslation(0,0,0.5*(zEnd+zBend));
00214 DDpos (logs[k], mother, i+1, tran, rotation);
00215 LogDebug("TIDGeom") << "DDTIDAxialCableAlgo test " << logs[k]
00216 << " number " << i+1 << " positioned in "
00217 << mother << " at " << tran << " with "
00218 << rotation;
00219 }
00220 }
00221 }