Changeset 2236
- Timestamp:
- 06/26/03 16:21:57 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2234 r2236 1 1 -*-*- END OF LINE -*-*- 2 3 2003/06/26: Thomas Bretz 4 5 * macros/CT1EgyEst.C: 6 - converted from dos to unix type 7 8 * macros/rootlogon.C: 9 - removed "-fno-rtti" from options for Aclic 10 11 * mbase/MLog.h: 12 - added a comment 13 14 * mgeom/MGeomCam.[h,cc], mgeom/MGeomPix.[h,cc], 15 mgeom/MGeomCamCT1.cc, mgeom/MGeomCamECO1000.cc, 16 mgeom/MGeomCamECO1000HG.cc, mgeom/MGeomCamMagicHG.cc: 17 - added support for sectors 18 19 * megom/MGeomCamMagic.[h,cc]: 20 - added sectors 21 22 * mhist/MHCamera.[h,cc]: 23 - convert Option_t in Paint to lower case 24 - remove 'hist' if detected from Option_t 25 - check for min==max 26 - added DrawSectorIndices() 27 - added TArrayC to AddCamContent 28 - added TArrayC to SetCamContent 29 - simplified DistancetoPrimitive 30 31 * mraw/MRawEvtData.cc: 32 - simplified Draw by converting option string to lower case 33 34 * mraw/MRawEvtPixelIter.[h,cc]: 35 - added GetNumMaxLoGainSample 36 37 2 38 3 39 2003/06/25: Thomas Bretz -
trunk/MagicSoft/Mars/macros/rootlogon.C
r2080 r2236 110 110 if (TString("linux")==gSystem->GetBuildArch()) 111 111 { 112 TString options = " -O -pipe -Wall -Woverloaded-virtual -fno- rtti -fno-exceptions -fPIC ";112 TString options = " -O -pipe -Wall -Woverloaded-virtual -fno-exceptions -fPIC "; 113 113 114 114 TString s = "cd $BuildDir ; "; -
trunk/MagicSoft/Mars/mbase/MLog.h
r2173 r2236 167 167 } 168 168 169 // FIXME: Switch off colors when on.... 169 170 void SetNullOutput(Bool_t n=kTRUE) { fIsNull = n; } 170 171 -
trunk/MagicSoft/Mars/mgeom/MGeomCam.cc
r2234 r2236 97 97 // -------------------------------------------------------------------------- 98 98 // 99 // Calculate the highest sector index+1 of all pixels, please make sure 100 // the the sector numbers are continous. 101 // 102 void MGeomCam::CalcNumSectors() 103 { 104 fNumSectors = 0; 105 106 for (UInt_t i=0; i<fNumPixels; i++) 107 { 108 const MGeomPix &pix = (*this)[i]; 109 const UInt_t s = pix.GetSector(); 110 111 if (s>fNumSectors) 112 fNumSectors = s; 113 } 114 115 fNumSectors++; 116 } 117 118 // -------------------------------------------------------------------------- 119 // 99 120 // Calculate the maximum radius of the camera. This is ment for GUI layout. 100 121 // -
trunk/MagicSoft/Mars/mgeom/MGeomCam.h
r2209 r2236 22 22 TObjArray fPixels; // Array of singel pixels storing the geometry 23 23 24 UInt_t fNumSectors; // Number of sectors 25 24 26 protected: 25 27 void CalcMaxRadius(); 28 void CalcNumSectors(); 26 29 void InitOuterRing(); 27 30 … … 32 35 virtual TObject *Clone(const char *newname=NULL) const; 33 36 34 Float_t GetCameraDist() const 35 Float_t GetConvMm2Deg() const 37 Float_t GetCameraDist() const { return fCamDist; } 38 Float_t GetConvMm2Deg() const { return fConvMm2Deg; } 36 39 37 UInt_t GetNumPixels() const { return fNumPixels; } 38 Float_t GetMaxRadius() const { return fMaxRadius; } 40 UInt_t GetNumPixels() const { return fNumPixels; } 41 Float_t GetMaxRadius() const { return fMaxRadius; } 42 UInt_t GetNumSectors() const { return fNumSectors; } 39 43 Float_t GetPixRatio(UInt_t i) const; 40 44 -
trunk/MagicSoft/Mars/mgeom/MGeomCamCT1.cc
r2037 r2236 56 56 CreateCam(); 57 57 CreateNN(); 58 CalcNumSectors(); 58 59 CalcMaxRadius(); 59 60 } -
trunk/MagicSoft/Mars/mgeom/MGeomCamECO1000.cc
r2195 r2236 52 52 CreateCam(); 53 53 CreateNN(); 54 CalcNumSectors(); 54 55 CalcMaxRadius(); 55 56 } -
trunk/MagicSoft/Mars/mgeom/MGeomCamECO1000HG.cc
r2195 r2236 56 56 CreateCam(); 57 57 CreateNN(); 58 CalcNumSectors(); 58 59 CalcMaxRadius(); 59 60 } -
trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.cc
r2135 r2236 53 53 CreateCam(); 54 54 CreateNN(); 55 CalcNumSectors(); 55 56 CalcMaxRadius(); 56 57 } … … 221 222 -034.641 // 576 222 223 }; 223 224 /* 224 225 const Float_t dtemp[577] = { 225 226 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, // 0 … … 296 297 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, // 568 297 298 60.00 }; // 576 299 */ 300 const Byte_t sector[577] = { 301 0, 1, 2, 3, 4, 5, 6, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 302 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 1, 303 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 304 6, 6, 6, 6, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 305 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 1, 1, 1, 1, 306 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 307 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 1, 1, 1, 1, 1, 1, 308 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 309 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 1, 1, 310 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 311 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 312 6, 6, 6, 6, 6, 6, 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 313 2, 2, 2, 2, 2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, 5, 5, 5, 5, 5, 6, 6, 331 6, 6, 6, 6, 6, 6, 6 }; 298 332 299 333 // 300 334 // fill the pixels list with this data 301 335 // 302 303 336 for (UInt_t i=0; i<GetNumPixels(); i++) 304 (*this)[i].Set(xtemp[i], ytemp[i], dtemp[i]);337 (*this)[i].Set(xtemp[i], ytemp[i], i>396?60:30, sector[i]); 305 338 } 306 339 -
trunk/MagicSoft/Mars/mgeom/MGeomCamMagicHG.cc
r2187 r2236 53 53 CreateCam(); 54 54 CreateNN(); 55 CalcNumSectors(); 55 56 CalcMaxRadius(); 56 57 } … … 983 984 984 985 for (UInt_t i=0; i<GetNumPixels(); i++) 985 (*this)[i].Set(xtemp[i], ytemp[i], dtemp[i]) 986 (*this)[i].Set(xtemp[i], ytemp[i], dtemp[i]); 986 987 } 987 988 -
trunk/MagicSoft/Mars/mgeom/MGeomPix.cc
r2178 r2236 56 56 // Initializes one pixel 57 57 // 58 MGeomPix::MGeomPix(Float_t x, Float_t y, Float_t r ) : fX(x), fY(y), fD(r)58 MGeomPix::MGeomPix(Float_t x, Float_t y, Float_t r, UInt_t s) : fX(x), fY(y), fD(r), fSector(s) 59 59 { 60 60 // default constructor -
trunk/MagicSoft/Mars/mgeom/MGeomPix.h
r2135 r2236 25 25 Short_t fNeighbors[6]; // the IDs of the pixel next to it (we are assuming an hexagonal geometry) 26 26 27 UInt_t fSector; // Number of sector the pixels corresponds to 28 27 29 public: 28 MGeomPix(Float_t x=0, Float_t y=0, Float_t d=0 );30 MGeomPix(Float_t x=0, Float_t y=0, Float_t d=0, UInt_t s=0); 29 31 30 32 void Print(Option_t *opt=NULL) const; 31 33 32 void Set(Float_t x, Float_t y, Float_t d ) { fX=x; fY=y; fD=d; }34 void Set(Float_t x, Float_t y, Float_t d, UInt_t s=0) { fX=x; fY=y; fD=d; fSector=s; } 33 35 34 36 void SetNeighbors(Short_t i0=-1, Short_t i1=-1, Short_t i2=-1, … … 36 38 37 39 void CheckOuterRing(const MGeomCam &cam); 38 39 void SetX(Float_t x) { fX = x; } 40 void SetY(Float_t y) { fY = y; } 41 void SetD(Float_t d) { fD = d; } 40 /* 41 void SetX(Float_t x) { fX = x; } 42 void SetY(Float_t y) { fY = y; } 43 void SetD(Float_t d) { fD = d; } 44 void SetSector(UInt_t s) { fSector = s; } 45 */ 42 46 43 47 Float_t GetX() const { return fX; } 44 48 Float_t GetY() const { return fY; } 45 49 Float_t GetD() const { return fD; } 50 UInt_t GetSector() const { return fSector; } 46 51 47 52 Float_t GetA() const; -
trunk/MagicSoft/Mars/mhist/MHCamera.cc
r2231 r2236 364 364 } 365 365 366 if (min==max) 367 max += 1; 368 366 369 UpdateLegend(min, max, islog); 367 370 … … 506 509 void MHCamera::Paint(Option_t *o) 507 510 { 508 const TString opt(o); 509 510 if (opt.Contains("hist", TString::kIgnoreCase)) 511 { 511 TString opt(o); 512 opt.ToLower(); 513 514 if (opt.Contains("hist")) 515 { 516 opt.ReplaceAll("hist", ""); 517 512 518 Int_t mode = gStyle->GetOptStat(); 513 519 TVirtualPad *save = gPad; … … 525 531 SetRange(); 526 532 527 Bool_t isbox = opt.Contains("box" , TString::kIgnoreCase);528 Bool_t iscol = isbox ? !opt.Contains("nocol" , TString::kIgnoreCase) : 1;533 Bool_t isbox = opt.Contains("box"); 534 Bool_t iscol = isbox ? !opt.Contains("nocol") : 1; 529 535 530 536 // Update Contents of the pixels and paint legend … … 595 601 void MHCamera::DrawPixelIndices() 596 602 { 603 // FIXME: Is this correct? 597 604 for (int i=0; i<kItemsLegend; i++) 598 605 fColors[i] = 16; … … 609 616 TString num; 610 617 num += i; 618 619 const MGeomPix &h = (*fGeomCam)[i]; 620 TText *nt = txt.DrawText(h.GetX(), h.GetY(), num); 621 nt->SetTextSize(0.3*h.GetD()/fGeomCam->GetMaxRadius()); 622 } 623 } 624 625 void MHCamera::DrawSectorIndices() 626 { 627 for (int i=0; i<kItemsLegend; i++) 628 fColors[i] = 16; 629 630 if (!gPad) 631 Draw(); 632 633 TText txt; 634 txt.SetTextFont(122); 635 txt.SetTextAlign(22); // centered/centered 636 637 for (Int_t i=0; i<fNcells-2; i++) 638 { 639 TString num; 640 num += (*fGeomCam)[i].GetSector(); 611 641 612 642 const MGeomPix &h = (*fGeomCam)[i]; … … 678 708 // Only 'used' pixels are added. 679 709 // 680 void MHCamera::AddCamContent(const TArrayD &event, Bool_t ispos)710 void MHCamera::AddCamContent(const TArrayD &event, const TArrayC *used) 681 711 { 682 712 if (event.GetSize()!=fNcells-2) 683 713 return; 684 714 715 if (used && used->GetSize()!=fNcells-2) 716 return; 717 685 718 for (Int_t idx=0; idx<fNcells-2; idx++) 686 719 { 687 720 Fill(idx, const_cast<TArrayD&>(event)[idx]); // FIXME: Slow! 688 721 689 if ( !ispos || fArray[idx+1]>0)722 if (used && (*used)[idx]) 690 723 SetUsed(idx); 691 724 } … … 814 847 Int_t MHCamera::GetColor(Float_t val, Float_t min, Float_t max, Bool_t islog) 815 848 { 849 if (TMath::IsNaN(val)) // FIXME: gLog! 850 { 851 cout << "MHCamera::GetColor: " << GetName() << " <" << GetTitle() << "> - Color for val=NaN (Not a Number) requested... set val=min." << endl; 852 val = min; 853 } 854 816 855 // 817 856 // first treat the over- and under-flows … … 833 872 else 834 873 ratio = (val-min) / (max-min); 874 835 875 const Int_t colidx = (Int_t)(ratio*maxcolidx + .5); 836 876 return fColors[colidx]; … … 930 970 return TH1D::DistancetoPrimitive(px, py); 931 971 932 Int_t dist = 999999;933 934 972 for (Int_t i=0; i<fNcells-2; i++) 935 973 { 936 974 MHexagon hex((*fGeomCam)[i]); 937 Int_t d = hex.DistancetoPrimitive(px, py); 938 939 if (d<dist) 940 dist=d; 941 } 942 return dist==0?0:999999; 975 if (hex.DistancetoPrimitive(px, py)==0) 976 return 0; 977 } 978 return 999999; 943 979 } 944 980 -
trunk/MagicSoft/Mars/mhist/MHCamera.h
r2229 r2236 90 90 virtual void AddCamContent(const MCamEvent &evt, Int_t type=0); 91 91 virtual void AddCamContent(const MHCamera &evt, Int_t type=0); 92 virtual void AddCamContent(const TArrayD &arr, Bool_t ispos=kTRUE);92 virtual void AddCamContent(const TArrayD &arr, const TArrayC *used=NULL); 93 93 virtual void SetCamContent(const MCamEvent &evt, Int_t type=0) { Reset(); AddCamContent(evt, type); } 94 virtual void SetCamContent(const TArrayD &evt, Bool_t ispos=kTRUE) { Reset(); AddCamContent(evt, ispos); }94 virtual void SetCamContent(const TArrayD &evt, const TArrayC *used=NULL) { Reset(); AddCamContent(evt, used); } 95 95 virtual void SetCamContent(const MHCamera &d, Int_t type=0) { Reset(), AddCamContent(d, type); } 96 96 virtual void CntCamContent(const MCamEvent &evt, Double_t threshold, Int_t type=0); … … 111 111 112 112 void DrawPixelIndices(); 113 void DrawSectorIndices(); 113 114 114 115 void PrintInfo() const { Print(""); } // *MENU* -
trunk/MagicSoft/Mars/mraw/MRawEvtData.cc
r2230 r2236 224 224 225 225 TString str(opt); 226 str.ToLower(); 226 227 227 228 UInt_t id = 0; 228 229 229 if (str.BeginsWith(" GRAPH", TString::kIgnoreCase))230 if (str.BeginsWith("graph")) 230 231 if (str.Length()>5) 231 232 sscanf(&str[5], "%d", &id); 232 if (str.BeginsWith(" HIST", TString::kIgnoreCase))233 if (str.BeginsWith("hist")) 233 234 if (str.Length()>4) 234 235 sscanf(&str[4], "%d", &id); … … 250 251 name += pix.GetPixelId(); 251 252 252 Bool_t same = str.Contains("same" , TString::kIgnoreCase);253 254 if (str.BeginsWith(" GRAPH", TString::kIgnoreCase))253 Bool_t same = str.Contains("same"); 254 255 if (str.BeginsWith("graph")) 255 256 { 256 257 *fLog << inf << "Drawing Graph: Pixel Idx #" << pix.GetPixelId(); … … 276 277 } 277 278 278 if (str.BeginsWith(" HIST", TString::kIgnoreCase))279 if (str.BeginsWith("hist")) 279 280 { 280 281 // FIXME: Add Legend -
trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc
r2229 r2236 228 228 // -------------------------------------------------------------------------- 229 229 // 230 // Returns the index of the FADC slice the maximum signal in 231 // 232 Byte_t MRawEvtPixelIter::GetNumMaxLoGainSample() const 233 { 234 Byte_t max = 0; 235 Byte_t maxi = 0; 236 237 for (int i=0; i<fNumLoGainSamples; i++) 238 if (fLoGainPos[i]>max) 239 { 240 max = fLoGainPos[i]; 241 maxi = i; 242 } 243 244 return maxi; 245 } 246 247 // -------------------------------------------------------------------------- 248 // 230 249 // returns the sum of all lo gain fadc samples of the actual pixel. 231 250 // if no lo gain information is available 0 is returned. -
trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.h
r2207 r2236 82 82 83 83 Byte_t GetNumMaxHiGainSample() const; 84 Byte_t GetNumMaxLoGainSample() const; 84 85 85 86 Bool_t HasLoGain() const
Note:
See TracChangeset
for help on using the changeset viewer.