File indexing completed on 2024-05-10 02:20:54
0001
0002
0003
0004
0005
0006 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0007 #include "DetectorDescription/Core/interface/DDLogicalPart.h"
0008 #include "DetectorDescription/Core/interface/DDSolid.h"
0009 #include "DetectorDescription/Core/interface/DDMaterial.h"
0010 #include "DetectorDescription/Core/interface/DDCurrentNamespace.h"
0011 #include "DetectorDescription/Core/interface/DDSplit.h"
0012 #include "DetectorDescription/Core/interface/DDTypes.h"
0013 #include "DetectorDescription/Core/interface/DDAlgorithm.h"
0014 #include "DetectorDescription/Core/interface/DDAlgorithmFactory.h"
0015 #include <CLHEP/Units/GlobalPhysicalConstants.h>
0016 #include <CLHEP/Units/SystemOfUnits.h>
0017
0018 #include <string>
0019 #include <vector>
0020
0021 using namespace std;
0022
0023 class DDTIDModuleAlgo : public DDAlgorithm {
0024 public:
0025
0026 DDTIDModuleAlgo();
0027 ~DDTIDModuleAlgo() override;
0028
0029 void initialize(const DDNumericArguments& nArgs,
0030 const DDVectorArguments& vArgs,
0031 const DDMapArguments& mArgs,
0032 const DDStringArguments& sArgs,
0033 const DDStringVectorArguments& vsArgs) override;
0034
0035 void execute(DDCompactView& cpv) override;
0036
0037 private:
0038 string genMat;
0039 int detectorN;
0040 double moduleThick;
0041 double detTilt;
0042 double fullHeight;
0043 double dlTop;
0044 double dlBottom;
0045 double dlHybrid;
0046 bool doComponents;
0047
0048 string boxFrameName;
0049 string boxFrameMat;
0050 double boxFrameHeight;
0051 double boxFrameThick;
0052 double boxFrameWidth;
0053 double bottomFrameHeight;
0054 double bottomFrameOver;
0055 double topFrameHeight;
0056 double topFrameOver;
0057 vector<string> sideFrameName;
0058 string sideFrameMat;
0059 double sideFrameWidth;
0060 double sideFrameThick;
0061 double sideFrameOver;
0062 vector<string> holeFrameName;
0063 vector<string> holeFrameRot;
0064
0065 vector<string> kaptonName;
0066 string kaptonMat;
0067
0068 double kaptonThick;
0069 double kaptonOver;
0070 vector<string> holeKaptonName;
0071 vector<string> holeKaptonRot;
0072
0073 vector<string> waferName;
0074 string waferMat;
0075 double sideWidthTop;
0076 double sideWidthBottom;
0077 vector<string> activeName;
0078 string activeMat;
0079 double activeHeight;
0080 vector<double> waferThick;
0081 string activeRot;
0082 vector<double> backplaneThick;
0083 string hybridName;
0084 string hybridMat;
0085 double hybridHeight;
0086 double hybridWidth;
0087 double hybridThick;
0088 vector<string> pitchName;
0089 string pitchMat;
0090 double pitchHeight;
0091 double pitchThick;
0092 double pitchStereoTol;
0093 string coolName;
0094 string coolMat;
0095 double coolHeight;
0096 double coolThick;
0097 double coolWidth;
0098 };
0099
0100 DDTIDModuleAlgo::DDTIDModuleAlgo() { LogDebug("TIDGeom") << "DDTIDModuleAlgo info: Creating an instance"; }
0101
0102 DDTIDModuleAlgo::~DDTIDModuleAlgo() {}
0103
0104 void DDTIDModuleAlgo::initialize(const DDNumericArguments& nArgs,
0105 const DDVectorArguments& vArgs,
0106 const DDMapArguments&,
0107 const DDStringArguments& sArgs,
0108 const DDStringVectorArguments& vsArgs) {
0109 int i;
0110 genMat = sArgs["GeneralMaterial"];
0111 detectorN = (int)(nArgs["DetectorNumber"]);
0112 DDName parentName(parent().name());
0113
0114 LogDebug("TIDGeom") << "DDTIDModuleAlgo debug: Parent " << parentName << " General Material " << genMat
0115 << " Detector Planes " << detectorN;
0116
0117 moduleThick = nArgs["ModuleThick"];
0118 detTilt = nArgs["DetTilt"];
0119 fullHeight = nArgs["FullHeight"];
0120 dlTop = nArgs["DlTop"];
0121 dlBottom = nArgs["DlBottom"];
0122 dlHybrid = nArgs["DlHybrid"];
0123 string comp = sArgs["DoComponents"];
0124 if (comp == "No" || comp == "NO" || comp == "no")
0125 doComponents = false;
0126 else
0127 doComponents = true;
0128
0129 LogDebug("TIDGeom") << "DDTIDModuleAlgo debug: ModuleThick " << moduleThick << " Detector Tilt "
0130 << detTilt / CLHEP::deg << " Height " << fullHeight << " dl(Top) " << dlTop << " dl(Bottom) "
0131 << dlBottom << " dl(Hybrid) " << dlHybrid << " doComponents " << doComponents;
0132
0133 boxFrameName = sArgs["BoxFrameName"];
0134 boxFrameMat = sArgs["BoxFrameMaterial"];
0135 boxFrameThick = nArgs["BoxFrameThick"];
0136 boxFrameHeight = nArgs["BoxFrameHeight"];
0137 boxFrameWidth = nArgs["BoxFrameWidth"];
0138 bottomFrameHeight = nArgs["BottomFrameHeight"];
0139 bottomFrameOver = nArgs["BottomFrameOver"];
0140 LogDebug("TIDGeom") << "DDTIDModuleAlgo debug: " << boxFrameName << " Material " << boxFrameMat << " Thickness "
0141 << boxFrameThick << " width " << boxFrameWidth << " height " << boxFrameHeight
0142 << " Extra Height at Bottom " << bottomFrameHeight << " Overlap " << bottomFrameOver;
0143
0144 topFrameHeight = nArgs["TopFrameHeight"];
0145 topFrameOver = nArgs["TopFrameOver"];
0146 sideFrameName = vsArgs["SideFrameName"];
0147 sideFrameMat = sArgs["SideFrameMaterial"];
0148 sideFrameWidth = nArgs["SideFrameWidth"];
0149 sideFrameThick = nArgs["SideFrameThick"];
0150 sideFrameOver = nArgs["SideFrameOver"];
0151 holeFrameName = vsArgs["HoleFrameName"];
0152 holeFrameRot = vsArgs["HoleFrameRotation"];
0153 for (i = 0; i < detectorN; i++)
0154 LogDebug("TIDGeom") << "DDTIDModuleAlgo debug : " << sideFrameName[i] << " Material " << sideFrameMat << " Width "
0155 << sideFrameWidth << " Thickness " << sideFrameThick << " Overlap " << sideFrameOver
0156 << " Hole " << holeFrameName[i];
0157
0158 kaptonName = vsArgs["KaptonName"];
0159 kaptonMat = sArgs["KaptonMaterial"];
0160 kaptonThick = nArgs["KaptonThick"];
0161 kaptonOver = nArgs["KaptonOver"];
0162 holeKaptonName = vsArgs["HoleKaptonName"];
0163 holeKaptonRot = vsArgs["HoleKaptonRotation"];
0164 for (i = 0; i < detectorN; i++)
0165 LogDebug("TIDGeom") << "DDTIDModuleAlgo debug : " << kaptonName[i] << " Material " << kaptonMat << " Thickness "
0166 << kaptonThick << " Overlap " << kaptonOver << " Hole " << holeKaptonName[i];
0167
0168 waferName = vsArgs["WaferName"];
0169 waferMat = sArgs["WaferMaterial"];
0170 sideWidthTop = nArgs["SideWidthTop"];
0171 sideWidthBottom = nArgs["SideWidthBottom"];
0172
0173 LogDebug("TIDGeom") << "DDTIDModuleAlgo debug: Wafer Material " << waferMat << " Side Width Top " << sideWidthTop
0174 << " Side Width Bottom " << sideWidthBottom;
0175 for (i = 0; i < detectorN; i++)
0176 LogDebug("TIDGeom") << "\twaferName[" << i << "] = " << waferName[i];
0177
0178 activeName = vsArgs["ActiveName"];
0179 activeMat = sArgs["ActiveMaterial"];
0180 activeHeight = nArgs["ActiveHeight"];
0181 waferThick = vArgs["WaferThick"];
0182 activeRot = sArgs["ActiveRotation"];
0183 backplaneThick = vArgs["BackPlaneThick"];
0184 LogDebug("TIDGeom") << "DDTIDModuleAlgo debug: Active Material " << activeMat << " Height " << activeHeight
0185 << " rotated by " << activeRot;
0186 for (i = 0; i < detectorN; i++)
0187 LogDebug("TIDGeom") << " translated by (0," << -0.5 * backplaneThick[i] << ",0)\tactiveName[" << i
0188 << "] = " << activeName[i] << " of thickness " << waferThick[i] - backplaneThick[i];
0189
0190 hybridName = sArgs["HybridName"];
0191 hybridMat = sArgs["HybridMaterial"];
0192 hybridHeight = nArgs["HybridHeight"];
0193 hybridWidth = nArgs["HybridWidth"];
0194 hybridThick = nArgs["HybridThick"];
0195 LogDebug("TIDGeom") << "DDTIDModuleAlgo debug: " << hybridName << " Material " << hybridMat << " Height "
0196 << hybridHeight << " Width " << hybridWidth << " Thickness " << hybridThick;
0197
0198 pitchName = vsArgs["PitchName"];
0199 pitchMat = sArgs["PitchMaterial"];
0200 pitchHeight = nArgs["PitchHeight"];
0201 pitchThick = nArgs["PitchThick"];
0202 pitchStereoTol = nArgs["PitchStereoTolerance"];
0203
0204 LogDebug("TIDGeom") << "DDTIDModuleAlgo debug: Pitch Adapter Material " << pitchMat << " Height " << pitchHeight
0205 << " Thickness " << pitchThick;
0206 for (i = 0; i < detectorN; i++)
0207 LogDebug("TIDGeom") << "\tpitchName[" << i << "] = " << pitchName[i];
0208
0209 coolName = sArgs["CoolInsertName"];
0210 coolMat = sArgs["CoolInsertMaterial"];
0211 coolHeight = nArgs["CoolInsertHeight"];
0212 coolThick = nArgs["CoolInsertThick"];
0213 coolWidth = nArgs["CoolInsertWidth"];
0214 LogDebug("TIDGeom") << "DDTIDModuleAlgo debug: Cool Element Material " << coolMat << " Height " << coolHeight
0215 << " Thickness " << coolThick << " Width " << coolWidth;
0216 }
0217
0218 void DDTIDModuleAlgo::execute(DDCompactView& cpv) {
0219 LogDebug("TIDGeom") << "==>> Constructing DDTIDModuleAlgo...";
0220
0221 DDName parentName(parent().name());
0222
0223 double sidfr = sideFrameWidth - sideFrameOver;
0224 double botfr;
0225 double topfr;
0226 double kaptonHeight;
0227 if (dlHybrid > dlTop) {
0228
0229 topfr = topFrameHeight - pitchHeight - topFrameOver;
0230 botfr = bottomFrameHeight - bottomFrameOver;
0231 kaptonHeight = fullHeight + botfr;
0232 } else {
0233
0234 topfr = topFrameHeight - topFrameOver;
0235 botfr = bottomFrameHeight - bottomFrameOver - pitchHeight;
0236 kaptonHeight = fullHeight + topfr;
0237 }
0238
0239 double sideFrameHeight = fullHeight + pitchHeight + botfr + topfr;
0240 double kaptonWidth = sidfr + kaptonOver;
0241
0242 double dxbot = 0.5 * dlBottom + sidfr;
0243 double dxtop = 0.5 * dlTop + sidfr;
0244 double dxtopenv, dxbotenv;
0245
0246
0247 if (dlHybrid > dlTop) {
0248
0249 dxtopenv = dxbot + (dxtop - dxbot) * (fullHeight + pitchHeight + topfr + hybridHeight) / fullHeight;
0250 dxbotenv = dxtop - (dxtop - dxbot) * (fullHeight + botfr) / fullHeight;
0251 } else {
0252
0253 dxtopenv = dxbot + (dxtop - dxbot) * (fullHeight + topfr) / fullHeight;
0254 dxbotenv = dxbot;
0255 }
0256 double bl1 = dxbotenv;
0257 double bl2 = dxtopenv;
0258 double h1 = 0.5 * moduleThick;
0259 double dz = 0.5 * (boxFrameHeight + sideFrameHeight);
0260
0261 DDSolid solidUncut, solidCut;
0262 DDSolid solid = DDSolidFactory::trap(parentName, dz, 0, 0, h1, bl1, bl1, 0, h1, bl2, bl2, 0);
0263 DDMaterial matter = DDMaterial(DDName(DDSplit(genMat).first, DDSplit(genMat).second));
0264 DDLogicalPart module(solid.ddname(), matter, solid);
0265 LogDebug("TIDGeom") << "DDTIDModuleAlgo test:\t" << solid.name() << " Trap made of " << genMat << " of dimensions "
0266 << dz << ", 0, 0, " << h1 << ", " << bl1 << ", " << bl1 << ", 0, " << h1 << ", " << bl2 << ", "
0267 << bl2 << ", 0";
0268
0269 if (doComponents) {
0270
0271 matter = DDMaterial(DDName(DDSplit(boxFrameMat).first, DDSplit(boxFrameMat).second));
0272 double dx = 0.5 * boxFrameWidth;
0273 double dy = 0.5 * boxFrameThick;
0274 double dz = 0.5 * boxFrameHeight;
0275 solid = DDSolidFactory::box(DDName(DDSplit(boxFrameName).first, DDSplit(boxFrameName).second), dx, dy, dz);
0276 LogDebug("TIDGeom") << "DDTIDModuleAlgo test:\t" << solid.name() << " Box made of " << matter.ddname()
0277 << " of dimensions " << dx << ", " << dy << ", " << dz;
0278 DDLogicalPart boxFrame(solid.ddname(), matter, solid);
0279
0280
0281 matter = DDMaterial(DDName(DDSplit(hybridMat).first, DDSplit(hybridMat).second));
0282 dx = 0.5 * hybridWidth;
0283 dy = 0.5 * hybridThick;
0284 dz = 0.5 * hybridHeight;
0285 solid = DDSolidFactory::box(DDName(DDSplit(hybridName).first, DDSplit(hybridName).second), dx, dy, dz);
0286 LogDebug("TIDGeom") << "DDTIDModuleAlgo test:\t" << solid.name() << " Box made of " << matter.ddname()
0287 << " of dimensions " << dx << ", " << dy << ", " << dz;
0288 DDLogicalPart hybrid(solid.ddname(), matter, solid);
0289
0290
0291 matter = DDMaterial(DDName(DDSplit(coolMat).first, DDSplit(coolMat).second));
0292 dx = 0.5 * coolWidth;
0293 dy = 0.5 * coolThick;
0294 dz = 0.5 * coolHeight;
0295 solid = DDSolidFactory::box(DDName(DDSplit(coolName).first, DDSplit(coolName).second), dx, dy, dz);
0296 LogDebug("TIDGeom") << "DDTIDModuleAlgo test:\t" << solid.name() << " Box made of " << matter.ddname()
0297 << " of dimensions " << dx << ", " << dy << ", " << dz;
0298 DDLogicalPart cool(solid.ddname(), matter, solid);
0299
0300
0301 for (int k = 0; k < detectorN; k++) {
0302 double bbl1, bbl2;
0303
0304
0305 matter = DDMaterial(DDName(DDSplit(sideFrameMat).first, DDSplit(sideFrameMat).second));
0306 if (dlHybrid > dlTop) {
0307
0308 bbl1 = dxtop - (dxtop - dxbot) * (fullHeight + botfr) / fullHeight;
0309 bbl2 = dxbot + (dxtop - dxbot) * (fullHeight + pitchHeight + topfr) / fullHeight;
0310 } else {
0311
0312 bbl1 = dxtop - (dxtop - dxbot) * (fullHeight + pitchHeight + botfr) / fullHeight;
0313 bbl2 = dxbot + (dxtop - dxbot) * (fullHeight + topfr) / fullHeight;
0314 }
0315 h1 = 0.5 * sideFrameThick;
0316 dz = 0.5 * sideFrameHeight;
0317 solid = DDSolidFactory::trap(DDName(DDSplit(sideFrameName[k]).first, DDSplit(sideFrameName[k]).second),
0318 dz,
0319 0,
0320 0,
0321 h1,
0322 bbl1,
0323 bbl1,
0324 0,
0325 h1,
0326 bbl2,
0327 bbl2,
0328 0);
0329 LogDebug("TIDGeom") << "DDTIDModuleAlgo test:\t" << solid.name() << " Trap made of " << matter.ddname()
0330 << " of dimensions " << dz << ", 0, 0, " << h1 << ", " << bbl1 << ", " << bbl1 << ", 0, "
0331 << h1 << ", " << bbl2 << ", " << bbl2 << ", 0";
0332 DDLogicalPart sideFrame(solid.ddname(), matter, solid);
0333
0334 string rotstr, rotns;
0335 DDRotation rot;
0336
0337
0338 matter = DDMaterial(DDName(DDSplit(genMat).first, DDSplit(genMat).second));
0339 double xpos, zpos;
0340 dz = fullHeight - bottomFrameOver - topFrameOver;
0341 bbl1 = dxbot - sideFrameWidth + bottomFrameOver * (dxtop - dxbot) / fullHeight;
0342 bbl2 = dxtop - sideFrameWidth - topFrameOver * (dxtop - dxbot) / fullHeight;
0343 if (dlHybrid > dlTop) {
0344
0345 zpos = -(topFrameHeight + 0.5 * dz - 0.5 * sideFrameHeight);
0346 } else {
0347
0348 zpos = bottomFrameHeight + 0.5 * dz - 0.5 * sideFrameHeight;
0349 }
0350 dz /= 2.;
0351 solid = DDSolidFactory::trap(DDName(DDSplit(holeFrameName[k]).first, DDSplit(holeFrameName[k]).second),
0352 dz,
0353 0,
0354 0,
0355 h1,
0356 bbl1,
0357 bbl1,
0358 0,
0359 h1,
0360 bbl2,
0361 bbl2,
0362 0);
0363 LogDebug("TIDGeom") << "DDTIDModuleAlgo test:\t" << solid.name() << " Trap made of " << matter.ddname()
0364 << " of dimensions " << dz << ", 0, 0, " << h1 << ", " << bbl1 << ", " << bbl1 << ", 0, "
0365 << h1 << ", " << bbl2 << ", " << bbl2 << ", 0";
0366 DDLogicalPart holeFrame(solid.ddname(), matter, solid);
0367
0368 rotstr = DDSplit(holeFrameRot[k]).first;
0369 if (rotstr != "NULL") {
0370 rotns = DDSplit(holeFrameRot[k]).second;
0371 rot = DDRotation(DDName(rotstr, rotns));
0372 } else {
0373 rot = DDRotation();
0374 }
0375 cpv.position(holeFrame, sideFrame, 1, DDTranslation(0.0, 0.0, zpos), rot);
0376 LogDebug("TIDGeom") << "DDTIDModuleAlgo test: " << holeFrame.name() << " number 1 positioned in "
0377 << sideFrame.name() << " at (0,0," << zpos << ") with no rotation";
0378
0379
0380 matter = DDMaterial(DDName(DDSplit(kaptonMat).first, DDSplit(kaptonMat).second));
0381 double kaptonExtraHeight = 0;
0382 if (dlHybrid > dlTop) {
0383
0384 bbl1 = dxtop - (dxtop - dxbot) * (fullHeight + botfr) / fullHeight;
0385 if (k == 1) {
0386 kaptonExtraHeight = dlTop * sin(detTilt) - fullHeight * (1 - cos(detTilt));
0387 kaptonExtraHeight = 0.5 * fabs(kaptonExtraHeight);
0388 bbl2 = dxbot + (dxtop - dxbot) * (fullHeight + kaptonExtraHeight) / fullHeight;
0389 } else {
0390 bbl2 = dxtop;
0391 }
0392 } else {
0393
0394 bbl2 = dxbot + (dxtop - dxbot) * (fullHeight + topfr) / fullHeight;
0395 if (k == 1) {
0396 kaptonExtraHeight = dlBottom * sin(detTilt) - fullHeight * (1 - cos(detTilt));
0397 kaptonExtraHeight = 0.5 * fabs(kaptonExtraHeight);
0398 bbl1 = dxtop - (dxtop - dxbot) * (fullHeight + kaptonExtraHeight) / fullHeight;
0399 } else {
0400 bbl1 = dxbot;
0401 }
0402 }
0403 h1 = 0.5 * kaptonThick;
0404 dz = 0.5 * (kaptonHeight + kaptonExtraHeight);
0405
0406
0407 if (k == 1) {
0408
0409 string kaptonUncutName = kaptonName[k] + "Uncut";
0410 solidUncut = DDSolidFactory::trap(DDName(DDSplit(kaptonUncutName).first, DDSplit(kaptonUncutName).second),
0411 dz,
0412 0,
0413 0,
0414 h1,
0415 bbl1,
0416 bbl1,
0417 0,
0418 h1,
0419 bbl2,
0420 bbl2,
0421 0);
0422
0423
0424 string kaptonCutName = kaptonName[k] + "Cut";
0425
0426 if (dlHybrid > dlTop) {
0427 dz = 0.5 * dlTop;
0428 } else {
0429 dz = 0.5 * dlBottom;
0430 }
0431 h1 = 0.5 * kaptonThick;
0432 bbl1 = fabs(dz * sin(detTilt));
0433 bbl2 = bbl1 * 0.000001;
0434 double thet = atan((bbl1 - bbl2) / (2 * dz));
0435 solidCut = DDSolidFactory::trap(DDName(DDSplit(kaptonCutName).first, DDSplit(kaptonCutName).second),
0436 dz,
0437 thet,
0438 0,
0439 h1,
0440 bbl1,
0441 bbl1,
0442 0,
0443 h1,
0444 bbl2,
0445 bbl2,
0446 0);
0447
0448 string aRot("tidmodpar:9PYX");
0449 rotstr = DDSplit(aRot).first;
0450 rotns = DDSplit(aRot).second;
0451 rot = DDRotation(DDName(rotstr, rotns));
0452
0453 xpos = -0.5 * fullHeight * sin(detTilt);
0454 zpos = 0.5 * kaptonHeight - bbl2;
0455
0456
0457 solid = DDSolidFactory::subtraction(DDName(DDSplit(kaptonName[k]).first, DDSplit(kaptonName[k]).second),
0458 solidUncut,
0459 solidCut,
0460 DDTranslation(xpos, 0.0, zpos),
0461 rot);
0462 } else {
0463 solid = DDSolidFactory::trap(DDName(DDSplit(kaptonName[k]).first, DDSplit(kaptonName[k]).second),
0464 dz,
0465 0,
0466 0,
0467 h1,
0468 bbl1,
0469 bbl1,
0470 0,
0471 h1,
0472 bbl2,
0473 bbl2,
0474 0);
0475 }
0476
0477 DDLogicalPart kapton(solid.ddname(), matter, solid);
0478 LogDebug("TIDGeom") << "DDTIDModuleAlgo test:\t" << solid.name() << " SUBTRACTION SOLID Trap made of "
0479 << matter.ddname() << " of dimensions " << dz << ", 0, 0, " << h1 << ", " << bbl1 << ", "
0480 << bbl1 << ", 0, " << h1 << ", " << bbl2 << ", " << bbl2 << ", 0";
0481
0482
0483 matter = DDMaterial(DDName(DDSplit(genMat).first, DDSplit(genMat).second));
0484 dz = fullHeight - kaptonOver;
0485 xpos = 0;
0486 if (dlHybrid > dlTop) {
0487
0488 bbl1 = dxbot - kaptonWidth + kaptonOver * (dxtop - dxbot) / fullHeight;
0489 bbl2 = dxtop - kaptonWidth;
0490 zpos = 0.5 * (kaptonHeight - kaptonExtraHeight - dz);
0491 if (k == 1) {
0492 zpos -= 0.5 * kaptonOver * (1 - cos(detTilt));
0493 xpos = -0.5 * kaptonOver * sin(detTilt);
0494 }
0495 } else {
0496
0497 bbl1 = dxbot - kaptonWidth;
0498 bbl2 = dxtop - kaptonWidth - kaptonOver * (dxtop - dxbot) / fullHeight;
0499 zpos = -0.5 * (kaptonHeight - kaptonExtraHeight - dz);
0500 }
0501 dz /= 2.;
0502 solid = DDSolidFactory::trap(DDName(DDSplit(holeKaptonName[k]).first, DDSplit(holeKaptonName[k]).second),
0503 dz,
0504 0,
0505 0,
0506 h1,
0507 bbl1,
0508 bbl1,
0509 0,
0510 h1,
0511 bbl2,
0512 bbl2,
0513 0);
0514 LogDebug("TIDGeom") << "DDTIDModuleAlgo test:\t" << solid.name() << " Trap made of " << matter.ddname()
0515 << " of dimensions " << dz << ", 0, 0, " << h1 << ", " << bbl1 << ", " << bbl1 << ", 0, "
0516 << h1 << ", " << bbl2 << ", " << bbl2 << ", 0";
0517 DDLogicalPart holeKapton(solid.ddname(), matter, solid);
0518
0519 rotstr = DDSplit(holeKaptonRot[k]).first;
0520 if (rotstr != "NULL") {
0521 rotns = DDSplit(holeKaptonRot[k]).second;
0522 rot = DDRotation(DDName(rotstr, rotns));
0523 } else {
0524 rot = DDRotation();
0525 }
0526 cpv.position(holeKapton, kapton, 1, DDTranslation(xpos, 0.0, zpos), rot);
0527 LogDebug("TIDGeom") << "DDTIDModuleAlgo test: " << holeKapton.name() << " number 1 positioned in "
0528 << kapton.name() << " at (0,0," << zpos << ") with no rotation";
0529
0530
0531 matter = DDMaterial(DDName(DDSplit(waferMat).first, DDSplit(waferMat).second));
0532 if (k == 0 && dlHybrid < dlTop) {
0533 bl1 = 0.5 * dlTop;
0534 bl2 = 0.5 * dlBottom;
0535 } else {
0536 bl1 = 0.5 * dlBottom;
0537 bl2 = 0.5 * dlTop;
0538 }
0539 h1 = 0.5 * waferThick[k];
0540 dz = 0.5 * fullHeight;
0541 solid = DDSolidFactory::trap(
0542 DDName(DDSplit(waferName[k]).first, DDSplit(waferName[k]).second), dz, 0, 0, h1, bl1, bl1, 0, h1, bl2, bl2, 0);
0543 LogDebug("TIDGeom") << "DDTIDModuleAlgo test:\t" << solid.name() << " Trap made of " << matter.ddname()
0544 << " of dimensions " << dz << ", 0, 0, " << h1 << ", " << bl1 << ", " << bl1 << ", 0, " << h1
0545 << ", " << bl2 << ", " << bl2 << ", 0";
0546 DDLogicalPart wafer(solid.ddname(), matter, solid);
0547
0548
0549 matter = DDMaterial(DDName(DDSplit(activeMat).first, DDSplit(activeMat).second));
0550 if (k == 0 && dlHybrid < dlTop) {
0551 bl1 -= sideWidthTop;
0552 bl2 -= sideWidthBottom;
0553 } else {
0554 bl1 -= sideWidthBottom;
0555 bl2 -= sideWidthTop;
0556 }
0557 dz = 0.5 * (waferThick[k] - backplaneThick[k]);
0558 h1 = 0.5 * activeHeight;
0559 solid = DDSolidFactory::trap(DDName(DDSplit(activeName[k]).first, DDSplit(activeName[k]).second),
0560 dz,
0561 0,
0562 0,
0563 h1,
0564 bl2,
0565 bl1,
0566 0,
0567 h1,
0568 bl2,
0569 bl1,
0570 0);
0571 LogDebug("TIDGeom") << "DDTIDModuleAlgo test:\t" << solid.name() << " Trap made of " << matter.ddname()
0572 << " of dimensions " << dz << ", 0, 0, " << h1 << ", " << bl2 << ", " << bl1 << ", 0, " << h1
0573 << ", " << bl2 << ", " << bl1 << ", 0";
0574 DDLogicalPart active(solid.ddname(), matter, solid);
0575 rotstr = DDSplit(activeRot).first;
0576 if (rotstr != "NULL") {
0577 rotns = DDSplit(activeRot).second;
0578 rot = DDRotation(DDName(rotstr, rotns));
0579 } else {
0580 rot = DDRotation();
0581 }
0582 DDTranslation tran(0.0, -0.5 * backplaneThick[k], 0.0);
0583 cpv.position(active, wafer, 1, tran, rot);
0584 LogDebug("TIDGeom") << "DDTIDModuleAlgo test: " << active.name() << " number 1 positioned in " << wafer.name()
0585 << " at " << tran << " with " << rot;
0586
0587
0588 matter = DDMaterial(DDName(DDSplit(pitchMat).first, DDSplit(pitchMat).second));
0589 if (dlHybrid > dlTop) {
0590 dz = 0.5 * dlTop;
0591 } else {
0592 dz = 0.5 * dlBottom;
0593 }
0594 if (k == 0) {
0595 dx = dz;
0596 dy = 0.5 * pitchThick;
0597 dz = 0.5 * pitchHeight;
0598 solid = DDSolidFactory::box(DDName(DDSplit(pitchName[k]).first, DDSplit(pitchName[k]).second), dx, dy, dz);
0599 LogDebug("TIDGeom") << "DDTIDModuleAlgo test:\t" << solid.name() << " Box made of " << matter.ddname()
0600 << " of dimensions"
0601 << " " << dx << ", " << dy << ", " << dz;
0602 } else {
0603 h1 = 0.5 * pitchThick;
0604 bl1 = 0.5 * pitchHeight + 0.5 * dz * sin(detTilt);
0605 bl2 = 0.5 * pitchHeight - 0.5 * dz * sin(detTilt);
0606
0607 dz -= 0.5 * pitchStereoTol;
0608 bl1 -= pitchStereoTol;
0609 bl2 -= pitchStereoTol;
0610
0611 double thet = atan((bl1 - bl2) / (2. * dz));
0612 solid = DDSolidFactory::trap(DDName(DDSplit(pitchName[k]).first, DDSplit(pitchName[k]).second),
0613 dz,
0614 thet,
0615 0,
0616 h1,
0617 bl1,
0618 bl1,
0619 0,
0620 h1,
0621 bl2,
0622 bl2,
0623 0);
0624 LogDebug("TIDGeom") << "DDTIDModuleAlgo test:\t" << solid.name() << " Trap made of " << matter.ddname()
0625 << " of "
0626 << "dimensions " << dz << ", " << thet / CLHEP::deg << ", 0, " << h1 << ", " << bl1 << ", "
0627 << bl1 << ", 0, " << h1 << ", " << bl2 << ", " << bl2 << ", 0";
0628 }
0629 DDLogicalPart pa(solid.ddname(), matter, solid);
0630 }
0631 }
0632 LogDebug("TIDGeom") << "<<== End of DDTIDModuleAlgo construction ...";
0633 }
0634
0635 DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDTIDModuleAlgo, "track:DDTIDModuleAlgo");