Changeset 2135 for trunk/MagicSoft
- Timestamp:
- 05/23/03 17:30:31 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 added
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2133 r2135 1 1 -*-*- END OF LINE -*-*- 2 2003/05/23: Thomas Bretz 3 4 * Makefile: 5 - added mreflector 6 7 * manalysis/MCerPhotAnal.cc, manalysis/MCerPhotCalc.cc: 8 - use FixSize instead of InitSize 9 10 * manalysis/MCerPhotEvt.[h,cc]: 11 - replaced InitSize by FixSize (seems to be more logical) 12 13 * manalysis/MMcPedestalNSBAdd.cc: 14 - replaced GetR by GetPixRatio 15 16 * manalysis/MPedestalCam.cc: 17 - replaced GetEntries by GetEntriesFast 18 19 * mfileio/FileIOLinkDef.h, mfileio/Makefile: 20 - added MReadRflFile 21 22 * mgeom/MGeomCam.[h,cc], mgeom/MGeomPix.[h,cc], 23 mgeom/MGeomCamMagic.[h,cc]: 24 - replaced R by D 25 26 * mgui/MCamDisplay.[h,cc]: 27 - added TClonesArray to display reflector events 28 - added FillRflEvent 29 - added ShowRflEvent 30 - adapted Paint function 31 32 * mgui/MHexagon.[h,cc]: 33 - replaced GetR by GetD 34 - added DistanceToPrimitive (capital T) 35 36 * mgui/Makefile: 37 - added mreflector 38 39 * mfileio/MReadRflFile.[h,cc]: 40 - added 41 42 * mreflector, mreflector/Makefile, mreflector/ReflectorLinkDef.h, 43 mreflector/MRflEvtData.[h,cc], mreflector/MRflSinglePhoton.[h,cc]: 44 - added 45 46 2 47 3 48 2003/05/22: Abelardo Moralejo … … 12 57 as well (in theta, phi or whatever). 13 58 59 60 14 61 2003/05/22: Wolfgang Wittek 15 62 … … 20 67 original Theta is stored in the container "ThetaOrig" 21 68 the discretized Theta is stored in MMcEvt.fTelescopeTheta 69 22 70 23 71 -
trunk/MagicSoft/Mars/Makefile
r2071 r2135 39 39 meventdisp \ 40 40 mfileio \ 41 mreflector \ 41 42 mhist \ 42 43 mdatacheck \ -
trunk/MagicSoft/Mars/NEWS
r2109 r2135 65 65 + MHillasExt now derives from MParContainer instead of MHillas 66 66 --> Files written with the old definition are more or less unreadable 67 68 - implemented reading of reflector files 69 70 - implemented displaying data from reflectro files in the camera 67 71 68 72 -
trunk/MagicSoft/Mars/manalysis/MCerPhotAnal.cc
r1557 r2135 118 118 Bool_t MCerPhotAnal::Process() 119 119 { 120 fCerPhotEvt->InitSize(fRawEvt->GetNumPixels());120 //fCerPhotEvt->InitSize(fRawEvt->GetNumPixels()); 121 121 122 122 MRawEvtPixelIter pixel(fRawEvt); … … 201 201 } 202 202 203 fCerPhotEvt->FixSize(); 203 204 fCerPhotEvt->SetReadyToSave(); 204 205 -
trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc
r1965 r2135 164 164 Bool_t MCerPhotCalc::Process() 165 165 { 166 fCerPhotEvt->InitSize(fRawEvt->GetNumPixels());166 //fCerPhotEvt->InitSize(fRawEvt->GetNumPixels()); 167 167 168 168 MRawEvtPixelIter pixel(fRawEvt); … … 212 212 } 213 213 214 fCerPhotEvt->FixSize(); 214 215 fCerPhotEvt->SetReadyToSave(); 215 216 -
trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc
r2052 r2135 75 75 { 76 76 fNumPixels = 0; 77 fPixels->Delete(); 77 //fPixels->Delete(); 78 } 79 80 void MCerPhotEvt::FixSize() 81 { 82 if (fPixels->GetEntriesFast() == (Int_t)fNumPixels) 83 return; 84 85 fPixels->ExpandCreateFast(fNumPixels); 78 86 } 79 87 -
trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h
r2052 r2135 23 23 24 24 UInt_t GetNumPixels() const { return fNumPixels; } 25 void InitSize(UInt_t num) { fPixels->Expand(num); }25 //void InitSize(UInt_t num) { fPixels->Expand(num); } 26 26 27 27 void AddPixel(Int_t id, Float_t nph, Float_t er) … … 29 29 new ((*fPixels)[fNumPixels++]) MCerPhotPix(id, nph, er); 30 30 } 31 32 void FixSize(); 31 33 32 34 //Bool_t AddEvent(const MCerPhotEvt &evt); -
trunk/MagicSoft/Mars/manalysis/MMcPedestalNSBAdd.cc
r1965 r2135 209 209 fPedCam->InitSize(num); 210 210 211 const Float_t size0 = (*fGeom)[0].GetR() * (*fGeom)[0].GetR();212 213 211 for (int i=0; i<num; i++) 214 212 { 215 MPedestalPix &pix = (*fPedCam)[i]; 216 const MGeomPix &pixgeom = (*fGeom)[i]; 213 MPedestalPix &pix = (*fPedCam)[i]; 217 214 218 215 const Float_t pedrms = pix.GetSigma(); 219 const Float_t size = pixgeom.GetR()*pixgeom.GetR()/size0; 220 216 const Float_t ratio = fGeom->GetPixRatio(i); 221 217 const Float_t ampl = fFadc->GetAmplitud(); 222 218 223 pix.SetSigma(sqrt(pedrms*pedrms + dnsbpix*ampl*ampl* size));219 pix.SetSigma(sqrt(pedrms*pedrms + dnsbpix*ampl*ampl*ratio)); 224 220 } 225 221 -
trunk/MagicSoft/Mars/manalysis/MPedestalCam.cc
r1544 r2135 82 82 Int_t MPedestalCam::GetSize() const 83 83 { 84 return fArray->GetEntries ();84 return fArray->GetEntriesFast(); 85 85 } 86 86 -
trunk/MagicSoft/Mars/mgeom/MGeomCam.cc
r2037 r2135 102 102 const Float_t x = pix.GetX(); 103 103 const Float_t y = pix.GetY(); 104 const Float_t r = pix.GetR();104 const Float_t d = pix.GetD(); 105 105 106 const Float_t maxr = sqrt(x*x+y*y) + r;106 const Float_t maxr = sqrt(x*x+y*y) + d; 107 107 108 108 if (maxr>fMaxRadius) -
trunk/MagicSoft/Mars/mgeom/MGeomCam.h
r1965 r2135 42 42 MGeomPix &operator[](Int_t i) const { return *(MGeomPix*)fPixels->UncheckedAt(i); } 43 43 44 45 46 44 virtual void Print(Option_t *opt=NULL) const; 47 45 -
trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.cc
r2037 r2135 222 222 }; 223 223 224 const Float_t rtemp[577] = {224 const Float_t dtemp[577] = { 225 225 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, // 0 226 226 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, // 8 … … 302 302 303 303 for (UInt_t i=0; i<GetNumPixels(); i++) 304 (*this)[i].Set(xtemp[i], ytemp[i], rtemp[i]) ;304 (*this)[i].Set(xtemp[i], ytemp[i], dtemp[i]) ; 305 305 } 306 306 … … 892 892 }; 893 893 894 for (Int_t i=0; i<577; i++)895 (*this)[i].SetNeighbors(nn[i][0], nn[i][1], nn[i][2],896 nn[i][3], nn[i][4], nn[i][5]);897 898 InitOuterRing();894 for (Int_t i=0; i<577; i++) 895 (*this)[i].SetNeighbors(nn[i][0], nn[i][1], nn[i][2], 896 nn[i][3], nn[i][4], nn[i][5]); 897 898 InitOuterRing(); 899 899 } -
trunk/MagicSoft/Mars/mgeom/MGeomPix.cc
r1640 r2135 52 52 // Initializes one pixel 53 53 // 54 MGeomPix::MGeomPix(Float_t x, Float_t y, Float_t r) : fX(x), fY(y), f R(r)54 MGeomPix::MGeomPix(Float_t x, Float_t y, Float_t r) : fX(x), fY(y), fD(r) 55 55 { 56 56 // default constructor … … 63 63 Float_t MGeomPix::GetA() const 64 64 { 65 return f R*fR*tan(60/kRad2Deg);65 return fD*fD*tan(60/kRad2Deg); 66 66 } 67 67 … … 121 121 *fLog << all << "MPixGeom: x= " << fX 122 122 << " y= " << fY 123 << " r= " << fR123 << " d= " << fD 124 124 << endl ; 125 125 } -
trunk/MagicSoft/Mars/mgeom/MGeomPix.h
r1459 r2135 20 20 Float_t fX; // [mm] the x coordinate of the center 21 21 Float_t fY; // [mm] the y coordinate of the center 22 Float_t f R; // [mm] the rcoordinate of the pixel (dist between two parallel sides)22 Float_t fD; // [mm] the d coordinate of the pixel (dist between two parallel sides) 23 23 24 24 Byte_t fNumNeighbors; // number of valid neighbors … … 26 26 27 27 public: 28 MGeomPix(Float_t x=0, Float_t y=0, Float_t r=0);28 MGeomPix(Float_t x=0, Float_t y=0, Float_t d=0); 29 29 30 30 void Print(Option_t *opt=NULL) const; 31 31 32 void Set(Float_t x, Float_t y, Float_t r) { fX=x; fY=y; fR=r; }32 void Set(Float_t x, Float_t y, Float_t d) { fX=x; fY=y; fD=d; } 33 33 34 34 void SetNeighbors(Short_t i0=-1, Short_t i1=-1, Short_t i2=-1, … … 39 39 void SetX(Float_t x) { fX = x; } 40 40 void SetY(Float_t y) { fY = y; } 41 void Set R(Float_t r) { fR = r; }41 void SetD(Float_t d) { fD = d; } 42 42 43 43 Float_t GetX() const { return fX; } 44 44 Float_t GetY() const { return fY; } 45 Float_t Get R() const { return fR; }45 Float_t GetD() const { return fD; } 46 46 47 47 Float_t GetA() const; -
trunk/MagicSoft/Mars/mgui/MCamDisplay.cc
r2122 r2135 41 41 #include <TLatex.h> 42 42 #include <TStyle.h> 43 #include <TMarker.h> 43 44 #include <TCanvas.h> 45 #include <TArrayF.h> 44 46 #include <TClonesArray.h> 45 47 … … 48 50 49 51 #include "MGeomCam.h" 52 53 #include "MRflEvtData.h" 50 54 51 55 #include "MCerPhotPix.h" … … 99 103 // register BIT(8) as kNoContextMenu. If an object has this bit set it will 100 104 // not get an automatic context menu when clicked with the right mouse button. 105 106 fPhotons = new TClonesArray("TMarker", 0); 101 107 102 108 // … … 180 186 fLegend->Delete(); 181 187 fLegText->Delete(); 188 fPhotons->Delete(); 182 189 183 190 delete fPixels; 184 191 delete fLegend; 185 192 delete fLegText; 193 delete fPhotons; 186 194 187 195 delete fArrowX; … … 322 330 323 331 // 324 // Paint primitives 325 // 326 for (UInt_t i=0; i<fNumPixels; i++) 327 (*this)[i].Paint(); 328 329 for (Int_t i=0; i<kItemsLegend; i++) 330 { 331 GetBox(i)->Paint(); 332 GetText(i)->Paint(); 333 } 334 332 // Paint Legend 333 // 335 334 fArrowX->Paint(">"); 336 335 fArrowY->Paint(">"); … … 338 337 fLegRadius->Paint(); 339 338 fLegDegree->Paint(); 339 340 // 341 // Paint primitives (pixels, color legend, photons, ...) 342 // 343 { fPixels->ForEach(TObject, Paint)(); } 344 { fLegend->ForEach(TObject, Paint)(); } 345 { fLegText->ForEach(TObject, Paint)(); } 346 { fPhotons->ForEach(TObject, Paint)(); } 340 347 } 341 348 … … 671 678 // ------------------------------------------------------------------------ 672 679 // 680 // Show a reflector event. EMarkerStyle is defined in root/include/Gtypes.h 681 // To remove the photons from the display call FillRflEvent(NULL) 682 // 683 void MCamDisplay::ShowRflEvent(const MRflEvtData *event, EMarkerStyle ms) 684 { 685 const Int_t num = event ? event->GetNumPhotons() : 0; 686 687 fPhotons->ExpandCreate(num); 688 if (num < 1) 689 return; 690 691 Int_t i=num-1; 692 do 693 { 694 const MRflSinglePhoton &ph = event->GetPhoton(i); 695 TMarker &m = (TMarker&)*fPhotons->UncheckedAt(i); 696 m.SetX(ph.GetX()); 697 m.SetY(ph.GetY()); 698 m.SetMarkerStyle(ms); 699 } while (i--); 700 } 701 702 // ------------------------------------------------------------------------ 703 // 704 // Fill a reflector event. Sums all pixels in each pixel as the 705 // pixel contents. 706 // 707 // WARNING: Due to the estimation in DistanceToPrimitive and the 708 // calculation in pixels instead of x, y this is only a 709 // rough estimate. 710 // 711 void MCamDisplay::FillRflEvent(const MRflEvtData &event) 712 { 713 // 714 // reset pixel colors to background color 715 // 716 Reset(); 717 718 // 719 // sum the photons content in each pixel 720 // 721 const Int_t entries = event.GetNumPhotons(); 722 723 TArrayF arr(fNumPixels); 724 for (Int_t i=0; i<entries; i++) 725 { 726 const MRflSinglePhoton &ph = event.GetPhoton(i); 727 728 UInt_t id; 729 for (id=0; id<fNumPixels; id++) 730 { 731 if ((*this)[id].DistanceToPrimitive(ph.GetX(), ph.GetY())<0) 732 break; 733 } 734 if (id==fNumPixels) 735 continue; 736 737 arr[id] += 1; 738 } 739 740 // 741 // Scale with the area and determin maximum 742 // 743 Float_t max = 0; 744 for (UInt_t id=0; id<fNumPixels; id++) 745 { 746 arr[id] *= fGeomCam->GetPixRatio(id); 747 if (arr[id]>max) 748 max = arr[id]; 749 } 750 751 // 752 // Update legend 753 // 754 if (fAutoScale) 755 UpdateLegend(0, max==0 ? 1 : max); 756 757 // 758 // Set color of pixels 759 // 760 for (UInt_t id=0; id<fNumPixels; id++) 761 if (arr[id]>0) 762 (*this)[id].SetFillColor(GetColor(arr[id], 0, max)); 763 } 764 765 // ------------------------------------------------------------------------ 766 // 673 767 // Reset the all pixel colors to a default value 674 768 // -
trunk/MagicSoft/Mars/mgui/MCamDisplay.h
r2109 r2135 4 4 #ifndef MARS_MAGIC 5 5 #include "MAGIC.h" 6 #endif 7 #ifndef ROOT_Gtypes 8 #include <Gtypes.h> 6 9 #endif 7 10 #ifndef ROOT_TClonesArray … … 15 18 class MGeomCam; 16 19 class MHexagon; 20 class MRflEvtData; 17 21 class MCerPhotEvt; 18 22 class MCerPhotPix; … … 42 46 TClonesArray *fLegend; // array of all color bars 43 47 TClonesArray *fLegText; // array of all texts 44 48 TClonesArray *fPhotons; // array of reflector photons 49 45 50 UInt_t fW; // Width of canvas 46 51 UInt_t fH; // Height of canvas … … 74 79 void FillLevels(const MCerPhotEvt &event, const MImgCleanStd &clean); 75 80 void FillPedestals(const MPedestalCam &event); 81 void FillRflEvent(const MRflEvtData &event); 82 void ShowRflEvent(const MRflEvtData *event=NULL, EMarkerStyle m=kFullDotMedium); 76 83 77 84 void DrawPixelNumbers(); -
trunk/MagicSoft/Mars/mgui/MHexagon.cc
r1965 r2135 67 67 fX = pix.GetX(); 68 68 fY = pix.GetY(); 69 fD = pix.Get R();69 fD = pix.GetD(); 70 70 } 71 71 … … 139 139 // comput the distance of hexagon center to pixel border 140 140 // 141 const Double_t dx = fD * cosa / 2;142 const Double_t dy = fD * sina / 2;141 const Double_t dx = fD/2 * cosa; 142 const Double_t dy = fD/2 * sina; 143 143 144 144 const Int_t pxborder = gPad->XtoAbsPixel(fX + dx); … … 155 155 // 156 156 return distborder < disthex ? (int)(disthex-distborder+1) : 0; 157 } 158 159 // ------------------------------------------------------------------------ 160 // 161 // compute the distance of a point (px,py) to the Hexagon in world 162 // coordinates. Return -1 if inside. 163 // 164 Float_t MHexagon::DistanceToPrimitive(Float_t px, Float_t py) 165 { 166 // 167 // compute the distance of the Point to the center of the Hexagon 168 // 169 const Double_t dx = px-fX; 170 const Double_t dy = py-fY; 171 172 const Double_t disthex = TMath::Sqrt(dx*dx + dy*dy); 173 174 // 175 // compute the distance from the border of Pixel 176 // here in the first implementation is just circle inside 177 // 178 return fD*0.5772 < disthex ? disthex-fD*0.5772 : -1; 157 179 } 158 180 -
trunk/MagicSoft/Mars/mgui/MHexagon.h
r1880 r2135 50 50 ; 51 51 52 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py); 52 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py); 53 virtual Float_t DistanceToPrimitive(Float_t px, Float_t py); 53 54 virtual void DrawHexagon(Float_t x, Float_t y, Float_t d); 54 55 -
trunk/MagicSoft/Mars/mgui/Makefile
r1965 r2135 22 22 # connect the include files defined in the config.mk file 23 23 # 24 INCLUDES = -I. -I../mbase -I../mgeom -I../manalysis -I../mimage -I../mhist 24 INCLUDES = -I. -I../mbase -I../mgeom -I../manalysis -I../mimage -I../mhist \ 25 -I../mreflector 25 26 26 27 #------------------------------------------------------------------------------ -
trunk/MagicSoft/Mars/mreflector/MRflEvtData.cc
r2134 r2135 1 /* ======================================================================== *\ 2 ! 3 ! * 4 ! * This file is part of MARS, the MAGIC Analysis and Reconstruction 5 ! * Software. It is distributed to you in the hope that it can be a useful 6 ! * and timesaving tool in analysing Data of imaging Cerenkov telescopes. 7 ! * It is distributed WITHOUT ANY WARRANTY. 8 ! * 9 ! * Permission to use, copy, modify and distribute this software and its 10 ! * documentation for any purpose is hereby granted without fee, 11 ! * provided that the above copyright notice appear in all copies and 12 ! * that both that copyright notice and this permission notice appear 13 ! * in supporting documentation. It is provided "as is" without express 14 ! * or implied warranty. 15 ! * 16 ! 17 ! 18 ! Author(s): Thomas Bretz, 5/2003 <mailto:tbretz@astro.uni-wuerzburg.de> 19 ! 20 ! Copyright: MAGIC Software Development, 2000-2003 21 ! 22 ! 23 \* ======================================================================== */ 24 25 ///////////////////////////////////////////////////////////////////////////// 26 // 27 // MRflEvtData 28 // 29 // All Photons of a event from the reflector program 30 // 31 // Should be filled like this: 32 // MRflEvtData evt; 33 // evt.Reset(); 34 // for (int i=0; i<10; i++) 35 // MRflSinglePhoton &ph = evt.GetNewPhoton(); 36 // evt.FixSize(); 37 // 38 ///////////////////////////////////////////////////////////////////////////// 1 39 #include "MRflEvtData.h" 2 40 … … 17 55 } 18 56 57 // -------------------------------------------------------------------------- 58 // 59 // Dump informations off all photons 60 // 19 61 void MRflEvtData::Print(Option_t *o="") const 20 62 { … … 23 65 } 24 66 67 // -------------------------------------------------------------------------- 68 // 69 // Add a new photon to the list 70 // 25 71 MRflSinglePhoton &MRflEvtData::GetNewPhoton() 26 72 { … … 31 77 } 32 78 79 // -------------------------------------------------------------------------- 80 // 81 // If you have added all photon fix the size of the container. 82 // 33 83 void MRflEvtData::FixSize() 34 84 { -
trunk/MagicSoft/Mars/mreflector/MRflEvtData.h
r2134 r2135 28 28 29 29 void Print(Option_t *o="") const; 30 ClassDef(MRflEvtData, 0) 30 31 ClassDef(MRflEvtData, 0) // All Photons of a event from the reflector program 31 32 }; 32 33 -
trunk/MagicSoft/Mars/mreflector/MRflSinglePhoton.cc
r2134 r2135 1 /* ======================================================================== *\ 2 ! 3 ! * 4 ! * This file is part of MARS, the MAGIC Analysis and Reconstruction 5 ! * Software. It is distributed to you in the hope that it can be a useful 6 ! * and timesaving tool in analysing Data of imaging Cerenkov telescopes. 7 ! * It is distributed WITHOUT ANY WARRANTY. 8 ! * 9 ! * Permission to use, copy, modify and distribute this software and its 10 ! * documentation for any purpose is hereby granted without fee, 11 ! * provided that the above copyright notice appear in all copies and 12 ! * that both that copyright notice and this permission notice appear 13 ! * in supporting documentation. It is provided "as is" without express 14 ! * or implied warranty. 15 ! * 16 ! 17 ! 18 ! Author(s): Thomas Bretz, 5/2003 <mailto:tbretz@astro.uni-wuerzburg.de> 19 ! 20 ! Copyright: MAGIC Software Development, 2000-2003 21 ! 22 ! 23 \* ======================================================================== */ 24 25 ///////////////////////////////////////////////////////////////////////////// 26 // 27 // MRflSinglePhoton 28 // 29 // Single Photon of a event from the reflector program 30 // 31 ///////////////////////////////////////////////////////////////////////////// 1 32 #include "MRflSinglePhoton.h" 2 33 … … 6 37 ClassImp(MRflSinglePhoton); 7 38 39 // -------------------------------------------------------------------------- 40 // 41 // Dump all photon information 42 // 8 43 void MRflSinglePhoton::Print(Option_t *o="") const 9 44 { -
trunk/MagicSoft/Mars/mreflector/MRflSinglePhoton.h
r2134 r2135 28 28 void Print(Option_t *o="") const; 29 29 30 ClassDef(MRflSinglePhoton, 0) 30 ClassDef(MRflSinglePhoton, 0) // Single Photon of a event from the reflector program 31 31 32 }; 32 33
Note:
See TracChangeset
for help on using the changeset viewer.