40 {
41
43
44
45 const GeoMaterial* ether =
m_mat_mgr->getMaterial(
"special::Ether");
46 GeoBox* dummybox= new GeoBox(4711., 4711., 4711.);
47 GeoLogVol* dummyTMT = new GeoLogVol("TMT",dummybox,ether);
48 GeoPhysVol* theTMT = new GeoPhysVol(dummyTMT);
49
50
51
52
54
55 double volume = 12647.7;
56 const GeoMaterial* material =
m_mat_mgr->getMaterialForVolume(matName,volume);
57 GeoNameTag*
tag =
new GeoNameTag(
"TMT");
58
59
60 GeoTrf::RotateX3D traprot(180.*Gaudi::Units::deg);
61
62 int halfNModule =
m_gmt_mgr->PixelNModule()/2;
63
64 for (
int ii = 0; ii <
m_gmt_mgr->PixelTMTNumParts(); ii++) {
67 double xbase1 =
m_gmt_mgr->PixelTMTBaseX1(ii);
68 double xbase2 =
m_gmt_mgr->PixelTMTBaseX2(ii);
69 double w1 =
m_gmt_mgr->PixelTMTWidthX1(ii);
70 double w2 =
m_gmt_mgr->PixelTMTWidthX2(ii);
71 double widthy =
m_gmt_mgr->PixelTMTWidthY(ii);
72 double ypos =
m_gmt_mgr->PixelTMTPosY(ii);
73 bool perModule =
m_gmt_mgr->PixelTMTPerModule(ii);
74
75
76
77 if (z1>z2) {
81 }
82
84 double zpos = 0.5*(z1+z2);
85 double xpos = 0.5*(xbase1 + xbase2 - 0.5*(w2+w1));
86
88 if (w1 != w2 || xbase1 != xbase2) {
89 theta = std::atan((xbase2 - xbase1 - 0.5*(w2-w1))/
length);
90 }
91
93 double angleydzn = 0;
94 double angleydzp = 0;
95
96 GeoIntrusivePtr<const GeoShape> shape{};
97 if (w1 == w2 &&
theta == 0) {
98
99 shape =
new GeoBox(0.5*w1, 0.5*widthy, 0.5*
length);
100 } else {
101 shape =
new GeoTrap(0.5*
length,
theta,
phi, 0.5*widthy, 0.5*w1, 0.5*w1, angleydzn,
102 0.5*widthy, 0.5*w2, 0.5*w2, angleydzp);
103
104 }
105
106
107
108
109 if (!perModule) {
110
111
112
113 GeoLogVol* tmpLogVol= new GeoLogVol("TMT",shape,material);
114 GeoPhysVol* tmpPhysVol= new GeoPhysVol(tmpLogVol);
115 GeoTransform* trans = new GeoTransform(GeoTrf::Translate3D(xpos,ypos,zpos));
116
117 theTMT->add(tag);
118 theTMT->add(trans);
119 theTMT->add(tmpPhysVol);
120
121 } else {
122
123
124 GeoLogVol* tmpLogVol= new GeoLogVol("TMT",shape,material);
125 GeoPhysVol* tmpPhysVol= new GeoPhysVol(tmpLogVol);
126
127 for (int ii = 0; ii < halfNModule; ii++) {
128
129
130 double zshift =
m_gmt_mgr->PixelModuleZPosition(1) * ii;
131
132 GeoTransform* transPos = new GeoTransform(GeoTrf::Translate3D(xpos,ypos,zpos+zshift));
133 theTMT->add(tag);
134 theTMT->add(transPos);
135 theTMT->add(tmpPhysVol);
136
137 GeoTransform* transNeg = new GeoTransform(GeoTrf::Translate3D(xpos,ypos,-(zpos+zshift))*GeoTrf::RotateX3D(180*Gaudi::Units::deg));
138 theTMT->add(tag);
139 theTMT->add(transNeg);
140 theTMT->add(tmpPhysVol);
141
142 }
143 }
144 }
145
146 return theTMT;
147
148}
Scalar phi() const
phi method
Scalar theta() const
theta method
PixelGeometryManager * m_gmt_mgr
InDetMaterialManager * m_mat_mgr
void swap(ElementLinkVector< DOBJ > &lhs, ElementLinkVector< DOBJ > &rhs)