16 #include "CLHEP/Units/PhysicalConstants.h"
17 #include "CLHEP/Units/SystemOfUnits.h"
21 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgoCoverage info: Creating an instance";
35 genMat = sArgs[
"GeneralMaterial"];
36 number = int(nArgs[
"Ladders"]);
44 coolMat = sArgs[
"CoolMaterial"];
45 tubeMat = sArgs[
"CoolTubeMaterial"];
48 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgoCoverage debug: Parent " << parentName
50 <<
"\tLadders " <<
number <<
"\tGeneral Material "
52 <<
sensorEdge <<
"\tSpecification of Cooling Pieces:\n"
54 <<
" Side " <<
coolSide <<
" Thickness of Shell "
58 ladder = sArgs[
"LadderName"];
64 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgoCoverage debug: Full Ladder "
67 std::cout <<
" LadderThick = " << ladderThick << std::endl;
78 double phi_coverage = 0.0;
79 double dphi = CLHEP::twopi/
number;
82 double x1 = (d1+d2)/(2.*
sin(0.5*dphi));
87 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgoCoverage test: Rmin/Rmax " << rmin
88 <<
", " << rmax <<
" d1/d2 " << d1 <<
", " << d2
89 <<
" x1/x2 " << x1 <<
", " << x2;
94 rtmi, rtmx, 0, CLHEP::twopi);
95 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgoCoverage test: "
97 <<
genMat <<
" from 0 to " << CLHEP::twopi/CLHEP::deg
98 <<
" with Rin " << rtmi <<
" Rout " << rtmx
104 double rr = 0.5*(rmax+rmin);
105 double dr = 0.5*(rmax-rmin);
109 h1, d2, d1, 0, h1, d2, d1, 0);
110 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgoCoverage test: " <<solid.
name()
111 <<
" Trap made of " <<
tubeMat <<
" of dimensions "
112 << 0.5*
coolDz <<
", 0, 0, " << h1 <<
", " << d2
113 <<
", " << d1 <<
", 0, " << h1 <<
", " << d2 <<
", "
118 name = idName +
"Coolant";
123 h1, d2, d1, 0, h1, d2, d1, 0);
124 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgoCoverage test: " <<solid.
name()
125 <<
" Trap made of " <<
coolMat <<
" of dimensions "
126 << 0.5*
coolDz <<
", 0, 0, " << h1 <<
", " << d2
127 <<
", " << d1 <<
", 0, " << h1 <<
", " << d2 <<
", "
132 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgoCoverage test: " << cool.name()
133 <<
" number 1 positioned in " << coolTube.name()
134 <<
" at (0,0,0) with no rotation";
140 double phix, phiy, rrr;
147 rots = idName + std::to_string(copy);
148 if (iup > 0) phix = phi-90*CLHEP::deg;
149 else phix = phi+90*CLHEP::deg;
150 phiy = phix+90.*CLHEP::deg;
151 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgoCoverage test: Creating a new "
152 <<
"rotation: " << rots <<
"\t90., " << phix/CLHEP::deg
153 <<
", 90.," << phiy/CLHEP::deg <<
", 0, 0";
155 cpv.
position (ladderFull, layer, copy, tran, rot);
156 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgoCoverage test: " << ladderFull
157 <<
" number " << copy <<
" positioned in "
158 << layer.
name() <<
" at " << tran <<
" with "
162 phi_coverage += phi_coverage_i;
166 rrr*
sin(phi)+x2*
cos(phi), 0);
167 rots = idName + std::to_string(
i+100);
169 if (iup > 0) phix += 180*CLHEP::deg;
170 phiy = phix+90.*CLHEP::deg;
171 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgoCoverage test: Creating a new "
172 <<
"rotation: " << rots <<
"\t90., " << phix/CLHEP::deg
173 <<
", 90.," << phiy/CLHEP::deg <<
", 0, 0";
175 cpv.
position (coolTube, layer,
i+1, tran, rot);
176 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgoCoverage test: " << coolTube.name()
177 <<
" number " <<
i+1 <<
" positioned in "
178 << layer.name() <<
" at " << tran <<
" with "<<
rot;
180 std::cout<<
"\nLayer covered "<<phi_coverage<<
" radians in phi. (2Pi="<<CLHEP::twopi<<
")" << std::endl;
181 if (phi_coverage>CLHEP::twopi)
std::cout<<
"\nPhi coverage is achieved"<< std::endl;
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs)
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()
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)
void execute(DDCompactView &cpv)
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)
DDPixBarLayerUpgradeAlgoCoverage()
virtual ~DDPixBarLayerUpgradeAlgoCoverage()
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
const std::string & name() const
Returns the name.