16 #include "CLHEP/Units/GlobalPhysicalConstants.h" 17 #include "CLHEP/Units/GlobalSystemOfUnits.h" 20 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC info: Creating an instance";
32 genMat = sArgs[
"GeneralMaterial"];
34 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC debug: Parent " << parentName
35 <<
" NameSpace " <<
idNameSpace <<
" General Material " 45 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC debug: Tilt Angle " 48 <<
" Detector layer Width/Thick " <<
detectorW <<
", " 49 <<
detectorT <<
" Cooling Tube/Cable layer Width/Thick " 64 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC debug: Lower layer Radius " 66 <<
" min " <<
phiMinLo/CLHEP::deg <<
" max " 90 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC debug: Upper layer Radius " 92 <<
" min " <<
phiMinUp/CLHEP::deg <<
" max " 107 supportT = nArgs[
"SupportThickness"];
109 ribMat = sArgs[
"RibMaterial"];
110 ribW = vArgs[
"RibWidth"];
112 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC debug: Cylinder Material/" 114 <<
" Support Wall Material/Width/Thickness " 116 <<
" Rib Material " <<
ribMat <<
" at " 117 <<
ribW.size() <<
" positions with width/phi";
118 for (
unsigned int i = 0;
i <
ribW.size();
i++)
122 dohmN =
int(nArgs[
"DOHMPhiNumber"]);
134 dohmAuxT = nArgs[
"DOHMAUXThickness"];
137 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC debug: DOHM PRIMary " <<
dohmN 138 <<
" Width/Length/Thickness " <<
" Material " 145 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC debug: DOHM AUXiliary " 152 LogDebug(
"TIBGeom") <<
" in Carrier Width/Thickness/Radius " 156 <<
"\n with cables and connectors Material " 158 <<
"DDTIBLayerAlgo_MTCC debug: no DOHM " 159 <<
" at positions: ";
169 LogDebug(
"TIBGeom") <<
"==>> Constructing DDTIBLayerAlgo_MTCC...";
177 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test DeltaR (Detector Tilt) " 178 << redgd1 <<
", " << redgd2 <<
" DeltaR (Cable+Cool) " 179 << redgc1 <<
", " << redgc2;
187 rmin, rmax, 0, CLHEP::twopi);
188 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 190 <<
genMat <<
" from 0 to " << CLHEP::twopi/CLHEP::deg
191 <<
" with Rin " << rmin <<
" Rout " << rmax <<
" ZHalf " 202 rin, rout, 0, CLHEP::twopi);
203 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 205 <<
genMat <<
" from 0 to " << CLHEP::twopi/CLHEP::deg
206 <<
" with Rin " << rin <<
" Rout " << rout <<
" ZHalf " 210 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " << layerIn.name()
211 <<
" number 1 positioned in " << layer.name()
212 <<
" at (0,0,0) with no rotation";
223 double phideg = phix/CLHEP::deg;
226 double theta = 90*CLHEP::deg;
227 double phiy = phix + 90.*CLHEP::deg;
228 std::string rotstr = idName + std::to_string(phideg*10.);
231 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test: Creating a new " 232 <<
"rotation: " << rotstr <<
"\t90., " 233 << phix/CLHEP::deg <<
", 90.," 234 << phiy/CLHEP::deg <<
", 0, 0";
251 cpv.
position(emptyDetIn, layerIn,
n+1, trdet, rotation);
252 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << emptyDetIn.
name()
253 <<
" number " <<
n+1 <<
" positioned in " 254 << layerIn.name() <<
" at " << trdet
260 cpv.
position(emptyCabIn, layerIn,
n+1, trcab, rotation);
261 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << emptyCabIn.
name()
262 <<
" number " <<
n+1 <<
" positioned in " 263 << layerIn.name() <<
" at " << trcab
268 cpv.
position(detIn, layerIn,
n+1, trdet, rotation);
269 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << detIn.
name()
270 <<
" number " <<
n+1 <<
" positioned in " 271 << layerIn.name() <<
" at " << trdet
274 cpv.
position(cabIn, layerIn,
n+1, trcab, rotation);
275 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << cabIn.
name()
276 <<
" number " <<
n+1 <<
" positioned in " 277 << layerIn.name() <<
" at " << trcab
289 name = idName +
"Up";
291 rin, rout, 0, CLHEP::twopi);
292 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 294 <<
genMat <<
" from 0 to " << CLHEP::twopi/CLHEP::deg
295 <<
" with Rin " << rin <<
" Rout " << rout <<
" ZHalf " 299 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " << layerOut.name()
300 <<
" number 1 positioned in " << layer.name()
301 <<
" at (0,0,0) with no rotation";
312 double phideg = phix/CLHEP::deg;
315 double theta = 90*CLHEP::deg;
316 double phiy = phix + 90.*CLHEP::deg;
317 std::string rotstr = idName + std::to_string(phideg*10.);
320 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test: Creating a new " 321 <<
"rotation: " << rotstr <<
"\t90., " 322 << phix/CLHEP::deg <<
", 90.," 323 << phiy/CLHEP::deg <<
", 0, 0";
340 cpv.
position(emptyDetOut, layerOut,
n+1, trdet, rotation);
341 LogDebug(
"TIBGeom") <<
"DDTIBLayer test " << emptyDetOut.
name()
342 <<
" number " <<
n+1 <<
" positioned in " 343 << layerOut.name() <<
" at " << trdet
350 cpv.
position(emptyCabOut, layerOut,
n+1, trcab, rotation);
351 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << emptyCabOut.
name()
352 <<
" number " <<
n+1 <<
" positioned in " 353 << layerOut.name() <<
" at " << trcab
358 cpv.
position(detOut, layerOut,
n+1, trdet, rotation);
359 LogDebug(
"TIBGeom") <<
"DDTIBLayer test " << detOut.
name()
360 <<
" number " <<
n+1 <<
" positioned in " 361 << layerOut.name() <<
" at " << trdet
364 cpv.
position(cabOut, layerOut,
n+1, trcab, rotation);
365 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << cabOut.
name()
366 <<
" number " <<
n+1 <<
" positioned in " 367 << layerOut.name() <<
" at " << trcab
378 double phidiff = fabs(phiMax-phiMin);
382 name = idName +
"Cylinder";
384 rin, rout, phiMin, phidiff);
385 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 387 <<
cylinderMat <<
" from " << phiMin/CLHEP::deg <<
" to " 388 << (phiMin+
phidiff)/CLHEP::deg <<
" with Rin " << rin
389 <<
" Rout " << rout <<
" ZHalf " << 0.25*
layerL;
394 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " << cylinder.name()
395 <<
" number 1 positioned in " << layer.name()
396 <<
" at (0,0," << 0.25*
layerL <<
") with no rotation";
399 name = idName +
"CylinderIn";
401 rin, rout, phiMin, phidiff);
402 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 404 <<
genMat <<
" from " << phiMin/CLHEP::deg <<
" to " 405 << (phiMin+
phidiff)/CLHEP::deg << phidiff/CLHEP::deg
406 <<
" with Rin " << rin <<
" Rout " << rout <<
" ZHalf " 410 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " << cylinderIn.name()
411 <<
" number 1 positioned in " << cylinder.name()
412 <<
" at (0,0," << -0.25*
layerL <<
") with no rotation";
413 name = idName +
"CylinderInSup";
415 rin, rout, phiMin, phidiff);
416 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 418 <<
genMat <<
" from " << phiMin/CLHEP::deg <<
" to " 419 << (phiMin+
phidiff)/CLHEP::deg <<
" with Rin " << rin
420 <<
" Rout " << rout <<
" ZHalf " << 0.5*
supportW;
425 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " << cylinderSup.name()
426 <<
" number 1 positioned in " << cylinderIn.name()
427 <<
" at (0,0,0) with no rotation";
430 for (
unsigned int i = 0;
i <
ribW.size();
i++) {
431 name = idName +
"Rib" + std::to_string(
i);
436 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 438 <<
ribMat <<
" from " << -0.5*width/CLHEP::deg
439 <<
" to " << 0.5*width/CLHEP::deg <<
" with Rin " 440 << rin <<
" Rout " << rout <<
" ZHalf " <<
dz;
443 double phideg = phix/CLHEP::deg;
444 if( phideg>=phiMin/CLHEP::deg && phideg<phiMax/CLHEP::deg ) {
447 double theta = 90*CLHEP::deg;
448 double phiy = phix + 90.*CLHEP::deg;
449 std::string rotstr = idName + std::to_string(phideg*10.);
452 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test: Creating a new " 453 <<
"rotation: " << rotstr <<
"\t90., " 454 << phix/CLHEP::deg <<
", 90.," 455 << phiy/CLHEP::deg <<
", 0, 0";
461 cpv.
position(cylinderRib, cylinderIn, 1, tran, rotation);
462 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << cylinderRib.name()
463 <<
" number 1 positioned in " << cylinderIn.name()
464 <<
" at " << tran <<
" with " <<
rotation;
471 double dphi_dohm = CLHEP::twopi/((double)
dohmN);
476 name = idName +
"DOHMCarrier_lo";
477 double rin_lo = rout_dohm;
481 -0.5*dphi_dohm, dphi_dohm);
482 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 485 << -0.5*(dphi_dohm)/CLHEP::deg <<
" to " 486 << +0.5*(dphi_dohm)/CLHEP::deg <<
" with Rin " 487 << rin_lo <<
" Rout " << rout_lo <<
" ZHalf " 490 std::string name_lo_r = name +
"_PRIM_AUX" +
"_lo" +
"_r";
491 std::string name_lo_l = name +
"_PRIM_AUX" +
"_lo" +
"_l";
494 name_lo_r = name +
"_PRIM" +
"_lo" +
"_r";
495 name_lo_l = name +
"_PRIM" +
"_lo" +
"_l";
499 name = idName +
"DOHMCarrier_up";
500 double rin_up = rout_lo + 2.*
dohmAuxT;
504 -0.5*dphi_dohm, dphi_dohm);
505 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 508 << -0.5*(dphi_dohm)/CLHEP::deg <<
" to " 509 << +0.5*(dphi_dohm)/CLHEP::deg <<
" with Rin " 510 << rin_up <<
" Rout " << rout_up <<
" ZHalf " 513 std::string name_up_r = name +
"_PRIM_AUX" +
"_up" +
"_r";
514 std::string name_up_l = name +
"_PRIM_AUX" +
"_up" +
"_l";
517 name_up_r = name +
"_PRIM" +
"_up" +
"_r";
518 name_up_l = name +
"_PRIM" +
"_up" +
"_l";
522 for (
unsigned int i = 0;
i < (
unsigned int)
dohmN;
i++) {
533 }
else if((
unsigned int)
dohmList[
i]==1) {
542 dohmCarrier_lo_r = dohmCarrierPrim_lo_r;
543 dohmCarrier_lo_l = dohmCarrierPrim_lo_l;
544 dohmCarrier_up_r = dohmCarrierPrim_up_r;
545 dohmCarrier_up_l = dohmCarrierPrim_up_l;
548 dohmCarrier_lo_r = dohmCarrierPrimAux_lo_r;
549 dohmCarrier_lo_l = dohmCarrierPrimAux_lo_l;
550 dohmCarrier_up_r = dohmCarrierPrimAux_up_r;
551 dohmCarrier_up_l = dohmCarrierPrimAux_up_l;
556 double phix = ((double)
i+0.5)*dphi_dohm;
557 double phideg = phix/CLHEP::deg;
561 double theta = 90*CLHEP::deg;
562 double phiy = phix + 90.*CLHEP::deg;
563 std::string rotstr = idName + std::to_string(phideg*10.);
566 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test: Creating a new " 567 <<
"rotation: " << rotstr <<
"\t90., " 568 << phix/CLHEP::deg <<
", 90.," 569 << phiy/CLHEP::deg <<
", 0, 0";
577 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmCarrier_lo_r.
name()
578 <<
" z+ number " <<
i+1 <<
" positioned in " 579 <<
parent().name() <<
" at " << tran
583 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmCarrier_up_r.
name()
584 <<
" z+ number " <<
i+1 <<
" positioned in " 585 <<
parent().name() <<
" at " << tran
597 name = idName +
"DOHM_PRIM";
600 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 604 name = idName +
"DOHM_PRIM_Cable";
610 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 613 <<
", " << dy_cable <<
", " << dz_cable;
617 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmPrim.name()
618 <<
" z+ number " << 1 <<
" positioned in " 619 << dohmCarrierPrim_lo_r.
name() <<
" at " << tran
620 <<
" with no rotation";
623 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmCablePrim.name()
624 <<
" copy number " << 1 <<
" positioned in " 625 << dohmCarrierPrim_lo_r.
name()
626 <<
" at " << tran <<
" with no rotation";
629 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmCablePrim.name()
630 <<
" copy number " << 2 <<
" positioned in " 631 << dohmCarrierPrim_lo_r.
name()
632 <<
" at " << tran <<
" with no rotation";
638 name = idName +
"DOHM_PRIM";
640 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 645 name = idName +
"DOHM_PRIM_Cable";
651 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 654 <<
", " << dy_cable <<
", " << dz_cable;
658 name = idName +
"DOHM_AUX";
661 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 665 name = idName +
"DOHM_AUX_Cable";
668 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 671 <<
", " << dy_cable <<
", " << dz_cable;
675 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmAux.name()
676 <<
" z+ number " << 1 <<
" positioned in " 677 << dohmCarrierPrimAux_lo_r.
name() <<
" at " << tran
678 <<
" with no rotation";
681 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmCablePrim.name()
682 <<
" copy number " << 1 <<
" positioned in " 683 << dohmCarrierPrimAux_lo_r.
name() <<
" at " << tran
684 <<
" with no rotation";
687 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmCablePrim.name()
688 <<
" copy number " << 2 <<
" positioned in " 689 << dohmCarrierPrimAux_lo_r.
name() <<
" at " << tran
690 <<
" with no rotation";
693 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmAux.name()
694 <<
" z+ number " << 1 <<
" positioned in " 695 << dohmCarrierPrimAux_lo_r.
name()
696 <<
" at (0,0,0) with no rotation";
699 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmCableAux.name()
700 <<
" copy number " << 1 <<
" positioned in " 701 << dohmCarrierPrimAux_lo_r.
name()
702 <<
" at " << tran <<
" with no rotation";
std::string dohmCarrierMaterial
DDMaterial is used to define and access material information.
std::vector< double > stringUpList
std::vector< double > dohmList
Sin< T >::type sin(const T &t)
std::vector< double > ribW
Geom::Theta< T > theta() const
DDName is used to identify DDD entities uniquely.
double phidiff(double phi)
Normalized difference in azimuthal angles to a range between .
static std::string & ns()
std::string dohmPrimMaterial
type of data representation of DDCompactView
A DDSolid represents the shape of a part.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Represents a uniquely identifyable rotation matrix.
U second(std::pair< T, U > const &p)
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
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)
std::vector< double > ribPhi
static DDSolid box(const DDName &name, double xHalf, double yHalf, double zHalf)
Creates a box with side length 2*xHalf, 2*yHalf, 2*zHalf.
void execute(DDCompactView &cpv) override
~DDTIBLayerAlgo_MTCC() override
std::string dohmAuxMaterial
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string ©no, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
std::string emptyCoolCableUp
std::vector< double > stringLoList
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
std::string dohmCableMaterial
std::string emptyDetectorLo
std::string emptyCoolCableLo
const std::string & name() const
Returns the name.
std::string emptyDetectorUp