15 #include "CLHEP/Units/GlobalPhysicalConstants.h"
16 #include "CLHEP/Units/GlobalSystemOfUnits.h"
116 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo info: Creating an instance";
127 genMat = sArgs[
"GeneralMaterial"];
129 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo debug: Parent " << parentName <<
" NameSpace " <<
idNameSpace
130 <<
" General Material " <<
genMat;
152 MFRingT = nArgs[
"MFRingThickness"];
157 supportT = nArgs[
"SupportThickness"];
159 centMat = sArgs[
"CentRingMaterial"];
166 ribMat = sArgs[
"RibMaterial"];
167 ribW = vArgs[
"RibWidth"];
169 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo debug: Cylinder Material/"
171 <<
ribW.size() <<
" positions with width/phi";
173 for (
unsigned int i = 0;
i <
ribW.size();
i++)
174 LogDebug(
"TIBGeom") <<
"\tribW[" <<
i <<
"] = " <<
ribW[
i] <<
"\tribPhi[" <<
i <<
"] = " <<
ribPhi[
i] / CLHEP::deg;
191 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo debug: DOHM Primary "
193 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo debug: DOHM Aux "
197 LogDebug(
"TIBGeom") <<
"DOHM Primary at FW Position " <<
i;
199 LogDebug(
"TIBGeom") <<
"DOHM Aux at FW Position " << -
i;
203 LogDebug(
"TIBGeom") <<
"DOHM Primary at BW Position " <<
i;
205 LogDebug(
"TIBGeom") <<
"DOHM Aux at BW Position " << -
i;
257 LogDebug(
"TIBGeom") <<
"==>> Constructing DDTIBLayerAlgo...";
268 <<
" from 0 to " << CLHEP::twopi / CLHEP::deg <<
" with Rin " << rmin <<
" Rout " << rmax
269 <<
" ZHalf " << 0.5 *
layerL;
282 <<
" from 0 to " << CLHEP::twopi / CLHEP::deg <<
" with Rin " << rin <<
" Rout " << rout
283 <<
" ZHalf " << 0.5 *
layerL;
286 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo test: " << layerIn.name() <<
" number 1 positioned in " << layer.name()
287 <<
" at (0,0,0) with no rotation";
293 double phi = (
n + 0.5) * dphi;
295 double phideg = phix / CLHEP::deg;
298 double theta = 90 * CLHEP::deg;
299 double phiy = phix + 90. * CLHEP::deg;
300 string rotstr =
idName + to_string(phideg * 10.);
303 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo test: Creating a new "
304 <<
"rotation: " << rotstr <<
"\t90., " << phix / CLHEP::deg <<
", 90.," << phiy / CLHEP::deg
311 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo test " << detIn.
name() <<
" number " <<
n + 1 <<
" positioned in "
312 << layerIn.name() <<
" at " << trdet <<
" with " <<
rotation;
321 <<
" from 0 to " << CLHEP::twopi / CLHEP::deg <<
" with Rin " << rin <<
" Rout " << rout
322 <<
" ZHalf " << 0.5 *
layerL;
325 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo test: " << layerOut.name() <<
" number 1 positioned in " << layer.name()
326 <<
" at (0,0,0) with no rotation";
332 double phi = (
n + 0.5) * dphi;
334 double phideg = phix / CLHEP::deg;
337 double theta = 90 * CLHEP::deg;
338 double phiy = phix + 90. * CLHEP::deg;
339 string rotstr =
idName + to_string(phideg * 10.);
342 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo test: Creating a new "
343 <<
"rotation: " << rotstr <<
"\t90., " << phix / CLHEP::deg <<
", 90.," << phiy / CLHEP::deg
350 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo test " << detOut.
name() <<
" number " <<
n + 1 <<
" positioned in "
351 << layerOut.name() <<
" at " << trdet <<
" with " <<
rotation;
363 <<
" from 0 to " << CLHEP::twopi / CLHEP::deg <<
" with Rin " << rin <<
" Rout " << rout
364 <<
" ZHalf " << 0.5 *
layerL;
369 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo test: " << cylinder.name() <<
" number 1 positioned in " << layer.name()
370 <<
" at (0,0,0) with no rotation";
379 <<
" from 0 to " << CLHEP::twopi / CLHEP::deg <<
" with Rin " << rin <<
" Rout " << rout
380 <<
" ZHalf " << 0.5 *
layerL;
383 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo test: " << cylinderIn.name() <<
" number 1 positioned in " << cylinder.name()
384 <<
" at (0,0,0) with no rotation";
393 <<
" from " << 0. <<
" to " << CLHEP::twopi / CLHEP::deg <<
" with Rin " << rin <<
" Rout "
398 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo test " << cylinderFiller.name() <<
" number 1"
399 <<
" positioned in " << cylinderIn.name() <<
" at "
401 <<
" positioned in " << cylinderIn.name() <<
" at "
409 for (
int i = 0;
i < (
int)(
ribW.size());
i++) {
416 <<
" from " << -0.5 *
width / CLHEP::deg <<
" to " << 0.5 *
width / CLHEP::deg <<
" with Rin "
417 << rin + 0.5 * CLHEP::mm <<
" Rout " << rout - 0.5 * CLHEP::mm <<
" ZHalf " <<
dz;
420 double phideg = phix / CLHEP::deg;
423 double theta = 90 * CLHEP::deg;
424 double phiy = phix + 90. * CLHEP::deg;
425 string rotstr =
idName + to_string(phideg * 10.);
428 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo test: Creating a new "
429 <<
"rotation: " << rotstr <<
"\t90., " << phix / CLHEP::deg <<
", 90.," << phiy / CLHEP::deg
436 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo test " << cylinderRib.name() <<
" number 1"
437 <<
" positioned in " << cylinderIn.name() <<
" at " << tran <<
" with " <<
rotation;
451 <<
" from 0 to " << CLHEP::twopi / CLHEP::deg <<
" with Rin " << rin <<
" Rout " << rout
457 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo test: " << inmfr.name() <<
" number 1 and 2 positioned in " << layer.name()
458 <<
" at (0,0,+-" << 0.5 *
layerL -
MFRingDz <<
") with no rotation";
468 <<
" from 0 to " << CLHEP::twopi / CLHEP::deg <<
" with Rin " << rin <<
" Rout " << rout
474 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo test: " << outmfr.name() <<
" number 1 and 2 positioned in " << layer.name()
475 <<
" at (0,0,+-" << 0.5 *
layerL -
MFRingDz <<
") with no rotation";
490 <<
" from 0 to " << CLHEP::twopi / CLHEP::deg <<
" with Rin " << rin <<
" Rout " << rout
491 <<
" ZHalf " << centDz;
495 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo test: " << cent1.name() <<
" positioned in " << layer.name() <<
" at (0,0,"
496 << centZ <<
") with no rotation";
506 <<
" from 0 to " << CLHEP::twopi / CLHEP::deg <<
" with Rin " << rin <<
" Rout " << rout
507 <<
" ZHalf " << centDz;
511 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo test: " << cent2.name() <<
" positioned in " << layer.name() <<
" at (0,0,"
512 << centZ <<
") with no rotation";
523 double dohmCarrierZ = 0.5 *
layerL - 2. *
MFRingDz - dohmCarrierDz;
533 <<
" with Rin " << dohmCarrierRin <<
" Rout " <<
MFRingOutR <<
" ZHalf " << dohmCarrierDz;
542 double dohmR = 0.5 * (dohmCarrierRin + dohmCarrierRout);
544 for (
int j = 0;
j < 4;
j++) {
545 vector<double> dohmList;
549 int dohmCarrierReplica = 0;
559 dohmCarrierReplica = 1;
566 rotstr =
idName +
"FwDown";
574 dohmCarrierReplica = 2;
589 dohmCarrierReplica = 1;
596 rotstr =
idName +
"BwDown";
604 dohmCarrierReplica = 2;
614 for (
int i = 0;
i < placeDohm * ((
int)(dohmList.size()));
i++) {
615 double phi = (
abs(dohmList[
i]) + 0.5 - 1.) * dphi;
616 double phix =
phi + 90 * CLHEP::deg;
617 double phideg = phix / CLHEP::deg;
619 double theta = 90 * CLHEP::deg;
620 double phiy = phix + 90. * CLHEP::deg;
621 string rotstr =
idName + to_string(
abs(dohmList[
i]) - 1.);
624 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo test: Creating a new "
625 <<
"rotation: " << rotstr <<
"\t" <<
theta <<
", " << phix / CLHEP::deg <<
", " <<
theta
626 <<
", " << phiy / CLHEP::deg <<
", 0, 0";
635 if (dohmList[
i] < 0.) {
640 dohmReplica = primReplica;
647 dohmReplica = auxReplica;
652 cpv.
position(dohm, dohmCarrier, dohmReplica, dohmTrasl, dohmRotation);
653 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo test " << dohm.
name() <<
" replica " << dohmReplica <<
" positioned in "
654 << dohmCarrier.
name() <<
" at " << dohmTrasl <<
" with " << dohmRotation;
658 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo test " << dohmCarrier.
name() <<
" positioned in " <<
parent().name()
659 <<
" at " << tran <<
" with " <<
rotation;
664 for (
int j = 0;
j < 4;
j++) {
667 vector<double> pillarZ;
668 vector<double> pillarPhi;
669 double pillarDz = 0, pillarDPhi = 0, pillarRin = 0, pillarRout = 0;
716 <<
" from " << -pillarDPhi <<
" to " << pillarDPhi <<
" with Rin " << pillarRin <<
" Rout "
717 << pillarRout <<
" ZHalf " << pillarDz;
721 int pillarReplica = 0;
722 for (
unsigned int i = 0;
i < pillarZ.size();
i++) {
723 if (pillarPhi[
i] > 0.) {
726 90. * CLHEP::deg, pillarPhi[
i], 90. * CLHEP::deg, 90. * CLHEP::deg + pillarPhi[
i], 0., 0.)));
729 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo test " << Pillar.
name() <<
" positioned in " <<
parent().name() <<
" at "
730 << pillarTran <<
" with " << pillarRota <<
" copy number " << pillarReplica;