17 #include "CLHEP/Units/GlobalPhysicalConstants.h"
18 #include "CLHEP/Units/GlobalSystemOfUnits.h"
22 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo info: Creating an instance";
36 genMat = sArgs[
"GeneralMaterial"];
37 number = int(nArgs[
"Ladders"]);
45 coolMat = sArgs[
"CoolMaterial"];
46 tubeMat = sArgs[
"CoolTubeMaterial"];
48 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo debug: Parent " << parentName
50 <<
"\tLadders " <<
number <<
"\tGeneral Material "
52 <<
sensorEdge <<
"\tSpecification of Cooling Pieces:\n"
54 <<
" Side " <<
coolSide <<
" Thickness of Shell "
58 ladder = vsArgs[
"LadderName"];
62 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo debug: Full Ladder "
72 const std::string &idName = mother.
name();
74 double dphi = CLHEP::twopi/
number;
77 double x1 = (d1+d2)/(2.*
sin(0.5*dphi));
82 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: Rmin/Rmax " << rmin
83 <<
", " << rmax <<
" d1/d2 " << d1 <<
", " << d2
84 <<
" x1/x2 " << x1 <<
", " << x2;
86 double rtmi = rmin + 0.5*ladderThick[0] - ladderThick[1];
89 rtmi, rtmx, 0, CLHEP::twopi);
90 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: "
92 <<
genMat <<
" from 0 to " << CLHEP::twopi/CLHEP::deg
93 <<
" with Rin " << rtmi <<
" Rout " << rtmx
99 double rr = 0.5*(rmax+rmin);
100 double dr = 0.5*(rmax-rmin);
102 std::string
name = idName +
"CoolTube";
104 h1, d2, d1, 0, h1, d2, d1, 0);
105 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: " <<solid.
name()
106 <<
" Trap made of " <<
tubeMat <<
" of dimensions "
107 << 0.5*
coolDz <<
", 0, 0, " << h1 <<
", " << d2
108 <<
", " << d1 <<
", 0, " << h1 <<
", " << d2 <<
", "
113 name = idName +
"Coolant";
118 h1, d2, d1, 0, h1, d2, d1, 0);
119 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: " <<solid.
name()
120 <<
" Trap made of " <<
coolMat <<
" of dimensions "
121 << 0.5*
coolDz <<
", 0, 0, " << h1 <<
", " << d2
122 <<
", " << d1 <<
", 0, " << h1 <<
", " << d2 <<
", "
127 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: " << cool.name()
128 <<
" number 1 positioned in " << coolTube.name()
129 <<
" at (0,0,0) with no rotation";
135 double phi0 = 90*CLHEP::deg;
138 double phi = phi0 +
i*dphi;
139 double phix, phiy, rrr, xx;
143 if (
i == 0 ||
i == nphi) {
144 rrr = rr + dr + 0.5*(ladderThick[1]-ladderThick[0]);
148 phix = phi-90*CLHEP::deg;
149 phiy = 90*CLHEP::deg+phix;
150 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: Creating a new "
151 <<
"rotation: " << rots <<
"\t90., "
152 << phix/CLHEP::deg <<
", 90.," << phiy/CLHEP::deg
157 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: " << ladderHalf
158 <<
" number " <<
copy <<
" positioned in "
159 << layer.name() <<
" at " << tran <<
" with "
163 rrr = rr - dr - 0.5*(ladderThick[1]-ladderThick[0]);
166 phix = phi+90*CLHEP::deg;
167 phiy = 90*CLHEP::deg+phix;
168 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: Creating a new "
169 <<
"rotation: " << rots <<
"\t90., "
170 << phix/CLHEP::deg <<
", 90.," << phiy/CLHEP::deg
175 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: " << ladderHalf
176 <<
" number " <<
copy <<
" positioned in "
177 << layer.name() <<
" at " << tran <<
" with "
185 if (iup > 0) phix = phi-90*CLHEP::deg;
186 else phix = phi+90*CLHEP::deg;
187 phiy = phix+90.*CLHEP::deg;
188 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: Creating a new "
189 <<
"rotation: " << rots <<
"\t90., "
190 << phix/CLHEP::deg <<
", 90.," << phiy/CLHEP::deg
195 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: " << ladderFull
196 <<
" number " <<
copy <<
" positioned in "
197 << layer.name() <<
" at " << tran <<
" with "
203 rrr*
sin(phi)+x2*
cos(phi), 0);
206 if (iup > 0) phix += 180*CLHEP::deg;
207 phiy = phix+90.*CLHEP::deg;
208 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: Creating a new "
209 <<
"rotation: " << rots <<
"\t90., "
210 << phix/CLHEP::deg <<
", 90.," << phiy/CLHEP::deg
214 cpv.
position(coolTube, layer,
i+1, tran, rot);
215 LogDebug(
"PixelGeom") <<
"DDPixBarLayerAlgo test: " << coolTube.name()
216 <<
" number " <<
i+1 <<
" positioned in "
217 << layer.name() <<
" at " << tran <<
" with "<< rot;
DDMaterial is used to define and access material information.
Sin< T >::type sin(const T &t)
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
std::vector< std::string > ladder
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)
virtual ~DDPixBarLayerAlgo()
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)
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)
std::vector< double > ladderWidth
std::vector< double > ladderThick
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
void execute(DDCompactView &cpv)
const std::string & name() const
Returns the name.