Changeset 695 for trunk/MagicSoft/Mars/mgui
- Timestamp:
- 03/20/01 17:25:33 (24 years ago)
- Location:
- trunk/MagicSoft/Mars/mgui
- Files:
-
- 4 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mgui/GuiLinkDef.h
r654 r695 13 13 14 14 #pragma link C++ class MHexagon; 15 #pragma link C++ class MCamNeighbor; 16 15 17 #pragma link C++ class MGeomPix; 16 18 #pragma link C++ class MGeomCam; 17 #pragma link C++ class MCamNeighbor; 19 #pragma link C++ class MGeomCamCT1; 20 #pragma link C++ class MGeomCamMagic; 18 21 19 22 #pragma link C++ class MCamDisplay; -
trunk/MagicSoft/Mars/mgui/MCamDisplay.cc
r653 r695 18 18 ClassImp(MCamDisplay) 19 19 20 MCamDisplay::MCamDisplay (Int_t type) : fAutoScale(kTRUE)20 MCamDisplay::MCamDisplay (MGeomCam *geom) : fAutoScale(kTRUE) 21 21 { 22 22 // default constructor 23 23 24 24 // 25 // create a object which contains the camera geometry26 //27 MGeomCam geom(type) ;28 29 //30 25 // set the color palette 31 26 // … … 35 30 // create the hexagons of the display 36 31 // 37 fNbPixels = geom.GetNbPixels() ; 38 fPixels = new TClonesArray("MHexagon", fNbPixels ) ; 39 40 for (Int_t i=0; i< fNbPixels; i++ ) 41 { 42 (*fPixels)[i] = new MHexagon(geom[i]) ; 43 } 32 fNumPixels = geom->GetNumPixels() ; 33 fPixels = new TClonesArray("MHexagon", fNumPixels ) ; 34 35 for (UInt_t i=0; i< fNumPixels; i++ ) 36 (*fPixels)[i] = new MHexagon((*geom)[i]) ; 44 37 45 38 // … … 98 91 // draw all pixels of the camera 99 92 // 100 for ( Int_t i=0; i< fNbPixels; i++)93 for (UInt_t i=0; i< fNumPixels; i++) 101 94 (*this)[i].Draw(); 102 95 … … 149 142 if ( fAutoScale ) 150 143 { 151 fMinPhe = event->Get MinNumPhotons() ;152 fMaxPhe = event->Get MaxNumPhotons() ;144 fMinPhe = event->GetNumPhotonsMin() ; 145 fMaxPhe = event->GetNumPhotonsMax() ; 153 146 154 147 if (fMaxPhe < 20.) … … 161 154 // update the colors in the picture 162 155 // 163 const Int_t entries = event->GetN bPixels();156 const Int_t entries = event->GetNumPixels(); 164 157 165 158 for (Int_t i=0 ; i<entries; i++ ) … … 190 183 // determine the Pixel Id and the content 191 184 // 192 const Int_t entries = event->GetN bPixels() ;185 const Int_t entries = event->GetNumPixels() ; 193 186 194 187 for (Int_t i=0 ; i<entries; i++ ) … … 211 204 // reset the all pixel colors to a default value 212 205 // 213 for ( Int_t i=0 ; i< fNbPixels ; i++ )206 for ( UInt_t i=0 ; i< fNumPixels ; i++ ) 214 207 (*this)[i].SetFillColor(10) ; 215 208 } -
trunk/MagicSoft/Mars/mgui/MCamDisplay.h
r653 r695 18 18 #endif 19 19 20 class TClonesArray ;21 class MCerPhotEvt ;22 20 class TBox; 23 21 class TText; 22 class TClonesArray ; 23 24 class MCerPhotEvt ; 25 class MGeomCam; 24 26 25 27 class MCamDisplay : public TObject 26 28 { 27 29 private: 28 Bool_t fAutoScale ; //! indicating the autoscale function30 Bool_t fAutoScale ; //! indicating the autoscale function 29 31 30 Int_t fNbPixels ;//!31 TClonesArray *fPixels ; //!32 UInt_t fNumPixels ; //! 33 TClonesArray *fPixels ; //! 32 34 33 Float_t fMinPhe ; //! The minimal number of Phe34 Float_t fMaxPhe ; //! The maximum number of Phe35 Float_t fMinPhe ; //! The minimal number of Phe 36 Float_t fMaxPhe ; //! The maximum number of Phe 35 37 36 TClonesArray *fLegend ; //!37 TClonesArray *fLegText ; //!38 TClonesArray *fLegend ; //! 39 TClonesArray *fLegText ; //! 38 40 39 41 TBox *GetBox(Int_t i) { return (TBox*) fLegend->At(i); } … … 47 49 public: 48 50 49 MCamDisplay ( Int_t type=0 ) ;51 MCamDisplay (MGeomCam *geom); 50 52 51 53 ~MCamDisplay () ; -
trunk/MagicSoft/Mars/mgui/MGeomCam.cc
r653 r695 1 1 #include "MGeomCam.h" 2 3 4 #include <math.h> // floor5 #include "TCanvas.h"6 2 7 3 #include "MLog.h" … … 10 6 ClassImp(MGeomCam) 11 7 12 MGeomCam::MGeomCam(Int_t type ) 13 { 14 // default constructor 8 MGeomCam::MGeomCam(UInt_t npix, const char *name, const char *title) 9 { 10 *fName = name ? name : "MGeomCam"; 11 *fTitle = title ? title : "Storage container for a camera geometry"; 15 12 16 if ( type == 1 ) { 17 // set up the Geometry of CT1 18 19 fNbPixels = 127 ; 20 fPixels = new TObjArray ( fNbPixels ) ; 21 22 CreateCT1() ; 23 } 24 else { 25 // set up the standard Geometry MAGIC 26 fNbPixels = 577 ; 27 fPixels = new TObjArray ( fNbPixels ) ; 13 fNumPixels = npix; 14 fPixels = new TObjArray(npix); 28 15 29 CreateMagic() ; 30 } 31 } 16 // 17 // make sure that the destructor delete all contained objects 18 // 19 fPixels->SetOwner(); 20 21 for (UInt_t i=0; i<npix; i++) 22 (*fPixels)[i] = new MGeomPix; 23 } 32 24 33 25 void MGeomCam::Draw( Option_t * ) 34 {35 TCanvas *can = new TCanvas("can", "Camera Geometry", 4 ) ;36 37 // set the range of the canvas38 if ( fNbPixels == 127 ) // case of CT139 can->Range(-175, -175, 175, 175 ) ;40 else41 can->Range(-600, -600, 600, 600 ) ;42 43 // draw all pixels44 45 for ( Int_t i=0; i < fNbPixels ; i++ ) {46 MHexagon *el = new MHexagon ( (*this)[i] ) ;47 48 el->Draw() ;49 }50 51 }52 53 void MGeomCam::Print(Option_t *)54 {55 // Print Information about the Geometry of the camera56 gLog << " Number of Pixels: " << fNbPixels << endl ;57 58 for ( Int_t i=0; i<fNbPixels; i++ ) {59 gLog << " Pixel: " << i << " " ;60 (*this)[i].Print() ;61 }62 }63 64 Int_t MGeomCam::GetNbPixels ()65 {66 // return the Number of pixels in the MCamGeom class67 return fNbPixels ;68 69 }70 71 72 void MGeomCam::CreateMagic()73 {74 // fill the geometry class with the coordinates of the MAGIC camera75 gLog << " Create Magic geometry " << endl ;76 77 // here define the hardwire things of the magic telescope78 //79 Float_t xtemp[577] = {80 0.000, 30.000, 15.000, -15.000, -30.000, -15.000, 15.000, 60.000,81 45.000, 30.000, 0.000, -30.000, -45.000, -60.000, -45.000, -30.000,82 0.000, 30.000, 45.000, 90.000, 75.000, 60.000, 45.000, 15.000,83 -15.000, -45.000, -60.000, -75.000, -90.000, -75.000, -60.000, -45.000,84 -15.000, 15.000, 45.000, 60.000, 75.000, 120.000, 105.000, 90.000,85 75.000, 60.000, 30.000, 0.000, -30.000, -60.000, -75.000, -90.000,86 -105.000, -120.000, -105.000, -90.000, -75.000, -60.000, -30.000, 0.000,87 30.000, 60.000, 75.000, 90.000, 105.000, 150.000, 135.000, 120.000,88 105.000, 90.000, 75.000, 45.000, 15.000, -15.000, -45.000, -75.000,89 -90.000, -105.000, -120.000, -135.000, -150.000, -135.000, -120.000, -105.000,90 -90.000, -75.000, -45.000, -15.000, 15.000, 45.000, 75.000, 90.000,91 105.000, 120.000, 135.000, 180.000, 165.000, 150.000, 135.000, 120.000,92 105.000, 90.000, 60.000, 30.000, 0.000, -30.000, -60.000, -90.000,93 -105.000, -120.000, -135.000, -150.000, -165.000, -180.000, -165.000, -150.000,94 -135.000, -120.000, -105.000, -90.000, -60.000, -30.000, 0.000, 30.000,95 60.000, 90.000, 105.000, 120.000, 135.000, 150.000, 165.000, 210.000,96 195.000, 180.000, 165.000, 150.000, 135.000, 120.000, 105.000, 75.000,97 45.000, 15.000, -15.000, -45.000, -75.000, -105.000, -120.000, -135.000,98 -150.000, -165.000, -180.000, -195.000, -210.000, -195.000, -180.000, -165.000,99 -150.000, -135.000, -120.000, -105.000, -75.000, -45.000, -15.000, 15.000,100 45.000, 75.000, 105.000, 120.000, 135.000, 150.000, 165.000, 180.000,101 195.000, 240.000, 225.000, 210.000, 195.000, 180.000, 165.000, 150.000,102 135.000, 120.000, 90.000, 60.000, 30.000, 0.000, -30.000, -60.000,103 -90.000, -120.000, -135.000, -150.000, -165.000, -180.000, -195.000, -210.000,104 -225.000, -240.000, -225.000, -210.000, -195.000, -180.000, -165.000, -150.000,105 -135.000, -120.000, -90.000, -60.000, -30.000, 0.000, 30.000, 60.000,106 90.000, 120.000, 135.000, 150.000, 165.000, 180.000, 195.000, 210.000,107 225.000, 270.000, 255.000, 240.000, 225.000, 210.000, 195.000, 180.000,108 165.000, 150.000, 135.000, 105.000, 75.000, 45.000, 15.000, -15.000,109 -45.000, -75.000, -105.000, -135.000, -150.000, -165.000, -180.000, -195.000,110 -210.000, -225.000, -240.000, -255.000, -270.000, -255.000, -240.000, -225.000,111 -210.000, -195.000, -180.000, -165.000, -150.000, -135.000, -105.000, -75.000,112 -45.000, -15.000, 15.000, 45.000, 75.000, 105.000, 135.000, 150.000,113 165.000, 180.000, 195.000, 210.000, 225.000, 240.000, 255.000, 300.000,114 285.000, 270.000, 255.000, 240.000, 225.000, 210.000, 195.000, 180.000,115 165.000, 150.000, 120.000, 90.000, 60.000, 30.000, 0.000, -30.000,116 -60.000, -90.000, -120.000, -150.000, -165.000, -180.000, -195.000, -210.000,117 -225.000, -240.000, -255.000, -270.000, -285.000, -300.000, -285.000, -270.000,118 -255.000, -240.000, -225.000, -210.000, -195.000, -180.000, -165.000, -150.000,119 -120.000, -90.000, -60.000, -30.000, 0.000, 30.000, 60.000, 90.000,120 120.000, 150.000, 165.000, 180.000, 195.000, 210.000, 225.000, 240.000,121 255.000, 270.000, 285.000, 330.000, 315.000, 300.000, 285.000, 270.000,122 255.000, 240.000, 225.000, 210.000, 195.000, 180.000, 165.000, 135.000,123 105.000, 75.000, 45.000, 15.000, -15.000, -45.000, -75.000, -105.000,124 -135.000, -165.000, -180.000, -195.000, -210.000, -225.000, -240.000, -255.000,125 -270.000, -285.000, -300.000, -315.000, -330.000, -315.000, -300.000, -285.000,126 -270.000, -255.000, -240.000, -225.000, -210.000, -195.000, -180.000, -165.000,127 -135.000, -105.000, -75.000, -45.000, -15.000, 15.000, 45.000, 75.000,128 105.000, 135.000, 165.000, 180.000, 195.000, 210.000, 225.000, 240.000,129 255.000, 270.000, 285.000, 300.000, 315.000, 360.000, 330.000, 300.000,130 270.000, 240.000, 210.000, 150.000, 90.000, 30.000, -30.000, -90.000,131 -150.000, -210.000, -240.000, -270.000, -300.000, -330.000, -360.000, -360.000,132 -330.000, -300.000, -270.000, -240.000, -210.000, -150.000, -90.000, -30.000,133 30.000, 90.000, 150.000, 210.000, 240.000, 270.000, 300.000, 330.000,134 360.000, 420.000, 390.000, 360.000, 330.000, 300.000, 270.000, 240.000,135 180.000, 120.000, 60.000, 0.000, -60.000, -120.000, -180.000, -240.000,136 -270.000, -300.000, -330.000, -360.000, -390.000, -420.000, -420.000, -390.000,137 -360.000, -330.000, -300.000, -270.000, -240.000, -180.000, -120.000, -60.000,138 0.000, 60.000, 120.000, 180.000, 240.000, 270.000, 300.000, 330.000,139 360.000, 390.000, 420.000, 480.000, 450.000, 420.000, 390.000, 360.000,140 330.000, 300.000, 270.000, 210.000, 150.000, 90.000, 30.000, -30.000,141 -90.000, -150.000, -210.000, -270.000, -300.000, -330.000, -360.000, -390.000,142 -420.000, -450.000, -480.000, -480.000, -450.000, -420.000, -390.000, -360.000,143 -330.000, -300.000, -270.000, -210.000, -150.000, -90.000, -30.000, 30.000,144 90.000, 150.000, 210.000, 270.000, 300.000, 330.000, 360.000, 390.000,145 420.000, 450.000, 480.000, 540.000, 510.000, 480.000, 450.000, 420.000,146 390.000, 360.000, 330.000, 300.000, 240.000, 180.000, 120.000, 60.000,147 0.000, -60.000, -120.000, -180.000, -240.000, -300.000, -330.000, -360.000,148 -390.000, -420.000, -450.000, -480.000, -510.000, -540.000, -540.000, -510.000,149 -480.000, -450.000, -420.000, -390.000, -360.000, -330.000, -300.000, -240.000,150 -180.000, -120.000, -60.000, 0.000, 60.000, 120.000, 180.000, 240.000,151 300.000, 330.000, 360.000, 390.000, 420.000, 450.000, 480.000, 510.000,152 540.000153 } ;154 155 Float_t ytemp[577] = {156 0.000, 0.000, 25.981, 25.981, 0.000, -25.981, -25.981, 0.000,157 25.981, 51.961, 51.961, 51.961, 25.981, 0.000, -25.981, -51.961,158 -51.961, -51.961, -25.981, 0.000, 25.981, 51.961, 77.942, 77.942,159 77.942, 77.942, 51.961, 25.981, 0.000, -25.981, -51.961, -77.942,160 -77.942, -77.942, -77.942, -51.961, -25.981, 0.000, 25.981, 51.961,161 77.942, 103.923, 103.923, 103.923, 103.923, 103.923, 77.942, 51.961,162 25.981, 0.000, -25.981, -51.961, -77.942, -103.923, -103.923, -103.923,163 -103.923, -103.923, -77.942, -51.961, -25.981, 0.000, 25.981, 51.961,164 77.942, 103.923, 129.904, 129.904, 129.904, 129.904, 129.904, 129.904,165 103.923, 77.942, 51.961, 25.981, 0.000, -25.981, -51.961, -77.942,166 -103.923, -129.904, -129.904, -129.904, -129.904, -129.904, -129.904, -103.923,167 -77.942, -51.961, -25.981, 0.000, 25.981, 51.961, 77.942, 103.923,168 129.904, 155.885, 155.885, 155.885, 155.885, 155.885, 155.885, 155.885,169 129.904, 103.923, 77.942, 51.961, 25.981, 0.000, -25.981, -51.961,170 -77.942, -103.923, -129.904, -155.885, -155.885, -155.885, -155.885, -155.885,171 -155.885, -155.885, -129.904, -103.923, -77.942, -51.961, -25.981, 0.000,172 25.981, 51.961, 77.942, 103.923, 129.904, 155.885, 181.865, 181.865,173 181.865, 181.865, 181.865, 181.865, 181.865, 181.865, 155.885, 129.904,174 103.923, 77.942, 51.961, 25.981, 0.000, -25.981, -51.961, -77.942,175 -103.923, -129.904, -155.885, -181.865, -181.865, -181.865, -181.865, -181.865,176 -181.865, -181.865, -181.865, -155.885, -129.904, -103.923, -77.942, -51.961,177 -25.981, 0.000, 25.981, 51.961, 77.942, 103.923, 129.904, 155.885,178 181.865, 207.846, 207.846, 207.846, 207.846, 207.846, 207.846, 207.846,179 207.846, 207.846, 181.865, 155.885, 129.904, 103.923, 77.942, 51.961,180 25.981, 0.000, -25.981, -51.961, -77.942, -103.923, -129.904, -155.885,181 -181.865, -207.846, -207.846, -207.846, -207.846, -207.846, -207.846, -207.846,182 -207.846, -207.846, -181.865, -155.885, -129.904, -103.923, -77.942, -51.961,183 -25.981, 0.000, 25.981, 51.961, 77.942, 103.923, 129.904, 155.885,184 181.865, 207.846, 233.827, 233.827, 233.827, 233.827, 233.827, 233.827,185 233.827, 233.827, 233.827, 233.827, 207.846, 181.865, 155.885, 129.904,186 103.923, 77.942, 51.961, 25.981, 0.000, -25.981, -51.961, -77.942,187 -103.923, -129.904, -155.885, -181.865, -207.846, -233.827, -233.827, -233.827,188 -233.827, -233.827, -233.827, -233.827, -233.827, -233.827, -233.827, -207.846,189 -181.865, -155.885, -129.904, -103.923, -77.942, -51.961, -25.981, 0.000,190 25.981, 51.961, 77.942, 103.923, 129.904, 155.885, 181.865, 207.846,191 233.827, 259.808, 259.808, 259.808, 259.808, 259.808, 259.808, 259.808,192 259.808, 259.808, 259.808, 259.808, 233.827, 207.846, 181.865, 155.885,193 129.904, 103.923, 77.942, 51.961, 25.981, 0.000, -25.981, -51.961,194 -77.942, -103.923, -129.904, -155.885, -181.865, -207.846, -233.827, -259.808,195 -259.808, -259.808, -259.808, -259.808, -259.808, -259.808, -259.808, -259.808,196 -259.808, -259.808, -233.827, -207.846, -181.865, -155.885, -129.904, -103.923,197 -77.942, -51.961, -25.981, 0.000, 25.981, 51.961, 77.942, 103.923,198 129.904, 155.885, 181.865, 207.846, 233.827, 259.808, 285.788, 285.788,199 285.788, 285.788, 285.788, 285.788, 285.788, 285.788, 285.788, 285.788,200 285.788, 285.788, 259.808, 233.827, 207.846, 181.865, 155.885, 129.904,201 103.923, 77.942, 51.961, 25.981, 0.000, -25.981, -51.961, -77.942,202 -103.923, -129.904, -155.885, -181.865, -207.846, -233.827, -259.808, -285.788,203 -285.788, -285.788, -285.788, -285.788, -285.788, -285.788, -285.788, -285.788,204 -285.788, -285.788, -285.788, -259.808, -233.827, -207.846, -181.865, -155.885,205 -129.904, -103.923, -77.942, -51.961, -25.981, 34.641, 86.603, 138.564,206 190.526, 242.487, 294.449, 329.090, 329.090, 329.090, 329.090, 329.090,207 329.090, 294.449, 242.487, 190.526, 138.564, 86.603, 34.641, -34.641,208 -86.603, -138.564, -190.526, -242.487, -294.449, -329.090, -329.090, -329.090,209 -329.090, -329.090, -329.090, -294.449, -242.487, -190.526, -138.564, -86.603,210 -34.641, 34.641, 86.603, 138.564, 190.526, 242.487, 294.449, 346.410,211 381.051, 381.051, 381.051, 381.051, 381.051, 381.051, 381.051, 346.410,212 294.449, 242.487, 190.526, 138.564, 86.603, 34.641, -34.641, -86.603,213 -138.564, -190.526, -242.487, -294.449, -346.410, -381.051, -381.051, -381.051,214 -381.051, -381.051, -381.051, -381.051, -346.410, -294.449, -242.487, -190.526,215 -138.564, -86.603, -34.641, 34.641, 86.603, 138.564, 190.526, 242.487,216 294.449, 346.410, 398.372, 433.013, 433.013, 433.013, 433.013, 433.013,217 433.013, 433.013, 433.013, 398.372, 346.410, 294.449, 242.487, 190.526,218 138.564, 86.603, 34.641, -34.641, -86.603, -138.564, -190.526, -242.487,219 -294.449, -346.410, -398.372, -433.013, -433.013, -433.013, -433.013, -433.013,220 -433.013, -433.013, -433.013, -398.372, -346.410, -294.449, -242.487, -190.526,221 -138.564, -86.603, -34.641, 34.641, 86.603, 138.564, 190.526, 242.487,222 294.449, 346.410, 398.372, 450.333, 484.974, 484.974, 484.974, 484.974,223 484.974, 484.974, 484.974, 484.974, 484.974, 450.333, 398.372, 346.410,224 294.449, 242.487, 190.526, 138.564, 86.603, 34.641, -34.641, -86.603,225 -138.564, -190.526, -242.487, -294.449, -346.410, -398.372, -450.333, -484.974,226 -484.974, -484.974, -484.974, -484.974, -484.974, -484.974, -484.974, -484.974,227 -450.333, -398.372, -346.410, -294.449, -242.487, -190.526, -138.564, -86.603,228 -34.641229 } ;230 231 Float_t rtemp[577] = {232 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,233 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,234 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,235 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,236 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,237 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,238 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,239 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,240 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,241 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,242 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,243 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,244 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,245 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,246 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,247 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,248 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,249 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,250 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,251 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,252 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,253 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,254 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,255 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,256 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,257 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,258 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,259 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,260 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,261 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,262 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,263 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,264 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,265 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,266 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,267 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,268 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,269 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,270 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,271 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,272 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,273 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,274 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,275 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,276 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,277 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,278 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,279 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,280 30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,281 30.00,30.00,30.00,30.00,30.00,60.00,60.00,60.00,282 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,283 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,284 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,285 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,286 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,287 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,288 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,289 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,290 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,291 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,292 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,293 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,294 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,295 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,296 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,297 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,298 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,299 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,300 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,301 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,302 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,303 60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,304 60.00 } ;305 306 // fill the pixels list with this data307 308 for ( Int_t i = 0 ; i< fNbPixels ; i++ ) {309 fPixels->Add( new MGeomPix(xtemp[i], ytemp[i], rtemp[i]) ) ;310 }311 }312 313 void MGeomCam::CreateCT1()314 26 { 315 27 // 316 // fill the geometry class with the coordinates of the CT1 camera28 // Draw the Camera 317 29 // 318 gLog << " Create CT1 geometry " << endl ; 319 320 // 321 // this algorithm is from Martin Kestel originally 322 // it was punt into a root/C++ context by Harald Kornmayer and Thomas Bretz 323 324 const Float_t pixdiameter = 21 ; // units are cm 325 326 // 327 // add the first pixel to the list 328 // 329 fPixels->Add( new MGeomPix( 0, 0, pixdiameter ) ) ; 330 331 const Float_t kS32 = sqrt(3)/2; 332 const Float_t kPI23 = kPI*2/3; 333 334 for (Int_t ringcounter=1; ringcounter<7; ringcounter++) { 335 // 336 // calc. numofpix in ring number i first 337 // 338 const Int_t numpixthisring = ringcounter*6; 339 340 // 341 // calc. coords for this ring counting from the 342 // starting number to the ending number 343 // 344 for (Int_t ipix = 0; ipix < numpixthisring; ipix++) { 345 346 Float_t ang = 60.0/ringcounter * ipix; 347 Float_t fracang = ang - 60*(int)floor(ang/60); 348 349 ang /= kRad2Deg; 350 fracang /= kRad2Deg; 351 352 Float_t rad = pixdiameter * ringcounter; 353 rad *= sin(kPI23-fracang) * kS32; 354 355 // fill the ObjArray with the pixels data ; 356 357 fPixels->Add( new MGeomPix(rad * cos(ang), 358 rad * sin(ang), 359 pixdiameter ) ) ; 360 } 30 for (UInt_t i=0; i<fNumPixels; i++) 31 { 32 MHexagon *el = new MHexagon((*this)[i]); 33 el->Draw(); 361 34 } 362 35 } 363 36 37 void MGeomCam::Print(Option_t *) 38 { 39 // 40 // Print Information about the Geometry of the camera 41 // 42 *fLog << " Number of Pixels: " << fNumPixels << endl ; 43 44 for (UInt_t i=0; i<fNumPixels; i++ ) 45 { 46 *fLog << " Pixel: " << i << " "; 47 (*this)[i].Print() ; 48 } 49 } 50 -
trunk/MagicSoft/Mars/mgui/MGeomCam.h
r653 r695 8 8 #include <TObjArray.h> 9 9 #endif 10 #ifndef MPARCONTAINER_H 11 #include "MParContainer.h" 12 #endif 10 13 #ifndef MGEOMPIX_H 11 14 #include "MGeomPix.h" 12 15 #endif 13 16 14 class MGeomCam 17 class MGeomCam : public MParContainer 15 18 { 16 19 private: 17 Int_t fNbPixels ; //! 18 TObjArray *fPixels ; //! 19 20 void CreateMagic() ; 21 void CreateCT1() ; 20 UInt_t fNumPixels; // Number of pixels in this camera 21 TObjArray *fPixels; // Array of singel pixels storing the geometry 22 22 23 23 public: 24 24 25 MGeomCam( Int_t type=0 ) ; 25 MGeomCam(UInt_t npix, const char *name=NULL, const char *title=NULL); 26 26 27 virtual ~MGeomCam() { delete fPixels; } 27 28 28 v oid Draw(Option_t *option = "" );29 virtual void Draw(Option_t *option = "" ); 29 30 30 Int_t GetNbPixels() ;31 UInt_t GetNumPixels() const { return fNumPixels; } 31 32 32 33 MGeomPix &operator[](Int_t i) { return *(MGeomPix*)fPixels->At(i); } 33 34 34 v oid Print(Option_t *opt=NULL);35 virtual void Print(Option_t *opt=NULL); 35 36 36 ClassDef(MGeomCam, 1) // Geometry class for the camera37 ClassDef(MGeomCam, 1) // Geometry base class for the camera 37 38 }; 38 39 -
trunk/MagicSoft/Mars/mgui/MGeomPix.h
r669 r695 11 11 Float_t fX ; // the x coordinate 12 12 Float_t fY ; // the y coordinate 13 Float_t fR ; // the ycoordinate13 Float_t fR ; // the r coordinate 14 14 15 15 public: … … 18 18 19 19 void Print(Option_t *opt=NULL) ; 20 21 void Set (Float_t x, Float_t y, Float_t r) { fX=x; fY=y; fR=r; } 20 22 21 void SetX ( Float_t x ) { fX = x ; } 22 void SetY ( Float_t y ) { fY = y ; } 23 void SetR ( Float_t r ) { fR = r ; } 24 Float_t GetX() { return fX ; } 25 Float_t GetY() { return fY ; } 26 Float_t GetR() { return fR ; } 23 void SetX (Float_t x) { fX = x; } 24 void SetY (Float_t y) { fY = y; } 25 void SetR (Float_t r) { fR = r; } 26 27 Float_t GetX() const { return fX; } 28 Float_t GetY() const { return fY; } 29 Float_t GetR() const { return fR; } 27 30 28 31 ClassDef(MGeomPix, 1) // Geometric class for one pixel -
trunk/MagicSoft/Mars/mgui/Makefile
r665 r695 35 35 MGMonteCarloMain.cc \ 36 36 MGPrototyp.cc \ 37 MGeomCamCT1.cc \ 38 MGeomCamMagic.cc \ 37 39 MGeomCam.cc \ 38 40 MGeomPix.cc \
Note:
See TracChangeset
for help on using the changeset viewer.