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 " 201 rin, rout, 0, CLHEP::twopi);
202 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 204 <<
genMat <<
" from 0 to " << CLHEP::twopi/CLHEP::deg
205 <<
" with Rin " << rin <<
" Rout " << rout <<
" ZHalf " 209 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " << layerIn.name()
210 <<
" number 1 positioned in " << layer.name()
211 <<
" at (0,0,0) with no rotation";
222 double phideg = phix/CLHEP::deg;
225 double theta = 90*CLHEP::deg;
226 double phiy = phix + 90.*CLHEP::deg;
227 std::string rotstr = idName + std::to_string(phideg*10.);
230 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test: Creating a new " 231 <<
"rotation: " << rotstr <<
"\t90., " 232 << phix/CLHEP::deg <<
", 90.," 233 << phiy/CLHEP::deg <<
", 0, 0";
250 cpv.
position(emptyDetIn, layerIn,
n+1, trdet, rotation);
251 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << emptyDetIn.
name()
252 <<
" number " <<
n+1 <<
" positioned in " 253 << layerIn.name() <<
" at " << trdet
259 cpv.
position(emptyCabIn, layerIn,
n+1, trcab, rotation);
260 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << emptyCabIn.
name()
261 <<
" number " <<
n+1 <<
" positioned in " 262 << layerIn.name() <<
" at " << trcab
267 cpv.
position(detIn, layerIn,
n+1, trdet, rotation);
268 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << detIn.
name()
269 <<
" number " <<
n+1 <<
" positioned in " 270 << layerIn.name() <<
" at " << trdet
273 cpv.
position(cabIn, layerIn,
n+1, trcab, rotation);
274 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << cabIn.
name()
275 <<
" number " <<
n+1 <<
" positioned in " 276 << layerIn.name() <<
" at " << trcab
288 name = idName +
"Up";
290 rin, rout, 0, CLHEP::twopi);
291 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 293 <<
genMat <<
" from 0 to " << CLHEP::twopi/CLHEP::deg
294 <<
" with Rin " << rin <<
" Rout " << rout <<
" ZHalf " 298 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " << layerOut.name()
299 <<
" number 1 positioned in " << layer.name()
300 <<
" at (0,0,0) with no rotation";
311 double phideg = phix/CLHEP::deg;
314 double theta = 90*CLHEP::deg;
315 double phiy = phix + 90.*CLHEP::deg;
316 std::string rotstr = idName + std::to_string(phideg*10.);
319 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test: Creating a new " 320 <<
"rotation: " << rotstr <<
"\t90., " 321 << phix/CLHEP::deg <<
", 90.," 322 << phiy/CLHEP::deg <<
", 0, 0";
339 cpv.
position(emptyDetOut, layerOut,
n+1, trdet, rotation);
340 LogDebug(
"TIBGeom") <<
"DDTIBLayer test " << emptyDetOut.
name()
341 <<
" number " <<
n+1 <<
" positioned in " 342 << layerOut.name() <<
" at " << trdet
349 cpv.
position(emptyCabOut, layerOut,
n+1, trcab, rotation);
350 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << emptyCabOut.
name()
351 <<
" number " <<
n+1 <<
" positioned in " 352 << layerOut.name() <<
" at " << trcab
357 cpv.
position(detOut, layerOut,
n+1, trdet, rotation);
358 LogDebug(
"TIBGeom") <<
"DDTIBLayer test " << detOut.
name()
359 <<
" number " <<
n+1 <<
" positioned in " 360 << layerOut.name() <<
" at " << trdet
363 cpv.
position(cabOut, layerOut,
n+1, trcab, rotation);
364 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << cabOut.
name()
365 <<
" number " <<
n+1 <<
" positioned in " 366 << layerOut.name() <<
" at " << trcab
377 double phidiff = fabs(phiMax-phiMin);
381 name = idName +
"Cylinder";
383 rin, rout, phiMin, phidiff);
384 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 386 <<
cylinderMat <<
" from " << phiMin/CLHEP::deg <<
" to " 387 << (phiMin+
phidiff)/CLHEP::deg <<
" with Rin " << rin
388 <<
" Rout " << rout <<
" ZHalf " << 0.25*
layerL;
392 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " << cylinder.name()
393 <<
" number 1 positioned in " << layer.name()
394 <<
" at (0,0," << 0.25*
layerL <<
") with no rotation";
397 name = idName +
"CylinderIn";
399 rin, rout, phiMin, phidiff);
400 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 402 <<
genMat <<
" from " << phiMin/CLHEP::deg <<
" to " 403 << (phiMin+
phidiff)/CLHEP::deg << phidiff/CLHEP::deg
404 <<
" with Rin " << rin <<
" Rout " << rout <<
" ZHalf " 408 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " << cylinderIn.name()
409 <<
" number 1 positioned in " << cylinder.name()
410 <<
" at (0,0," << -0.25*
layerL <<
") with no rotation";
411 name = idName +
"CylinderInSup";
413 rin, rout, phiMin, phidiff);
414 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 416 <<
genMat <<
" from " << phiMin/CLHEP::deg <<
" to " 417 << (phiMin+
phidiff)/CLHEP::deg <<
" with Rin " << rin
418 <<
" Rout " << rout <<
" ZHalf " << 0.5*
supportW;
422 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " << cylinderSup.name()
423 <<
" number 1 positioned in " << cylinderIn.name()
424 <<
" at (0,0,0) with no rotation";
426 for (
unsigned int i = 0;
i <
ribW.size();
i++) {
427 name = idName +
"Rib" + std::to_string(
i);
432 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 434 <<
ribMat <<
" from " << -0.5*width/CLHEP::deg
435 <<
" to " << 0.5*width/CLHEP::deg <<
" with Rin " 436 << rin <<
" Rout " << rout <<
" ZHalf " <<
dz;
439 double phideg = phix/CLHEP::deg;
440 if( phideg>=phiMin/CLHEP::deg && phideg<phiMax/CLHEP::deg ) {
443 double theta = 90*CLHEP::deg;
444 double phiy = phix + 90.*CLHEP::deg;
445 std::string rotstr = idName + std::to_string(phideg*10.);
448 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test: Creating a new " 449 <<
"rotation: " << rotstr <<
"\t90., " 450 << phix/CLHEP::deg <<
", 90.," 451 << phiy/CLHEP::deg <<
", 0, 0";
457 cpv.
position(cylinderRib, cylinderIn, 1, tran, rotation);
458 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << cylinderRib.name()
459 <<
" number 1 positioned in " << cylinderIn.name()
460 <<
" at " << tran <<
" with " <<
rotation;
467 double dphi_dohm = CLHEP::twopi/((double)
dohmN);
472 name = idName +
"DOHMCarrier_lo";
473 double rin_lo = rout_dohm;
477 -0.5*dphi_dohm, dphi_dohm);
478 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 481 << -0.5*(dphi_dohm)/CLHEP::deg <<
" to " 482 << +0.5*(dphi_dohm)/CLHEP::deg <<
" with Rin " 483 << rin_lo <<
" Rout " << rout_lo <<
" ZHalf " 486 std::string name_lo_r = name +
"_PRIM_AUX" +
"_lo" +
"_r";
487 std::string name_lo_l = name +
"_PRIM_AUX" +
"_lo" +
"_l";
490 name_lo_r = name +
"_PRIM" +
"_lo" +
"_r";
491 name_lo_l = name +
"_PRIM" +
"_lo" +
"_l";
495 name = idName +
"DOHMCarrier_up";
496 double rin_up = rout_lo + 2.*
dohmAuxT;
500 -0.5*dphi_dohm, dphi_dohm);
501 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 504 << -0.5*(dphi_dohm)/CLHEP::deg <<
" to " 505 << +0.5*(dphi_dohm)/CLHEP::deg <<
" with Rin " 506 << rin_up <<
" Rout " << rout_up <<
" ZHalf " 509 std::string name_up_r = name +
"_PRIM_AUX" +
"_up" +
"_r";
510 std::string name_up_l = name +
"_PRIM_AUX" +
"_up" +
"_l";
513 name_up_r = name +
"_PRIM" +
"_up" +
"_r";
514 name_up_l = name +
"_PRIM" +
"_up" +
"_l";
518 for (
unsigned int i = 0;
i < (
unsigned int)
dohmN;
i++) {
529 }
else if((
unsigned int)
dohmList[
i]==1) {
538 dohmCarrier_lo_r = dohmCarrierPrim_lo_r;
539 dohmCarrier_lo_l = dohmCarrierPrim_lo_l;
540 dohmCarrier_up_r = dohmCarrierPrim_up_r;
541 dohmCarrier_up_l = dohmCarrierPrim_up_l;
544 dohmCarrier_lo_r = dohmCarrierPrimAux_lo_r;
545 dohmCarrier_lo_l = dohmCarrierPrimAux_lo_l;
546 dohmCarrier_up_r = dohmCarrierPrimAux_up_r;
547 dohmCarrier_up_l = dohmCarrierPrimAux_up_l;
552 double phix = ((double)
i+0.5)*dphi_dohm;
553 double phideg = phix/CLHEP::deg;
557 double theta = 90*CLHEP::deg;
558 double phiy = phix + 90.*CLHEP::deg;
559 std::string rotstr = idName + std::to_string(phideg*10.);
562 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test: Creating a new " 563 <<
"rotation: " << rotstr <<
"\t90., " 564 << phix/CLHEP::deg <<
", 90.," 565 << phiy/CLHEP::deg <<
", 0, 0";
573 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmCarrier_lo_r.
name()
574 <<
" z+ number " <<
i+1 <<
" positioned in " 575 <<
parent().name() <<
" at " << tran
579 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmCarrier_up_r.
name()
580 <<
" z+ number " <<
i+1 <<
" positioned in " 581 <<
parent().name() <<
" at " << tran
593 name = idName +
"DOHM_PRIM";
596 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 600 name = idName +
"DOHM_PRIM_Cable";
606 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 609 <<
", " << dy_cable <<
", " << dz_cable;
613 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmPrim.name()
614 <<
" z+ number " << 1 <<
" positioned in " 615 << dohmCarrierPrim_lo_r.
name() <<
" at " << tran
616 <<
" with no rotation";
619 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmCablePrim.name()
620 <<
" copy number " << 1 <<
" positioned in " 621 << dohmCarrierPrim_lo_r.
name()
622 <<
" at " << tran <<
" with no rotation";
625 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmCablePrim.name()
626 <<
" copy number " << 2 <<
" positioned in " 627 << dohmCarrierPrim_lo_r.
name()
628 <<
" at " << tran <<
" with no rotation";
634 name = idName +
"DOHM_PRIM";
636 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 641 name = idName +
"DOHM_PRIM_Cable";
647 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 650 <<
", " << dy_cable <<
", " << dz_cable;
654 name = idName +
"DOHM_AUX";
657 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 661 name = idName +
"DOHM_AUX_Cable";
664 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " 667 <<
", " << dy_cable <<
", " << dz_cable;
671 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmAux.name()
672 <<
" z+ number " << 1 <<
" positioned in " 673 << dohmCarrierPrimAux_lo_r.
name() <<
" at " << tran
674 <<
" with no rotation";
677 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmCablePrim.name()
678 <<
" copy number " << 1 <<
" positioned in " 679 << dohmCarrierPrimAux_lo_r.
name() <<
" at " << tran
680 <<
" with no rotation";
683 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmCablePrim.name()
684 <<
" copy number " << 2 <<
" positioned in " 685 << dohmCarrierPrimAux_lo_r.
name() <<
" at " << tran
686 <<
" with no rotation";
689 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmAux.name()
690 <<
" z+ number " << 1 <<
" positioned in " 691 << dohmCarrierPrimAux_lo_r.
name()
692 <<
" at (0,0,0) with no rotation";
695 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmCableAux.name()
696 <<
" copy number " << 1 <<
" positioned in " 697 << dohmCarrierPrimAux_lo_r.
name()
698 <<
" 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
Compact representation of the geometrical detector hierarchy.
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