Changeset 9369 for trunk/MagicSoft/Mars/mhft
- Timestamp:
- 03/01/09 21:54:27 (16 years ago)
- Location:
- trunk/MagicSoft/Mars/mhft
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhft/MGeomCamMagicXT.cc
r8910 r9369 36 36 #include "MGeomCamMagicXT.h" 37 37 38 #include <TMath.h>39 40 #include "MGeomPix.h"41 42 38 ClassImp(MGeomCamMagicXT); 43 39 … … 48 44 // 49 45 MGeomCamMagicXT::MGeomCamMagicXT(const char *name) 50 : MGeomCam (1141, 17, name, "Geometry information of Magic Camera")46 : MGeomCamDwarf(19, 30, 17, name) 51 47 { 52 CreateCam();53 CreateNN();54 InitGeometry();55 48 } 56 57 // --------------------------------------------------------------------------58 //59 // This fills the geometry information from a table into the pixel objects.60 //61 void MGeomCamMagicXT::CreateCam()62 {63 //64 // fill the geometry class with the coordinates of the CT1 camera65 //66 //*fLog << inf << " Create CT1 geometry " << endl;67 68 //69 // this algorithm is from Martin Kestel originally70 // it was punt into a root/C++ context by Harald Kornmayer and Thomas Bretz71 72 const Float_t diameter = 30; // units are mm73 const Float_t kS32 = sqrt(3)/2;74 75 //76 // add the first pixel to the list77 //78 Int_t pixnum = 0;79 80 (*this)[pixnum++].Set(0, 0, diameter);81 82 for (Int_t ring=1; ring<20; ring++)83 {84 //85 // calc. coords for this ring counting from the86 // starting number to the ending number87 //88 for (int i=0; i<ring; i++)89 (*this)[pixnum++].Set((ring-i*0.5)*diameter,90 i*kS32*diameter,91 diameter);92 93 for (int i=0; i<ring; i++)94 (*this)[pixnum++].Set((ring*0.5-i)*diameter,95 ring*kS32 * diameter,96 diameter);97 98 for (int i=0; i<ring; i++)99 (*this)[pixnum++].Set(-(ring+i)*0.5*diameter,100 (ring-i)*kS32*diameter,101 diameter);102 103 for (int i=0; i<ring; i++)104 (*this)[pixnum++].Set((0.5*i-ring)*diameter,105 -i*kS32*diameter,106 diameter);107 108 for (int i=0; i<ring; i++)109 (*this)[pixnum++].Set((i-ring*0.5)*diameter,110 -ring*kS32 * diameter,111 diameter);112 113 for (int i=0; i<ring; i++)114 (*this)[pixnum++].Set((ring+i)*0.5*diameter,115 (-ring+i)*kS32*diameter,116 diameter);117 }118 }119 120 // --------------------------------------------------------------------------121 //122 // This fills the next neighbor information from a table into the pixel123 // objects.124 //125 void MGeomCamMagicXT::CreateNN()126 {127 Int_t pos = 0;128 129 const Short_t nn[7][6] = { // Neighbors of #130 { 1, 2, 3, 4, 5, 6}, // 0131 { 0, 2, 6, 7, 8, 18},132 { 0, 1, 3, 8, 9, 10},133 { 0, 2, 4, 10, 11, 12},134 { 0, 3, 5, 12, 13, 14},135 { 0, 4, 6, 14, 15, 16},136 { 0, 1, 5, 16, 17, 18}137 };138 139 for (Int_t i=0; i<7; i++)140 (*this)[pos++].SetNeighbors(nn[i][0], nn[i][1], nn[i][2],141 nn[i][3], nn[i][4], nn[i][5]);142 143 for (Int_t ring=2; ring<20; ring++)144 {145 for (Int_t s=0; s<6; s++)146 {147 for (int i=pos; i<ring+pos; i++)148 {149 Int_t n[6], idx[6];150 151 n[0] = i==pos&&s==0 ? i+6*ring : i-1; // vor152 n[1] = i==ring+pos-1&&s==5 ? i-12*(ring-1)-5 : i+1; // danach153 n[2] = i==pos ? i+6*ring-1+s : i-6*(ring-1)-s; // ring- groesser154 n[3] = i==pos ? i-6*(ring-1)-s : i-6*(ring-1)-1-s; // ring- kleiner155 n[4] = i==pos&&s==0 ? i+12*ring+5 : i+6*ring+s; // ring+ kleiner156 n[5] = i+6*ring+1+s; // ring+ groesser157 158 if (n[0]>1140)159 n[0] = -1;160 if (n[1]>1140)161 n[1] = -1;162 if (n[2]>1140)163 n[2] = -1;164 if (n[3]>1140)165 n[3] = -1;166 if (n[4]>1140)167 n[4] = -1;168 if (n[5]>1140)169 n[5] = -1;170 171 TMath::Sort(6, n, idx);172 173 (*this)[i].SetNeighbors(n[idx[0]],174 n[idx[1]],175 n[idx[2]],176 n[idx[3]],177 n[idx[4]],178 n[idx[5]]);179 }180 181 pos += ring;182 }183 }184 } -
trunk/MagicSoft/Mars/mhft/MGeomCamMagicXT.h
r5691 r9369 2 2 #define MARS_MGeomCamMagicXT 3 3 4 #ifndef MARS_MGeomCam 5 #include "MGeomCam .h"4 #ifndef MARS_MGeomCamDwarf 5 #include "MGeomCamDwarf.h" 6 6 #endif 7 7 8 class MGeomCamMagicXT : public MGeomCam 8 class MGeomCamMagicXT : public MGeomCamDwarf 9 9 { 10 private:11 void CreateCam();12 void CreateNN();13 14 10 public: 15 11 MGeomCamMagicXT(const char *name=NULL); -
trunk/MagicSoft/Mars/mhft/MHexagonFreqSpace.cc
r8911 r9369 169 169 int idx1 = (j+n)*(j+n+1)/2 + j; 170 170 171 (*cam)[idx1].Set(n-j, (n+j-num/2)*fgTan30, 2);172 (*cam)[idx1].SetNeighbors( -1, -1, -1, -1, -1, -1);171 cam->SetAt(idx1, MGeomPix(n-j, (n+j-num/2)*fgTan30, 2)); 172 (*cam)[idx1].SetNeighbors(); 173 173 } 174 174 }
Note:
See TracChangeset
for help on using the changeset viewer.