Changeset 2109 for trunk/MagicSoft
- Timestamp:
- 05/10/03 18:27:17 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2108 r2109 1 1 -*-*- END OF LINE -*-*- 2 2 3 2003/05/10: Abelardo Moralejo3 2003/05/10: Thomas Bretz 4 4 5 5 * Makefile.rules: -
trunk/MagicSoft/Mars/Makefile.rules
r2096 r2109 68 68 @echo $(INCLUDES) $(CXXFLAGS) 69 69 70 70 diff: 71 @cvs diff | grep -v "^? " > mars.diff -
trunk/MagicSoft/Mars/NEWS
r2080 r2109 59 59 60 60 - colors in logging output to screen 61 62 - changes to the Image Parameter declaration: 63 + moved fConc, fConc1 from MHillasSrc to MNewImagePar 64 + moved fNumUsedPix, fNumCorePix from MHillas to MNewImagePar 65 + MHillasExt now derives from MParContainer instead of MHillas 66 --> Files written with the old definition are more or less unreadable 61 67 62 68 -
trunk/MagicSoft/Mars/manalysis/MCT1SupercutsCalc.cc
r2105 r2109 235 235 Bool_t MCT1SupercutsCalc::Process() 236 236 { 237 const Double_t dNOMLOGSIZE= 4.1;238 const Double_t dNOMCOSZA = 1.0;237 const Double_t kNomLogSize = 4.1; 238 const Double_t kNomCosZA = 1.0; 239 239 240 240 const Double_t newdist = fHilSrc->GetDist() * fMm2Deg; … … 245 245 const Double_t dd2 = dist * dist; 246 246 247 const Double_t dmls = log(fHil->GetSize()) - dNOMLOGSIZE;247 const Double_t dmls = log(fHil->GetSize()) - kNomLogSize; 248 248 const Double_t dmls2 = dmls * dmls; 249 249 250 const Double_t dmcza = cos(fMcEvt->GetTelescopeTheta()) - dNOMCOSZA;250 const Double_t dmcza = cos(fMcEvt->GetTelescopeTheta()) - kNomCosZA; 251 251 252 252 const Double_t length = fHil->GetLength() * fMm2Deg; -
trunk/MagicSoft/Mars/mbase/MParContainer.cc
r1965 r2109 376 376 TMethodCall *call = NULL; 377 377 378 *fLog << warn << "Trying to find MethodCall '" << IsA()->GetName();378 *fLog << warn << "Trying to find MethodCall '" << ClassName(); 379 379 *fLog << "::Get" << name << "' instead <LEAKS MEMORY>" << endl; 380 380 call = new TMethodCall(IsA(), (TString)"Get"+name, ""); … … 384 384 delete call; 385 385 386 *fLog << warn << "Trying to find MethodCall '" << IsA()->GetName();386 *fLog << warn << "Trying to find MethodCall '" << ClassName(); 387 387 *fLog << "::" << name << "' instead <LEAKS MEMORY>" << endl; 388 388 call = new TMethodCall(IsA(), name, ""); … … 482 482 return kFALSE; 483 483 484 *fLog << warn << "WARNING - Resource " << prefix+fName << " found, but no " << IsA()->GetName() << "::ReadEnv." << endl;484 *fLog << warn << "WARNING - Resource " << prefix+fName << " found, but no " << ClassName() << "::ReadEnv." << endl; 485 485 return kTRUE; 486 486 } … … 513 513 return kFALSE; 514 514 515 *fLog << warn << "WARNING - Resource " << prefix+fName << " found, but " << IsA()->GetName() << "::WriteEnv not overloaded." << endl;515 *fLog << warn << "WARNING - Resource " << prefix+fName << " found, but " << ClassName() << "::WriteEnv not overloaded." << endl; 516 516 return kTRUE; 517 517 } -
trunk/MagicSoft/Mars/mbase/Makefile
r2063 r2109 20 20 # @endcode 21 21 22 INCLUDES = -I. -I../m raw -I../MRawFormat -I../mmc -I../mfileio \23 -I../mmain -I../mfilter 22 INCLUDES = -I. -I../mmain -I../mfileio -I../mfilter 23 # MStatusDisplay (MTask), MRead (MEvtLoop), MF (MContinue) 24 24 25 25 # @code -
trunk/MagicSoft/Mars/mdata/MDataArray.cc
r1574 r2109 163 163 } 164 164 165 TString MDataArray::GetRule(int i) const 166 { 167 return (*this)[i].GetRule(); 168 } 169 165 170 // -------------------------------------------------------------------------- 166 171 // -
trunk/MagicSoft/Mars/mdata/MDataArray.h
r1891 r2109 33 33 Double_t operator()(Int_t i); 34 34 35 TString GetRule(int i) const; 36 35 37 Bool_t PreProcess(const MParList *plist); 36 38 -
trunk/MagicSoft/Mars/mgui/MCamDisplay.cc
r2010 r2109 787 787 } 788 788 789 // ------------------------------------------------------------------------ 790 // 791 // Returns string containing info about the object at position (px,py). 792 // Returned string will be re-used (lock in MT environment). 793 // 794 char *MCamDisplay::GetObjectInfo(Int_t px, Int_t py) const 795 { 796 static char info[64]; 797 798 Int_t dist = 999999; 799 UInt_t i; 800 for (i=0; i<fNumPixels; i++) 801 { 802 if ((*fPixels)[i]->DistancetoPrimitive(px, py)>0) 803 continue; 804 805 sprintf(info, "Pixel Id: %d", i); 806 return info; 807 } 808 return TObject::GetObjectInfo(px, py); 809 } -
trunk/MagicSoft/Mars/mgui/MCamDisplay.h
r1965 r2109 77 77 void DrawPixelNumbers(); 78 78 79 void Paint(Option_t *option=""); 80 void Reset(); 81 void Draw(Option_t *option=""); 82 void SavePrimitive(ofstream &out, Option_t *); 83 Int_t DistancetoPrimitive(Int_t px, Int_t py); 79 void Paint(Option_t *option=""); 80 void Reset(); 81 void Draw(Option_t *option=""); 82 void SavePrimitive(ofstream &out, Option_t *); 83 Int_t DistancetoPrimitive(Int_t px, Int_t py); 84 char *GetObjectInfo(Int_t px, Int_t py) const; 84 85 //virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py); 85 86 … … 90 91 void SetInvDeepBlueSeaPalette(); // *MENU* 91 92 92 void 93 void SetPix(const Int_t pixnum, const Int_t color, Float_t min, Float_t max); // New function added by M.Lopez in 31-01-03 93 94 94 95 ClassDef(MCamDisplay, 0) // Displays the magic camera -
trunk/MagicSoft/Mars/mhist/MH.cc
r2098 r2109 819 819 return kFALSE; 820 820 } 821 822 void MH::ProjectionX(TH1D &dest, const TH2 &src, Int_t firstybin, Int_t lastybin) 823 { 824 //*-*-*-*-*Project a 2-D histogram into a 1-D histogram along X*-*-*-*-*-*-* 825 //*-* ==================================================== 826 // 827 // The projection dest is always of the type TH1D. 828 // The projection is made from the channels along the Y axis 829 // ranging from firstybin to lastybin included. 830 // By default, bins 1 to ny are included 831 // When all bins are included, the number of entries in the projection 832 // is set to the number of entries of the 2-D histogram, otherwise 833 // the number of entries is incremented by 1 for all non empty cells. 834 // 835 // if Sumw2() was called for dest, the errors are computed. 836 // 837 TAxis &axex = *((TH2&)src).GetXaxis(); 838 TAxis &axey = *((TH2&)src).GetYaxis(); 839 840 const Int_t nx = axex.GetNbins(); 841 const Int_t ny = axey.GetNbins(); 842 if (firstybin < 0) 843 firstybin = 1; 844 if (lastybin > ny) 845 lastybin = ny; 846 847 dest.Reset(); 848 SetBinning(&dest, &axex); 849 850 // Create the projection histogram 851 const Bool_t computeErrors = dest.GetSumw2N() ? 1 : 0; 852 853 // Fill the projected histogram 854 for (Int_t binx=0; binx<=nx+1; binx++) 855 { 856 Double_t err2 = 0; 857 for (Int_t biny=firstybin; biny<=lastybin; biny++) 858 { 859 const Double_t cont = src.GetCellContent(binx,biny); 860 const Double_t err1 = src.GetCellError(binx,biny); 861 err2 += err1*err1; 862 if (cont) 863 dest.Fill(axex.GetBinCenter(binx), cont); 864 } 865 if (computeErrors) 866 dest.SetBinError(binx, TMath::Sqrt(err2)); 867 } 868 if (firstybin <=1 && lastybin >= ny) 869 dest.SetEntries(src.GetEntries()); 870 } 871 872 void MH::ProjectionY(TH1D &dest, const TH2 &src, Int_t firstxbin, Int_t lastxbin) 873 { 874 //*-*-*-*-*Project a 2-D histogram into a 1-D histogram along X*-*-*-*-*-*-* 875 //*-* ==================================================== 876 // 877 // The projection dest is always of the type TH1D. 878 // The projection is made from the channels along the Y axis 879 // ranging from firstybin to lastybin included. 880 // By default, bins 1 to ny are included 881 // When all bins are included, the number of entries in the projection 882 // is set to the number of entries of the 2-D histogram, otherwise 883 // the number of entries is incremented by 1 for all non empty cells. 884 // 885 // if Sumw2() was called for dest, the errors are computed. 886 // 887 TAxis &axex = *((TH2&)src).GetXaxis(); 888 TAxis &axey = *((TH2&)src).GetYaxis(); 889 890 const Int_t nx = axex.GetNbins(); 891 const Int_t ny = axey.GetNbins(); 892 if (firstxbin < 0) 893 firstxbin = 1; 894 if (lastxbin > nx) 895 lastxbin = nx; 896 897 dest.Reset(); 898 SetBinning(&dest, &axey); 899 900 // Create the projection histogram 901 const Bool_t computeErrors = dest.GetSumw2N() ? 1 : 0; 902 903 // Fill the projected histogram 904 for (Int_t biny=0; biny<=ny+1; biny++) 905 { 906 Double_t err2 = 0; 907 for (Int_t binx=firstxbin; binx<=lastxbin; binx++) 908 { 909 const Double_t cont = src.GetCellContent(binx,biny); 910 const Double_t err1 = src.GetCellError(binx,biny); 911 err2 += err1*err1; 912 if (cont) 913 dest.Fill(axey.GetBinCenter(biny), cont); 914 } 915 if (computeErrors) 916 dest.SetBinError(biny, TMath::Sqrt(err2)); 917 } 918 if (firstxbin <=1 && lastxbin >= nx) 919 dest.SetEntries(src.GetEntries()); 920 } 921 922 // -------------------------------------------------------------------------- 923 // 924 // In contradiction to TPad::FindObject this function searches recursively 925 // in a pad for an object. gPad is the default. 926 // 927 TObject *MH::FindObjectInPad(const char *name, TVirtualPad *pad) 928 { 929 if (!pad) 930 pad = gPad; 931 932 if (!pad) 933 return NULL; 934 935 TObject *o; 936 937 TIter Next(pad->GetListOfPrimitives()); 938 while ((o=Next())) 939 { 940 if (!strcmp(o->GetName(), name)) 941 return o; 942 943 if (o->InheritsFrom("TPad")) 944 if ((o = FindObjectInPad(name, (TVirtualPad*)o))) 945 return o; 946 } 947 return NULL; 948 } -
trunk/MagicSoft/Mars/mhist/MH.h
r2098 r2109 7 7 8 8 class TH1; 9 class TH1D; 9 10 class TH2; 10 11 class TH3; … … 75 76 static Double_t GetMinimumGT(const TH1 &h, Double_t gt=0); 76 77 78 static void ProjectionX(TH1D &dest, const TH2 &src, Int_t firstybin=-1, Int_t lastybin=9999); 79 static void ProjectionY(TH1D &dest, const TH2 &src, Int_t firstxbin=-1, Int_t lastxbin=9999); 80 81 static TObject *FindObjectInPad(const char *name, TVirtualPad *pad=NULL); 82 77 83 ClassDef(MH, 0) //A base class for Mars histograms 78 84 }; -
trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc
r2106 r2109 223 223 // -------------------------------------------------------------------------- 224 224 // 225 // Update the projections and (if possible) set log scales before painting 226 // 227 void MHSigmaTheta::Paint(Option_t *opt) 228 { 229 TVirtualPad *padsave = gPad; 230 231 TH1D* h; 232 233 padsave->cd(1); 234 if ((h = (TH1D*)gPad->FindObject("ProjX-Theta"))) 235 { 236 ProjectionX(*h, fSigmaTheta); 237 if (h->GetEntries()!=0) 238 gPad->SetLogy(); 239 } 240 241 padsave->cd(4); 242 if ((h = (TH1D*)gPad->FindObject("ProjY-sigma"))) 243 ProjectionY(*h, fSigmaTheta); 244 245 gPad = padsave; 246 } 247 248 // -------------------------------------------------------------------------- 249 // 225 250 // Draw the histogram 226 251 // … … 239 264 pad->cd(1); 240 265 gPad->SetBorderMode(0); 241 // gPad->SetLogy();242 266 h = fSigmaTheta.ProjectionX("ProjX-Theta", -1, 9999, "E"); 243 267 h->SetDirectory(NULL); -
trunk/MagicSoft/Mars/mhist/MHSigmaTheta.h
r2106 r2109 37 37 TH3D fDiffPixTheta; // 3D-distr.:Theta, pixel, sigma^2-sigmabar^2 38 38 39 void Paint(Option_t *opt=""); 39 40 40 41 public: -
trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc
r2087 r2109 72 72 #include <TDatime.h> // TDatime 73 73 #include <TRandom.h> // TRandom 74 #include <TBrowser.h> // TBrowser 74 75 #include <TObjArray.h> // TObjArray 75 76 #include <TPostScript.h> // TPostScript … … 169 170 // 170 171 MGPopupMenu *filemenu = new MGPopupMenu(gClient->GetRoot()); 171 // filemenu->AddEntry("S&ave [F2]", kFileSave); 172 // filemenu->AddEntry("Save &As... [Shift-F2]", kFileSaveAs); 172 // filemenu->AddEntry("Save &As...", kFileSaveAs); 173 filemenu->AddEntry("New Can&vas", kFileCanvas); 174 filemenu->AddEntry("New &Browser", kFileBrowser); 175 filemenu->AddSeparator(); 173 176 filemenu->AddEntry("Save As status.&ps", kFileSaveAsPS); 174 177 filemenu->AddEntry("Save As status.&gif", kFileSaveAsGIF); … … 177 180 filemenu->AddSeparator(); 178 181 filemenu->AddEntry("Print with &lpr", kFilePrint); 179 filemenu->AddEntry("Set printer &name", kFilePrinterName);182 //filemenu->AddEntry("Set printer &name", kFilePrinterName); 180 183 filemenu->AddSeparator(); 181 184 filemenu->AddEntry("E&xit", kFileExit); … … 186 189 // 187 190 MGPopupMenu *tabmenu = new MGPopupMenu(gClient->GetRoot()); 188 // tabmenu->AddEntry("S&ave [F2]", kFileSave); 189 // tabmenu->AddEntry("Save &As... [Shift-F2]", kFileSaveAs); 191 // tabmenu->AddEntry("Save &As...", kFileSaveAs); 190 192 tabmenu->AddEntry("Save As tab-i.&ps", kTabSaveAsPS); 191 193 tabmenu->AddEntry("Save As tab-i.&gif", kTabSaveAsGIF); … … 760 762 fStatus = (Status_t)id; 761 763 return kTRUE; 762 /* 764 765 case kFileCanvas: 766 new TCanvas; 767 return kTRUE; 768 769 case kFileBrowser: 770 new TBrowser; 771 return kTRUE; 772 773 /* 763 774 case kFileSave: 764 775 cout << "Save..." << endl; … … 1356 1367 TPostScript ps(name, 112); 1357 1368 ps.SetBit(TPad::kPrintingPS); 1369 1370 //%%DocumentPaperSizes: a4 1371 //%%Orientation: Portrait 1372 1358 1373 ps.PrintFast(13, "/nan {1} def "); 1359 1374 -
trunk/MagicSoft/Mars/mmain/MStatusDisplay.h
r2087 r2109 33 33 typedef enum { 34 34 // KFile 35 kFile Save, kFileSaveAs, kFileSaveAsPS, kFileSaveAsRoot,36 kFileSaveAs GIF, kFileSaveAsC, kFilePrint, kFilePrinterName,37 kFile Exit,35 kFileBrowser, kFileCanvas, kFileSave, kFileSaveAs, kFileSaveAsPS, 36 kFileSaveAsRoot, kFileSaveAsGIF, kFileSaveAsC, kFilePrint, 37 kFilePrinterName, kFileExit, 38 38 // kLoop 39 39 kLoopNone, kLoopStop,
Note:
See TracChangeset
for help on using the changeset viewer.