17 #include "CLHEP/Units/PhysicalConstants.h"
18 #include "CLHEP/Units/SystemOfUnits.h"
22 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo info: Creating an instance";
36 genMat = sArgs[
"GeneralMaterial"];
37 number = int(nArgs[
"Ladders"]);
45 coolMat = sArgs[
"CoolMaterial"];
46 tubeMat = sArgs[
"CoolTubeMaterial"];
49 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo debug: Parent " << parentName
51 <<
"\tLadders " <<
number <<
"\tGeneral Material "
52 <<
genMat <<
"\tLength " <<
layerDz <<
"\tSpecification of Cooling Pieces:\n"
53 <<
"\tLength " <<
coolDz <<
" Thickness of Shell "
57 ladder = sArgs[
"LadderName"];
63 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo debug: Full Ladder "
73 double dphi = CLHEP::twopi/
number;
79 rtmi, rtmx, 0, CLHEP::twopi);
80 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: "
82 <<
genMat <<
" from 0 to " << CLHEP::twopi/CLHEP::deg
83 <<
" with Rin " << rtmi <<
" Rout " << rtmx
93 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: " <<solid.
name()
94 <<
" Tubs made of " <<
tubeMat <<
" from 0 to " <<
95 CLHEP::twopi/CLHEP::deg <<
" with Rout " <<
coolRadius <<
100 name = idName +
"Coolant";
103 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: " <<solid.
name()
104 <<
" Tubs made of " <<
tubeMat <<
" from 0 to " <<
110 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: " << cool.name()
111 <<
" number 1 positioned in " << coolTube.name()
112 <<
" at (0,0,0) with no rotation";
118 double phi =
i*dphi+90*CLHEP::deg-0.5*dphi;
119 double phix, phiy, rrr, rrroffset;
124 if ((
i==1)||(
i==number/2+1)){
132 if (iup > 0) phix = phi-90*CLHEP::deg;
133 else phix = phi+90*CLHEP::deg;
134 phiy = phix+90.*CLHEP::deg;
135 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: Creating a new "
136 <<
"rotation: " << rots <<
"\t90., " << phix/CLHEP::deg
137 <<
", 90.," << phiy/CLHEP::deg <<
", 0, 0";
139 cpv.
position (ladderFull, layer, copy, tran, rot);
140 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: " << ladderFull
141 <<
" number " << copy <<
" positioned in "
142 << layer.
name() <<
" at " << tran <<
" with "
147 rrr*
sin(phi)+x2*
cos(phi), 0);
150 if (iup > 0) phix += 180*CLHEP::deg;
151 phiy = phix+90.*CLHEP::deg;
152 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: Creating a new "
153 <<
"rotation: " << rots <<
"\t90., " << phix/CLHEP::deg
154 <<
", 90.," << phiy/CLHEP::deg <<
", 0, 0";
156 cpv.
position (coolTube, layer,
i+1, tran, rot);
157 if ((
i==1)||(
i==number/2+1)){
168 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgo test: " << coolTube.name()
169 <<
" number " <<
i+1 <<
" positioned in "
170 << layer.name() <<
" at " << tran <<
" with "<<
rot;
void execute(DDCompactView &cpv)
DDMaterial is used to define and access material information.
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs)
Sin< T >::type sin(const T &t)
virtual ~DDPixBarLayerUpgradeAlgo()
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.
static std::string & ns()
std::string dbl_to_string(const double &in)
Converts only the integer part of a double to a string.
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)
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)
DDPixBarLayerUpgradeAlgo()
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
const std::string & name() const
Returns the name.