14 #include "CLHEP/Units/GlobalPhysicalConstants.h"
15 #include "CLHEP/Units/GlobalSystemOfUnits.h"
19 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo info: Creating an instance";
32 detectorN = (int)(nArgs[
"DetectorNumber"]);
34 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo debug: Parent " << parentName
39 dlTop = nArgs[
"DlTop"];
43 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo debug: Detector Tilt "
57 <<
" positioned at Z";
86 <<
" positioned at Z " <<
waferZ[
i]
101 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo debug: Pitch Adapter Height "
105 <<
" position at Z " <<
pitchZ[
i]
110 coolZ = nArgs[
"CoolInsertZ"];
114 std::string comp = sArgs[
"DoSpacers"];
115 if (comp ==
"No" || comp ==
"NO" || comp ==
"no")
doSpacers =
false;
131 LogDebug(
"TIDGeom") <<
"==>> Constructing DDTIDModulePosAlgo...";
157 double dxbot = 0.5*
dlBottom + sidfr;
158 double dxtop = 0.5*
dlTop + sidfr;
159 double dxtopenv, dxbotenv;
162 double thetaWafer = atan(tanWafer);
174 double tanEnv=(dxtopenv-dxbotenv)/(sideFrameHeight+
boxFrameHeight);
176 double xpos=0;
double ypos=0;
double zpos=0;
186 for (
int j1=0; j1<2; j1++){
202 zpos = zCool-zCenter;
203 for (
int j2=0; j2<2; j2++) {
206 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo test: " << name <<
" number "
207 << copy <<
" positioned in " << parentName <<
" at "
225 zpos = zBotSpacers - zCenter;
228 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo test: " << name <<
" number "
229 << 1 <<
" positioned in " << parentName <<
" at "
244 zpos = zSideSpacers - zCenter;
249 double phix, phiy, phiz;
250 phix=0.*CLHEP::deg; phiy=90.*CLHEP::deg; phiz=0.*CLHEP::deg;
252 double thetay, thetax;
253 thetay=90.*CLHEP::deg;
254 double thetaz = thetaWafer;
256 for (
int j1=0; j1<2; j1++){
260 thetax = 90.*CLHEP::deg+thetaz;
261 double thetadeg = thetax/CLHEP::deg;
265 phix, thetay, phiy, thetaz, phiz);
269 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo test: " << name <<
" number "
270 << copy <<
" positioned in " << parentName <<
" at "
290 zpos = zWafer - zCenter;
294 if (rotstr !=
"NULL") {
298 cpv.
position(name, parentName, k+1, tran, rot);
299 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo test: " << name <<
" number "
300 << k+1 <<
" positioned in " << parentName <<
" at "
301 << tran <<
" with " <<
rot;
317 zpos = zPitch - zCenter;
319 if (rotstr !=
"NULL") {
326 cpv.
position(name, parentName, k+1, tran, rot);
327 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo test: " << name <<
" number "
328 << k+1 <<
" positioned in " << parentName <<
" at "
329 << tran <<
" with " <<
rot;
340 zpos = zHybrid - zCenter;
343 cpv.
position(name, parentName, k+1, tran, rot);
344 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo test: " << name <<
" number "
345 << k+1 <<
" positioned in " << parentName <<
" at "
346 << tran <<
" with " <<
rot;
358 zpos = zBoxFrame - zCenter;
361 cpv.
position(name, parentName, k+1, tran, rot);
362 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo test: " << name <<
" number "
363 << k+1 <<
" positioned in " << parentName <<
" at "
364 << tran <<
" with " <<
rot;
372 zSideFrame = 0.5*sideFrameHeight;
376 zpos = zSideFrame-zCenter;
378 if (rotstr !=
"NULL") {
385 cpv.
position(name, parentName, k+1, tran, rot);
386 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo test: " << name <<
" number "
387 << k+1 <<
" positioned in " << parentName <<
" at "
388 << tran <<
" with " <<
rot;
395 double kaptonExtraHeight=0;
398 kaptonExtraHeight = 0.5*fabs(kaptonExtraHeight);
399 zKapton = 0.5*(kaptonHeight+kaptonExtraHeight);
402 kaptonExtraHeight = 0.5*fabs(kaptonExtraHeight);
403 zKapton =
boxFrameHeight+sideFrameHeight-0.5*(kaptonHeight+kaptonExtraHeight);
405 zpos = zKapton-zCenter;
407 if (rotstr !=
"NULL") {
414 cpv.
position(name, parentName, k+1, tran, rot);
415 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo test: " << name <<
" number "
416 << k+1 <<
" positioned in " << parentName <<
" at "
417 << tran <<
" with " <<
rot;
420 LogDebug(
"TIDGeom") <<
"<<== End of DDTIDModulePosAlgo positioning ...";
std::vector< double > pitchZ
std::vector< std::string > pitchName
std::string botSpacersName
virtual ~DDTIDModulePosAlgo()
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.
void execute(DDCompactView &cpv)
std::string sidSpacersName
std::string dbl_to_string(const double &in)
Converts only the integer part of a double to a string.
std::vector< std::string > sideFrameName
type of data representation of DDCompactView
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Represents a uniquely identifyable rotation matrix.
U second(std::pair< T, U > const &p)
std::vector< double > coolRadShift
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs)
Cos< T >::type cos(const T &t)
std::vector< std::string > waferRot
std::vector< double > hybridZ
std::vector< std::string > waferName
std::vector< std::string > pitchRot
std::vector< std::string > sideFrameRot
std::vector< double > sideFrameZ
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
std::vector< std::string > kaptonRot
std::vector< double > waferZ
std::vector< double > kaptonZ
std::vector< std::string > kaptonName
double sidSpacersRadShift
std::vector< double > boxFrameZ