17 #include "CLHEP/Units/PhysicalConstants.h"
18 #include "CLHEP/Units/SystemOfUnits.h"
22 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgoCoverage info: Creating an instance";
36 genMat = sArgs[
"GeneralMaterial"];
37 number = int(nArgs[
"Ladders"]);
45 coolMat = sArgs[
"CoolMaterial"];
46 tubeMat = sArgs[
"CoolTubeMaterial"];
49 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgoCoverage debug: Parent " << parentName
51 <<
"\tLadders " <<
number <<
"\tGeneral Material "
53 <<
sensorEdge <<
"\tSpecification of Cooling Pieces:\n"
55 <<
" Side " <<
coolSide <<
" Thickness of Shell "
59 ladder = sArgs[
"LadderName"];
65 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgoCoverage debug: Full Ladder "
68 std::cout <<
" LadderThick = " << ladderThick << std::endl;
79 double phi_coverage = 0.0;
80 double dphi = CLHEP::twopi/
number;
83 double x1 = (d1+d2)/(2.*
sin(0.5*dphi));
88 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgoCoverage test: Rmin/Rmax " << rmin
89 <<
", " << rmax <<
" d1/d2 " << d1 <<
", " << d2
90 <<
" x1/x2 " << x1 <<
", " << x2;
95 rtmi, rtmx, 0, CLHEP::twopi);
96 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgoCoverage test: "
98 <<
genMat <<
" from 0 to " << CLHEP::twopi/CLHEP::deg
99 <<
" with Rin " << rtmi <<
" Rout " << rtmx
105 double rr = 0.5*(rmax+rmin);
106 double dr = 0.5*(rmax-rmin);
110 h1, d2, d1, 0, h1, d2, d1, 0);
111 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgoCoverage test: " <<solid.
name()
112 <<
" Trap made of " <<
tubeMat <<
" of dimensions "
113 << 0.5*
coolDz <<
", 0, 0, " << h1 <<
", " << d2
114 <<
", " << d1 <<
", 0, " << h1 <<
", " << d2 <<
", "
119 name = idName +
"Coolant";
124 h1, d2, d1, 0, h1, d2, d1, 0);
125 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgoCoverage test: " <<solid.
name()
126 <<
" Trap made of " <<
coolMat <<
" of dimensions "
127 << 0.5*
coolDz <<
", 0, 0, " << h1 <<
", " << d2
128 <<
", " << d1 <<
", 0, " << h1 <<
", " << d2 <<
", "
133 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgoCoverage test: " << cool.name()
134 <<
" number 1 positioned in " << coolTube.name()
135 <<
" at (0,0,0) with no rotation";
141 double phix, phiy, rrr;
149 if (iup > 0) phix = phi-90*CLHEP::deg;
150 else phix = phi+90*CLHEP::deg;
151 phiy = phix+90.*CLHEP::deg;
152 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgoCoverage test: Creating a new "
153 <<
"rotation: " << rots <<
"\t90., " << phix/CLHEP::deg
154 <<
", 90.," << phiy/CLHEP::deg <<
", 0, 0";
156 cpv.
position (ladderFull, layer, copy, tran, rot);
157 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgoCoverage test: " << ladderFull
158 <<
" number " << copy <<
" positioned in "
159 << layer.
name() <<
" at " << tran <<
" with "
163 phi_coverage += phi_coverage_i;
167 rrr*
sin(phi)+x2*
cos(phi), 0);
170 if (iup > 0) phix += 180*CLHEP::deg;
171 phiy = phix+90.*CLHEP::deg;
172 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgoCoverage test: Creating a new "
173 <<
"rotation: " << rots <<
"\t90., " << phix/CLHEP::deg
174 <<
", 90.," << phiy/CLHEP::deg <<
", 0, 0";
176 cpv.
position (coolTube, layer,
i+1, tran, rot);
177 LogDebug(
"PixelGeom") <<
"DDPixBarLayerUpgradeAlgoCoverage test: " << coolTube.name()
178 <<
" number " <<
i+1 <<
" positioned in "
179 << layer.name() <<
" at " << tran <<
" with "<<
rot;
181 std::cout<<
"\nLayer covered "<<phi_coverage<<
" radians in phi. (2Pi="<<CLHEP::twopi<<
")" << std::endl;
182 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()
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)
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.