Changeset 653 for trunk/MagicSoft/Mars/mgui
- Timestamp:
- 03/01/01 15:42:32 (24 years ago)
- Location:
- trunk/MagicSoft/Mars/mgui
- Files:
-
- 4 added
- 2 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mgui/MCamDisplay.cc
r602 r653 2 2 3 3 #include <math.h> 4 4 5 #include <TClonesArray.h> 5 6 #include <TCanvas.h> … … 9 10 10 11 #include "MHexagon.h" 11 #include "M CamGeom.h"12 #include "MGeomCam.h" 12 13 13 14 #include "MCerPhotEvt.h" 14 15 16 #define kITEMS_LEGEND 25 15 17 16 18 ClassImp(MCamDisplay) 17 19 18 MCamDisplay::MCamDisplay (Int_t type ) 20 MCamDisplay::MCamDisplay (Int_t type ) : fAutoScale(kTRUE) 19 21 { 20 // default constructor 21 22 // set the color palette 23 24 gStyle->SetPalette(1,0) ; 25 26 fAutoScale = kTRUE ; 27 28 MCamGeom *geometry = new MCamGeom( type ) ; 29 30 fNbPixels = geometry->GetNbPixels() ; 31 fPixels = new TClonesArray("MHexagon", fNbPixels ) ; 32 33 // create the hexagons of the display 34 35 TClonesArray &obj = *fPixels ; 36 37 for (Int_t i=0; i< fNbPixels; i++ ) 38 { 39 new (obj[i]) MHexagon(geometry->GetX(i) , 40 geometry->GetY(i) , 41 geometry->GetR(i) ) ; 42 } 43 44 // set the range to default 45 46 fMinPhe = -2. ; 47 fMaxPhe = 50. ; 48 49 // set up the Legend 50 51 fLegend = new TClonesArray("TBox", ITEMS_LEGEND ) ; 52 TClonesArray &obj1 = *fLegend ; 53 54 fLegText = new TClonesArray("TText", ITEMS_LEGEND ) ; 55 TClonesArray &obj2 = *fLegText ; 56 57 char text[100] ; 58 59 Float_t help ; 60 61 help = 50. / ITEMS_LEGEND ; 62 63 for ( Int_t il = 0 ; il < ITEMS_LEGEND ; il++ ) 64 { 65 new ( obj1[il] ) TBox(650, il*40-500 , 700, il*40-460 ) ; 66 ( (TBox*) fLegend->At(il))->SetFillColor( GetColor ( (Float_t) help*il) ) ; 67 68 sprintf ( text, "%5.1f", (Float_t) help * il ) ; 69 new ( obj2[il] ) TText(720, il*40-480, text ) ; 70 ( (TText*) fLegText->At(il))->SetTextSize (0.025) ; 71 ( (TText*) fLegText->At(il))->SetTextAlign(12) ; 72 } 73 } 22 // default constructor 23 24 // 25 // create a object which contains the camera geometry 26 // 27 MGeomCam geom(type) ; 28 29 // 30 // set the color palette 31 // 32 gStyle->SetPalette(1,0) ; 33 34 // 35 // create the hexagons of the display 36 // 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 } 44 45 // 46 // set the range to default 47 // 48 fMinPhe = -2. ; 49 fMaxPhe = 50. ; 50 51 // 52 // set up the Legend 53 // 54 fLegend = new TClonesArray("TBox", kITEMS_LEGEND ) ; 55 fLegText = new TClonesArray("TText", kITEMS_LEGEND ) ; 56 57 char text[10] ; 58 for ( Int_t il = 0 ; il < kITEMS_LEGEND ; il++ ) 59 { 60 const Int_t y = il*40; 61 62 TBox *newbox = new TBox (650, y-500, 700, y-460 ); 63 TText *newtxt = new TText(720, y-480, text ); 64 65 const Float_t lvl = 50. / kITEMS_LEGEND * il; 66 67 newbox->SetFillColor( GetColor(lvl) ); 68 69 sprintf ( text, "%5.1f", lvl ) ; 70 71 newtxt->SetTextSize (0.025) ; 72 newtxt->SetTextAlign(12) ; 73 74 (*fLegend) [il] = newbox; 75 (*fLegText)[il] = newtxt; 76 } 77 } 74 78 75 79 MCamDisplay::~MCamDisplay() 76 80 { 77 delete fPixels ;78 } 81 delete fPixels ; 82 } 79 83 80 84 81 85 void MCamDisplay::Init() 82 86 { 83 84 // Set the right colors 85 86 gStyle->SetPalette(1, 0) ; 87 88 if ( ! gPad ) new TCanvas("display", "MAGIC display", 0, 0, 650, 500) ; 89 90 for (Int_t i=0; i< fNbPixels; i++) 91 { 92 ( (MHexagon*) fPixels->At(i))->Draw() ; 93 } 94 95 for (Int_t i=0; i< ITEMS_LEGEND; i++) 96 { 97 98 ( (TBox*) fLegend->At(i))->Draw() ; 99 100 ( (TText*) fLegText->At(i))->Draw() ; 101 } 102 87 // 88 // Set the right colors 89 // 90 gStyle->SetPalette(1, 0) ; 91 92 // 93 // if no canvas is yet existing to draw into, create a new one 94 // 95 if ( !gPad ) new TCanvas("display", "MAGIC display", 0, 0, 650, 500) ; 96 97 // 98 // draw all pixels of the camera 99 // 100 for (Int_t i=0; i< fNbPixels; i++) 101 (*this)[i].Draw(); 102 103 // 104 // draw legend 105 // 106 for (Int_t i=0; i< kITEMS_LEGEND; i++) 107 { 108 GetBox(i)->Draw(); 109 GetText(i)->Draw(); 110 } 103 111 } 104 112 … … 108 116 // 109 117 110 // check if there a pad exists 111 112 if ( ! gPad ) Init() ; 113 114 gPad->Range (-600, -600, 900, 600) ; 115 gPad->SetFillColor(22) ; 116 117 // 118 119 gPad->Modified() ; 120 gPad->Update() ; 121 122 //gPad->Update() ; 118 // 119 // check if there a pad exists, if not create one 120 // 121 if ( !gPad ) Init() ; 122 123 // 124 // set init values 125 // 126 gPad->Range (-600, -600, 900, 600) ; 127 gPad->SetFillColor(22) ; 128 129 // 130 // mark pad as modified and update screen 131 // 132 gPad->Modified() ; 133 gPad->Update() ; 123 134 } 124 135 125 void MCamDisplay::Draw( MCerPhotEvt *event) 126 { 127 128 // loop over all pixels in the MCerPhotEvt and 129 // determine the Pixel Id and the content 130 131 Reset() ; 132 133 // if the autoscale is true, set the values for the range for 134 // each event 135 136 if ( fAutoScale == kTRUE ) 137 { 138 fMinPhe = event->GetMinimumPhoton() ; 139 fMaxPhe = event->GetMaximumPhoton() ; 140 141 if ( fMaxPhe < 20. ) fMaxPhe = 20. ; 142 143 144 UpdateLegend() ; 145 } 146 147 // update the picture 148 149 for (Int_t i=0 ; i<event->GetNbPixels() ; i++ ) 150 { 151 if ( event->IsPixelUsed(i) == kTRUE ) 152 ( (MHexagon*) fPixels->At( event->GetPixelId(i) ))->SetFillColor( GetColor(event->GetPhotons(i))) ; 153 154 } 155 156 Draw() ; 157 136 void MCamDisplay::DrawPhotNum( MCerPhotEvt *event) 137 { 138 139 // 140 // loop over all pixels in the MCerPhotEvt and 141 // determine the Pixel Id and the content 142 // 143 Reset() ; 144 145 // 146 // if the autoscale is true, set the values for the range for 147 // each event 148 // 149 if ( fAutoScale ) 150 { 151 fMinPhe = event->GetMinNumPhotons() ; 152 fMaxPhe = event->GetMaxNumPhotons() ; 153 154 if (fMaxPhe < 20.) 155 fMaxPhe = 20. ; 156 157 UpdateLegend() ; 158 } 159 160 // 161 // update the colors in the picture 162 // 163 const Int_t entries = event->GetNbPixels(); 164 165 for (Int_t i=0 ; i<entries; i++ ) 166 { 167 MCerPhotPix &pix = (*event)[i]; 168 169 if (!pix.IsPixelUsed()) 170 continue; 171 172 SetPixColor(pix); 173 } 174 175 // 176 // update the picture 177 // 178 Draw() ; 158 179 } 159 180 160 void MCamDisplay::DrawError( MCerPhotEvt *event) 161 { 162 // 163 164 // loop over all pixels in the MCerPhotEvt and 165 // determine the Pixel Id and the content 166 Reset() ; 167 168 for (Int_t i=0 ; i<event->GetNbPixels() ; i++ ) 169 { 170 ( (MHexagon*) fPixels->At( event->GetPixelId(i) ))->SetFillColor( GetColor(event->GetErrorPhot(i)) ) ; 171 } 172 173 Draw() ; 174 181 void MCamDisplay::DrawPhotErr( MCerPhotEvt *event) 182 { 183 // 184 // reset the all pixel colors to a default value 185 // 186 Reset() ; 187 188 // 189 // loop over all pixels in the MCerPhotEvt and 190 // determine the Pixel Id and the content 191 // 192 const Int_t entries = event->GetNbPixels() ; 193 194 for (Int_t i=0 ; i<entries; i++ ) 195 { 196 MCerPhotPix &pix = (*event)[i]; 197 198 SetPixColor(pix); 199 } 200 201 // 202 // update display 203 // 204 Draw() ; 175 205 } 176 206 … … 178 208 void MCamDisplay::Reset() 179 209 { 180 for ( Int_t i=0 ; i< fNbPixels ; i++ )181 {182 ( (MHexagon*) fPixels->At(i))->SetFillColor(10) ;183 }184 210 // 211 // reset the all pixel colors to a default value 212 // 213 for ( Int_t i=0 ; i< fNbPixels ; i++ ) 214 (*this)[i].SetFillColor(10) ; 185 215 } 186 216 187 Int_t MCamDisplay::GetColor(Float_t wert )188 { 189 // Here we calculate the color index for the current value.190 // The color index is defined with the class TStyle and the191 // Color palette inside. We use the command gStyle->SetPalette(1,0)192 // for the display. So we have to convert the value "wert" into193 // a color index that fits the color palette.194 // The range of the color palette is defined by the values fMinPhe195 // and fMaxRange. Between this values we have 50 color index, starting196 // with 0 up to 49.197 //198 199 // first treat the over- and under-flows 200 201 if ( wert >= fMaxPhe )202 return gStyle->GetColorPalette( 49 ) ;203 204 if ( wert <= fMinPhe ) 205 return gStyle->GetColorPalette( 0 ) ;206 207 // calculate the color index 208 209 Int_t ColIndex ;210 211 ColIndex = (Int_t) wert ;212 213 ColIndex = (Int_t) ( .5 + ( (wert-fMinPhe) * 49. / (fMaxPhe-fMinPhe) ) ) ;214 215 return (gStyle->GetColorPalette(ColIndex) ) ;216 217 } 218 217 Int_t MCamDisplay::GetColor(Float_t val) 218 { 219 // 220 // Here we calculate the color index for the current value. 221 // The color index is defined with the class TStyle and the 222 // Color palette inside. We use the command gStyle->SetPalette(1,0) 223 // for the display. So we have to convert the value "wert" into 224 // a color index that fits the color palette. 225 // The range of the color palette is defined by the values fMinPhe 226 // and fMaxRange. Between this values we have 50 color index, starting 227 // with 0 up to 49. 228 // 229 230 // 231 // first treat the over- and under-flows 232 // 233 const Float_t maxcolidx = 49.0; 234 235 if (val >= fMaxPhe ) 236 return gStyle->GetColorPalette(maxcolidx); 237 238 if (val <= fMinPhe ) 239 return gStyle->GetColorPalette( 0 ); 240 241 // 242 // calculate the color index 243 // 244 const Float_t ratio = (val-fMinPhe) / (fMaxPhe-fMinPhe); 245 const Int_t colidx = (Int_t)(maxcolidx*ratio + .5) ; 246 247 return gStyle->GetColorPalette(colidx) ; 248 } 219 249 220 250 void MCamDisplay::UpdateLegend() 221 { 222 // change the text on the legend according to the range of the 223 // Display 224 225 char text[100] ; 226 227 Float_t x, y, wert, help ; 228 229 help = 50./ITEMS_LEGEND ; 230 231 for (Int_t il=0; il < ITEMS_LEGEND; il++) 232 { 233 wert = fMinPhe + (il*help)/50 * (fMaxPhe-fMinPhe) ; 234 235 sprintf ( text, "%5.1f", wert ) ; 236 237 x = ( (TText*) fLegText->At(il))->GetX () ; 238 y = ( (TText*) fLegText->At(il))->GetY () ; 239 ( (TText*) fLegText->At(il))->SetText (x, y, text ) ; 240 } 241 242 } 251 { 252 // 253 // change the text on the legend according to the range of the 254 // Display 255 // 256 257 char text[10] ; 258 259 for (Int_t il=0; il < kITEMS_LEGEND; il++) 260 { 261 const Float_t val = fMinPhe + (Float_t)il/kITEMS_LEGEND * (fMaxPhe-fMinPhe) ; 262 263 sprintf(text, "%5.1f", val); 264 265 TText &txt = *GetText(il); 266 267 txt.SetText(txt.GetX(), txt.GetY(), text) ; 268 } 269 } -
trunk/MagicSoft/Mars/mgui/MCamDisplay.h
r602 r653 2 2 #define MCAMDISPLAY_H 3 3 4 #include <iostream> 4 #ifndef MAGIC_H 5 #include "MAGIC.h" 6 #endif 7 #ifndef MHEXAGON_H 8 #include "MHexagon.h" 9 #endif 10 #ifndef MCERPHOTPIX_H 11 #include "MCerPhotPix.h" 12 #endif 13 #ifndef MCERPHOTEVT_H 14 #include "MCerPhotEvt.h" 15 #endif 16 #ifndef ROOT_TClonesArray 17 #include <TClonesArray.h> 18 #endif 5 19 6 #include "MAGIC.h" 7 8 #define ITEMS_LEGEND 25 9 10 class TClonesArray ; 11 class MCerPhotEvt ; 20 class TClonesArray ; 21 class MCerPhotEvt ; 22 class TBox; 23 class TText; 12 24 13 25 class MCamDisplay : public TObject 14 26 { 15 27 private: 16 Bool_t fAutoScale ; //indicating the autoscale function28 Bool_t fAutoScale ; //! indicating the autoscale function 17 29 18 Int_t fNbPixels ; //19 TClonesArray *fPixels ; //!30 Int_t fNbPixels ; //! 31 TClonesArray *fPixels ; //! 20 32 21 Float_t fMinPhe ; //The minimal number of Phe22 Float_t fMaxPhe ; // The maximum number of Phe33 Float_t fMinPhe ; //! The minimal number of Phe 34 Float_t fMaxPhe ; //! The maximum number of Phe 23 35 24 36 TClonesArray *fLegend ; //! 25 37 TClonesArray *fLegText ; //! 38 39 TBox *GetBox(Int_t i) { return (TBox*) fLegend->At(i); } 40 TText *GetText(Int_t i) { return (TText*)fLegText->At(i); } 41 42 void SetPixColor(MCerPhotPix &pix) 43 { 44 (*this)[pix.GetPixId()].SetFillColor( GetColor(pix.GetNumPhotons())); 45 } 26 46 27 47 public: … … 35 55 void Draw(Option_t *option = "" ) ; 36 56 37 void Draw ( MCerPhotEvt *event) ;38 void Draw Error( MCerPhotEvt *event) ;57 void DrawPhotNum( MCerPhotEvt *event) ; 58 void DrawPhotErr( MCerPhotEvt *event) ; 39 59 40 60 void Reset() ; 61 62 MHexagon &operator[](int i) { return *((MHexagon*)fPixels->At(i)); } 41 63 42 64 Int_t GetColor( Float_t wert ) ; … … 49 71 } 50 72 51 //Int_t GetNbPixels() ; 52 53 ClassDef(MCamDisplay, 1) // Base (abstract) class for a task 73 ClassDef(MCamDisplay, 1) // Display the magic camera 54 74 }; 55 75 -
trunk/MagicSoft/Mars/mgui/MCamNeighbor.cc
r603 r653 1 1 #include "MCamNeighbor.h" 2 2 3 #include <stdlib.h>4 5 ClassImp(MCamNeighbor) 3 #include "MLog.h" 4 5 ClassImp(MCamNeighbor) 6 6 7 7 MCamNeighbor::MCamNeighbor() … … 341 341 { 269, 270, 328, 330, 394, 395} , 342 342 { 217, 270, 271, 329, 395, 396} , 343 { 271, 332, 396, 397, 432, - 9999} ,344 { 271, 272, 331, 333, 397, - 9999} ,345 { 272, 273, 332, 334, 398, - 9999} ,346 { 273, 274, 333, 335, 398, - 9999} ,347 { 274, 275, 334, 336, 399, - 9999} ,348 { 275, 276, 335, 337, 399, - 9999} ,349 { 276, 277, 336, 338, 400, - 9999} ,350 { 277, 278, 337, 339, 400, - 9999} ,351 { 278, 279, 338, 340, 401, - 9999} ,352 { 279, 280, 339, 341, 401, - 9999} ,353 { 280, 281, 340, 342, 402, - 9999} ,354 { 281, 341, 343, 402, 403, - 9999} ,355 { 281, 282, 342, 344, 403, - 9999} ,356 { 282, 283, 343, 345, 404, - 9999} ,357 { 283, 284, 344, 346, 404, - 9999} ,358 { 284, 285, 345, 347, 405, - 9999} ,359 { 285, 286, 346, 348, 405, - 9999} ,360 { 286, 287, 347, 349, 406, - 9999} ,361 { 287, 288, 348, 350, 406, - 9999} ,362 { 288, 289, 349, 351, 407, - 9999} ,363 { 289, 290, 350, 352, 407, - 9999} ,364 { 290, 291, 351, 353, 408, - 9999} ,365 { 291, 352, 354, 408, 409, - 9999} ,366 { 291, 292, 353, 355, 409, - 9999} ,367 { 292, 293, 354, 356, 410, - 9999} ,368 { 293, 294, 355, 357, 410, - 9999} ,369 { 294, 295, 356, 358, 411, - 9999} ,370 { 295, 296, 357, 359, 411, - 9999} ,371 { 296, 297, 358, 360, 412, - 9999} ,372 { 297, 298, 359, 361, 412, - 9999} ,373 { 298, 299, 360, 362, 413, - 9999} ,374 { 299, 300, 361, 363, 413, - 9999} ,375 { 300, 301, 362, 364, 414, - 9999} ,376 { 301, 363, 365, 414, 415, - 9999} ,377 { 301, 302, 364, 366, 415, - 9999} ,378 { 302, 303, 365, 367, 416, - 9999} ,379 { 303, 304, 366, 368, 416, - 9999} ,380 { 304, 305, 367, 369, 417, - 9999} ,381 { 305, 306, 368, 370, 417, - 9999} ,382 { 306, 307, 369, 371, 418, - 9999} ,383 { 307, 308, 370, 372, 418, - 9999} ,384 { 308, 309, 371, 373, 419, - 9999} ,385 { 309, 310, 372, 374, 419, - 9999} ,386 { 310, 311, 373, 375, 420, - 9999} ,387 { 311, 374, 376, 420, 421, - 9999} ,388 { 311, 312, 375, 377, 421, - 9999} ,389 { 312, 313, 376, 378, 422, - 9999} ,390 { 313, 314, 377, 379, 422, - 9999} ,391 { 314, 315, 378, 380, 423, - 9999} ,392 { 315, 316, 379, 381, 423, - 9999} ,393 { 316, 317, 380, 382, 424, - 9999} ,394 { 317, 318, 381, 383, 424, - 9999} ,395 { 318, 319, 382, 384, 425, - 9999} ,396 { 319, 320, 383, 385, 425, - 9999} ,397 { 320, 321, 384, 386, 426, - 9999} ,398 { 321, 385, 387, 426, 427, - 9999} ,399 { 321, 322, 386, 388, 427, - 9999} ,400 { 322, 323, 387, 389, 428, - 9999} ,401 { 323, 324, 388, 390, 428, - 9999} ,402 { 324, 325, 389, 391, 429, - 9999} ,403 { 325, 326, 390, 392, 429, - 9999} ,404 { 326, 327, 391, 393, 430, - 9999} ,405 { 327, 328, 392, 394, 430, - 9999} ,406 { 328, 329, 393, 395, 431, - 9999} ,407 { 329, 330, 394, 396, 431, - 9999} ,408 { 271, 330, 331, 395, 432, - 9999} ,343 { 271, 332, 396, 397, 432, -1} , 344 { 271, 272, 331, 333, 397, -1} , 345 { 272, 273, 332, 334, 398, -1} , 346 { 273, 274, 333, 335, 398, -1} , 347 { 274, 275, 334, 336, 399, -1} , 348 { 275, 276, 335, 337, 399, -1} , 349 { 276, 277, 336, 338, 400, -1} , 350 { 277, 278, 337, 339, 400, -1} , 351 { 278, 279, 338, 340, 401, -1} , 352 { 279, 280, 339, 341, 401, -1} , 353 { 280, 281, 340, 342, 402, -1} , 354 { 281, 341, 343, 402, 403, -1} , 355 { 281, 282, 342, 344, 403, -1} , 356 { 282, 283, 343, 345, 404, -1} , 357 { 283, 284, 344, 346, 404, -1} , 358 { 284, 285, 345, 347, 405, -1} , 359 { 285, 286, 346, 348, 405, -1} , 360 { 286, 287, 347, 349, 406, -1} , 361 { 287, 288, 348, 350, 406, -1} , 362 { 288, 289, 349, 351, 407, -1} , 363 { 289, 290, 350, 352, 407, -1} , 364 { 290, 291, 351, 353, 408, -1} , 365 { 291, 352, 354, 408, 409, -1} , 366 { 291, 292, 353, 355, 409, -1} , 367 { 292, 293, 354, 356, 410, -1} , 368 { 293, 294, 355, 357, 410, -1} , 369 { 294, 295, 356, 358, 411, -1} , 370 { 295, 296, 357, 359, 411, -1} , 371 { 296, 297, 358, 360, 412, -1} , 372 { 297, 298, 359, 361, 412, -1} , 373 { 298, 299, 360, 362, 413, -1} , 374 { 299, 300, 361, 363, 413, -1} , 375 { 300, 301, 362, 364, 414, -1} , 376 { 301, 363, 365, 414, 415, -1} , 377 { 301, 302, 364, 366, 415, -1} , 378 { 302, 303, 365, 367, 416, -1} , 379 { 303, 304, 366, 368, 416, -1} , 380 { 304, 305, 367, 369, 417, -1} , 381 { 305, 306, 368, 370, 417, -1} , 382 { 306, 307, 369, 371, 418, -1} , 383 { 307, 308, 370, 372, 418, -1} , 384 { 308, 309, 371, 373, 419, -1} , 385 { 309, 310, 372, 374, 419, -1} , 386 { 310, 311, 373, 375, 420, -1} , 387 { 311, 374, 376, 420, 421, -1} , 388 { 311, 312, 375, 377, 421, -1} , 389 { 312, 313, 376, 378, 422, -1} , 390 { 313, 314, 377, 379, 422, -1} , 391 { 314, 315, 378, 380, 423, -1} , 392 { 315, 316, 379, 381, 423, -1} , 393 { 316, 317, 380, 382, 424, -1} , 394 { 317, 318, 381, 383, 424, -1} , 395 { 318, 319, 382, 384, 425, -1} , 396 { 319, 320, 383, 385, 425, -1} , 397 { 320, 321, 384, 386, 426, -1} , 398 { 321, 385, 387, 426, 427, -1} , 399 { 321, 322, 386, 388, 427, -1} , 400 { 322, 323, 387, 389, 428, -1} , 401 { 323, 324, 388, 390, 428, -1} , 402 { 324, 325, 389, 391, 429, -1} , 403 { 325, 326, 390, 392, 429, -1} , 404 { 326, 327, 391, 393, 430, -1} , 405 { 327, 328, 392, 394, 430, -1} , 406 { 328, 329, 393, 395, 431, -1} , 407 { 329, 330, 394, 396, 431, -1} , 408 { 271, 330, 331, 395, 432, -1} , 409 409 { 331, 332, 398, 432, 433, 434} , 410 { 333, 334, 397, 399, 434, - 9999} ,411 { 335, 336, 400, 435, 436, - 9999} ,412 { 337, 338, 399, 401, 437, - 9999} ,413 { 339, 340, 400, 402, 438, - 9999} ,410 { 333, 334, 397, 399, 434, -1} , 411 { 335, 336, 400, 435, 436, -1} , 412 { 337, 338, 399, 401, 437, -1} , 413 { 339, 340, 400, 402, 438, -1} , 414 414 { 341, 342, 401, 403, 438, 439} , 415 415 { 342, 343, 402, 404, 440, 441} , 416 { 344, 345, 403, 441, 442, - 9999} ,417 { 346, 347, 404, 442, 443, - 9999} ,418 { 348, 349, 405, 443, 444, - 9999} ,419 { 350, 351, 406, 444, 445, - 9999} ,416 { 344, 345, 403, 441, 442, -1} , 417 { 346, 347, 404, 442, 443, -1} , 418 { 348, 349, 405, 443, 444, -1} , 419 { 350, 351, 406, 444, 445, -1} , 420 420 { 352, 353, 407, 409, 445, 446} , 421 421 { 353, 354, 408, 410, 447, 448} , 422 { 355, 356, 409, 411, 448, - 9999} ,423 { 357, 358, 410, 412, 449, - 9999} ,424 { 359, 360, 411, 450, 451, - 9999} ,425 { 361, 362, 412, 414, 452, - 9999} ,422 { 355, 356, 409, 411, 448, -1} , 423 { 357, 358, 410, 412, 449, -1} , 424 { 359, 360, 411, 450, 451, -1} , 425 { 361, 362, 412, 414, 452, -1} , 426 426 { 363, 364, 413, 415, 452, 453} , 427 427 { 364, 365, 414, 416, 454, 455} , 428 { 366, 367, 415, 417, 455, - 9999} ,429 { 368, 369, 418, 456, 457, - 9999} ,430 { 370, 371, 417, 419, 458, - 9999} ,431 { 372, 373, 418, 420, 459, - 9999} ,428 { 366, 367, 415, 417, 455, -1} , 429 { 368, 369, 418, 456, 457, -1} , 430 { 370, 371, 417, 419, 458, -1} , 431 { 372, 373, 418, 420, 459, -1} , 432 432 { 374, 375, 419, 421, 459, 460} , 433 433 { 375, 376, 420, 422, 461, 462} , 434 { 377, 378, 421, 462, 463, - 9999} ,435 { 379, 380, 422, 463, 464, - 9999} ,436 { 381, 382, 423, 464, 465, - 9999} ,437 { 383, 384, 424, 465, 466, - 9999} ,434 { 377, 378, 421, 462, 463, -1} , 435 { 379, 380, 422, 463, 464, -1} , 436 { 381, 382, 423, 464, 465, -1} , 437 { 383, 384, 424, 465, 466, -1} , 438 438 { 385, 386, 425, 427, 466, 467} , 439 439 { 386, 387, 426, 428, 468, 469} , 440 { 388, 389, 427, 429, 469, - 9999} ,441 { 390, 391, 428, 430, 470, - 9999} ,442 { 392, 393, 429, 471, 472, - 9999} ,443 { 394, 395, 430, 432, 473, - 9999} ,440 { 388, 389, 427, 429, 469, -1} , 441 { 390, 391, 428, 430, 470, -1} , 442 { 392, 393, 429, 471, 472, -1} , 443 { 394, 395, 430, 432, 473, -1} , 444 444 { 331, 396, 397, 431, 473, 474} , 445 { 397, 434, 474, 475, 476, - 9999} ,445 { 397, 434, 474, 475, 476, -1} , 446 446 { 397, 398, 433, 435, 476, 477} , 447 447 { 398, 399, 434, 436, 477, 478} , … … 449 449 { 400, 401, 436, 438, 479, 480} , 450 450 { 401, 402, 437, 439, 480, 481} , 451 { 402, 438, 440, 481, 482, - 9999} ,452 { 403, 439, 441, 483, 484, - 9999} ,451 { 402, 438, 440, 481, 482, -1} , 452 { 403, 439, 441, 483, 484, -1} , 453 453 { 403, 404, 440, 442, 484, 485} , 454 454 { 404, 405, 441, 443, 485, 486} , … … 456 456 { 406, 407, 443, 445, 487, 488} , 457 457 { 407, 408, 444, 446, 488, 489} , 458 { 408, 445, 447, 489, 490, - 9999} ,459 { 409, 446, 448, 491, 492, - 9999} ,458 { 408, 445, 447, 489, 490, -1} , 459 { 409, 446, 448, 491, 492, -1} , 460 460 { 409, 410, 447, 449, 492, 493} , 461 461 { 410, 411, 448, 450, 493, 494} , … … 463 463 { 412, 413, 450, 452, 495, 496} , 464 464 { 413, 414, 451, 453, 496, 497} , 465 { 414, 452, 454, 497, 498, - 9999} ,466 { 415, 453, 455, 499, 500, - 9999} ,465 { 414, 452, 454, 497, 498, -1} , 466 { 415, 453, 455, 499, 500, -1} , 467 467 { 415, 416, 454, 456, 500, 501} , 468 468 { 416, 417, 455, 457, 501, 502} , … … 470 470 { 418, 419, 457, 459, 503, 504} , 471 471 { 419, 420, 458, 460, 504, 505} , 472 { 420, 459, 461, 505, 506, - 9999} ,473 { 421, 460, 462, 507, 508, - 9999} ,472 { 420, 459, 461, 505, 506, -1} , 473 { 421, 460, 462, 507, 508, -1} , 474 474 { 421, 422, 461, 463, 508, 509} , 475 475 { 422, 423, 462, 464, 509, 510} , … … 477 477 { 424, 425, 464, 466, 511, 512} , 478 478 { 425, 426, 465, 467, 512, 513} , 479 { 426, 466, 468, 513, 514, - 9999} ,480 { 427, 467, 469, 515, 516, - 9999} ,479 { 426, 466, 468, 513, 514, -1} , 480 { 427, 467, 469, 515, 516, -1} , 481 481 { 427, 428, 468, 470, 516, 517} , 482 482 { 428, 429, 469, 471, 517, 518} , … … 484 484 { 430, 431, 471, 473, 519, 520} , 485 485 { 431, 432, 472, 474, 520, 521} , 486 { 432, 433, 473, 521, 522, - 9999} ,487 { 433, 476, 522, 523, 524, - 9999} ,486 { 432, 433, 473, 521, 522, -1} , 487 { 433, 476, 522, 523, 524, -1} , 488 488 { 433, 434, 475, 477, 524, 525} , 489 489 { 434, 435, 476, 478, 525, 526} , … … 492 492 { 437, 438, 479, 481, 528, 529} , 493 493 { 438, 439, 480, 482, 529, 530} , 494 { 439, 481, 483, 530, 531, - 9999} ,495 { 440, 482, 484, 532, 533, - 9999} ,494 { 439, 481, 483, 530, 531, -1} , 495 { 440, 482, 484, 532, 533, -1} , 496 496 { 440, 441, 483, 485, 533, 534} , 497 497 { 441, 442, 484, 486, 534, 535} , … … 500 500 { 444, 445, 487, 489, 537, 538} , 501 501 { 445, 446, 488, 490, 538, 539} , 502 { 446, 489, 491, 539, 540, - 9999} ,503 { 447, 490, 492, 541, 542, - 9999} ,502 { 446, 489, 491, 539, 540, -1} , 503 { 447, 490, 492, 541, 542, -1} , 504 504 { 447, 448, 491, 493, 542, 543} , 505 505 { 448, 449, 492, 494, 543, 544} , … … 508 508 { 451, 452, 495, 497, 546, 547} , 509 509 { 452, 453, 496, 498, 547, 548} , 510 { 453, 497, 499, 548, 549, - 9999} ,511 { 454, 498, 500, 550, 551, - 9999} ,510 { 453, 497, 499, 548, 549, -1} , 511 { 454, 498, 500, 550, 551, -1} , 512 512 { 454, 455, 499, 501, 551, 552} , 513 513 { 455, 456, 500, 502, 552, 553} , … … 516 516 { 458, 459, 503, 505, 555, 556} , 517 517 { 459, 460, 504, 506, 556, 557} , 518 { 460, 505, 507, 557, 558, - 9999} ,519 { 461, 506, 508, 559, 560, - 9999} ,518 { 460, 505, 507, 557, 558, -1} , 519 { 461, 506, 508, 559, 560, -1} , 520 520 { 461, 462, 507, 509, 560, 561} , 521 521 { 462, 463, 508, 510, 561, 562} , … … 524 524 { 465, 466, 511, 513, 564, 565} , 525 525 { 466, 467, 512, 514, 565, 566} , 526 { 467, 513, 515, 566, 567, - 9999} ,527 { 468, 514, 516, 568, 569, - 9999} ,526 { 467, 513, 515, 566, 567, -1} , 527 { 468, 514, 516, 568, 569, -1} , 528 528 { 468, 469, 515, 517, 569, 570} , 529 529 { 469, 470, 516, 518, 570, 571} , … … 532 532 { 472, 473, 519, 521, 573, 574} , 533 533 { 473, 474, 520, 522, 574, 575} , 534 { 474, 475, 521, 575, 576, -9999} , 535 { 475, 524, 576, -9999, -9999, -9999} , 536 { 475, 476, 523, 525, -9999, -9999} , 537 { 476, 477, 524, 526, -9999, -9999} , 538 { 477, 478, 525, 527, -9999, -9999} , 539 { 478, 479, 526, 528, -9999, -9999} , 540 { 479, 480, 527, 529, -9999, -9999} , 541 { 480, 481, 528, 530, -9999, -9999} , 542 { 481, 482, 529, 531, -9999, -9999} , 543 { 482, 530, 532, -9999, -9999, -9999} , 544 { 483, 531, 533, -9999, -9999, -9999} , 545 { 483, 484, 532, 534, -9999, -9999} , 546 { 484, 485, 533, 535, -9999, -9999} , 547 { 485, 486, 534, 536, -9999, -9999} , 548 { 486, 487, 535, 537, -9999, -9999} , 549 { 487, 488, 536, 538, -9999, -9999} , 550 { 488, 489, 537, 539, -9999, -9999} , 551 { 489, 490, 538, 540, -9999, -9999} , 552 { 490, 539, 541, -9999, -9999, -9999} , 553 { 491, 540, 542, -9999, -9999, -9999} , 554 { 491, 492, 541, 543, -9999, -9999} , 555 { 492, 493, 542, 544, -9999, -9999} , 556 { 493, 494, 543, 545, -9999, -9999} , 557 { 494, 495, 544, 546, -9999, -9999} , 558 { 495, 496, 545, 547, -9999, -9999} , 559 { 496, 497, 546, 548, -9999, -9999} , 560 { 497, 498, 547, 549, -9999, -9999} , 561 { 498, 548, 550, -9999, -9999, -9999} , 562 { 499, 549, 551, -9999, -9999, -9999} , 563 { 499, 500, 550, 552, -9999, -9999} , 564 { 500, 501, 551, 553, -9999, -9999} , 565 { 501, 502, 552, 554, -9999, -9999} , 566 { 502, 503, 553, 555, -9999, -9999} , 567 { 503, 504, 554, 556, -9999, -9999} , 568 { 504, 505, 555, 557, -9999, -9999} , 569 { 505, 506, 556, 558, -9999, -9999} , 570 { 506, 557, 559, -9999, -9999, -9999} , 571 { 507, 558, 560, -9999, -9999, -9999} , 572 { 507, 508, 559, 561, -9999, -9999} , 573 { 508, 509, 560, 562, -9999, -9999} , 574 { 509, 510, 561, 563, -9999, -9999} , 575 { 510, 511, 562, 564, -9999, -9999} , 576 { 511, 512, 563, 565, -9999, -9999} , 577 { 512, 513, 564, 566, -9999, -9999} , 578 { 513, 514, 565, 567, -9999, -9999} , 579 { 514, 566, 568, -9999, -9999, -9999} , 580 { 515, 567, 569, -9999, -9999, -9999} , 581 { 515, 516, 568, 570, -9999, -9999} , 582 { 516, 517, 569, 571, -9999, -9999} , 583 { 517, 518, 570, 572, -9999, -9999} , 584 { 518, 519, 571, 573, -9999, -9999} , 585 { 519, 520, 572, 574, -9999, -9999} , 586 { 520, 521, 573, 575, -9999, -9999} , 587 { 521, 522, 574, 576, -9999, -9999} , 588 { 522, 523, 575, -9999, -9999, -9999} } ; 589 534 { 474, 475, 521, 575, 576, -1} , 535 { 475, 524, 576, -1, -1, -1} , 536 { 475, 476, 523, 525, -1, -1} , 537 { 476, 477, 524, 526, -1, -1} , 538 { 477, 478, 525, 527, -1, -1} , 539 { 478, 479, 526, 528, -1, -1} , 540 { 479, 480, 527, 529, -1, -1} , 541 { 480, 481, 528, 530, -1, -1} , 542 { 481, 482, 529, 531, -1, -1} , 543 { 482, 530, 532, -1, -1, -1} , 544 { 483, 531, 533, -1, -1, -1} , 545 { 483, 484, 532, 534, -1, -1} , 546 { 484, 485, 533, 535, -1, -1} , 547 { 485, 486, 534, 536, -1, -1} , 548 { 486, 487, 535, 537, -1, -1} , 549 { 487, 488, 536, 538, -1, -1} , 550 { 488, 489, 537, 539, -1, -1} , 551 { 489, 490, 538, 540, -1, -1} , 552 { 490, 539, 541, -1, -1, -1} , 553 { 491, 540, 542, -1, -1, -1} , 554 { 491, 492, 541, 543, -1, -1} , 555 { 492, 493, 542, 544, -1, -1} , 556 { 493, 494, 543, 545, -1, -1} , 557 { 494, 495, 544, 546, -1, -1} , 558 { 495, 496, 545, 547, -1, -1} , 559 { 496, 497, 546, 548, -1, -1} , 560 { 497, 498, 547, 549, -1, -1} , 561 { 498, 548, 550, -1, -1, -1} , 562 { 499, 549, 551, -1, -1, -1} , 563 { 499, 500, 550, 552, -1, -1} , 564 { 500, 501, 551, 553, -1, -1} , 565 { 501, 502, 552, 554, -1, -1} , 566 { 502, 503, 553, 555, -1, -1} , 567 { 503, 504, 554, 556, -1, -1} , 568 { 504, 505, 555, 557, -1, -1} , 569 { 505, 506, 556, 558, -1, -1} , 570 { 506, 557, 559, -1, -1, -1} , 571 { 507, 558, 560, -1, -1, -1} , 572 { 507, 508, 559, 561, -1, -1} , 573 { 508, 509, 560, 562, -1, -1} , 574 { 509, 510, 561, 563, -1, -1} , 575 { 510, 511, 562, 564, -1, -1} , 576 { 511, 512, 563, 565, -1, -1} , 577 { 512, 513, 564, 566, -1, -1} , 578 { 513, 514, 565, 567, -1, -1} , 579 { 514, 566, 568, -1, -1, -1} , 580 { 515, 567, 569, -1, -1, -1} , 581 { 515, 516, 568, 570, -1, -1} , 582 { 516, 517, 569, 571, -1, -1} , 583 { 517, 518, 570, 572, -1, -1} , 584 { 518, 519, 571, 573, -1, -1} , 585 { 519, 520, 572, 574, -1, -1} , 586 { 520, 521, 573, 575, -1, -1} , 587 { 521, 522, 574, 576, -1, -1} , 588 { 522, 523, 575, -1, -1, -1} } ; 590 589 591 590 for (Int_t ip=0; ip<577; ip++) 592 for (Int_t in=0; in<6; in++) 593 fNN[ip][in] = help[ip][in] ; 594 595 591 for (Int_t in=0; in<6; in++) 592 fNN[ip][in] = help[ip][in]; 596 593 } 597 594 598 Int_t MCamNeighbor::GetNN(Int_t pix, Int_t inn )595 Int_t MCamNeighbor::GetNN(Int_t pix, Int_t inn) 599 596 { 600 // return the number of one neighbor 601 602 if ( pix >= 577 ) { 603 cout << "ERROR GetNN -> pixel out of range" << endl ; 604 exit (123) ; 605 } 606 607 if ( inn >= 6 ) { 608 cout << "ERROR GetNN -> not more than 6 neighbors" << endl ; 609 exit (123) ; 610 } 611 612 return fNN[pix][inn] ; 597 // return the number of one neighbor 598 599 if ( pix >= 577 ) 600 { 601 gLog << "WARNING: GetNN -> pixel out of range" << endl; 602 return -1; 603 } 604 605 if ( inn >= 6 ) 606 { 607 gLog << "WARNING: GetNN -> not more than 6 neighbors" << endl; 608 return -1; 609 } 610 611 return fNN[pix][inn] ; 613 612 } 614 613 615 614 void MCamNeighbor::CheckPixel(Int_t pix) 616 615 { 617 cout << " Pixel " << pix << " has neighbors " ; 618 for (Int_t i=0; i<6; i++ ) 619 cout << fNN[pix][i] << "/" ; 620 cout << endl ; 621 616 gLog << " Pixel " << pix << " has neighbors " ; 617 618 gLog << fNN[pix][0]; 619 620 for (Int_t i=1; i<6; i++ ) 621 if (fNN[pix][i] >= 0) 622 gLog << ", " << fNN[pix][i]; 623 624 gLog << endl ; 625 622 626 } 623 627 624 void MCamNeighbor::Print( )628 void MCamNeighbor::Print(Option_t *) 625 629 { 626 for (Int_t i=0; i<577; i++ ) { 627 628 cout << " Pixel " << i ; 629 630 for (Int_t j=0; j<6; j++ ) { 631 cout << " ->" << fNN[i][j] ; 632 } 633 cout << endl ; 634 635 } 630 for (Int_t i=0; i<577; i++ ) 631 { 632 gLog << " Pixel " << i << ":"; 633 634 for (Int_t j=0; j<6; j++ ) 635 gLog << " " << fNN[i][j]; 636 637 gLog << endl; 638 } 636 639 } -
trunk/MagicSoft/Mars/mgui/MCamNeighbor.h
r597 r653 2 2 #define MCAMNEIGHBOR_H 3 3 4 #include <iostream> 5 4 #ifndef MAGIC_H 6 5 #include "MAGIC.h" 6 #endif 7 7 8 8 class MCamNeighbor … … 18 18 Int_t GetNN(Int_t pix, Int_t inn) ; 19 19 void CheckPixel(Int_t pix) ; 20 void Print( ) ;20 void Print(Option_t *opt=NULL) ; 21 21 22 ClassDef(MCamNeighbor, 1) //22 ClassDef(MCamNeighbor, 1) // Conatins the neighbors in the magic camera 23 23 } ; 24 24 -
trunk/MagicSoft/Mars/mgui/MHexagon.cc
r589 r653 1 #include <stdlib.h> 2 #include <fstream.h> 3 #include <iostream.h> 4 5 #include "TROOT.h" 6 #include "TVirtualPad.h" 7 #include "TMath.h" 8 9 #include "MHexagon.h" 10 1 // 2 // The class MHexagon is needed for the Event Display of 3 // MAGIC. 4 // 5 #include "MHexagon.h" 6 7 #include <TVirtualPad.h> // gPad 8 9 #include "MGeomPix.h" // GetX 11 10 12 11 ClassImp(MHexagon) 13 12 14 // 15 // The class MHexagon is needed for the Event Display of 16 // MAGIC. 17 18 19 20 MHexagon::MHexagon() : TObject(), TAttLine(), TAttFill() 13 MHexagon::MHexagon() 21 14 { 22 15 // default constructor for MHexagon … … 24 17 } 25 18 26 MHexagon::MHexagon(Float_t x, Float_t y, Float_t d ) : TObject(), TAttLine(), TAttFill(0, 1001) 19 MHexagon::MHexagon(Float_t x, Float_t y, Float_t d ) 20 : TAttFill(0, 1001), fX(x), fY(y), fD(d) 27 21 { 28 22 // normal constructor for MHexagon 29 fX = x ; 30 fY = y ; 31 fD = d ; 32 33 } 23 } 24 25 MHexagon::MHexagon(MGeomPix &pix) 26 : TAttFill(0, 1001) 27 { 28 // normal constructor for MHexagon 29 fX = pix.GetX(); 30 fY = pix.GetY(); 31 fD = pix.GetR(); 32 } 33 34 34 MHexagon::MHexagon( const MHexagon &hexagon) 35 35 { … … 41 41 { 42 42 // default destructor for MHexagon 43 44 43 } 45 44 … … 47 46 { 48 47 // copy this hexagon to hexagon 49 50 TObject::Copy ( obj ) ; 51 TAttLine::Copy (((MHexagon&) obj ) ) ; 52 TAttFill::Copy (((MHexagon&) obj ) ) ; 53 54 ((MHexagon&) obj).fX = fX ; 55 ((MHexagon&) obj).fY = fY ; 56 ((MHexagon&) obj).fD = fD ; 57 } 58 Int_t MHexagon::DistancetoPrimitive( Int_t px, Int_t py ) 59 { 60 // compute the distance of a point (px,py) to the Hexagon 61 // this functions needed for graphical primitives, that 62 // means without this function you are not able to interact 63 // with the graphical primitive with the mouse!!! 64 // 65 // All calcutations are running in pixel coordinates 66 67 // compute the distance of the Point to the center of the Hexagon 68 69 Int_t pxhex = gPad->XtoAbsPixel( fX ) ; 70 Int_t pyhex = gPad->YtoAbsPixel( fY ) ; 71 72 Double_t DistPointHexagon = TMath::Sqrt( Double_t ((pxhex-px)*(pxhex-px) + (pyhex-py)*(pyhex-py))) ; 73 Double_t cosa = TMath::Abs(px-pxhex) / DistPointHexagon ; 74 Double_t sina = TMath::Abs(py-pyhex) / DistPointHexagon ; 48 TObject::Copy ( obj ) ; 49 TAttLine::Copy (((MHexagon&) obj ) ) ; 50 TAttFill::Copy (((MHexagon&) obj ) ) ; 51 52 ((MHexagon&) obj).fX = fX ; 53 ((MHexagon&) obj).fY = fY ; 54 ((MHexagon&) obj).fD = fD ; 55 } 56 Int_t MHexagon::DistancetoPrimitive( Int_t px, Int_t py ) 57 { 58 // compute the distance of a point (px,py) to the Hexagon 59 // this functions needed for graphical primitives, that 60 // means without this function you are not able to interact 61 // with the graphical primitive with the mouse!!! 62 // 63 // All calcutations are running in pixel coordinates 64 65 // compute the distance of the Point to the center of the Hexagon 66 67 const Int_t pxhex = gPad->XtoAbsPixel( fX ) ; 68 const Int_t pyhex = gPad->YtoAbsPixel( fY ) ; 69 70 const Double_t DistPointHexagon = TMath::Sqrt( Double_t ((pxhex-px)*(pxhex-px) + (pyhex-py)*(pyhex-py))) ; 71 const Double_t cosa = TMath::Abs(px-pxhex) / DistPointHexagon ; 72 const Double_t sina = TMath::Abs(py-pyhex) / DistPointHexagon ; 75 73 76 74 // comput the distance to pixel border 77 75 78 Double_t dx = fD * cosa / 2 ;79 Double_t dy = fD * sina / 2 ;80 81 Double_t xborder = fX + dx ;82 Double_t yborder = fY + dy ;83 84 Int_t pxborder = gPad->XtoAbsPixel( xborder ) ;85 Int_t pyborder = gPad->YtoAbsPixel( yborder ) ;86 87 Double_t DistBorderHexagon = TMath::Sqrt( Double_t ((pxborder-pxhex)*(pxborder-pxhex)+(pyborder-pyhex)*(pyborder-pyhex))) ;76 const Double_t dx = fD * cosa / 2 ; 77 const Double_t dy = fD * sina / 2 ; 78 79 const Double_t xborder = fX + dx ; 80 const Double_t yborder = fY + dy ; 81 82 const Int_t pxborder = gPad->XtoAbsPixel( xborder ) ; 83 const Int_t pyborder = gPad->YtoAbsPixel( yborder ) ; 84 85 const Double_t DistBorderHexagon = TMath::Sqrt( Double_t ((pxborder-pxhex)*(pxborder-pxhex)+(pyborder-pyhex)*(pyborder-pyhex))) ; 88 86 89 87 … … 91 89 // here in the first implementation is just circle inside 92 90 93 if ( DistBorderHexagon < DistPointHexagon ) 94 return 999999 ; 95 else 96 // return Int_t ( DistBorderHexagon - DistPointHexagon ) ; 97 return 0 ; 91 return DistBorderHexagon < DistPointHexagon ? 999999 : 0; 98 92 } 99 93 … … 147 141 // list this hexagon with its attributes 148 142 TROOT::IndentLevel() ; 149 printf ("%s: X= %f Y= %f R= %f \n", GetName , fX, fY, fD ) ;143 printf ("%s: X= %f Y= %f R= %f \n", GetName(), fX, fY, fD ) ; 150 144 } 151 145 … … 164 158 const Int_t np = 6 ; 165 159 166 Float_t dx[np+1] = { .5 , 0. , -.5 , -.5 , 0. , .5 , .5 } ;167 Float_t dy[np+1] = { .2886, .5772, .2886, -.2886, -.5772, -.2886, .2886 } ;160 const Float_t dx[np+1] = { .5 , 0. , -.5 , -.5 , 0. , .5 , .5 } ; 161 const Float_t dy[np+1] = { .2886, .5772, .2886, -.2886, -.5772, -.2886, .2886 } ; 168 162 169 163 static Float_t x[np+1], y[np+1] ; … … 189 183 { 190 184 // print/dump this hexagon with its attributes 191 printf ("Ellipse: X= %f Y= %f R= %f ", fX, fY, fD ) ; 185 printf ("Ellipse: X= %f Y= %f R= %f ", fX, fY, fD ) ; 192 186 193 187 if ( GetLineColor() != 1 ) printf (" Color=%d", GetLineColor() ) ; -
trunk/MagicSoft/Mars/mgui/MHexagon.h
r609 r653 22 22 #endif 23 23 24 class MGeomPix; 25 24 26 class MHexagon : public TObject, public TAttLine, public TAttFill 25 27 { … … 33 35 34 36 MHexagon() ; 35 MHexagon(Float_t x, Float_t y, Float_t d ) ; 37 MHexagon(Float_t x, Float_t y, Float_t d ) ; 38 MHexagon(MGeomPix &pix); 36 39 MHexagon( const MHexagon &hexagon) ; 37 40 virtual ~MHexagon() ;
Note:
See TracChangeset
for help on using the changeset viewer.