Changeset 695
- Timestamp:
- 03/20/01 17:25:33 (24 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 12 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r670 r695 1 1 -*-*- END -*-*- 2 3 2000/03/20: Thomas Bretz 4 5 * manalysis/MPedestalPix.[h,cc], manalysis/MPedestalCam.[h,cc], 6 manalysis/MHillas.[h,cc], manalysis/MHillasCalc.[h,cc], 7 mgui/MGeomCamCT1.[h,cc], mgui/MGeomCamMagic.[h,cc] 8 - added 9 10 * macros/readCT1.C: 11 - added calculation of Hillas parameters 12 - changed from pointers to objects 13 14 * manalysis/AnalysisLinkDef.h, manalysis/Makefile: 15 - added MPedestalPix/Cam, MHillas, MHillasCalc 16 17 * manalysis/MCerPhotEvt.[h,cc]: 18 - removed fType 19 - commented out Draw function - should be fixed soon 20 - renamed *Nb* to *Num* 21 - renamed Get[Min,Max]NumPhotons to GetNumPhontons[Min,Max] 22 23 * meventdisp/MGFadcDisp.[h,cc]: 24 - changed parameter of ReadinEvent to unsigned 25 26 * mgui/GuiLinkDef.h, mgui/Makefile: 27 - added MGeomCamCT1, MGeomCamMagic 28 29 * mgui/MCamDisplay.[h,cc]: 30 - changed constructor argument from int to MGeomCam 31 - renamed *Nb* to *Num* 32 33 * mgui/MGeomCam.[h,cc]: 34 - removed all camara specific stuff 35 - MGeomCam is now used as a base class for the classes 36 MGeomCam[Magic,CT1] which are containing the camera specific stuff 37 38 * mgui/MGeomPix.h: 39 - added Set function 40 41 2 42 2000/03/02: Thomas Bretz 3 43 -
trunk/MagicSoft/Mars/macros/readCT1.C
r655 r695 1 1 void readCT1() 2 2 { 3 MParList *plist = new MParList();3 MParList plist; 4 4 5 MCT1ReadAscii *readct1 = new MCT1ReadAscii("CT1_99_on1.dat") ; 5 MGeomCamMagic camct1; 6 MHillas hillas; 7 MTaskList tlist; 6 8 7 if (!readct1->PreProcess(plist)) 9 plist->AddToList(&camct1); 10 plist->AddToList(&hillas); 11 plist->AddToList(&tlist); 12 13 MCT1ReadAscii readct1("CT1_99_on1.dat") ; 14 MHillasCalc hcalc; 15 16 tlist.AddToList(&readct1); 17 tlist.AddToList(&hcalc); 18 19 MEvtLoop evtloop; 20 evtloop.SetParList(&plist); 21 22 if (!evtloop.PreProcess()) 8 23 return; 9 24 10 MCerPhotEvt *phevt =(MCerPhotEvt*)plist->FindObject("MCerPhotEvt");25 MCerPhotEvt &phevt = *(MCerPhotEvt*)plist->FindObject("MCerPhotEvt"); 11 26 12 27 Int_t icount = 0 ; 13 MCamDisplay display( 0) ;28 MCamDisplay display(&camct1) ; 14 29 15 while ( readct1->Process())30 while (readct1.Process()) 16 31 { 17 32 cout << "Event: " << icount++ << endl ; 18 33 19 if (icount >= 45 ) 20 { 21 display->DrawPhotNum( phevt ) ; 34 if (icount < 45 ) 35 continue; 22 36 23 gClient->HandleInput(); 24 if(getchar()=='q') 25 break; 37 display.DrawPhotNum(&phevt); 38 gClient->HandleInput(); 39 if(getchar()=='q') 40 break; 26 41 27 phevt->CleanLevel1();28 phevt->CleanLevel2();29 display->DrawPhotNum( phevt );30 31 32 42 phevt.CleanLevel1(); 43 phevt.CleanLevel2(); 44 display.DrawPhotNum(&phevt); 45 gClient->HandleInput(); 46 if(getchar()=='q') 47 break; 33 48 34 phevt->CleanLevel3();49 phevt.CleanLevel3(); 35 50 36 display->DrawPhotNum( phevt ) ; 37 gClient->HandleInput(); 38 if(getchar()=='q') 39 break; 40 } 51 hcalc.Process(); 52 53 hillas.Print(); 54 hillas.Draw(); 55 56 display.DrawPhotNum(&phevt); 57 58 gClient->HandleInput(); 59 if(getchar()=='q') 60 break; 61 62 hillas.Clear(); 41 63 } 42 64 43 readct1->PostProcess();65 evtloop.PostProcess(); 44 66 } -
trunk/MagicSoft/Mars/manalysis/AnalysisIncl.h
r597 r695 1 1 #ifndef __CINT__ 2 3 2 4 3 #include <TClonesArray.h> -
trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h
r653 r695 11 11 #pragma link C++ class MCT1Pedestals; 12 12 13 #pragma link C++ class MPedestalPix; 14 #pragma link C++ class MPedestalCam; 15 16 #pragma link C++ class MHillas; 17 #pragma link C++ class MHillasCalc; 18 13 19 #endif -
trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc
r653 r695 8 8 9 9 #include "MLog.h" 10 #include "MGeomCam.h"11 10 #include "MCamNeighbor.h" 12 11 #include "MCamDisplay.h" … … 15 14 ClassImp(MCerPhotEvt) 16 15 17 MCerPhotEvt::MCerPhotEvt(const char *name, const char *title ) : fType(0), fNbPixels(0)16 MCerPhotEvt::MCerPhotEvt(const char *name, const char *title) : fNumPixels(0) 18 17 { 19 18 // the default constructor … … 31 30 } 32 31 32 #include "MGeomCamMagic.h" 33 #include "MGeomCamCT1.h" 34 33 35 void MCerPhotEvt::Draw(Option_t* option) 34 36 { 35 // FIXME!!! 36 // 37 38 MCamDisplay *disp = new MCamDisplay(fType) ; 39 40 disp->DrawPhotNum(this) ; 41 } 42 43 Int_t MCerPhotEvt::GetNbPixels() 44 { 45 return fNbPixels; 37 // 38 // FIXME!!! Here the Draw function of the CamDisplay 39 // should be called to add the CamDisplay to the Pad. 40 // The drawing should be done in MCamDisplay::Paint 41 // 42 43 // MGeomCam *geom = fType ? new MGeomCamMagic : new MGeomCamCT1; 44 // MCamDisplay *disp = new MCamDisplay(geom); 45 // delete geom; 46 // disp->DrawPhotNum(this); 47 } 48 49 Int_t MCerPhotEvt::GetNumPixels() 50 { 51 return fNumPixels; 46 52 } 47 53 … … 52 58 // of valid pixels in the list by one 53 59 // 54 (*fPixels)[fN bPixels++] = new MCerPhotPix( id, nph, err);60 (*fPixels)[fNumPixels++] = new MCerPhotPix( id, nph, err); 55 61 } 56 62 … … 60 66 // reset counter and delete netries in list. 61 67 // 62 fN bPixels = 0 ;68 fNumPixels = 0 ; 63 69 fPixels->Clear() ; 64 70 } … … 69 75 70 76 *fLog << "MCerPhotEvt::Print()" << endl 71 << "Number of Pixels: " << fN bPixels77 << "Number of Pixels: " << fNumPixels 72 78 << "(" << entries << ")" 73 79 << endl ; … … 276 282 } 277 283 278 Float_t MCerPhotEvt::Get MinNumPhotons()284 Float_t MCerPhotEvt::GetNumPhotonsMin() 279 285 { 280 286 // 281 287 // get the minimum number of photons of all valid pixels in the list 282 288 // 283 if (fN bPixels <= 0)289 if (fNumPixels <= 0) 284 290 return -5. ; 285 291 … … 287 293 288 294 Float_t testval; 289 for (Int_t i=1 ; i<fN bPixels; i++ )295 for (Int_t i=1 ; i<fNumPixels; i++ ) 290 296 { 291 297 testval = (*this)[i].GetNumPhotons(); … … 298 304 } 299 305 300 Float_t MCerPhotEvt::Get MaxNumPhotons()306 Float_t MCerPhotEvt::GetNumPhotonsMax() 301 307 { 302 308 // 303 309 // get the maximum number of photons of all valid pixels in the list 304 310 // 305 if (fN bPixels <= 0)311 if (fNumPixels <= 0) 306 312 return 50.; 307 313 … … 309 315 310 316 Float_t testval; 311 for (Int_t i=1; i<fN bPixels; i++)317 for (Int_t i=1; i<fNumPixels; i++) 312 318 { 313 319 testval = (*this)[i].GetNumPhotons(); -
trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h
r653 r695 21 21 private: 22 22 23 Int_t fType; 24 Int_t fNbPixels; 23 Int_t fNumPixels; 25 24 TClonesArray *fPixels; 26 25 … … 32 31 void Draw(Option_t* option = "" ) ; 33 32 34 Int_t GetN bPixels() ;33 Int_t GetNumPixels() ; 35 34 36 35 void AddPixel(Int_t id, Float_t nph, Float_t err ); … … 48 47 Bool_t IsPixelCore ( Int_t id ) ; 49 48 50 Float_t Get MinNumPhotons();51 Float_t Get MaxNumPhotons();49 Float_t GetNumPhotonsMin(); 50 Float_t GetNumPhotonsMax(); 52 51 53 52 MCerPhotPix &operator[](int i) { return *(MCerPhotPix*)(fPixels->At(i)); } -
trunk/MagicSoft/Mars/manalysis/Makefile
r665 r695 30 30 SRCFILES = MCT1Pedestals.cc \ 31 31 MCT1ReadAscii.cc \ 32 MPedestalCam.cc \ 33 MPedestalPix.cc \ 34 MHillas.cc \ 35 MHillasCalc.cc \ 32 36 MCerPhotEvt.cc \ 33 37 MCerPhotPix.cc -
trunk/MagicSoft/Mars/meventdisp/MGFadcDisp.cc
r663 r695 339 339 } 340 340 341 void MGFadcDisp::ReadinEvent( Int_t iEvt)341 void MGFadcDisp::ReadinEvent(UInt_t iEvt) 342 342 { 343 343 Int_t buttons = 4; … … 346 346 // first check if the new event is in the range of possible events 347 347 348 if ( iEvt < 0 || iEvt>= fReadTree->GetEntries() )348 if ( iEvt >= fReadTree->GetEntries() ) 349 349 { 350 350 new TGMsgBox(fClient->GetRoot(), this, -
trunk/MagicSoft/Mars/meventdisp/MGFadcDisp.h
r663 r695 114 114 void CreatePixelList() ; 115 115 void UpdateEventCounter() ; 116 void ReadinEvent( Int_t iEvt) ;116 void ReadinEvent(UInt_t iEvt) ; 117 117 118 118 virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2); -
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.