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"];
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 "
289 zpos = zWafer - zCenter;
293 if (rotstr !=
"NULL") {
297 cpv.
position(name, parentName, k+1, tran, rot);
298 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo test: " << name <<
" number "
299 << k+1 <<
" positioned in " << parentName <<
" at "
300 << tran <<
" with " <<
rot;
316 zpos = zPitch - zCenter;
318 if (rotstr !=
"NULL") {
325 cpv.
position(name, parentName, k+1, tran, rot);
326 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo test: " << name <<
" number "
327 << k+1 <<
" positioned in " << parentName <<
" at "
328 << tran <<
" with " <<
rot;
339 zpos = zHybrid - zCenter;
342 cpv.
position(name, parentName, k+1, tran, rot);
343 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo test: " << name <<
" number "
344 << k+1 <<
" positioned in " << parentName <<
" at "
345 << tran <<
" with " <<
rot;
357 zpos = zBoxFrame - zCenter;
360 cpv.
position(name, parentName, k+1, tran, rot);
361 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo test: " << name <<
" number "
362 << k+1 <<
" positioned in " << parentName <<
" at "
363 << tran <<
" with " <<
rot;
371 zSideFrame = 0.5*sideFrameHeight;
375 zpos = zSideFrame-zCenter;
377 if (rotstr !=
"NULL") {
384 cpv.
position(name, parentName, k+1, tran, rot);
385 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo test: " << name <<
" number "
386 << k+1 <<
" positioned in " << parentName <<
" at "
387 << tran <<
" with " <<
rot;
394 double kaptonExtraHeight=0;
397 kaptonExtraHeight = 0.5*fabs(kaptonExtraHeight);
398 zKapton = 0.5*(kaptonHeight+kaptonExtraHeight);
401 kaptonExtraHeight = 0.5*fabs(kaptonExtraHeight);
402 zKapton =
boxFrameHeight+sideFrameHeight-0.5*(kaptonHeight+kaptonExtraHeight);
404 zpos = zKapton-zCenter;
406 if (rotstr !=
"NULL") {
413 cpv.
position(name, parentName, k+1, tran, rot);
414 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo test: " << name <<
" number "
415 << k+1 <<
" positioned in " << parentName <<
" at "
416 << tran <<
" with " <<
rot;
419 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