15 #include <CLHEP/Units/PhysicalConstants.h> 16 #include <CLHEP/Units/SystemOfUnits.h> 66 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo info: Creating an instance";
79 genMat = sArgs[
"GeneralMaterial"];
81 layerDz = nArgs[
"LayerDz"];
82 coolDz = nArgs[
"CoolDz"];
83 coolThick = nArgs[
"CoolThick"];
84 coolRadius = nArgs[
"CoolRadius"];
85 coolDist = nArgs[
"CoolDist"];
86 cool1Offset = nArgs[
"Cool1Offset"];
87 cool2Offset = nArgs[
"Cool2Offset"];
88 coolMat = sArgs[
"CoolMaterial"];
89 tubeMat = sArgs[
"CoolTubeMaterial"];
90 coolMatHalf = sArgs[
"CoolMaterialHalf"];
91 tubeMatHalf = sArgs[
"CoolTubeMaterialHalf"];
92 phiFineTune = nArgs[
"PitchFineTune"];
93 rOuterFineTune = nArgs[
"OuterOffsetFineTune"];
94 rInnerFineTune = nArgs[
"InnerOffsetFineTune"];
96 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo debug: Parent " << parentName <<
" NameSpace " << idNameSpace
98 <<
"\tLadders " <<
number <<
"\tGeneral Material " << genMat <<
"\tLength " << layerDz
99 <<
"\tSpecification of Cooling Pieces:\n" 100 <<
"\tLength " << coolDz <<
" Thickness of Shell " << coolThick <<
" Radial distance " 101 << coolDist <<
" Materials " << coolMat <<
", " << tubeMat;
103 ladder = sArgs[
"LadderName"];
104 ladderWidth = nArgs[
"LadderWidth"];
105 ladderThick = nArgs[
"LadderThick"];
106 ladderOffset = nArgs[
"LadderOffset"];
107 outerFirst =
int(nArgs[
"OuterFirst"]);
109 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo debug: Full Ladder " <<
ladder <<
" width/thickness " 110 << ladderWidth <<
", " << ladderThick;
117 double dphi = CLHEP::twopi /
number;
118 double x2 = coolDist *
sin(0.5 * dphi);
119 double rtmi = coolDist *
cos(0.5 * dphi) - (coolRadius + ladderThick) + rInnerFineTune;
120 double rmxh = coolDist *
cos(0.5 * dphi) + (coolRadius + ladderThick + ladderOffset) + rOuterFineTune;
121 double rtmx =
sqrt(rmxh * rmxh + ladderWidth * ladderWidth / 4);
123 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: " <<
DDName(
idName, idNameSpace) <<
" Tubs made of " 124 << genMat <<
" from 0 to " << CLHEP::twopi / CLHEP::deg <<
" with Rin " << rtmi <<
" Rout " 125 << rtmx <<
" ZHalf " << 0.5 * layerDz;
133 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: " << solid.
name() <<
" Tubs made of " << tubeMat
134 <<
" from 0 to " << CLHEP::twopi / CLHEP::deg <<
" with Rout " << coolRadius <<
" ZHalf " 142 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: " << solid.
name() <<
" Tubs made of " << tubeMatHalf
143 <<
" from 0 to " << CLHEP::twopi / CLHEP::deg <<
" with Rout " << coolRadius <<
" ZHalf " 151 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: " << solid.
name() <<
" Tubs made of " << tubeMat
152 <<
" from 0 to " << CLHEP::twopi / CLHEP::deg <<
" with Rout " << coolRadius - coolThick
153 <<
" ZHalf " << 0.5 * coolDz;
157 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: " << cool.name() <<
" number 1 positioned in " 158 << coolTube.name() <<
" at (0,0,0) with no rotation";
163 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: " << solid.
name() <<
" Tubs made of " << tubeMatHalf
164 <<
" from 0 to " << CLHEP::twopi / CLHEP::deg <<
" with Rout " << coolRadius - coolThick
165 <<
" ZHalf " << 0.5 * coolDz;
169 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: " << cool.name() <<
" number 1 positioned in " 170 << coolTube.name() <<
" at (0,0,0) with no rotation";
173 int copy = 1, iup = (-1) * outerFirst;
174 int copyoffset =
number + 2;
176 double phi =
i * dphi + 90 * CLHEP::deg - 0.5 * dphi + phiFineTune;
177 double phix, phiy, rrr, rrroffset;
183 if ((
i == 1) || (
i ==
number / 2 + 1)) {
184 dr = coolRadius + 0.5 * ladderThick + ladderOffset;
186 dr = coolRadius + 0.5 * ladderThick;
189 rrr = coolDist *
cos(0.5 * dphi) + iup * dr + rOuterFineTune;
191 rrr = coolDist *
cos(0.5 * dphi) + iup * dr + rInnerFineTune;
196 phix = phi - 90 * CLHEP::deg;
198 phix = phi + 90 * CLHEP::deg;
199 phiy = phix + 90. * CLHEP::deg;
200 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: Creating a new " 201 <<
"rotation: " << rots <<
"\t90., " << phix / CLHEP::deg <<
", 90.," << phiy / CLHEP::deg
203 rot =
DDrot(
DDName(rots, idNameSpace), 90 * CLHEP::deg, phix, 90 * CLHEP::deg, phiy, 0., 0.);
205 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: " << ladderFull <<
" number " <<
copy <<
" positioned in " 206 << layer.name() <<
" at " << tran <<
" with " <<
rot;
208 rrr = coolDist *
cos(0.5 * dphi) + coolRadius / 2.;
210 phix = phi + 90. * CLHEP::deg;
213 phiy = phix + 90. * CLHEP::deg;
214 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: Creating a new " 215 <<
"rotation: " << rots <<
"\t90., " << phix / CLHEP::deg <<
", 90.," << phiy / CLHEP::deg
218 rot =
DDrot(
DDName(rots, idNameSpace), 90 * CLHEP::deg, phix, 90 * CLHEP::deg, phiy, 0., 0.);
220 if ((
i == 1) || (
i ==
number / 2 + 1)) {
221 rrroffset = coolDist *
cos(0.5 * dphi) + iup * ladderOffset + rOuterFineTune;
223 rrroffset *
cos(phi) - cool1Offset *
sin(phi), rrroffset *
sin(phi) + cool1Offset *
cos(phi), 0);
227 rrroffset *
cos(phi) - cool2Offset *
sin(phi), rrroffset *
sin(phi) + cool2Offset *
cos(phi), 0);
231 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: " << coolTube.name() <<
" number " <<
i + 1
232 <<
" positioned in " << 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.
static std::string & ns()
Compact representation of the geometrical detector hierarchy.
A DDSolid represents the shape of a part.
static std::string to_string(const XMLCh *ch)
Represents a uniquely identifyable rotation matrix.
U second(std::pair< T, U > const &p)
const std::string & name() const
Returns the name.
Cos< T >::type cos(const T &t)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
void execute(DDCompactView &cpv) override
DDPixBarLayerUpgradeAlgo()
~DDPixBarLayerUpgradeAlgo() override
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation