source: trunk/MagicSoft/Mars/mgui/MGeomCamCT1.cc@ 698

Last change on this file since 698 was 698, checked in by tbretz, 24 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 2.2 KB
Line 
1#include "MGeomCamCT1.h"
2
3
4#include <math.h> // floor
5#include "TCanvas.h"
6
7#include "MLog.h"
8
9ClassImp(MGeomCamCT1)
10
11MGeomCamCT1::MGeomCamCT1(const char *name) : MGeomCam(127, name, "Geometry information of CT1 camera")
12{
13 CreateCam();
14}
15
16void MGeomCamCT1::Draw( Option_t * )
17{
18 TCanvas *can = new TCanvas("can", "Camera Geometry", 4 ) ;
19
20 can->Range(-175, -175, 175, 175 ) ;
21
22 MGeomCam::Draw();
23}
24
25void MGeomCamCT1::CreateCam()
26{
27 //
28 // fill the geometry class with the coordinates of the CT1 camera
29 //
30 *fLog << " Create CT1 geometry " << endl;
31
32 //
33 // this algorithm is from Martin Kestel originally
34 // it was punt into a root/C++ context by Harald Kornmayer and Thomas Bretz
35
36 const Float_t diameter = 21 ; // units are mm
37 const Float_t kS32 = sqrt(3)/2;
38
39 //
40 // add the first pixel to the list
41 //
42 Int_t pixnum = 1;
43
44 (*this)[pixnum++].Set(0, 0, diameter);
45
46 for (Int_t ring=1; ring<7; ring++)
47 {
48 //
49 // calc. coords for this ring counting from the
50 // starting number to the ending number
51 //
52 for (int i=0; i<ring; i++)
53 (*this)[pixnum++].Set((-ring+i*0.5)*diameter,
54 i*kS32*diameter,
55 diameter);
56
57 for (int i=0; i<ring; i++)
58 (*this)[pixnum++].Set((-ring*0.5+i)*diameter,
59 ring*kS32 * diameter,
60 diameter);
61
62 for (int i=0; i<ring; i++)
63 (*this)[pixnum++].Set((ring+i)*0.5*diameter,
64 (ring-i)*kS32*diameter,
65 diameter);
66
67 for (int i=0; i<ring; i++)
68 (*this)[pixnum++].Set((ring-0.5*i)*diameter,
69 -i*kS32*diameter,
70 diameter);
71
72 for (int i=0; i<ring; i++)
73 (*this)[pixnum++].Set((ring*0.5-i)*diameter,
74 -ring*kS32 * diameter,
75 diameter);
76
77 for (int i=0; i<ring; i++)
78 (*this)[pixnum++].Set((-ring-i)*0.5*diameter,
79 (-ring+i)*kS32*diameter,
80 diameter);
81 }
82}
83
Note: See TracBrowser for help on using the repository browser.