98{
99 Int_t CgemLineColor = 15;
100 Int_t CgemFillColor = 18;
101 Int_t CgemFillStyle = 1001;
102 Int_t CgemLayerStyle = 3003;
103 Int_t CgemElectrodeColor = 12;
104 Int_t CgemFoilColor = 12;
106
107 TGeoVolume* CgemVol;
108 TGeoTube* CgemTube;
109 TString name;
110 Double_t center[3] = {0.0, 0.0, 0.0};
112
113
114 TGeoTube* CgemShape = (TGeoTube*)
GetVolumeCgem()->GetShape();
115 m_CgemXY =
new BesCircle2D(
"CGEM",
"CGEM", CgemShape->GetRmin(), CgemShape->GetRmax(), ¢er[0]);
117 m_CgemXY->SetFillColor(CgemFillColor);
118 m_CgemXY->SetFillStyle(CgemFillStyle);
119 m_CgemXY->SetLineColor(CgemLineColor);
120
121 for (int layer = 0; layer < m_kCgemLayer; ++layer)
122 {
124 CgemTube = (TGeoTube*)CgemVol->GetShape();
125 name = "CGEM Layer";
126 name += layer;
127 name += " Anode";
128 center[2] = CgemTube->GetDz();
129 m_CgemAnodeXY[layer] =
new BesCircle2D(name, name, CgemTube->GetRmin(), CgemTube->GetRmax(), center);
131 m_CgemAnodeXY[layer]->SetFillStyle(CgemLayerStyle);
132 m_CgemAnodeXY[layer]->SetLineColor(CgemElectrodeColor);
133 m_CgemAnodeXY[layer]->SetFillColor(CgemElectrodeColor);
134
136 CgemTube = (TGeoTube*)CgemVol->GetShape();
137 name = "CGEM Layer";
138 name += layer;
139 name += " Cathode";
140 center[2] = CgemTube->GetDz();
141 m_CgemCathodeXY[layer] =
new BesCircle2D(name, name, CgemTube->GetRmin(), CgemTube->GetRmax(), center);
143 m_CgemCathodeXY[layer]->SetFillStyle(CgemLayerStyle);
144 m_CgemCathodeXY[layer]->SetLineColor(CgemElectrodeColor);
145 m_CgemCathodeXY[layer]->SetFillColor(CgemElectrodeColor);
146
147 for (int foil = 0; foil < m_kCgemFoil; ++foil)
148 {
150 CgemTube = (TGeoTube*)CgemVol->GetShape();
151 name = "CGEM Layer";
152 name += layer;
153 name += " Foil";
154 name += foil;
155 center[2] = CgemTube->GetDz();
156 m_CgemFoilXY[layer][foil] =
new BesCircle2D(name, name, CgemTube->GetRmin(), CgemTube->GetRmax(), center);
158 m_CgemFoilXY[layer][foil]->SetFillStyle(CgemLayerStyle);
159 m_CgemFoilXY[layer][foil]->SetLineColor(CgemFoilColor);
160 m_CgemFoilXY[layer][foil]->SetFillColor(CgemFoilColor);
161 }
162 }
163
164
165 for (int j = 0; j < 2; ++j)
166 {
167 P[0] =
P[3] =
P[6] =
P[9] = 0;
168 P[1] =
P[10] = CgemShape->GetRmin() * (1 - 2 * j);
169 P[2] =
P[5] = -CgemShape->GetDz();
170 P[4] =
P[7] = CgemShape->GetRmax() * (1 - 2 * j);
171 P[8] =
P[11] = CgemShape->GetDz();
172
173 name = "CgemZR ";
174 if (j == 0) name += "Up";
175 else name += "Down";
177 m_CgemZR[j]->SetFillColor(CgemFillColor);
178 m_CgemZR[j]->SetFillStyle(CgemFillStyle);
179 m_CgemZR[j]->SetLineColor(CgemLineColor);
181 }
182
183 for (int layer = 0; layer < m_kCgemLayer; ++layer)
184 {
185 for (int j = 0; j < 2; ++j)
186 {
188 CgemTube = (TGeoTube*)CgemVol->GetShape();
189 name = "CgemZR Layer";
190 name += layer;
191 if (j == 0) name += " Anode Up";
192 else name += " Anode Down";
193
194 P[0] =
P[3] =
P[6] =
P[9] = 0;
195 P[1] =
P[10] = CgemTube->GetRmin() * (1 - 2 * j);
196 P[2] =
P[5] = -CgemTube->GetDz();
197 P[4] =
P[7] = CgemTube->GetRmax() * (1 - 2 * j);
198 P[8] =
P[11] = CgemTube->GetDz();
199
200 m_CgemAnodeZR[layer][j] =
new BesPolygon2D(name, name, 4,
P);
201 m_CgemAnodeZR[layer][j]->SetFillStyle(CgemLayerStyle);
202 m_CgemAnodeZR[layer][j]->SetLineColor(CgemElectrodeColor);
203 m_CgemAnodeZR[layer][j]->SetFillColor(CgemElectrodeColor);
205
207 CgemTube = (TGeoTube*)CgemVol->GetShape();
208 name = "CgemZR Layer";
209 name += layer;
210 if (j == 0) name += " Cathode Up";
211 else name += " Cathode Down";
212
213 P[0] =
P[3] =
P[6] =
P[9] = 0;
214 P[1] =
P[10] = CgemTube->GetRmin() * (1 - 2 * j);
215 P[2] =
P[5] = -CgemTube->GetDz();
216 P[4] =
P[7] = CgemTube->GetRmax() * (1 - 2 * j);
217 P[8] =
P[11] = CgemTube->GetDz();
218
219 m_CgemCathodeZR[layer][j] =
new BesPolygon2D(name, name, 4,
P);
220 m_CgemCathodeZR[layer][j]->SetFillStyle(CgemLayerStyle);
221 m_CgemCathodeZR[layer][j]->SetLineColor(CgemElectrodeColor);
222 m_CgemCathodeZR[layer][j]->SetFillColor(CgemElectrodeColor);
224
225 for (int foil = 0; foil < m_kCgemFoil; ++foil)
226 {
228 CgemTube = (TGeoTube*)CgemVol->GetShape();
229 name = "CgemZR Layer";
230 name += layer;
231 name += " Foil";
232 name += foil;
233 if (j == 0) name += " Up";
234 else name += " Down";
235
236 P[0] =
P[3] =
P[6] =
P[9] = 0;
237 P[1] =
P[10] = CgemTube->GetRmin() * (1 - 2 * j);
238 P[2] =
P[5] = -CgemTube->GetDz();
239 P[4] =
P[7] = CgemTube->GetRmax() * (1 - 2 * j);
240 P[8] =
P[11] = CgemTube->GetDz();
241
242 m_CgemFoilZR[layer][foil][j] =
new BesPolygon2D(name, name, 4,
P);
243 m_CgemFoilZR[layer][foil][j]->SetFillStyle(CgemLayerStyle);
244 m_CgemFoilZR[layer][foil][j]->SetLineColor(CgemFoilColor);
245 m_CgemFoilZR[layer][foil][j]->SetFillColor(CgemFoilColor);
247 }
248 }
249 }
250
251
252 CgemGeomSvc cgs(
"CgemGeomSvc", Gaudi::svcLocator());
253 cgs.initGeom();
256
257 for (int layer = 0; layer < 3; ++layer)
258 {
259 for (int sheet = 0; sheet < 2; ++sheet)
260 {
261
262 if (layer == 0 && sheet == 1) continue;
263 plane = cgs.getReadoutPlane(layer, sheet);
264 geolayer = cgs.getCgemLayer(layer);
265
266 cout << "layer" << layer << " sheet" << sheet << " " << plane << endl;
267 cout <<
"\tRX:" << plane->
getRX() << endl;
268 cout <<
"\tRV:" << plane->
getRV() << endl;
269 cout <<
"\tXmin:" << plane->
getXmin() << endl;
270 cout <<
"\tWidth:" << plane->
getWidth() << endl;
271 cout <<
"\tZmin:" << plane->
getZmin() << endl;
272 cout <<
"\tLength:" << plane->
getLength() << endl;
273 cout <<
"\tXPitch:" << plane->
getXPitch() << endl;
274 cout <<
"\tVPitch:" << plane->
getVPitch() << endl;
276 cout <<
"\tMid R at Gap:" << plane->
getMidRAtGap() << endl;
277 cout <<
"\tVmax:" << plane->
getVmax() << endl;
278 cout <<
"\tX-strip number:" << plane->
getNXstrips() << endl;
279 cout <<
"\tV-strip number:" << plane->
getNVstrips() << endl;
282
283
284
286 P[2] =
P[5] =
P[8] =
P[11] = 0;
287
291
292
293
294
295
296
297
298
299
300
301
302
303
304 name = "CGEM Layer";
305 name += layer;
306 name += " Sheet";
307 name += sheet;
308 m_CgemSheet[layer][sheet] =
new BesPolygon2D(name, name, 4,
P);
309 m_CgemSheet[layer][sheet]->SetFillColor(CgemFillColor);
310 m_CgemSheet[layer][sheet]->SetFillStyle(CgemFillStyle);
311 m_CgemSheet[layer][sheet]->SetLineColor(CgemLineColor);
312
313
314
315 double r, wid, len, phi, xmin, zmin, ang, pit, thick, size,
v, ruf;
317
318
320 NXStrip[layer][sheet] =
n;
322 XStripPhi[layer][sheet] =
new Double_t[
n];
327 thick = 0.1;
329 SheetWidth[layer][sheet] = wid;
330 RX[layer][sheet] = r;
331 ZMin[layer][sheet] = zmin;
332
333 for (
int strip = 0; strip <
n; ++strip)
334 {
335 name = "CGEM X-Strip Layer";
336 name += layer;
337 name += " Sheet";
338 name += sheet;
339 name += " Strip";
340 name += strip;
342 XStripPhi[layer][sheet][strip] = phi;
343 m_CgemXStrip[layer][sheet][strip] =
new Cgem2DXStrip(name, name,
344 len, wid, phi, zmin, r, size, thick, layer, sheet, strip, ruf);
345 }
346
349
350
352 NVStrip[layer][sheet] =
n;
354 VStripV[layer][sheet] =
new Double_t[
n];
361 thick = 0.1;
363 RV[layer][sheet] = r;
364 SheetLength[layer][sheet] = len;
365 StereoAngle[layer][sheet] = ang;
366
368 xmin = XMin[layer][sheet];
369 VPitch[layer][sheet] = pit;
370 XPitch[layer][sheet] = plane->
getXPitch();
371
372 for (
int strip = 0; strip <
n; ++strip)
373 {
374 name = "CGEM V-Strip Layer";
375 name += layer;
376 name += " Sheet";
377 name += sheet;
378 name += " Strip";
379 name += strip;
380
382 VStripV[layer][sheet][strip] =
v;
383 m_CgemVStrip[layer][sheet][strip] =
new Cgem2DVStrip(name, name,
v,
384 r, len, wid, ang, xmin, zmin, pit, size, thick, layer, sheet, strip, ruf);
385 }
386 }
387 }
388}
virtual void SetNSegment(Int_t np)
void SetRotatable(Bool_t input)
double getWidthOfStripV() const
double getWidthOfStripX() const
double getCentralVFromVID(int V_ID) const
double getPhiFromXID(int X_ID) const
TGeoNode * GetCgemAnode(int layer)
TGeoNode * GetCgemCathode(int layer)
TGeoVolume * GetVolumeCgem() const
TGeoNode * GetCgemFoil(int layer, int foil)