15 #include "CLHEP/Units/GlobalPhysicalConstants.h" 16 #include "CLHEP/Units/GlobalSystemOfUnits.h" 70 genMat = sArgs[
"GeneralMaterial"];
72 layerDz = nArgs[
"LayerDz"];
73 sensorEdge = nArgs[
"SensorEdge"];
74 coolDz = nArgs[
"CoolDz"];
75 coolWidth = nArgs[
"CoolWidth"];
76 coolSide = nArgs[
"CoolSide"];
77 coolThick = nArgs[
"CoolThick"];
78 coolDist = nArgs[
"CoolDist"];
79 coolMat = sArgs[
"CoolMaterial"];
80 tubeMat = sArgs[
"CoolTubeMaterial"];
82 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo debug: Parent " << parentName <<
" NameSpace " << idNameSpace <<
"\n" 83 <<
"\tLadders " <<
number <<
"\tGeneral Material " << genMat <<
"\tLength " << layerDz
84 <<
"\tSensorEdge " << sensorEdge <<
"\tSpecification of Cooling Pieces:\n" 85 <<
"\tLength " << coolDz <<
" Width " << coolWidth <<
" Side " << coolSide
86 <<
" Thickness of Shell " << coolThick <<
" Radial distance " << coolDist <<
" Materials " 87 << coolMat <<
", " << tubeMat;
89 ladder = vsArgs[
"LadderName"];
90 ladderWidth = vArgs[
"LadderWidth"];
91 ladderThick = vArgs[
"LadderThick"];
93 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo debug: Full Ladder " <<
ladder[0] <<
" width/thickness " << ladderWidth[0]
94 <<
", " << ladderThick[0] <<
"\tHalf Ladder " <<
ladder[1] <<
" width/thickness " 95 << ladderWidth[1] <<
", " << ladderThick[1];
102 double dphi = CLHEP::twopi /
number;
103 double d2 = 0.5 * coolWidth;
104 double d1 = d2 - coolSide *
sin(0.5 * dphi);
105 double x1 = (
d1 + d2) / (2. *
sin(0.5 * dphi));
106 double x2 = coolDist *
sin(0.5 * dphi);
107 double rmin = (coolDist - 0.5 * (
d1 + d2)) *
cos(0.5 * dphi) - 0.5 * ladderThick[0];
108 double rmax = (coolDist + 0.5 * (
d1 + d2)) *
cos(0.5 * dphi) + 0.5 * ladderThick[0];
109 double rmxh = rmax - 0.5 * ladderThick[0] + ladderThick[1];
110 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: Rmin/Rmax " << rmin <<
", " << rmax <<
" d1/d2 " <<
d1 <<
", " << d2
111 <<
" x1/x2 " << x1 <<
", " << x2;
113 double rtmi = rmin + 0.5 * ladderThick[0] - ladderThick[1];
114 double rtmx =
sqrt(rmxh * rmxh + ladderWidth[1] * ladderWidth[1]);
116 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: " <<
DDName(
idName, idNameSpace) <<
" Tubs made of " << genMat
117 <<
" from 0 to " << CLHEP::twopi / CLHEP::deg <<
" with Rin " << rtmi <<
" Rout " << rtmx
118 <<
" ZHalf " << 0.5 * layerDz;
123 double rr = 0.5 * (rmax + rmin);
124 double dr = 0.5 * (rmax - rmin);
125 double h1 = 0.5 * coolSide *
cos(0.5 * dphi);
127 solid =
DDSolidFactory::trap(
DDName(
name, idNameSpace), 0.5 * coolDz, 0, 0, h1, d2,
d1, 0, h1, d2,
d1, 0);
128 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: " << solid.
name() <<
" Trap made of " << tubeMat
129 <<
" of dimensions " << 0.5 * coolDz <<
", 0, 0, " << h1 <<
", " << d2 <<
", " <<
d1 <<
", 0, " 130 << h1 <<
", " << d2 <<
", " <<
d1 <<
", 0";
138 solid =
DDSolidFactory::trap(
DDName(
name, idNameSpace), 0.5 * coolDz, 0, 0, h1, d2,
d1, 0, h1, d2,
d1, 0);
139 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: " << solid.
name() <<
" Trap made of " << coolMat
140 <<
" of dimensions " << 0.5 * coolDz <<
", 0, 0, " << h1 <<
", " << d2 <<
", " <<
d1 <<
", 0, " 141 << h1 <<
", " << d2 <<
", " <<
d1 <<
", 0";
145 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: " << cool.name() <<
" number 1 positioned in " << coolTube.name()
146 <<
" at (0,0,0) with no rotation";
152 double phi0 = 90 * CLHEP::deg;
154 double phi = phi0 +
i * dphi;
155 double phix, phiy, rrr,
xx;
159 if (
i == 0 ||
i ==
nphi) {
160 rrr =
rr + dr + 0.5 * (ladderThick[1] - ladderThick[0]);
161 xx = (0.5 * ladderWidth[1] - sensorEdge) *
sin(phi);
164 phix = phi - 90 * CLHEP::deg;
165 phiy = 90 * CLHEP::deg + phix;
166 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: Creating a new " 167 <<
"rotation: " << rots <<
"\t90., " << phix / CLHEP::deg <<
", 90.," << phiy / CLHEP::deg
169 rot =
DDrot(
DDName(rots, idNameSpace), 90 * CLHEP::deg, phix, 90 * CLHEP::deg, phiy, 0., 0.);
171 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: " << ladderHalf <<
" number " <<
copy <<
" positioned in " 172 << layer.name() <<
" at " << tran <<
" with " <<
rot;
175 rrr =
rr - dr - 0.5 * (ladderThick[1] - ladderThick[0]);
178 phix = phi + 90 * CLHEP::deg;
179 phiy = 90 * CLHEP::deg + phix;
180 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: Creating a new " 181 <<
"rotation: " << rots <<
"\t90., " << phix / CLHEP::deg <<
", 90.," << phiy / CLHEP::deg
183 rot =
DDrot(
DDName(rots, idNameSpace), 90 * CLHEP::deg, phix, 90 * CLHEP::deg, phiy, 0., 0.);
185 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: " << ladderHalf <<
" number " <<
copy <<
" positioned in " 186 << layer.name() <<
" at " << tran <<
" with " <<
rot;
194 phix = phi - 90 * CLHEP::deg;
196 phix = phi + 90 * CLHEP::deg;
197 phiy = phix + 90. * CLHEP::deg;
198 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: Creating a new " 199 <<
"rotation: " << rots <<
"\t90., " << phix / CLHEP::deg <<
", 90.," << phiy / CLHEP::deg
201 rot =
DDrot(
DDName(rots, idNameSpace), 90 * CLHEP::deg, phix, 90 * CLHEP::deg, phiy, 0., 0.);
203 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: " << ladderFull <<
" number " <<
copy <<
" positioned in " 204 << layer.name() <<
" at " << tran <<
" with " <<
rot;
207 rrr = coolDist *
cos(0.5 * dphi);
210 phix = phi + 0.5 * dphi;
212 phix += 180 * CLHEP::deg;
213 phiy = phix + 90. * CLHEP::deg;
214 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: Creating a new " 215 <<
"rotation: " << rots <<
"\t90., " << phix / CLHEP::deg <<
", 90.," << phiy / CLHEP::deg
217 rot =
DDrot(
DDName(rots, idNameSpace), 90 * CLHEP::deg, phix, 90 * CLHEP::deg, phiy, 0., 0.);
219 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: " << coolTube.name() <<
" number " <<
i + 1 <<
" positioned in " 220 << layer.name() <<
" at " << tran <<
" with " <<
rot;
static AlgebraicMatrix initialize()
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.
Sin< T >::type sin(const T &t)
DDName is used to identify DDD entities uniquely.
std::string to_string(const V &value)
static std::string & ns()
Compact representation of the geometrical detector hierarchy.
void execute(DDCompactView &cpv) override
A DDSolid represents the shape of a part.
Represents a uniquely identifyable rotation matrix.
U second(std::pair< T, U > const &p)
vector< double > ladderWidth
const std::string & name() const
Returns the name.
Cos< T >::type cos(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)
~DDPixBarLayerAlgo() override
static DDSolid trap(const DDName &name, double pDz, double pTheta, double pPhi, double pDy1, double pDx1, double pDx2, double pAlp1, double pDy2, double pDx3, double pDx4, double pAlp2)
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
vector< double > ladderThick
#define DEFINE_EDM_PLUGIN(factory, type, name)
static constexpr float d1
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation