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;
110 Double_t center[3] = {0.0, 0.0, 0.0};
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);
121 for (
int layer = 0; layer < m_kCgemLayer; ++layer)
124 CgemTube = (TGeoTube*)CgemVol->GetShape();
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);
136 CgemTube = (TGeoTube*)CgemVol->GetShape();
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);
147 for (
int foil = 0; foil < m_kCgemFoil; ++foil)
150 CgemTube = (TGeoTube*)CgemVol->GetShape();
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);
165 for (
int j = 0; j < 2; ++j)
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();
174 if (j == 0) name +=
"Up";
177 m_CgemZR[j]->SetFillColor(CgemFillColor);
178 m_CgemZR[j]->SetFillStyle(CgemFillStyle);
179 m_CgemZR[j]->SetLineColor(CgemLineColor);
183 for (
int layer = 0; layer < m_kCgemLayer; ++layer)
185 for (
int j = 0; j < 2; ++j)
188 CgemTube = (TGeoTube*)CgemVol->GetShape();
189 name =
"CgemZR Layer";
191 if (j == 0) name +=
" Anode Up";
192 else name +=
" Anode Down";
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();
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);
207 CgemTube = (TGeoTube*)CgemVol->GetShape();
208 name =
"CgemZR Layer";
210 if (j == 0) name +=
" Cathode Up";
211 else name +=
" Cathode Down";
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();
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);
225 for (
int foil = 0; foil < m_kCgemFoil; ++foil)
228 CgemTube = (TGeoTube*)CgemVol->GetShape();
229 name =
"CgemZR Layer";
233 if (j == 0) name +=
" Up";
234 else name +=
" Down";
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();
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);
252 CgemGeomSvc cgs(
"CgemGeomSvc", Gaudi::svcLocator());
258 for (
int layer = 0; layer < 3; ++layer)
260 for (
int sheet = 0; sheet < 2; ++sheet)
263 if (layer == 0 && sheet == 1)
continue;
267 cout <<
"layer" << layer <<
" sheet" << sheet <<
" " << plane << endl;
268 cout <<
"\tRX:" << plane->
getRX() << endl;
269 cout <<
"\tRV:" << plane->
getRV() << endl;
270 cout <<
"\tXmin:" << plane->
getXmin() << endl;
271 cout <<
"\tWidth:" << plane->
getWidth() << endl;
272 cout <<
"\tZmin:" << plane->
getZmin() << endl;
273 cout <<
"\tLength:" << plane->
getLength() << endl;
274 cout <<
"\tXPitch:" << plane->
getXPitch() << endl;
275 cout <<
"\tVPitch:" << plane->
getVPitch() << endl;
277 cout <<
"\tMid R at Gap:" << plane->
getMidRAtGap() << endl;
278 cout <<
"\tVmax:" << plane->
getVmax() << endl;
279 cout <<
"\tX-strip number:" << plane->
getNXstrips() << endl;
280 cout <<
"\tV-strip number:" << plane->
getNVstrips() << endl;
287 P[2] =
P[5] =
P[8] =
P[11] = 0;
309 m_CgemSheet[layer][sheet] =
new BesPolygon2D(name, name, 4,
P);
310 m_CgemSheet[layer][sheet]->SetFillColor(CgemFillColor);
311 m_CgemSheet[layer][sheet]->SetFillStyle(CgemFillStyle);
312 m_CgemSheet[layer][sheet]->SetLineColor(CgemLineColor);
316 double r, wid, len, phi, xmin, zmin, ang, pit, thick, size,
v, ruf;
321 NXStrip[layer][sheet] =
n;
323 XStripPhi[layer][sheet] =
new Double_t[
n];
330 SheetWidth[layer][sheet] = wid;
331 RX[layer][sheet] = r;
332 ZMin[layer][sheet] = zmin;
334 for (
int strip = 0; strip <
n; ++strip)
336 name =
"CGEM X-Strip Layer";
343 XStripPhi[layer][sheet][strip] = phi;
344 m_CgemXStrip[layer][sheet][strip] =
new Cgem2DXStrip(name, name,
345 len, wid, phi, zmin, r, size, thick, layer, sheet, strip, ruf);
353 NVStrip[layer][sheet] =
n;
355 VStripV[layer][sheet] =
new Double_t[
n];
364 RV[layer][sheet] = r;
365 SheetLength[layer][sheet] = len;
366 StereoAngle[layer][sheet] = ang;
369 xmin = XMin[layer][sheet];
370 VPitch[layer][sheet] = pit;
371 XPitch[layer][sheet] = plane->
getXPitch();
373 for (
int strip = 0; strip <
n; ++strip)
375 name =
"CGEM V-Strip Layer";
383 VStripV[layer][sheet][strip] =
v;
384 m_CgemVStrip[layer][sheet][strip] =
new Cgem2DVStrip(name, name,
v,
385 r, len, wid, ang, xmin, zmin, pit, size, thick, layer, sheet, strip, ruf);
598 TString opt = option;
601 if (!
m_2DGeoInit) cout <<
"CgemROOTGeo::Draw(), Geometry not initialized!" << endl;
603 if (!view) cout <<
"CgemROOTGeo::Draw(), BesView not found" << endl;
607 if (opt.Contains(
"XY")) m_CgemXY->
Draw(
"");
608 if (opt.Contains(
"ZR"))
610 m_CgemZR[0]->
Draw(
"");
611 m_CgemZR[1]->
Draw(
"");
616 if (opt.Contains(
"XY"))
618 for (
int layer = 0; layer < m_kCgemLayer; ++layer)
620 m_CgemAnodeXY[layer]->
Draw(
"");
621 m_CgemCathodeXY[layer]->
Draw(
"");
622 for (
int foil = 0; foil < m_kCgemFoil; ++foil)
623 m_CgemFoilXY[layer][foil]->
Draw(
"");
627 if (opt.Contains(
"ZR"))
629 for (
int layer = 0; layer < m_kCgemLayer; ++layer)
631 m_CgemAnodeZR[layer][0]->
Draw(
"");
632 m_CgemAnodeZR[layer][1]->
Draw(
"");
633 m_CgemCathodeZR[layer][0]->
Draw(
"");
634 m_CgemCathodeZR[layer][1]->
Draw(
"");
635 for (
int foil = 0; foil < m_kCgemFoil; ++foil)
637 m_CgemFoilZR[layer][foil][0]->
Draw(
"");
638 m_CgemFoilZR[layer][foil][1]->
Draw(
"");
644 if (opt.Contains(
"ZR"))
648 for (
int layer = 0; layer < m_kCgemLayer; ++layer)
650 for (
int sheet = 0; sheet < 2; ++sheet)
652 if (layer == 0 && sheet == 1)
continue;
653 for (
int strip = 0; strip < NXStrip[layer][sheet]; ++strip)
655 m_CgemXStrip[layer][sheet][strip]->
SetFired(
false);
656 m_CgemXStrip[layer][sheet][strip]->
Draw(opt);
663 for (
int layer = 0; layer < m_kCgemLayer; ++layer)
665 for (
int sheet = 0; sheet < 2; ++sheet)
667 if (layer == 0 && sheet == 1)
continue;
668 for (
int strip = 0; strip < NVStrip[layer][sheet]; ++strip)
670 m_CgemVStrip[layer][sheet][strip]->
SetFired(
false);
671 m_CgemVStrip[layer][sheet][strip]->
Draw(opt);
681 for (
int layer = 0; layer < m_kCgemLayer; ++layer)
683 for (
int sheet = 0; sheet < 2; ++sheet)
685 if (layer == 0 && sheet == 1)
continue;
686 for (
int strip = 0; strip < NVStrip[layer][sheet]; ++strip)
688 m_CgemVStrip[layer][sheet][strip]->
SetFired(
false);
689 m_CgemVStrip[layer][sheet][strip]->
Draw(opt);
696 for (
int layer = 0; layer < m_kCgemLayer; ++layer)
698 for (
int sheet = 0; sheet < 2; ++sheet)
700 if (layer == 0 && sheet == 1)
continue;
701 for (
int strip = 0; strip < NXStrip[layer][sheet]; ++strip)
703 m_CgemXStrip[layer][sheet][strip]->
SetFired(
false);
704 m_CgemXStrip[layer][sheet][strip]->
Draw(opt);
805 if (!view) cout <<
"CgemROOTGeo::Draw3DHits(), BesView not found" << endl;
813 if (m_CgemDigiCol) NDigiCol = m_CgemDigiCol->GetEntries();
817 for (
int i = 0; i < NDigiCol; ++i)
825 TPolyLine3D* pStrip = 0;
833 double phi = XStripPhi[layer][sheet][strip];
834 double r = RX[layer][sheet];
835 double zmin = ZMin[layer][sheet];
836 P[0] =
P[3] = TMath::Cos(phi) * r;
837 P[1] =
P[4] = TMath::Sin(phi) * r;
841 pStrip =
new TPolyLine3D(2,
P);
842 pStrip->SetBit(kCanDelete);
843 pStrip->SetLineWidth(4);
844 pStrip->SetLineColor(m_XstripColor);
845 pStrip->Draw(option);
853 double r = RV[layer][sheet];
854 double len = SheetLength[layer][sheet];
855 double wid = SheetWidth[layer][sheet];
856 double ang = StereoAngle[layer][sheet];
857 double xmin = XMin[layer][sheet];
858 double zmin = ZMin[layer][sheet];
859 double pit = VPitch[layer][sheet];
865 pStrip =
new TPolyLine3D(N);
866 pStrip->SetBit(kCanDelete);
867 pStrip->SetLineWidth(3);
868 pStrip->SetLineColor(m_VstripColor);
870 double tphi = 0, tz = 0;
871 for (
int i = 0; i < N; ++i)
874 double v = VStripV[layer][sheet][strip];
876 double x = r * TMath::Cos(tphi);
877 double y = r * TMath::Sin(tphi);
879 pStrip->SetPoint(i,
x, y, z);
882 pStrip->Draw(option);