17 #include "CLHEP/Units/GlobalPhysicalConstants.h"
18 #include "CLHEP/Units/GlobalSystemOfUnits.h"
21 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC info: Creating an instance";
33 genMat = sArgs[
"GeneralMaterial"];
35 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC debug: Parent " << parentName
36 <<
" NameSpace " <<
idNameSpace <<
" General Material "
46 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC debug: Tilt Angle "
49 <<
" Detector layer Width/Thick " <<
detectorW <<
", "
50 <<
detectorT <<
" Cooling Tube/Cable layer Width/Thick "
65 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC debug: Lower layer Radius "
67 <<
" min " <<
phiMinLo/CLHEP::deg <<
" max "
91 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC debug: Upper layer Radius "
93 <<
" min " <<
phiMinUp/CLHEP::deg <<
" max "
108 supportT = nArgs[
"SupportThickness"];
110 ribMat = sArgs[
"RibMaterial"];
111 ribW = vArgs[
"RibWidth"];
113 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC debug: Cylinder Material/"
115 <<
" Support Wall Material/Width/Thickness "
117 <<
" Rib Material " <<
ribMat <<
" at "
118 <<
ribW.size() <<
" positions with width/phi";
119 for (
unsigned int i = 0;
i <
ribW.size();
i++)
123 dohmN = int(nArgs[
"DOHMPhiNumber"]);
135 dohmAuxT = nArgs[
"DOHMAUXThickness"];
138 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC debug: DOHM PRIMary " <<
dohmN
139 <<
" Width/Length/Thickness " <<
" Material "
146 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC debug: DOHM AUXiliary "
153 LogDebug(
"TIBGeom") <<
" in Carrier Width/Thickness/Radius "
157 <<
"\n with cables and connectors Material "
159 <<
"DDTIBLayerAlgo_MTCC debug: no DOHM "
160 <<
" at positions: ";
170 LogDebug(
"TIBGeom") <<
"==>> Constructing DDTIBLayerAlgo_MTCC...";
178 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test DeltaR (Detector Tilt) "
179 << redgd1 <<
", " << redgd2 <<
" DeltaR (Cable+Cool) "
180 << redgc1 <<
", " << redgc2;
188 rmin, rmax, 0, CLHEP::twopi);
189 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: "
191 <<
genMat <<
" from 0 to " << CLHEP::twopi/CLHEP::deg
192 <<
" with Rin " << rmin <<
" Rout " << rmax <<
" ZHalf "
203 rin, rout, 0, CLHEP::twopi);
204 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: "
206 <<
genMat <<
" from 0 to " << CLHEP::twopi/CLHEP::deg
207 <<
" with Rin " << rin <<
" Rout " << rout <<
" ZHalf "
211 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " << layerIn.name()
212 <<
" number 1 positioned in " << layer.name()
213 <<
" at (0,0,0) with no rotation";
224 double phideg = phix/CLHEP::deg;
227 double theta = 90*CLHEP::deg;
228 double phiy = phix + 90.*CLHEP::deg;
232 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test: Creating a new "
233 <<
"rotation: " << rotstr <<
"\t90., "
234 << phix/CLHEP::deg <<
", 90.,"
235 << phiy/CLHEP::deg <<
", 0, 0";
252 cpv.
position(emptyDetIn, layerIn,
n+1, trdet, rotation);
253 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << emptyDetIn.
name()
254 <<
" number " <<
n+1 <<
" positioned in "
255 << layerIn.name() <<
" at " << trdet
261 cpv.
position(emptyCabIn, layerIn,
n+1, trcab, rotation);
262 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << emptyCabIn.
name()
263 <<
" number " <<
n+1 <<
" positioned in "
264 << layerIn.name() <<
" at " << trcab
269 cpv.
position(detIn, layerIn,
n+1, trdet, rotation);
270 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << detIn.
name()
271 <<
" number " <<
n+1 <<
" positioned in "
272 << layerIn.name() <<
" at " << trdet
275 cpv.
position(cabIn, layerIn,
n+1, trcab, rotation);
276 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << cabIn.
name()
277 <<
" number " <<
n+1 <<
" positioned in "
278 << layerIn.name() <<
" at " << trcab
290 name = idName +
"Up";
292 rin, rout, 0, CLHEP::twopi);
293 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: "
295 <<
genMat <<
" from 0 to " << CLHEP::twopi/CLHEP::deg
296 <<
" with Rin " << rin <<
" Rout " << rout <<
" ZHalf "
300 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " << layerOut.name()
301 <<
" number 1 positioned in " << layer.name()
302 <<
" at (0,0,0) with no rotation";
313 double phideg = phix/CLHEP::deg;
316 double theta = 90*CLHEP::deg;
317 double phiy = phix + 90.*CLHEP::deg;
321 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test: Creating a new "
322 <<
"rotation: " << rotstr <<
"\t90., "
323 << phix/CLHEP::deg <<
", 90.,"
324 << phiy/CLHEP::deg <<
", 0, 0";
341 cpv.
position(emptyDetOut, layerOut,
n+1, trdet, rotation);
342 LogDebug(
"TIBGeom") <<
"DDTIBLayer test " << emptyDetOut.
name()
343 <<
" number " <<
n+1 <<
" positioned in "
344 << layerOut.name() <<
" at " << trdet
351 cpv.
position(emptyCabOut, layerOut,
n+1, trcab, rotation);
352 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << emptyCabOut.
name()
353 <<
" number " <<
n+1 <<
" positioned in "
354 << layerOut.name() <<
" at " << trcab
359 cpv.
position(detOut, layerOut,
n+1, trdet, rotation);
360 LogDebug(
"TIBGeom") <<
"DDTIBLayer test " << detOut.
name()
361 <<
" number " <<
n+1 <<
" positioned in "
362 << layerOut.name() <<
" at " << trdet
365 cpv.
position(cabOut, layerOut,
n+1, trcab, rotation);
366 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << cabOut.
name()
367 <<
" number " <<
n+1 <<
" positioned in "
368 << layerOut.name() <<
" at " << trcab
379 double phidiff = fabs(phiMax-phiMin);
383 name = idName +
"Cylinder";
385 rin, rout, phiMin, phidiff);
386 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: "
388 <<
cylinderMat <<
" from " << phiMin/CLHEP::deg <<
" to "
389 << (phiMin+
phidiff)/CLHEP::deg <<
" with Rin " << rin
390 <<
" Rout " << rout <<
" ZHalf " << 0.25*
layerL;
395 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " << cylinder.name()
396 <<
" number 1 positioned in " << layer.name()
397 <<
" at (0,0," << 0.25*
layerL <<
") with no rotation";
400 name = idName +
"CylinderIn";
402 rin, rout, phiMin, phidiff);
403 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: "
405 <<
genMat <<
" from " << phiMin/CLHEP::deg <<
" to "
406 << (phiMin+
phidiff)/CLHEP::deg << phidiff/CLHEP::deg
407 <<
" with Rin " << rin <<
" Rout " << rout <<
" ZHalf "
411 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " << cylinderIn.name()
412 <<
" number 1 positioned in " << cylinder.name()
413 <<
" at (0,0," << -0.25*
layerL <<
") with no rotation";
414 name = idName +
"CylinderInSup";
416 rin, rout, phiMin, phidiff);
417 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: "
419 <<
genMat <<
" from " << phiMin/CLHEP::deg <<
" to "
420 << (phiMin+
phidiff)/CLHEP::deg <<
" with Rin " << rin
421 <<
" Rout " << rout <<
" ZHalf " << 0.5*
supportW;
426 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: " << cylinderSup.name()
427 <<
" number 1 positioned in " << cylinderIn.name()
428 <<
" at (0,0,0) with no rotation";
431 for (
unsigned int i = 0;
i <
ribW.size();
i++) {
437 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: "
439 <<
ribMat <<
" from " << -0.5*width/CLHEP::deg
440 <<
" to " << 0.5*width/CLHEP::deg <<
" with Rin "
441 << rin <<
" Rout " << rout <<
" ZHalf " << dz;
444 double phideg = phix/CLHEP::deg;
445 if( phideg>=phiMin/CLHEP::deg && phideg<phiMax/CLHEP::deg ) {
448 double theta = 90*CLHEP::deg;
449 double phiy = phix + 90.*CLHEP::deg;
453 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test: Creating a new "
454 <<
"rotation: " << rotstr <<
"\t90., "
455 << phix/CLHEP::deg <<
", 90.,"
456 << phiy/CLHEP::deg <<
", 0, 0";
462 cpv.
position(cylinderRib, cylinderIn, 1, tran, rotation);
463 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << cylinderRib.name()
464 <<
" number 1 positioned in " << cylinderIn.name()
465 <<
" at " << tran <<
" with " <<
rotation;
472 double dphi_dohm = CLHEP::twopi/((double)
dohmN);
477 name = idName +
"DOHMCarrier_lo";
478 double rin_lo = rout_dohm;
482 -0.5*dphi_dohm, dphi_dohm);
483 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: "
486 << -0.5*(dphi_dohm)/CLHEP::deg <<
" to "
487 << +0.5*(dphi_dohm)/CLHEP::deg <<
" with Rin "
488 << rin_lo <<
" Rout " << rout_lo <<
" ZHalf "
491 std::string name_lo_r = name +
"_PRIM_AUX" +
"_lo" +
"_r";
492 std::string name_lo_l = name +
"_PRIM_AUX" +
"_lo" +
"_l";
495 name_lo_r = name +
"_PRIM" +
"_lo" +
"_r";
496 name_lo_l = name +
"_PRIM" +
"_lo" +
"_l";
500 name = idName +
"DOHMCarrier_up";
501 double rin_up = rout_lo + 2.*
dohmAuxT;
505 -0.5*dphi_dohm, dphi_dohm);
506 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: "
509 << -0.5*(dphi_dohm)/CLHEP::deg <<
" to "
510 << +0.5*(dphi_dohm)/CLHEP::deg <<
" with Rin "
511 << rin_up <<
" Rout " << rout_up <<
" ZHalf "
514 std::string name_up_r = name +
"_PRIM_AUX" +
"_up" +
"_r";
515 std::string name_up_l = name +
"_PRIM_AUX" +
"_up" +
"_l";
518 name_up_r = name +
"_PRIM" +
"_up" +
"_r";
519 name_up_l = name +
"_PRIM" +
"_up" +
"_l";
523 for (
unsigned int i = 0;
i < (
unsigned int)
dohmN;
i++) {
534 }
else if((
unsigned int)
dohmList[
i]==1) {
543 dohmCarrier_lo_r = dohmCarrierPrim_lo_r;
544 dohmCarrier_lo_l = dohmCarrierPrim_lo_l;
545 dohmCarrier_up_r = dohmCarrierPrim_up_r;
546 dohmCarrier_up_l = dohmCarrierPrim_up_l;
549 dohmCarrier_lo_r = dohmCarrierPrimAux_lo_r;
550 dohmCarrier_lo_l = dohmCarrierPrimAux_lo_l;
551 dohmCarrier_up_r = dohmCarrierPrimAux_up_r;
552 dohmCarrier_up_l = dohmCarrierPrimAux_up_l;
557 double phix = ((double)
i+0.5)*dphi_dohm;
558 double phideg = phix/CLHEP::deg;
562 double theta = 90*CLHEP::deg;
563 double phiy = phix + 90.*CLHEP::deg;
567 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test: Creating a new "
568 <<
"rotation: " << rotstr <<
"\t90., "
569 << phix/CLHEP::deg <<
", 90.,"
570 << phiy/CLHEP::deg <<
", 0, 0";
577 cpv.
position(dohmCarrier_lo_r, parent(),
i+1, tran, rotation );
578 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmCarrier_lo_r.
name()
579 <<
" z+ number " <<
i+1 <<
" positioned in "
580 << parent().name() <<
" at " << tran
583 cpv.
position(dohmCarrier_up_r, parent(),
i+1+(
unsigned int)
dohmN, tran, rotation );
584 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmCarrier_up_r.
name()
585 <<
" z+ number " <<
i+1 <<
" positioned in "
586 << parent().name() <<
" at " << tran
598 name = idName +
"DOHM_PRIM";
601 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: "
605 name = idName +
"DOHM_PRIM_Cable";
611 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: "
614 <<
", " << dy_cable <<
", " << dz_cable;
618 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmPrim.name()
619 <<
" z+ number " << 1 <<
" positioned in "
620 << dohmCarrierPrim_lo_r.
name() <<
" at " << tran
621 <<
" with no rotation";
624 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmCablePrim.name()
625 <<
" copy number " << 1 <<
" positioned in "
626 << dohmCarrierPrim_lo_r.
name()
627 <<
" at " << tran <<
" with no rotation";
630 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmCablePrim.name()
631 <<
" copy number " << 2 <<
" positioned in "
632 << dohmCarrierPrim_lo_r.
name()
633 <<
" at " << tran <<
" with no rotation";
639 name = idName +
"DOHM_PRIM";
641 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: "
646 name = idName +
"DOHM_PRIM_Cable";
652 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: "
655 <<
", " << dy_cable <<
", " << dz_cable;
659 name = idName +
"DOHM_AUX";
662 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: "
666 name = idName +
"DOHM_AUX_Cable";
669 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo_MTCC test: "
672 <<
", " << dy_cable <<
", " << dz_cable;
676 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmAux.name()
677 <<
" z+ number " << 1 <<
" positioned in "
678 << dohmCarrierPrimAux_lo_r.
name() <<
" at " << tran
679 <<
" with no rotation";
682 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmCablePrim.name()
683 <<
" copy number " << 1 <<
" positioned in "
684 << dohmCarrierPrimAux_lo_r.
name() <<
" at " << tran
685 <<
" with no rotation";
688 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmCablePrim.name()
689 <<
" copy number " << 2 <<
" positioned in "
690 << dohmCarrierPrimAux_lo_r.
name() <<
" at " << tran
691 <<
" with no rotation";
694 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmAux.name()
695 <<
" z+ number " << 1 <<
" positioned in "
696 << dohmCarrierPrimAux_lo_r.
name()
697 <<
" at (0,0,0) with no rotation";
700 LogDebug(
"TIBGeom") <<
"DDTIBLayer_MTCC test " << dohmCableAux.name()
701 <<
" copy number " << 1 <<
" positioned in "
702 << dohmCarrierPrimAux_lo_r.
name()
703 <<
" 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)
virtual ~DDTIBLayerAlgo_MTCC()
std::vector< double > ribW
Geom::Theta< T > theta() const
void execute(DDCompactView &cpv)
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
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 dbl_to_string(const double &in)
Converts only the integer part of a double to a string.
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)
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.
std::string dohmAuxMaterial
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