62 {
63 sTGCDetectorHelper stgcHelper;
65 AGDDDetectorStore&
ds =
c->GetDetectorStore();
67
68 sTGC_Technology *
t =
static_cast<sTGC_Technology *
>(
ds.GetTechnology(
name));
70 double gasTck =
t->gasThickness;
71
74 double pcbTck = (isQS1 || isQL1) ?
t->pcbThickness150 :
t->pcbThickness200;
75
76
77 if(pcbTck == 0)
78 pcbTck =
t->pcbThickness;
79
80 double coverTck =
t->coverThickness;
81 double f4 = stgc_descr->
ylFrame();
82 double f5 = stgc_descr->
ysFrame();
83 double f6 = stgc_descr->
xFrame();
84
85
86 double chamberTck = gasTck + pcbTck;
87 double honeycombTck = (
thickness - 4 * chamberTck - 2 * coverTck) / 5;
88 double pcbActualTck = pcbTck / 2;
89
90 minimalgeo =
t->geoLevel;
91
92
93 GeoSimplePolygonBrep *
solid;
103
104
105 GeoTrf::Transform3D rot = GeoTrf::RotateZ3D(
M_PI / 2.) * GeoTrf::RotateX3D(
M_PI / 2.);
106 const GeoShape *strd =
new GeoShapeShift(
solid, rot);
107
111 const GeoMaterial *mtrd = matManager.
getMaterial(
"muo::Honeycomb");
112 GeoLogVol *ltrd =
new GeoLogVol(
logVolName, strd, mtrd);
113 GeoFullPhysVol *ptrd = new GeoFullPhysVol(ltrd);
114
115 if (!minimalgeo)
116 return ptrd;
117
119 ptrd->add(new GeoSerialIdentifier(0));
120
121 int igl = 0;
122
123
124 for (
int i = 0;
i <
t->nlayers;
i++) {
125 double widthActive;
126 double longWidthActive;
127 double lengthActive;
128
129 igl++;
130 ptrd->add(new GeoIdentifierTag(igl));
131
135
136 double newXPos;
137 double pcbpos;
138 if (i == 0)
139 newXPos = newpos + chamberTck / 2 + honeycombTck + coverTck;
140 else
141 newXPos = newpos + chamberTck + honeycombTck;
142
143
144 GeoSimplePolygonBrep *sGasVolume = new GeoSimplePolygonBrep(chamberTck / 2.);
145 sGasVolume->addVertex(longWidthActive / 2., lengthActive / 2.);
146 sGasVolume->addVertex(-longWidthActive / 2., lengthActive / 2.);
148 sGasVolume->addVertex(-longWidthActive / 2., lengthActive / 2. -
yCutout);
149 sGasVolume->addVertex(-widthActive / 2., -lengthActive / 2.);
150 sGasVolume->addVertex(widthActive / 2., -lengthActive / 2.);
152 sGasVolume->addVertex(longWidthActive / 2., lengthActive / 2. -
yCutout);
153
154
155 GeoTrf::Transform3D rot = GeoTrf::RotateZ3D(
M_PI / 2.) * GeoTrf::RotateX3D(
M_PI / 2.);
156 const GeoShape *sGasVolume1 = new GeoShapeShift(sGasVolume, rot);
157 GeoLogVol *ltrdgas =
new GeoLogVol(
"sTGC_Sensitive", sGasVolume1, matManager.
getMaterial(
"muo::TGCGas"));
158 GeoPhysVol *ptrdgas = new GeoPhysVol(ltrdgas);
159 GeoNameTag *gastag =
new GeoNameTag(
name +
"muo::TGCGas");
160 GeoTransform *chamberpos = new GeoTransform(GeoTrf::TranslateX3D(newXPos));
161
162
163 for (
int i = 0;
i < 2;
i++) {
164 if (i == 0) {
165
166 pcbpos = -chamberTck / 2 + pcbActualTck / 2;
167 } else {
168
169
170 pcbpos = -chamberTck / 2 + pcbActualTck + gasTck + pcbActualTck / 2;
171 }
172
173
174 GeoSimplePolygonBrep *sPcbVolume = new GeoSimplePolygonBrep(pcbActualTck / 2.);
175 sPcbVolume->addVertex(longWidthActive / 2., lengthActive / 2.);
176 sPcbVolume->addVertex(-longWidthActive / 2., lengthActive / 2.);
178 sPcbVolume->addVertex(-longWidthActive / 2., lengthActive / 2. -
yCutout);
179 sPcbVolume->addVertex(-widthActive / 2., -lengthActive / 2.);
180 sPcbVolume->addVertex(widthActive / 2., -lengthActive / 2.);
182 sPcbVolume->addVertex(longWidthActive / 2., lengthActive / 2. -
yCutout);
183
184
185 GeoTrf::Transform3D rott = GeoTrf::RotateZ3D(
M_PI / 2.) * GeoTrf::RotateX3D(
M_PI / 2.);
186 const GeoShape *sPcbVolume1 = new GeoShapeShift(sPcbVolume, rott);
187
188 const GeoMaterial *mtrdC = matManager.
getMaterial(
"std::G10");
189 GeoLogVol *ltrdC =
new GeoLogVol(
logVolName, sPcbVolume1, mtrdC);
190 GeoPhysVol *ptrdPcb = new GeoPhysVol(ltrdC);
191 GeoNameTag *ntrdtmpC =
new GeoNameTag(
name +
"std::G10");
192
193 GeoTransform *ttrdtmpC = new GeoTransform(GeoTrf::TranslateX3D(pcbpos));
194
195
196 ptrdgas->add(ntrdtmpC);
197 ptrdgas->add(ttrdtmpC);
198 ptrdgas->add(ptrdPcb);
199 }
200
201
202 ptrd->add(gastag);
203 ptrd->add(chamberpos);
204 ptrd->add(ptrdgas);
205
206
210 const GeoShape *trd1 =
new GeoTrd(gasTck / 2, gasTck / 2,
width / 2,
longWidth / 2,
length / 2);
211 const GeoShape *trd2 =
new GeoTrd(gasTck, gasTck, W - f6, lW - f6,
length / 2 - (f4 + f5) / 2.);
212 GeoTrf::Translate3D
c(0, 0, (f5 - f4) / 2.);
213 trd1 = &(trd1->subtract((*trd2) << c));
214 GeoLogVol *ltrdframe =
new GeoLogVol(
"sTGC_Frame", trd1, matManager.
getMaterial(
"std::Aluminium"));
215 GeoPhysVol *ptrdframe = new GeoPhysVol(ltrdframe);
216
217 ptrdgas->add(ptrdframe);
218 } else {
220
221 GeoSimplePolygonBrep *sGasV = new GeoSimplePolygonBrep(gasTck / 2.);
222 sGasV->addVertex(longWidthActive / 2. - f6, lengthActive / 2. - f4);
223 sGasV->addVertex(-longWidthActive / 2. + f6, lengthActive / 2. - f4);
224 sGasV->addVertex(-longWidthActive / 2. + f6, lengthActive / 2. - f4 -
yCutoutCathode);
225 sGasV->addVertex(-W + f6, -lengthActive / 2. + f5);
226 sGasV->addVertex(W - f6, -lengthActive / 2. + f5);
227 sGasV->addVertex(longWidthActive / 2. - f6, lengthActive / 2. - f4 -
yCutoutCathode);
228
229
230 GeoSimplePolygonBrep *sGasV2 = new GeoSimplePolygonBrep(gasTck / 2.);
237
238
239 const GeoShape *sGasV1 = new GeoShapeShift(sGasV, rot);
240 const GeoShape *sGasV3 = new GeoShapeShift(sGasV2, rot);
241
242 sGasV3 = &(sGasV3->subtract((*sGasV1)));
243
244 GeoLogVol *ltrdframe =
new GeoLogVol(
"sTGC_Frame", sGasV3, matManager.
getMaterial(
"std::Aluminium"));
245 GeoPhysVol *ptrdframe = new GeoPhysVol(ltrdframe);
246
247
248 ptrdgas->add(ptrdframe);
249 }
250
251 newpos = newXPos;
252 }
253
254 return ptrd;
255 }
static std::map< double, LArWheelSliceSolid * > solid
CxxUtils::LockedPointer< AGDDController > LockedController
virtual const GeoMaterial * getMaterial(const std::string &name)=0
IAGDDtoGeoSvc::LockedController Get_Controller()
sTGCDetectorDescription * Get_sTGCDetectorSubType(const std::string &type)