13 #include "CLHEP/Units/GlobalPhysicalConstants.h" 14 #include "CLHEP/Units/GlobalSystemOfUnits.h" 18 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo info: Creating an instance";
33 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo debug: Parent " << parentName
38 dlTop = nArgs[
"DlTop"];
42 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo debug: Detector Tilt " 56 <<
" positioned at Z";
85 <<
" positioned at Z " <<
waferZ[
i]
100 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo debug: Pitch Adapter Height " 104 <<
" position at Z " <<
pitchZ[
i]
109 coolZ = nArgs[
"CoolInsertZ"];
114 if (comp ==
"No" || comp ==
"NO" || comp ==
"no")
doSpacers =
false;
130 LogDebug(
"TIDGeom") <<
"==>> Constructing DDTIDModulePosAlgo...";
156 double dxbot = 0.5*
dlBottom + sidfr;
157 double dxtop = 0.5*
dlTop + sidfr;
158 double dxtopenv, dxbotenv;
161 double thetaWafer = atan(tanWafer);
173 double tanEnv=(dxtopenv-dxbotenv)/(sideFrameHeight+
boxFrameHeight);
175 double xpos=0;
double ypos=0;
double zpos=0;
185 for (
int j1=0; j1<2; j1++){
201 zpos = zCool-zCenter;
202 for (
int j2=0; j2<2; j2++) {
205 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo test: " << name <<
" number " 206 << copy <<
" positioned in " << parentName <<
" at " 224 zpos = zBotSpacers - zCenter;
227 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo test: " << name <<
" number " 228 << 1 <<
" positioned in " << parentName <<
" at " 243 zpos = zSideSpacers - zCenter;
248 double phix, phiy, phiz;
249 phix=0.*CLHEP::deg; phiy=90.*CLHEP::deg; phiz=0.*CLHEP::deg;
251 double thetay, thetax;
252 thetay=90.*CLHEP::deg;
253 double thetaz = thetaWafer;
255 for (
int j1=0; j1<2; j1++){
259 thetax = 90.*CLHEP::deg+thetaz;
260 double thetadeg = thetax/CLHEP::deg;
264 phix, thetay, phiy, thetaz, phiz);
268 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo test: " << name <<
" number " 269 << copy <<
" positioned in " << parentName <<
" at " 288 zpos = zWafer - zCenter;
292 if (rotstr !=
"NULL") {
296 cpv.
position(name, parentName, k+1, tran, rot);
297 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo test: " << name <<
" number " 298 << k+1 <<
" positioned in " << parentName <<
" at " 299 << tran <<
" with " <<
rot;
315 zpos = zPitch - zCenter;
317 if (rotstr !=
"NULL") {
324 cpv.
position(name, parentName, k+1, tran, rot);
325 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo test: " << name <<
" number " 326 << k+1 <<
" positioned in " << parentName <<
" at " 327 << tran <<
" with " <<
rot;
338 zpos = zHybrid - zCenter;
341 cpv.
position(name, parentName, k+1, tran, rot);
342 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo test: " << name <<
" number " 343 << k+1 <<
" positioned in " << parentName <<
" at " 344 << tran <<
" with " <<
rot;
356 zpos = zBoxFrame - zCenter;
359 cpv.
position(name, parentName, k+1, tran, rot);
360 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo test: " << name <<
" number " 361 << k+1 <<
" positioned in " << parentName <<
" at " 362 << tran <<
" with " <<
rot;
370 zSideFrame = 0.5*sideFrameHeight;
374 zpos = zSideFrame-zCenter;
376 if (rotstr !=
"NULL") {
383 cpv.
position(name, parentName, k+1, tran, rot);
384 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo test: " << name <<
" number " 385 << k+1 <<
" positioned in " << parentName <<
" at " 386 << tran <<
" with " <<
rot;
393 double kaptonExtraHeight=0;
396 kaptonExtraHeight = 0.5*fabs(kaptonExtraHeight);
397 zKapton = 0.5*(kaptonHeight+kaptonExtraHeight);
400 kaptonExtraHeight = 0.5*fabs(kaptonExtraHeight);
401 zKapton =
boxFrameHeight+sideFrameHeight-0.5*(kaptonHeight+kaptonExtraHeight);
403 zpos = zKapton-zCenter;
405 if (rotstr !=
"NULL") {
412 cpv.
position(name, parentName, k+1, tran, rot);
413 LogDebug(
"TIDGeom") <<
"DDTIDModulePosAlgo test: " << name <<
" number " 414 << k+1 <<
" positioned in " << parentName <<
" at " 415 << tran <<
" with " <<
rot;
418 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::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