Changeset 7342 for trunk/MagicSoft
- Timestamp:
- 09/06/05 11:58:35 (19 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 14 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r7341 r7342 18 18 19 19 -*-*- END OF LINE -*-*- 20 2005/09/06 Thomas Bretz 21 22 * Makefile.conf.general: 23 - added libASImage 24 25 * mgeom/MGeomCam.[h,cc]: 26 - clone the whole container in any case not only if it is 27 different from MGeomCam 28 - unified the non-default and default constructor 29 30 * mgeom/MGeomPix.[h,cc]: 31 - initialize neighbors with empty values in constructor 32 - added some more default arguments 33 34 * mhist/MHCamera.[h,cc]: 35 - implemented new Draw-options "nopal", "abscontent" 36 - implemented more accurate handling of transparency 37 - new flags kNoScale and kNoUnused 38 - changed private stuff to protected 39 40 * mtools/Makefile, mtools/ToolsLinkDef.h: 41 - added new "tool" MagicJam 42 43 * mtools/MagicJam.[h,cc]: 44 - added 45 46 * mtools/jam/*.jam: 47 - games for Magic Jam 48 49 50 20 51 2005/08/29 Daniela Dorner 21 52 -
trunk/MagicSoft/Mars/Makefile.conf.general
r7294 r7342 4 4 5 5 ROOTVER = `root-config --version` 6 ROOTLIBS = `root-config --libs` -l Minuit -lHistPainter -lThread7 ROOTGLIBS = `root-config --glibs` -l Minuit -lHistPainter -lThread6 ROOTLIBS = `root-config --libs` -lASImage -lMinuit -lHistPainter -lThread 7 ROOTGLIBS = `root-config --glibs` -lASImage -lMinuit -lHistPainter -lThread 8 8 ROOTCFLAGS = `root-config --cflags` 9 9 -
trunk/MagicSoft/Mars/NEWS
r7301 r7342 5 5 * general: added new tutorial macro macros/tutorials/threshold.C: 6 6 how to calculate the threshold 7 8 * general: added a new game. Start it from the interpreter with 9 MagicJam j; 7 10 8 11 -
trunk/MagicSoft/Mars/mgeom/MGeomCam.cc
r7297 r7342 68 68 // 69 69 // Default Constructor 70 / /70 /* 71 71 MGeomCam::MGeomCam() 72 : fNumPixels(0), fCamDist(0), fConvMm2Deg(0), /*fPixels(1000),*/fMaxRadius(1), fMinRadius(1)72 : fNumPixels(0), fCamDist(0), fConvMm2Deg(0), fMaxRadius(1), fMinRadius(1) 73 73 { 74 74 fName = "MGeomCam"; 75 75 fTitle = "Storage container for a camera geometry"; 76 76 } 77 77 */ 78 78 // -------------------------------------------------------------------------- 79 79 // … … 313 313 TObject *MGeomCam::Clone(const char *newname) const 314 314 { 315 if (IsA()==MGeomCam::Class())315 //if (IsA()==MGeomCam::Class()) 316 316 { 317 317 MGeomCam *cam = new MGeomCam(fNumPixels, fCamDist); -
trunk/MagicSoft/Mars/mgeom/MGeomCam.h
r7298 r7342 43 43 44 44 public: 45 MGeomCam();46 MGeomCam(UInt_t npix , Float_t dist, const char *name=NULL, const char *title=NULL);45 //MGeomCam(); 46 MGeomCam(UInt_t npix=0, Float_t dist=1, const char *name=NULL, const char *title=NULL); 47 47 48 48 virtual TObject *Clone(const char *newname=NULL) const; -
trunk/MagicSoft/Mars/mgeom/MGeomPix.cc
r4826 r7342 76 76 // default constructor 77 77 Set(x, y, r, s, a); 78 SetNeighbors(); 78 79 } 79 80 -
trunk/MagicSoft/Mars/mgeom/MGeomPix.h
r7297 r7342 32 32 33 33 public: 34 MGeomPix(Float_t x=0, Float_t y=0, Float_t d= 0, UInt_t s=0, UInt_t aidx=0);34 MGeomPix(Float_t x=0, Float_t y=0, Float_t d=1, UInt_t s=0, UInt_t aidx=0); 35 35 36 36 void Copy(TObject &obj) const … … 50 50 void Print(Option_t *opt=NULL) const; 51 51 52 void Set(Float_t x, Float_t y, Float_t d , UInt_t s=0, UInt_t aidx=0) { fX=x; fY=y; fD=d; fA=d*d*gsTan60/2; fSector=s; fAidx=aidx; }52 void Set(Float_t x, Float_t y, Float_t d=1, UInt_t s=0, UInt_t aidx=0) { fX=x; fY=y; fD=d; fA=d*d*gsTan60/2; fSector=s; fAidx=aidx; } 53 53 54 54 void SetNeighbors(Short_t i0=-1, Short_t i1=-1, Short_t i2=-1, -
trunk/MagicSoft/Mars/mhist/MHCamera.cc
r7169 r7342 93 93 void MHCamera::Init() 94 94 { 95 Sumw2(); 96 95 97 UseCurrentStyle(); 96 98 … … 164 166 //Rebuild(); 165 167 166 Sumw2(); // necessary?167 168 168 if (fGeomCam) 169 169 delete fGeomCam; … … 893 893 for (Int_t i=0; i<fNcells-2; i++) 894 894 { 895 hex.SetFillStyle(issame ? 0 : 1001);895 hex.SetFillStyle(issame || (IsTransparent() && !IsUsed(i)) ? 0 : 1001); 896 896 897 897 if (!issame) … … 912 912 913 913 Float_t x = pix.GetX()*conv/(fAbberation+1); 914 915 914 Float_t y = pix.GetY()*conv/(fAbberation+1); 916 915 Float_t d = pix.GetD()*conv; 917 916 918 917 if (!isbox) 919 hex.PaintHexagon(x, y, d); 918 if (IsUsed(i) || !TestBit(kNoUnused)) 919 hex.PaintHexagon(x, y, d); 920 920 else 921 921 if (IsUsed(i) && !TMath::IsNaN(fArray[i+1])) … … 985 985 opt.ReplaceAll("pixelindex", ""); 986 986 opt.ReplaceAll("sectorindex", ""); 987 opt.ReplaceAll("abscontent", ""); 987 988 opt.ReplaceAll("content", ""); 988 989 opt.ReplaceAll("proj", ""); … … 990 991 opt.ReplaceAll("pal1", ""); 991 992 opt.ReplaceAll("pal2", ""); 993 opt.ReplaceAll("nopal", ""); 992 994 TH1D::Paint(opt); 993 995 return; … … 1027 1029 } 1028 1030 1029 const Bool_t pal1 = opt.Contains("pal1"); 1030 const Bool_t pal2 = opt.Contains("pal2"); 1031 1032 if (!pal1 && !pal2) 1031 const Bool_t pal1 = opt.Contains("pal1"); 1032 const Bool_t pal2 = opt.Contains("pal2"); 1033 const Bool_t nopal = opt.Contains("nopal"); 1034 1035 if (!pal1 && !pal2 && !nopal) 1033 1036 SetPrettyPalette(); 1034 1037 … … 1046 1049 1047 1050 if (opt.Contains("pixelindex")) 1051 { 1048 1052 PaintIndices(0); 1053 return; 1054 } 1049 1055 if (opt.Contains("sectorindex")) 1056 { 1050 1057 PaintIndices(1); 1058 return; 1059 } 1060 if (opt.Contains("abscontent")) 1061 { 1062 PaintIndices(3); 1063 return; 1064 } 1051 1065 if (opt.Contains("content")) 1066 { 1052 1067 PaintIndices(2); 1068 return; 1069 } 1070 if (opt.Contains("pixelentries")) 1071 { 1072 PaintIndices(4); 1073 return; 1074 } 1053 1075 } 1054 1076 … … 1198 1220 case 0: num += i; break; 1199 1221 case 1: num += h.GetSector(); break; 1200 case 2: num += (Int_t)((fArray[i+1]-min)/(max-min)); break; 1222 case 2: num += TMath::Nint((fArray[i+1]-min)/(max-min)); break; 1223 case 3: num += TMath::Nint(fArray[i+1]); break; 1224 case 4: num += fBinEntries[i+1]; break; 1201 1225 } 1202 1226 … … 1557 1581 { 1558 1582 fArray[i+1]=0; 1583 fBinEntries[i]=0; 1559 1584 ResetUsed(i); 1560 1585 } 1586 1561 1587 fArray[0] = 0; 1562 1588 fArray[fNcells-1] = 0; … … 1623 1649 const Float_t range = fGeomCam->GetMaxRadius()*1.05; 1624 1650 1625 TArrow arr; 1626 arr.PaintArrow(-range*.9, -range*.9, -range*.6, -range*.9, 0.025); 1627 arr.PaintArrow(-range*.9, -range*.9, -range*.9, -range*.6, 0.025); 1628 1629 TString text; 1630 text += (int)(range*.3); 1631 text += "mm"; 1632 1633 TText newtxt2; 1634 newtxt2.SetTextSize(0.04); 1635 newtxt2.PaintText(-range*.85, -range*.85, text); 1636 1637 text = ""; 1638 text += Form("%.2f", (float)((int)(range*.3*fGeomCam->GetConvMm2Deg()*10))/10); 1639 text += "\\circ"; 1640 text = text.Strip(TString::kLeading); 1641 1642 TLatex latex; 1643 latex.PaintLatex(-range*.85, -range*.75, 0, 0.04, text); 1644 1645 if (TestBit(kNoLegend)) 1646 return; 1647 1648 TPaveStats *stats = GetStatisticBox(); 1649 1650 const Float_t hndc = 0.92 - (stats ? stats->GetY1NDC() : 1); 1651 const Float_t H = (0.75-hndc)*range; 1652 const Float_t offset = hndc*range; 1653 1654 const Float_t h = 2./kItemsLegend; 1655 const Float_t w = range/sqrt((float)(fNcells-2)); 1656 1657 TBox newbox; 1658 TText newtxt; 1659 newtxt.SetTextSize(0.03); 1660 newtxt.SetTextAlign(12); 1651 if (!TestBit(kNoScale)) 1652 { 1653 TArrow arr; 1654 arr.PaintArrow(-range*.9, -range*.9, -range*.6, -range*.9, 0.025); 1655 arr.PaintArrow(-range*.9, -range*.9, -range*.9, -range*.6, 0.025); 1656 1657 TString text; 1658 text += (int)(range*.3); 1659 text += "mm"; 1660 1661 TText newtxt2; 1662 newtxt2.SetTextSize(0.04); 1663 newtxt2.PaintText(-range*.85, -range*.85, text); 1664 1665 text = ""; 1666 text += Form("%.2f", (float)((int)(range*.3*fGeomCam->GetConvMm2Deg()*10))/10); 1667 text += "\\circ"; 1668 text = text.Strip(TString::kLeading); 1669 1670 TLatex latex; 1671 latex.PaintLatex(-range*.85, -range*.75, 0, 0.04, text); 1672 } 1673 1674 if (!TestBit(kNoLegend)) 1675 { 1676 TPaveStats *stats = GetStatisticBox(); 1677 1678 const Float_t hndc = 0.92 - (stats ? stats->GetY1NDC() : 1); 1679 const Float_t H = (0.75-hndc)*range; 1680 const Float_t offset = hndc*range; 1681 1682 const Float_t h = 2./kItemsLegend; 1683 const Float_t w = range/sqrt((float)(fNcells-2)); 1684 1685 TBox newbox; 1686 TText newtxt; 1687 newtxt.SetTextSize(0.03); 1688 newtxt.SetTextAlign(12); 1661 1689 #if ROOT_VERSION_CODE > ROOT_VERSION(3,01,06) 1662 newtxt.SetBit(/*kNoContextMenu|*/kCannotPick);1663 newbox.SetBit(/*kNoContextMenu|*/kCannotPick);1690 newtxt.SetBit(/*kNoContextMenu|*/kCannotPick); 1691 newbox.SetBit(/*kNoContextMenu|*/kCannotPick); 1664 1692 #endif 1665 1693 1666 const Float_t step = (islog && min>0 ? log10(max/min) : max-min) / kItemsLegend; 1667 const Int_t firsts = step*3 < 1e-8 ? 8 : (Int_t)floor(log10(step*3)); 1668 const TString opt = Form("%%.%if", firsts>0 ? 0 : TMath::Abs(firsts)); 1669 1670 for (Int_t i=0; i<kItemsLegend+1; i+=3) 1671 { 1672 Float_t val; 1673 if (islog && min>0) 1674 val = pow(10, step*i) * min; 1675 else 1676 val = min + step*i; 1677 1678 //const bool dispexp = max-min>1.5 && fabs(val)>0.1 && fabs(val)<1e6; 1679 newtxt.PaintText(range+1.5*w, H*(i*h-1)-offset, Form(opt, val)); 1680 } 1681 1682 for (Int_t i=0; i<kItemsLegend; i++) 1683 { 1684 newbox.SetFillColor(gStyle->GetColorPalette(i)); 1685 newbox.PaintBox(range, H*(i*h-1)-offset, range+w, H*((i+1)*h-1)-offset); 1694 const Float_t step = (islog && min>0 ? log10(max/min) : max-min) / kItemsLegend; 1695 const Int_t firsts = step*3 < 1e-8 ? 8 : (Int_t)floor(log10(step*3)); 1696 const TString opt = Form("%%.%if", firsts>0 ? 0 : TMath::Abs(firsts)); 1697 1698 for (Int_t i=0; i<kItemsLegend+1; i+=3) 1699 { 1700 Float_t val; 1701 if (islog && min>0) 1702 val = pow(10, step*i) * min; 1703 else 1704 val = min + step*i; 1705 1706 //const bool dispexp = max-min>1.5 && fabs(val)>0.1 && fabs(val)<1e6; 1707 newtxt.PaintText(range+1.5*w, H*(i*h-1)-offset, Form(opt, val)); 1708 } 1709 1710 for (Int_t i=0; i<kItemsLegend; i++) 1711 { 1712 newbox.SetFillColor(gStyle->GetColorPalette(i)); 1713 newbox.PaintBox(range, H*(i*h-1)-offset, range+w, H*((i+1)*h-1)-offset); 1714 } 1686 1715 } 1687 1716 } … … 1881 1910 UInt_t MHCamera::GetNumPixels() const 1882 1911 { 1883 return fGeomCam ->GetNumPixels();1912 return fGeomCam ? fGeomCam->GetNumPixels() : 0; 1884 1913 } 1885 1914 -
trunk/MagicSoft/Mars/mhist/MHCamera.h
r7297 r7342 39 39 kProfile = BIT(18), // FIXME: When changing change max/min! 40 40 kFreezed = BIT(19), 41 kNoLegend = BIT(20)/*, 41 kNoLegend = BIT(20), 42 kNoScale = BIT(21), 43 kNoUnused = BIT(22)/*, 42 44 kSqrtVariance = BIT(21), 43 45 kSinglePixelProfile = BIT(22)*/ 44 46 }; 45 pr ivate:47 protected: 46 48 MGeomCam *fGeomCam; // pointer to camera geometry (y-axis) 47 49 TArrayC fUsed; // array containing flags -
trunk/MagicSoft/Mars/mtools/Makefile
r3927 r7342 20 20 # 21 21 INCLUDES = -I. -I../mbase -I../mgui -I../mgeom -I../mdata -I../mhbase \ 22 -I../mfileio -I../mfbase -I../manalysis 22 -I../mfileio -I../mfbase -I../manalysis -I../mhist 23 23 24 24 #manalysis: MChisqEval (MParameters) … … 34 34 MagicSnake.cc \ 35 35 MagicShow.cc \ 36 MagicJam.cc \ 36 37 MagicDomino.cc \ 37 38 MagicCivilization.cc \ -
trunk/MagicSoft/Mars/mtools/ToolsLinkDef.h
r3022 r7342 18 18 #pragma link C++ class MagicSnake+; 19 19 #pragma link C++ class MagicShow+; 20 #pragma link C++ class MagicJamAbc+; 21 #pragma link C++ class MagicJam+; 22 #pragma link C++ class MagicJamEditor+; 20 23 #pragma link C++ class MagicDomino+; 21 24 #pragma link C++ class MagicCivilization+;
Note:
See TracChangeset
for help on using the changeset viewer.