Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GlueX_boundaries.C
Go to the documentation of this file.
1 //-----------------------------------------------------------------
2 // This macro is to be included and called from an external file
3 // to draw the various GlueX detectors on a TH2D. Call this
4 // macro with:
5 //
6 // DrawGlueXBoundaries([full_detector=false], [fill_in=false],
7 // [clip_TOF=1000], [color=-1 (multi-colored]);
8 // full_detector: boolean which toggles drawing the detectors
9 // above or both above and below the beamline.
10 // fill_in: boolean which toggles between drawing outlines
11 // or filled shapes
12 // clip_TOF: double which will reduce the size of the TOF
13 // detector in the r-direction
14 // color: Int_t which will draw all detectors with the
15 // specified color
16 //
17 // A minimal example of an macro calling GlueX_boundaries:
18 //-----------------------------------------------------------------
19 //#include "GlueX_boundaries.C"
20 #include <TH2D.h>
21 #include <TCanvas.h>
22 #include <TROOT.h>
23 #include <TFile.h>
24 
25 #if 0
26 void boundaries_plot()
27 {
28  TColor::CreateColorWheel();
29 
30  TCanvas *c1 = new TCanvas("boundaries canvas");
31  c1->SetTicks();
32 
33  Int_t zmin = -100;
34  Int_t zmax=700, rmax=200;
35  TH2D *boundaries = new TH2D("boundaries", "The GlueX Detectors",
36  zmax-zmin, zmin, zmax, rmax*2, -rmax, rmax);
37  boundaries->SetStats(0);
38  boundaries->SetXTitle("Z (cm)");
39  boundaries->SetYTitle("R (cm)");
40 
41  boundaries->Draw();
42  DrawGlueXBoundaries(true, true);
43 }
44 #endif
45 //-----------------------------------------------------------------
46 
47 #include <TBox.h>
48 #include <TLatex.h>
49 #include <TPolyLine.h>
50 
51 Int_t full=false; // used to toggle between drawing full detector or only above the beamline
52 Int_t fill_detectors=false; // used to toggle outlined or full color detectors
53 Int_t target_color = kBlack;
54 Int_t start_counter_color = kGreen+3;
55 Int_t FDC_color = kBlue;
56 Int_t CDC_color = kPink+6;
57 Int_t TOF_color = kGreen+2;
58 Int_t BCAL_color = kOrange+1;
59 Int_t FCAL_color = kOrange+2;
60 Int_t Magnet_color = kBlack;
61 
62 void DrawPoly(int N, double *z, double *r, int color);
63 
64 //--------------------------
65 // DrawTargetBoundaries
66 //--------------------------
67 void DrawTargetBoundaries(int color=target_color)
68 {
69  double Zlo = 50.0;
70  double Zhi = Zlo + 30.0;
71  double Rlo = 0.0;
72  double Rhi = Rlo + 1.5;
73  if (full) { Rlo=-1.5; Rhi=Rlo+3; }
74 
75  TBox *box = new TBox(Zlo, Rlo, Zhi, Rhi);
76  box->SetLineWidth(2.0);
77  if (fill_detectors) { box->SetFillColor(color); box->SetFillStyle(1001); }
78  else box->SetFillStyle(0);
79  box->SetLineColor(color);
80  box->Draw();
81 
82  TLatex *lab = new TLatex(Zlo-5, 0, "target");
83  if (full) lab->SetTextAlign(32); else lab->SetTextAlign(31);
84  lab->SetTextSize(0.02);
85  lab->SetTextColor(color);
86  lab->Draw();
87 }
88 
89 //--------------------------
90 // DrawStartCounterBoundaries
91 //--------------------------
92 void DrawStartCounterBoundaries(int color=start_counter_color)
93 {
94  // Values from Richard's old spreadsheet "start_geom.xls"
95  const int Npoints = 15;
96  double r_hi[] = {8.675, 8.675, 8.675, 7.759, 7.354, 4.353, 3.134,
97  2.290, 1.915, 5.593, 5.893, 6.907, 6.951, 6.951, 8.675};
98  double r_lo[Npoints];
99  for (Int_t i=0; i<Npoints; i++) r_lo[i] = -r_hi[i];
100 
101  double z[] = { 0.0, 51.383, 51.726, 53.938, 54.914, 57.915, 59.134,
102  58.442, 58.290, 54.360, 54.238, 51.531, 51.488, 0.0, 0.0};
103 
104  // shift z to proper location in lab system
105  for(int i=0; i<Npoints; i++)z[i] += 38.75;
106 
107  TPolyLine *pol = new TPolyLine(Npoints, z, r_hi);
108  pol->SetLineWidth(2.0);
109  if (fill_detectors) { pol->SetFillColor(color); pol->SetFillStyle(1001); }
110  else pol->SetFillStyle(0);
111  pol->SetLineColor(color);
112  pol->Draw();
113 
114  TLatex *lab = new TLatex(z[6]+(z[6]-z[0])*0.1, 0, "start counter");
115  if (full) lab->SetTextAlign(12); else lab->SetTextAlign(11);
116  lab->SetTextSize(0.02);
117  lab->SetTextColor(color);
118  lab->Draw();
119 
120  if (full) {
121  pol = new TPolyLine(Npoints, z, r_lo);
122  pol->SetLineWidth(2.0);
123  if (fill_detectors) { pol->SetFillColor(color); pol->SetFillStyle(1001); }
124  else pol->SetFillStyle(0);
125  pol->SetLineColor(color);
126  pol->Draw();
127  }
128 }
129 
130 //--------------------------
131 // DrawFDCBoundaries
132 //--------------------------
133 void DrawFDCBoundaries(int color=FDC_color)
134 {
135  double Rlo = 2.0, Rhi=48.5;
136 
137  double Zlo[7], Zhi[7];
138 
139  Zlo[0] = 176.1586;
140  Zhi[0] = 187.1614;
141 
142  Zlo[1] = 233.7186;
143  Zhi[1] = 244.7214;
144 
145  Zlo[2] = 291.2786;
146  Zhi[2] = 302.2814;
147 
148  Zlo[3] = 348.8386;
149  Zhi[3] = 359.8414;
150 
151  for(int sl=0; sl<4; sl++){
152 
153  TBox *box_hi = new TBox(Zlo[sl], Rlo, Zhi[sl], Rhi);
154  box_hi->SetLineWidth(2.0);
155  if (fill_detectors) { box_hi->SetFillColor(color); box_hi->SetFillStyle(1001); }
156  else box_hi->SetFillStyle(0);
157  box_hi->SetLineColor(color);
158  box_hi->Draw();
159 
160  TLatex *lab_hi = new TLatex((Zlo[sl]+Zhi[sl])/2.0+2.0, Rhi+1, "FDC");
161  lab_hi->SetTextAlign(21);
162  lab_hi->SetTextSize(0.025);
163  lab_hi->SetTextColor(color);
164  lab_hi->Draw();
165 
166  if (full) {
167  TBox *box_lo = new TBox(Zlo[sl], -Rlo, Zhi[sl], -Rhi);
168  box_lo->SetLineWidth(2.0);
169  if (fill_detectors) { box_lo->SetFillColor(color); box_lo->SetFillStyle(1001); }
170  else box_lo->SetFillStyle(0);
171  box_lo->SetLineColor(color);
172  box_lo->Draw();
173  }
174  }
175 }
176 
177 //--------------------------
178 // DrawCDCBoundaries
179 //--------------------------
180 void DrawCDCBoundaries(int color=CDC_color)
181 {
182  double Zlo=17.0, Zhi=Zlo+150.0;
183  double Rlo[7], Rhi[7];
184 
185  Rlo[0] = 10.7219;
186  Rhi[0] = 15.1621;
187 
188  Rlo[1] = 16.9321;
189  Rhi[1] = sqrt(pow(21.8912,2.0) + pow(0.860106,2.0));
190 
191  Rlo[2] = 23.8544;
192  Rhi[2] = sqrt(pow(28.5658,2.0) + pow(0.846871,2.0));
193 
194  Rlo[3] = 31.3799;
195  Rhi[3] = 35.8301;
196 
197  Rlo[4] = 37.4446;
198  Rhi[4] = sqrt(pow(41.9225,2.0) + pow(0.833676,2.0));
199 
200  Rlo[5] = 43.6152;
201  Rhi[5] = sqrt(pow(48.0733,2.0) + pow(0.829899,2.0));
202 
203  Rlo[6] = 50.3747;
204  Rhi[6] = 54.7617;
205 
206  TBox *box_hi = new TBox(Zlo, Rlo[0], Zhi, Rhi[6]);
207  box_hi->SetLineWidth(2.0);
208  if (fill_detectors) { box_hi->SetFillColor(color); box_hi->SetFillStyle(1001); }
209  else box_hi->SetFillStyle(0);
210  box_hi->SetLineColor(color);
211  box_hi->Draw();
212 
213  TLatex *lab_hi = new TLatex(Zlo+5, Rhi[6]-1, "CDC");
214  lab_hi->SetTextAlign(13);
215  lab_hi->SetTextSize(0.03);
216  if (fill_detectors) lab_hi->SetTextColor(kWhite); else lab_hi->SetTextColor(color);
217  lab_hi->Draw();
218 
219  if (full) {
220  TBox *box_lo = new TBox(Zlo, -Rlo[0], Zhi, -Rhi[6]);
221  box_lo->SetLineWidth(2.0);
222  if (fill_detectors) { box_lo->SetFillColor(color); box_lo->SetFillStyle(1001); }
223  else box_lo->SetFillStyle(0);
224  box_lo->SetLineColor(color);
225  box_lo->Draw();
226 
227  TLatex *lab_lo = new TLatex(Zlo+5, -Rlo[0]-1, "CDC");
228  lab_lo->SetTextAlign(13);
229  lab_lo->SetTextSize(0.03);
230  if (fill_detectors) lab_lo->SetTextColor(kWhite); else lab_lo->SetTextColor(color);
231  lab_lo->Draw();
232  }
233 }
234 
235 //--------------------------
236 // DrawTOFBoundaries
237 //--------------------------
238 void DrawTOFBoundaries(int color=TOF_color, double clip_tof=1000.0)
239 {
240  double Zlo = 616.25;
241  double Zhi = Zlo + 2.0*2.54;
242  double Rlo = 3.0;
243  double Rhi = 252.0/2.0;
244 
245  // Clip TOF at top of histogram area
246  if(Rhi>clip_tof)Rhi = clip_tof;
247 
248  TBox *box_hi = new TBox(Zlo, Rlo, Zhi, Rhi);
249  box_hi->SetLineWidth(2.0);
250  if (fill_detectors) { box_hi->SetFillColor(color); box_hi->SetFillStyle(1001); }
251  else box_hi->SetFillStyle(0);
252  box_hi->SetLineColor(color);
253  box_hi->Draw();
254 
255  TLatex *lab_hi = new TLatex(Zlo-5, Rhi-1, "TOF");
256  lab_hi->SetTextAlign(31);
257  lab_hi->SetTextSize(0.03);
258  lab_hi->SetTextAngle(90.0);
259  lab_hi->SetTextColor(color);
260  lab_hi->Draw();
261 
262  if (full) {
263  TBox *box_lo = new TBox(Zlo, -Rlo, Zhi, -Rhi);
264  box_lo->SetLineWidth(2.0);
265  box_lo->SetLineColor(color);
266  if (fill_detectors) { box_lo->SetFillColor(color); box_lo->SetFillStyle(1001);}
267  else box_lo->SetFillStyle(0);
268  box_lo->Draw();
269  }
270 }
271 
272 //--------------------------
273 // DrawBCALBoundaries
274 //--------------------------
275 void DrawBCALBoundaries(int color=BCAL_color)
276 {
277  double Zlo = 17.0;
278  double Zhi = Zlo + 390.0;
279  double Rlo = 64.2; // includes aluminum plate
280  double Rhi = 90.0;
281 
282  TBox *box_hi = new TBox(Zlo, Rlo, Zhi, Rhi);
283  box_hi->SetLineWidth(2.0);
284  if (fill_detectors) { box_hi->SetFillColor(color); box_hi->SetFillStyle(1001); }
285  else box_hi->SetFillStyle(0);
286  box_hi->SetLineColor(color);
287  box_hi->Draw();
288 
289  TLatex *lab_hi = new TLatex(Zlo+5, Rhi-1, "BCAL");
290  lab_hi->SetTextAlign(13);
291  lab_hi->SetTextSize(0.03);
292  if (fill_detectors) lab_hi->SetTextColor(kWhite); else lab_hi->SetTextColor(color);
293  lab_hi->Draw();
294 
295  if (full) {
296  TBox *box_lo = new TBox(Zlo, -Rlo, Zhi, -Rhi);
297  box_lo->SetLineWidth(2.0);
298  if (fill_detectors) { box_lo->SetFillColor(color); box_lo->SetFillStyle(1001); }
299  else box_lo->SetFillStyle(0);
300  box_lo->SetLineColor(color);
301  box_lo->Draw();
302 
303  TLatex *lab_lo = new TLatex(Zlo+5, -Rlo-1, "BCAL");
304  lab_lo->SetTextAlign(13);
305  lab_lo->SetTextSize(0.03);
306  if (fill_detectors) lab_lo->SetTextColor(kWhite); else lab_lo->SetTextColor(color);
307  lab_lo->Draw();
308  }
309 }
310 
311 //--------------------------
312 // DrawBCALBoundaries
313 //--------------------------
314 void DrawFCALBoundaries(int color=FCAL_color)
315 {
316  double Zlo = 622.8;
317  double Zhi = Zlo + 45.;
318  double Rlo = 6.0;
319  double Rhi = 106.;
320 
321  TBox *box_hi = new TBox(Zlo, Rlo, Zhi, Rhi);
322  box_hi->SetLineWidth(2.0);
323  if (fill_detectors) { box_hi->SetFillColor(color); box_hi->SetFillStyle(1001); }
324  else box_hi->SetFillStyle(0);
325  box_hi->SetLineColor(color);
326  box_hi->Draw();
327 
328  TLatex *lab_hi = new TLatex(Zlo, Rhi-1, "FCAL");
329  lab_hi->SetTextAlign(13);
330  lab_hi->SetTextSize(0.025);
331  if (fill_detectors) lab_hi->SetTextColor(kWhite); else lab_hi->SetTextColor(color);
332  lab_hi->Draw();
333 
334  if (full) {
335  TBox *box_lo = new TBox(Zlo, -Rlo, Zhi, -Rhi);
336  box_lo->SetLineWidth(2.0);
337  box_lo->SetLineColor(color);
338  if (fill_detectors) { box_lo->SetFillColor(color); box_lo->SetFillStyle(1001); }
339  else box_lo->SetFillStyle(0);
340  box_lo->Draw();
341  }
342 }
343 
344 //--------------------------
345 // DrawMagnet
346 //--------------------------
347 void DrawMagnet(int yoke_color=Magnet_color, int coil_color=Magnet_color)
348 {
349  // Yoke
350  int N = 0;
351  double z[50], r[50];
352  z[N] = 0.000; r[N++] = 89.540;
353  z[N] = 0.000; r[N++] = 147.320;
354  z[N] = 53.820; r[N++] = 147.320;
355  z[N] = 53.820; r[N++] = 150.500;
356  z[N] = 56.200; r[N++] = 150.500;
357  z[N] = 56.200; r[N++] = 154.940;
358  z[N] = 60.960; r[N++] = 154.940;
359  z[N] = 60.960; r[N++] = 147.320;
360  z[N] = 187.800; r[N++] = 147.320;
361  z[N] = 187.800; r[N++] = 150.500;
362  z[N] = 190.180; r[N++] = 150.500;
363  z[N] = 190.180; r[N++] = 154.940;
364  z[N] = 194.950; r[N++] = 154.940;
365  z[N] = 194.950; r[N++] = 147.320;
366  z[N] = 264.000; r[N++] = 147.320;
367  z[N] = 264.000; r[N++] = 150.500;
368  z[N] = 266.380; r[N++] = 150.500;
369  z[N] = 266.380; r[N++] = 154.940;
370  z[N] = 271.150; r[N++] = 154.940;
371  z[N] = 271.150; r[N++] = 147.320;
372  z[N] = 340.200; r[N++] = 147.320;
373  z[N] = 340.200; r[N++] = 150.500;
374  z[N] = 342.580; r[N++] = 150.500;
375  z[N] = 342.580; r[N++] = 154.940;
376  z[N] = 347.350; r[N++] = 154.940;
377  z[N] = 347.350; r[N++] = 147.320;
378  z[N] = 354.970; r[N++] = 147.320;
379  z[N] = 354.970; r[N++] = 92.710;
380  z[N] = 428.630; r[N++] = 92.710;
381  z[N] = 428.630; r[N++] = 187.960;
382  z[N] = -50.800; r[N++] = 187.960;
383  z[N] = -50.800; r[N++] = 89.540;
384  z[N] = 0.000; r[N++] = 89.540;
385  DrawPoly(N, z, r, yoke_color);
386 
387  // Baffles
388  N = 0;
389  z[N] = 76.200; r[N++] = 147.320;
390  z[N] = 76.200; r[N++] = 92.710;
391  z[N] = 84.460; r[N++] = 92.710;
392  z[N] = 84.460; r[N++] = 147.320;
393  z[N] = 76.200; r[N++] = 147.320;
394  DrawPoly(N, z, r, yoke_color);
395 
396  N = 0;
397  z[N] = 202.570; r[N++] = 147.320;
398  z[N] = 202.570; r[N++] = 92.710;
399  z[N] = 210.190; r[N++] = 92.710;
400  z[N] = 210.190; r[N++] = 147.320;
401  z[N] = 202.570; r[N++] = 147.320;
402  DrawPoly(N, z, r, yoke_color);
403 
404  // Coils
405  //&reg mat=1, cur= 432000.0; ; Coil 1A
406  N = 0;
407  z[N] = 92.853; r[N++] = 101.881;
408  z[N] = 104.548; r[N++] = 101.881;
409  z[N] = 104.548; r[N++] = 116.952;
410  z[N] = 92.853; r[N++] = 116.952;
411  z[N] = 92.853; r[N++] = 101.881;
412  DrawPoly(N, z, r, coil_color);
413 
414  //&reg mat=1, cur= 414000.0; ; Coil 1B
415  N = 0;
416  z[N] = 104.548; r[N++] = 101.881;
417  z[N] = 116.511; r[N++] = 101.881;
418  z[N] = 116.511; r[N++] = 116.320;
419  z[N] = 104.548; r[N++] = 116.320;
420  z[N] = 104.548; r[N++] = 101.881;
421  DrawPoly(N, z, r, coil_color);
422 
423  //&reg mat=1, cur= 180000.0; ; Coil 1C
424  N = 0;
425  z[N] = 124.961; r[N++] = 101.881;
426  z[N] = 132.679; r[N++] = 101.881;
427  z[N] = 132.679; r[N++] = 111.263;
428  z[N] = 124.961; r[N++] = 111.263;
429  z[N] = 124.961; r[N++] = 101.881;
430  DrawPoly(N, z, r, coil_color);
431 
432  //&reg mat=1, cur= 120000.0; ; Coil 1D
433  N = 0;
434  z[N] = 140.845; r[N++] = 101.881;
435  z[N] = 148.563; r[N++] = 101.881;
436  z[N] = 148.563; r[N++] = 108.607;
437  z[N] = 140.845; r[N++] = 108.607;
438  z[N] = 140.845; r[N++] = 101.881;
439  DrawPoly(N, z, r, coil_color);
440 
441  //&reg mat=1, cur= 324000.0; ; Coil 1E
442  N = 0;
443  z[N] = 156.729; r[N++] = 101.881;
444  z[N] = 168.423; r[N++] = 101.881;
445  z[N] = 168.423; r[N++] = 113.159;
446  z[N] = 156.729; r[N++] = 113.159;
447  z[N] = 156.729; r[N++] = 101.881;
448  DrawPoly(N, z, r, coil_color);
449 
450  //&reg mat=1, cur= 324000.0; ; Coil 1F
451  N = 0;
452  z[N] = 172.416; r[N++] = 101.881;
453  z[N] = 180.134; r[N++] = 101.881;
454  z[N] = 180.134; r[N++] = 118.849;
455  z[N] = 172.416; r[N++] = 118.849;
456  z[N] = 172.416; r[N++] = 101.881;
457  DrawPoly(N, z, r, coil_color);
458 
459  //&reg mat=1, cur= 348000.0; ; Coil 1G
460  N = 0;
461  z[N] = 180.134; r[N++] = 101.881;
462  z[N] = 188.087; r[N++] = 101.881;
463  z[N] = 188.087; r[N++] = 120.113;
464  z[N] = 180.134; r[N++] = 120.113;
465  z[N] = 180.134; r[N++] = 101.881;
466  DrawPoly(N, z, r, coil_color);
467 
468  //&reg mat=1, cur= 468000.0; ; Coil 2A
469  N = 0;
470  z[N] = 7.256; r[N++] = 101.881;
471  z[N] = 18.950; r[N++] = 101.881;
472  z[N] = 18.950; r[N++] = 118.217;
473  z[N] = 7.256; r[N++] = 118.217;
474  z[N] = 7.256; r[N++] = 101.881;
475  DrawPoly(N, z, r, coil_color);
476 
477  //&reg mat=1, cur= 204000.0; ; Coil 2B
478  N = 0;
479  z[N] = 22.124; r[N++] = 101.881;
480  z[N] = 29.842; r[N++] = 101.881;
481  z[N] = 29.842; r[N++] = 112.527;
482  z[N] = 22.124; r[N++] = 112.527;
483  z[N] = 22.124; r[N++] = 101.881;
484  DrawPoly(N, z, r, coil_color);
485 
486  //&reg mat=1, cur= 324000.0; ; Coil 2C
487  N = 0;
488  z[N] = 29.842; r[N++] = 101.881;
489  z[N] = 41.772; r[N++] = 101.881;
490  z[N] = 41.772; r[N++] = 112.527;
491  z[N] = 29.842; r[N++] = 112.527;
492  z[N] = 29.842; r[N++] = 101.881;
493  DrawPoly(N, z, r, coil_color);
494 
495  //&reg mat=1, cur= 396000.0; ; Coil 2D
496  N = 0;
497  z[N] = 42.007; r[N++] = 101.881;
498  z[N] = 53.702; r[N++] = 101.881;
499  z[N] = 53.702; r[N++] = 115.688;
500  z[N] = 42.007; r[N++] = 115.688;
501  z[N] = 42.007; r[N++] = 101.881;
502  DrawPoly(N, z, r, coil_color);
503 
504  //&reg mat=1, cur= 468000.0; ; Coil 3A
505  N = 0;
506  z[N] = 217.441; r[N++] = 101.881;
507  z[N] = 229.135; r[N++] = 101.881;
508  z[N] = 229.135; r[N++] = 118.217;
509  z[N] = 217.441; r[N++] = 118.217;
510  z[N] = 217.441; r[N++] = 101.881;
511  DrawPoly(N, z, r, coil_color);
512 
513  //&reg mat=1, cur= 306000.0; ; Coil 3B
514  N = 0;
515  z[N] = 232.309; r[N++] = 101.881;
516  z[N] = 244.003; r[N++] = 101.881;
517  z[N] = 244.003; r[N++] = 112.527;
518  z[N] = 232.309; r[N++] = 112.527;
519  z[N] = 232.309; r[N++] = 101.881;
520  DrawPoly(N, z, r, coil_color);
521 
522  //&reg mat=1, cur= 192000.0; ; Coil 3C
523  N = 0;
524  z[N] = 244.003; r[N++] = 101.881;
525  z[N] = 251.957; r[N++] = 101.881;
526  z[N] = 251.957; r[N++] = 112.527;
527  z[N] = 244.003; r[N++] = 112.527;
528  z[N] = 244.003; r[N++] = 101.881;
529  DrawPoly(N, z, r, coil_color);
530 
531  //&reg mat=1, cur= 198000.0; ; Coil 3D
532  N = 0;
533  z[N] = 251.957; r[N++] = 101.881;
534  z[N] = 263.887; r[N++] = 101.881;
535  z[N] = 263.887; r[N++] = 108.734;
536  z[N] = 251.957; r[N++] = 108.734;
537  z[N] = 251.957; r[N++] = 101.881;
538  DrawPoly(N, z, r, coil_color);
539 
540  //&reg mat=1, cur= 324000.0; ; Coil 4A/B
541  N = 0;
542  z[N] = 293.929; r[N++] = 101.881;
543  z[N] = 305.623; r[N++] = 101.881;
544  z[N] = 305.623; r[N++] = 113.159;
545  z[N] = 293.929; r[N++] = 113.159;
546  z[N] = 293.929; r[N++] = 101.881;
547  DrawPoly(N, z, r, coil_color);
548 
549  //&reg mat=1, cur=1890000.0; ; Coil 4C/D
550  N = 0;
551  z[N] = 310.709; r[N++] = 101.881;
552  z[N] = 340.299; r[N++] = 101.881;
553  z[N] = 340.299; r[N++] = 128.331;
554  z[N] = 310.709; r[N++] = 128.331;
555  z[N] = 310.709; r[N++] = 101.881;
556  DrawPoly(N, z, r, coil_color);
557 
558  // Label
559  TLatex *lab_hi = new TLatex(-48.0, 180.0, "solenoid");
560  lab_hi->SetTextAlign(12);
561  lab_hi->SetTextSize(0.03);
562  lab_hi->SetTextColor(coil_color);
563  lab_hi->Draw();
564 
565 }
566 
567 //--------------------------
568 // DrawPoly
569 //--------------------------
570 void DrawPoly(int N, double *z, double *r, int color)
571 {
572  TPolyLine *pl = new TPolyLine(N, z, r);
573  pl->SetLineColor(color);
574  if (fill_detectors) { pl->SetFillColor(color); pl->SetFillStyle(1001); }
575  pl->SetLineWidth(2);
576  pl->Draw();
577 
578  if (full) {
579  for(int i=0; i<N; i++)r[i] = -r[i];
580  pl = new TPolyLine(N, z, r);
581  pl->SetLineColor(color);
582  if (fill_detectors) { pl->SetFillColor(color); pl->SetFillStyle(1001); }
583  pl->SetLineWidth(2);
584  pl->Draw();
585  }
586 }
587 
588 //--------------------------
589 // DrawGlueXBoundaries
590 //--------------------------
591 void DrawGlueXBoundaries(Int_t full_detector=false, Int_t fill_in=false, Double_t clip_tof=1000.0, Int_t color=-1)
592 {
593  full = full_detector;
594  fill_detectors = fill_in;
595  if (color==-1) DrawBCALBoundaries(); else DrawBCALBoundaries(color);
596  if (color==-1) DrawCDCBoundaries(); else DrawCDCBoundaries(color);
597  if (color==-1) DrawFDCBoundaries(); else DrawFDCBoundaries(color);
598  if (color==-1) DrawStartCounterBoundaries(); else DrawStartCounterBoundaries(color);
599  if (color==-1) DrawTOFBoundaries(); else DrawTOFBoundaries(color, clip_tof);
600  if (color==-1) DrawTargetBoundaries(); else DrawTargetBoundaries(color);
601  if (color==-1) DrawFCALBoundaries(); else DrawFCALBoundaries(color);
602  if (color==-1) DrawMagnet(); else DrawMagnet(color, color);
603 }
604 
Int_t TOF_color
void DrawStartCounterBoundaries(int color=start_counter_color)
double rmax
void DrawTOFBoundaries(int color=TOF_color, double clip_tof=1000.0)
Int_t FCAL_color
double zmax
Int_t target_color
void DrawFCALBoundaries(int color=FCAL_color)
Int_t BCAL_color
void DrawPoly(int N, double *z, double *r, int color)
Double_t c1[2][NMODULES]
Definition: tw_corr.C:68
Int_t FDC_color
Int_t full
Int_t CDC_color
Int_t Magnet_color
Int_t fill_detectors
double sqrt(double)
void DrawFDCBoundaries(int color=FDC_color)
Int_t start_counter_color
void DrawBCALBoundaries(int color=BCAL_color)
void DrawGlueXBoundaries(Int_t full_detector=false, Int_t fill_in=false, Double_t clip_tof=1000.0, Int_t color=-1)
void DrawCDCBoundaries(int color=CDC_color)
void DrawTargetBoundaries(int color=target_color)
double zmin
void DrawMagnet(int yoke_color=Magnet_color, int coil_color=Magnet_color)