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;
279 string name = idName +
"Down";
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
310 cpv.
position(detIn, layerIn,
n + 1, trdet, rotation);
311 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo test " << detIn.
name() <<
" number " <<
n + 1 <<
" positioned in "
312 << layerIn.name() <<
" at " << trdet <<
" with " <<
rotation;
318 name = idName +
"Up";
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
349 cpv.
position(detOut, layerOut,
n + 1, trdet, rotation);
350 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo test " << detOut.
name() <<
" number " <<
n + 1 <<
" positioned in "
351 << layerOut.name() <<
" at " << trdet <<
" with " <<
rotation;
360 name = idName +
"Cylinder";
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";
376 name = idName +
"CylinderIn";
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";
390 name = idName +
"Filler";
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++) {
410 name = idName +
"Rib" + to_string(
i);
411 double width = 2. *
ribW[
i] / (rin + rout);
414 DDName(name,
idNameSpace), dz, rin + 0.5 * CLHEP::mm, rout - 0.5 * CLHEP::mm, -0.5 * width, width);
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
435 cpv.
position(cylinderRib, cylinderIn, 1, tran, rotation);
436 LogDebug(
"TIBGeom") <<
"DDTIBLayerAlgo test " << cylinderRib.name() <<
" number 1"
437 <<
" positioned in " << cylinderIn.name() <<
" at " << tran <<
" with " <<
rotation;
447 name = idName +
"InnerMFRing";
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";
464 name = idName +
"OuterMFRing";
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";
486 name = idName +
"CentRing1";
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";
502 name = idName +
"CentRing2";
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";
518 name = idName +
"DOHMCarrier";
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;
554 name = idName +
"DOHMCarrierFW";
557 rotstr = idName +
"FwUp";
559 dohmCarrierReplica = 1;
563 name = idName +
"DOHMCarrierFW";
566 rotstr = idName +
"FwDown";
574 dohmCarrierReplica = 2;
578 name = idName +
"DOHMCarrierBW";
581 rotstr = idName +
"BwUp";
589 dohmCarrierReplica = 1;
593 name = idName +
"DOHMCarrierBW";
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;
657 cpv.
position(dohmCarrier,
parent(), dohmCarrierReplica, tran, rotation);
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;
673 name = idName +
"FWIntPillar";
682 name = idName +
"BWIntPillar";
691 name = idName +
"FWExtPillar";
700 name = idName +
"BWExtPillar";
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;
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
static AlgebraicMatrix initialize()
vector< double > bwIntPillarPhi
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string ©no, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
DDMaterial is used to define and access material information.
vector< double > bwExtPillarZ
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
DDName is used to identify DDD entities uniquely.
static std::string & ns()
Compact representation of the geometrical detector hierarchy.
~DDTIBLayerAlgo() override
vector< double > dohmListFW
A DDSolid represents the shape of a part.
vector< double > bwIntPillarZ
constexpr std::array< uint8_t, layerIndexSize > layer
Represents a uniquely identifyable rotation matrix.
vector< double > fwExtPillarPhi
U second(std::pair< T, U > const &p)
string dohmCarrierMaterial
vector< double > bwExtPillarPhi
vector< double > fwIntPillarPhi
vector< double > dohmListBW
void execute(DDCompactView &cpv) override
vector< double > fwIntPillarZ
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)
vector< double > centRing2par
#define DEFINE_EDM_PLUGIN(factory, type, name)
vector< double > fwExtPillarZ
vector< double > centRing1par
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
const std::string & name() const
Returns the name.