- Timestamp:
- 05/16/03 13:11:23 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2116 r2117 1 1 -*-*- END OF LINE -*-*- 2 3 2003/05/16: Thomas Bretz 4 5 * mbase/MContinue.cc: 6 - SetDisplay for filter 7 - Set LogStream for filter 8 9 * mbase/MEvtLoop.cc: 10 - don't use pointer to fTasklist in PostProcess if not initialized 11 - do not execute Process if fTasklist is not initialized 12 13 * mbase/MTask.[h,cc]: 14 - overwrite SetDisplay (set also display of attached filter 15 16 * mbase/MTaskList.cc: 17 - minor changes 18 19 * mdata/MDataChain.[h,cc]: 20 - implemented ParseDataMember to support constants 21 22 * mfileio/MCT1ReadPreProc.[h,cc]: 23 - added fNumFile to support Rewind 24 - added Rewind 25 26 * mfileio/MRead.[h,cc]: 27 - new virtual function Rewind 28 29 * mfileio/MReadMarsFile.[h,cc]: 30 - added Rewind 31 32 * mfileio/MReadTree.[h,cc]: 33 - added Rewind 34 - fixed a missing 'else' in AddFile 35 36 * mhist/MBinning.[h,cc]: 37 - added SetEdges(TAxis&) 38 - added SetEdges(TH1&, char) 39 40 * mhist/MFillH.[h,cc]: 41 - added bit kDoNotDisplay 42 43 * mhist/MH.h: 44 - added a comment 45 46 * mhist/MH3.[h,cc]: 47 - implemented GetRule 48 - implemented GetNbins 49 - implemented FindFixBin 50 51 * mimage/MHHillasSrc.cc: 52 - replaced gPad->cd(4) by savepad 53 54 * mmain/MStatusDisplay.[h,cc]: 55 - fixed locked mode for loop-in-loop cases 56 57 2 58 3 59 2003/05/15: Wolfgang Wittek … … 14 70 15 71 * mranforest/MRanForestCalc.cc 16 - exchange arguments in 'FindCreateObj("MHadronness", fHadronnessName)' 72 - exchange arguments in 73 FindCreateObj("MHadronness", fHadronnessName) 17 74 18 75 -
trunk/MagicSoft/Mars/mbase/MContinue.cc
r1937 r2117 137 137 } 138 138 139 GetFilter()->SetDisplay(fDisplay); 140 GetFilter()->SetLogStream(fLog); 141 139 142 SetBit(kFilterIsPrivate); 140 143 -
trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
r2098 r2117 171 171 Bool_t MEvtLoop::PreProcess(const char *tlist) 172 172 { 173 fTaskList = NULL; 174 173 175 // 174 176 // check if the needed parameter list is set. … … 328 330 Bool_t MEvtLoop::Process(Int_t maxcnt) 329 331 { 332 if (!fTaskList) 333 return kFALSE; 334 330 335 // 331 336 // loop over all events and process all tasks for … … 440 445 // execute the post process of all tasks 441 446 // 442 return fTaskList ->PostProcess();447 return fTaskList ? fTaskList->PostProcess() : kTRUE; 443 448 } 444 449 -
trunk/MagicSoft/Mars/mbase/MTask.cc
r2052 r2117 364 364 return kFALSE; 365 365 } 366 367 void MTask::SetDisplay(MStatusDisplay *d) 368 { 369 if (fFilter) 370 fFilter->SetDisplay(d); 371 MParContainer::SetDisplay(d); 372 } -
trunk/MagicSoft/Mars/mbase/MTask.h
r2015 r2117 68 68 const MFilter *GetFilter() const { return fFilter; } 69 69 MFilter *GetFilter() { return fFilter; } // for MContinue only 70 void SetDisplay(MStatusDisplay *d); 70 71 virtual void PrintStatistics(const Int_t lvl=0, Bool_t title=kFALSE) const; 71 72 -
trunk/MagicSoft/Mars/mbase/MTaskList.cc
r2052 r2117 134 134 { 135 135 fTasks->ForEach(MTask, SetLogStream)(log); 136 M ParContainer::SetLogStream(log);136 MTask::SetLogStream(log); 137 137 } 138 138 … … 140 140 { 141 141 fTasks->ForEach(MTask, SetDisplay)(d); 142 M ParContainer::SetDisplay(d);142 MTask::SetDisplay(d); 143 143 } 144 144 -
trunk/MagicSoft/Mars/mdata/MDataChain.cc
r2098 r2117 82 82 // randl(x) returns gRandom->Landau(0, x) 83 83 // 84 // 85 // Constants are implemented in ParseDataMember, namely: 86 // kPi: TMath::Pi() 87 // kRad2Deg: 180/kPi 88 // kDeg2Rad: kPi/180 89 // 90 // You can also defined constants which are defined in TMath by: 91 // kLn10 for static Double_t TMath::Ln10(); 92 // kLogE for static Double_t TMath::LogE(); 93 // kRadToDeg for static Double_t TMath::RadToDeg(); 94 // kDegToRad for static Double_t TMath::DegToRad(); 95 // Remark: In older root versions only Pi() and E() are implemented in 96 // TMath. 97 // 98 // 84 99 // REMARK: 85 100 // - All the random functions are returning 0 if gRandom==0 … … 100 115 101 116 #include <TRandom.h> 117 #include <TMethodCall.h> 102 118 103 119 #include "MLog.h" … … 126 142 // -------------------------------------------------------------------------- 127 143 // 128 // Default constructor129 //130 MDataChain::MDataChain()131 : fMember(NULL), fOperatorType(kENoop)132 {133 }134 135 // --------------------------------------------------------------------------136 //137 144 // Constructor taking a rule as an argument. For more details see 138 145 // class description 139 146 // 140 147 MDataChain::MDataChain(const char *rule, const char *name, const char *title) 141 : f OperatorType(kENoop)148 : fMember(NULL), fOperatorType(kENoop) 142 149 { 143 150 fName = name ? name : "MDataChain"; 144 151 fTitle = title ? title : rule; 152 153 if (TString(rule).IsNull()) 154 return; 145 155 146 156 *fLog << inf << "Trying to resolve rule... " << flush; … … 259 269 // -------------------------------------------------------------------------- 260 270 // 271 // Here the names of data members are interpreted. This can be used to 272 // check for constants. 273 // 274 MData *MDataChain::ParseDataMember(TString txt) 275 { 276 //txt.ToLower(); 277 278 if (txt=="kRad2Deg") return new MDataValue(kRad2Deg); 279 if (txt=="kDeg2Rad") return new MDataValue(1./kRad2Deg); 280 281 if (!txt.BeginsWith("k")) 282 return new MDataMember(txt.Data()); 283 284 const TString name = txt(1, txt.Length()); 285 TMethodCall call(TMath::Class(), name, ""); 286 switch (call.ReturnType()) 287 { 288 case TMethodCall::kLong: 289 Long_t l; 290 call.Execute(l); 291 return new MDataValue(l); 292 case TMethodCall::kDouble: 293 Double_t d; 294 call.Execute(d); 295 return new MDataValue(d); 296 default: 297 break; 298 } 299 300 return new MDataMember(txt.Data()); 301 } 302 303 // -------------------------------------------------------------------------- 304 // 261 305 // Core of the data chain. Here the chain is constructed out of the rule. 262 306 // … … 418 462 if ((txt.IsNull() || txt[0]!='(') && text[0]!='-' && text[0]!='+') 419 463 { 420 newmember = new MDataMember(text.Data());464 newmember = ParseDataMember(text.Data()); 421 465 break; 422 466 } … … 469 513 if (!fMember) 470 514 { 471 *fLog << warn << "MDataChain not valid." << endl;515 //*fLog << warn << "MDataChain not valid." << endl; 472 516 return 0; 473 517 } -
trunk/MagicSoft/Mars/mdata/MDataChain.h
r1853 r2117 59 59 60 60 MData *ParseString(TString txt, Int_t level); 61 MData *ParseDataMember(TString txt); 61 62 62 63 MDataChain(const char *rule, OperatorType_t op); 63 64 64 65 public: 65 MDataChain(); 66 MDataChain(const char *rule, const char *name=NULL, const char *title=NULL); 66 MDataChain(const char *rule=NULL, const char *name=NULL, const char *title=NULL); 67 67 ~MDataChain(); 68 68 -
trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.cc
r2091 r2117 549 549 // Check for the existence of a next file to read 550 550 // 551 TNamed *file = (TNamed*)fFileNames->First(); 552 if (!file) 553 return kFALSE; 551 if (fNumFile >= (UInt_t)fFileNames->GetSize()) 552 return kFALSE; 553 554 TNamed *file = (TNamed*)fFileNames->At(fNumFile); 555 556 //TNamed *file = (TNamed*)fFileNames->GetFirst(); 557 //if (!file) 558 // return kFALSE; 554 559 555 560 // … … 565 570 // Remove this file from the list of pending files 566 571 // 567 fFileNames->Remove(file);572 //fFileNames->Remove(file); 568 573 569 574 *fLog << inf << "Open file: '" << name << "'" << endl; 570 575 571 576 if (!CheckHeader(fname)) 572 { 573 *fLog << "OpenNextFile : CheckHeader(fname) is FALSE" << endl; 574 return kFALSE; 575 } 577 return kFALSE; 578 579 fNumFile++; 576 580 577 581 fIn = new ifstream(fname); 578 582 579 583 *fLog << inf << "-----------------------------------------------------------------------" << endl; 580 581 584 582 585 switch (ReadRunHeader()) … … 690 693 } 691 694 692 // -------------------------------------------------------------------------- 693 // 694 // Open the first file in the list. Check for the output containers or create 695 // them if they don't exist. 696 // 697 // Initialize the size of the MPedestalCam container to 127 pixels (CT1 camera) 698 // 699 Bool_t MCT1ReadPreProc::PreProcess(MParList *pList) 700 { 701 702 fParList = pList; 703 704 // 705 // look for the HourAngle container in the plist 706 // 707 fHourAngle = (MParameterD*)pList->FindCreateObj("MParameterD", "HourAngle"); 708 if (!fHourAngle) 709 return kFALSE; 710 fHourAngle->SetTitle("Store the CT1 hour angle [deg]"); 711 712 // 713 // look for the ThetaOrig container in the plist 714 // 715 fThetaOrig = (MParameterD*)pList->FindCreateObj("MParameterD", "ThetaOrig"); 716 if (!fThetaOrig) 717 return kFALSE; 718 fThetaOrig->SetTitle("Store the original CT1 zenith angle [rad]"); 719 720 // 721 // look for the MCerPhotEvt class in the plist 722 // 723 fNphot = (MCerPhotEvt*)pList->FindCreateObj("MCerPhotEvt"); 724 if (!fNphot) 725 return kFALSE; 726 727 // 728 // look for the pedestal class in the plist 729 // 730 fPedest = (MPedestalCam*)pList->FindCreateObj("MPedestalCam"); 731 if (!fPedest) 732 return kFALSE; 733 734 // 735 // look for the time class in the plist 736 // 737 fTime = (MTime*)pList->FindCreateObj("MTime"); 738 if (!fTime) 739 return kFALSE; 740 741 // 742 // look for the pedestal class in the plist 743 // 744 fBlinds = (MBlindPixels*)pList->FindCreateObj("MBlindPixels"); 745 if (!fBlinds) 746 return kFALSE; 747 748 // 749 // look for the source position in the camera 750 // 751 fSrcPos = (MSrcPosCam*)pList->FindCreateObj("MSrcPosCam"); 752 if (!fSrcPos) 753 return kFALSE; 754 755 // 756 // look for the camera geometry 757 // 758 fGeom = (MGeomCam*)pList->FindCreateObj("MGeomCamCT1", "MGeomCam"); 759 if (!fGeom) 760 return kFALSE; 761 762 // 763 // look for the mc event class 764 // 765 fMcEvt = (MMcEvt*)pList->FindCreateObj("MMcEvt"); 766 if (!fMcEvt) 767 return kFALSE; 768 769 // 770 // look for the mc trigger class 771 // 772 fMcTrig = (MMcTrig*)pList->FindCreateObj("MMcTrig"); 773 if (!fMcTrig) 774 return kFALSE; 775 776 // 777 // look for the raw run header class 778 // 779 fRawRunHeader = (MRawRunHeader*)pList->FindCreateObj("MRawRunHeader"); 780 if (!fRawRunHeader) 781 return kFALSE; 782 783 fBinningT = (MBinning*)pList->FindObject("BinningTheta"); 784 695 Bool_t MCT1ReadPreProc::Rewind() 696 { 785 697 fNumFilterEvts = 0; 786 698 fNumEvents = 0; 787 699 fNumRuns = 0; 700 fNumFile = 0; 701 if (fIn) 702 delete fIn; 703 704 fIn=NULL; 705 706 return kTRUE; 707 } 708 709 // -------------------------------------------------------------------------- 710 // 711 // Open the first file in the list. Check for the output containers or create 712 // them if they don't exist. 713 // 714 // Initialize the size of the MPedestalCam container to 127 pixels (CT1 camera) 715 // 716 Bool_t MCT1ReadPreProc::PreProcess(MParList *pList) 717 { 718 fParList = pList; 719 720 // 721 // look for the HourAngle container in the plist 722 // 723 fHourAngle = (MParameterD*)pList->FindCreateObj("MParameterD", "HourAngle"); 724 if (!fHourAngle) 725 return kFALSE; 726 fHourAngle->SetTitle("Store the CT1 hour angle [deg]"); 727 728 // 729 // look for the ThetaOrig container in the plist 730 // 731 fThetaOrig = (MParameterD*)pList->FindCreateObj("MParameterD", "ThetaOrig"); 732 if (!fThetaOrig) 733 return kFALSE; 734 fThetaOrig->SetTitle("Store the original CT1 zenith angle [rad]"); 735 736 // 737 // look for the MCerPhotEvt class in the plist 738 // 739 fNphot = (MCerPhotEvt*)pList->FindCreateObj("MCerPhotEvt"); 740 if (!fNphot) 741 return kFALSE; 742 743 // 744 // look for the pedestal class in the plist 745 // 746 fPedest = (MPedestalCam*)pList->FindCreateObj("MPedestalCam"); 747 if (!fPedest) 748 return kFALSE; 749 750 // 751 // look for the time class in the plist 752 // 753 fTime = (MTime*)pList->FindCreateObj("MTime"); 754 if (!fTime) 755 return kFALSE; 756 757 // 758 // look for the pedestal class in the plist 759 // 760 fBlinds = (MBlindPixels*)pList->FindCreateObj("MBlindPixels"); 761 if (!fBlinds) 762 return kFALSE; 763 764 // 765 // look for the source position in the camera 766 // 767 fSrcPos = (MSrcPosCam*)pList->FindCreateObj("MSrcPosCam"); 768 if (!fSrcPos) 769 return kFALSE; 770 771 // 772 // look for the camera geometry 773 // 774 fGeom = (MGeomCam*)pList->FindCreateObj("MGeomCamCT1", "MGeomCam"); 775 if (!fGeom) 776 return kFALSE; 777 778 // 779 // look for the mc event class 780 // 781 fMcEvt = (MMcEvt*)pList->FindCreateObj("MMcEvt"); 782 if (!fMcEvt) 783 return kFALSE; 784 785 // 786 // look for the mc trigger class 787 // 788 fMcTrig = (MMcTrig*)pList->FindCreateObj("MMcTrig"); 789 if (!fMcTrig) 790 return kFALSE; 791 792 // 793 // look for the raw run header class 794 // 795 fRawRunHeader = (MRawRunHeader*)pList->FindCreateObj("MRawRunHeader"); 796 if (!fRawRunHeader) 797 return kFALSE; 798 799 fBinningT = (MBinning*)pList->FindObject("BinningTheta"); 800 801 Rewind(); 788 802 789 803 fPedest->InitSize(iMAXNUMPIX); … … 1115 1129 } 1116 1130 1131 delete fIn; 1132 fIn = NULL; 1133 1117 1134 return GetSelector() ? GetSelector()->CallPostProcess() : kTRUE; 1118 1135 } -
trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.h
r1952 r2117 50 50 Bool_t fIsMcFile; // Flag whether current run is a MC run 51 51 52 UInt_t fNumFile; 52 53 UInt_t fNumEvents; // number of events counted in all runs in all files 53 54 UInt_t fNumEventsInRun; // number of events in the counted in th ecurrent run … … 76 77 Bool_t PostProcess(); 77 78 79 Bool_t Rewind(); 80 78 81 public: 79 82 MCT1ReadPreProc(const char *filename=NULL, -
trunk/MagicSoft/Mars/mfileio/MRead.cc
r1902 r2117 41 41 42 42 ClassImp(MRead); 43 44 Bool_t MRead::Rewind() 45 { 46 *fLog << err << "ERROR - Rewind() not implemented for " << GetDescriptor() << endl; 47 return kFALSE; 48 } 43 49 44 50 // -------------------------------------------------------------------------- -
trunk/MagicSoft/Mars/mfileio/MRead.h
r1880 r2117 17 17 18 18 virtual UInt_t GetEntries() = 0; 19 virtual Bool_t Rewind(); 19 20 20 21 void SetSelector(MFilter *f) { fSelector = f; } -
trunk/MagicSoft/Mars/mfileio/MReadMarsFile.h
r1668 r2117 26 26 Int_t AddFile(const char *fname, Int_t entries=-1); 27 27 28 Bool_t Rewind() { if (fRun) fRun->Rewind(); MReadTree::Rewind(); return kTRUE; } 29 28 30 ClassDef(MReadMarsFile, 1) // Reads a tree from file(s) and the information from the 'RunHeader'-tree 29 31 }; -
trunk/MagicSoft/Mars/mfileio/MReadTree.cc
r2106 r2117 131 131 // 132 132 // Delete all the pointers to pointers to the objects where the 133 // branche data gets stored. 133 // branche data gets stored. FIXME: When PreProcessed twice this 134 // creates a memory leak! 134 135 // 135 136 TIter Next(fChain->GetStatus()); … … 239 240 if (numfiles>0) 240 241 SetBit(kChainWasChanged); 241 242 *fLog << warn << "WARNING: '" << fname << "' not added to " << GetDescriptor() << endl;242 else 243 *fLog << warn << "WARNING: '" << fname << "' not added to " << GetDescriptor() << endl; 243 244 244 245 return numfiles; -
trunk/MagicSoft/Mars/mfileio/MReadTree.h
r1836 r2117 57 57 UInt_t GetEntries(); 58 58 59 TString 60 Int_t 59 TString GetFileName() const; 60 Int_t GetFileIndex() const; 61 61 62 virtual void AddNotify(TObject *obj); 63 virtual void SetOwner(Bool_t flag=kTRUE); 64 virtual void Print(Option_t *opt="") const; 62 virtual void AddNotify(TObject *obj); 63 virtual void SetOwner(Bool_t flag=kTRUE); 65 64 66 virtual Int_t 67 virtual Int_t 65 virtual Int_t AddFile(const char *fname, Int_t entries=-1); 66 virtual Int_t AddFiles(const MReadTree &read); 68 67 69 virtualBool_t PreProcess(MParList *pList);70 virtualBool_t Process();71 virtualBool_t PostProcess();68 Bool_t PreProcess(MParList *pList); 69 Bool_t Process(); 70 Bool_t PostProcess(); 72 71 73 virtual Bool_t Notify(); 72 Bool_t Notify(); 73 Bool_t Rewind() { SetEventNum(0); return kTRUE; } 74 void Print(Option_t *opt="") const; 74 75 75 76 ClassDef(MReadTree, 1) // Reads a tree from file(s) -
trunk/MagicSoft/Mars/mhist/MBinning.cc
r2106 r2117 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 218 ! Author(s): Thomas Bretz, 01/2002 <mailto:tbretz@astro.uni-wuerzburg.de> 19 ! 20 ! Copyright: MAGIC Software Development, 2000-2003 21 21 ! 22 22 ! … … 30 30 #include "MBinning.h" 31 31 32 #include <ctype.h> // tolower 32 33 #include <fstream.h> 33 34 … … 60 61 61 62 fType = kIsDefault; 63 } 64 65 void MBinning::SetEdges(const TAxis &axe) 66 { 67 const TArrayD &arr = *((TAxis&)axe).GetXbins(); 68 if (arr.GetSize()>0) 69 { 70 SetEdges(arr); 71 return; 72 } 73 74 SetEdges(axe.GetNbins(), axe.GetXmin(), axe.GetXmax()); 75 } 76 77 void MBinning::SetEdges(const TH1 &h, const Char_t axis='x') 78 { 79 TH1 &hist = (TH1&)h; // get rid of const qualifier 80 switch (tolower(axis)) 81 { 82 case 'x': 83 SetEdges(*hist.GetXaxis()); 84 return; 85 case 'y': 86 SetEdges(*hist.GetYaxis()); 87 return; 88 case 'z': 89 SetEdges(*hist.GetZaxis()); 90 return; 91 default: 92 *fLog << warn << "MBinning::SetEdges: Axis '" << axis << "' unknown... using x." << endl; 93 SetEdges(*hist.GetXaxis()); 94 } 62 95 } 63 96 -
trunk/MagicSoft/Mars/mhist/MBinning.h
r1962 r2117 7 7 8 8 #ifndef ROOT_TArrayD 9 #include "TArrayD.h"9 #include <TArrayD.h> 10 10 #endif 11 11 12 12 class TH1; 13 class TAxis; 13 14 14 15 class MBinning : public MParContainer … … 38 39 } 39 40 41 void SetEdges(const TAxis &axe); 42 void SetEdges(const TH1 &h, const Char_t axis='x'); 40 43 void SetEdges(const Int_t nbins, const Axis_t lo, Axis_t up); 41 44 void SetEdgesLog(const Int_t nbins, const Axis_t lo, Axis_t up); -
trunk/MagicSoft/Mars/mhist/MFillH.cc
r2015 r2117 341 341 return kTRUE; 342 342 343 if (TestBit(kDoNotDisplay)) 344 return kTRUE; 345 343 346 fCanvas = &fDisplay->AddTab(fH->GetName()); 344 347 fH->Draw(); -
trunk/MagicSoft/Mars/mhist/MFillH.h
r1994 r2117 16 16 class MFillH : public MTask 17 17 { 18 public: 19 enum { 20 kDoNotDisplay = BIT(17) 21 }; 22 18 23 private: 19 24 MParContainer *fParContainer; // Pointer to the data container storing -
trunk/MagicSoft/Mars/mhist/MH.h
r2109 r2117 36 36 static TCanvas *MakeDefCanvas(const TObject *obj, 37 37 const UInt_t w=625, const UInt_t h=440); 38 39 // FIXME: * --> & !!! 38 40 39 41 static void SetBinning(TH1 *h, const MBinning *binsx); -
trunk/MagicSoft/Mars/mhist/MH3.cc
r2043 r2117 60 60 #include "MH3.h" 61 61 62 #include <ctype.h> // tolower 62 63 #include <fstream.h> 63 64 … … 636 637 return h; 637 638 } 639 640 TString MH3::GetRule(const Char_t axis='x') const 641 { 642 switch (tolower(axis)) 643 { 644 case 'x': 645 return fData[0] ? fData[0]->GetRule() : TString(""); 646 case 'y': 647 return fData[1] ? fData[1]->GetRule() : TString(""); 648 case 'z': 649 return fData[2] ? fData[2]->GetRule() : TString(""); 650 default: 651 return "<n/a>"; 652 } 653 } 654 655 // -------------------------------------------------------------------------- 656 // 657 // Returns the total number of bins in a histogram (excluding under- and 658 // overflow bins) 659 // 660 Int_t MH3::GetNbins() const 661 { 662 Int_t num = 1; 663 664 switch (fDimension) 665 { 666 case 3: 667 num *= fHist->GetNbinsZ()+2; 668 case 2: 669 num *= fHist->GetNbinsY()+2; 670 case 1: 671 num *= fHist->GetNbinsX()+2; 672 } 673 674 return num; 675 } 676 677 // -------------------------------------------------------------------------- 678 // 679 // Returns the total number of bins in a histogram (excluding under- and 680 // overflow bins) Return -1 if bin is underflow or overflow 681 // 682 Int_t MH3::FindFixBin(Double_t x, Double_t y, Double_t z) const 683 { 684 const TAxis &axex = *fHist->GetXaxis(); 685 const TAxis &axey = *fHist->GetYaxis(); 686 const TAxis &axez = *fHist->GetZaxis(); 687 688 Int_t binz = 0; 689 Int_t biny = 0; 690 Int_t binx = 0; 691 692 switch (fDimension) 693 { 694 case 3: 695 binz = axez.FindFixBin(z); 696 if (binz>axez.GetLast() || binz<axez.GetFirst()) 697 return -1; 698 case 2: 699 biny = axey.FindFixBin(y); 700 if (biny>axey.GetLast() || biny<axey.GetFirst()) 701 return -1; 702 case 1: 703 binx = axex.FindFixBin(x); 704 if (binx<axex.GetFirst() || binx>axex.GetLast()) 705 return -1; 706 } 707 708 const Int_t nx = fHist->GetNbinsX()+2; 709 const Int_t ny = fHist->GetNbinsY()+2; 710 711 return binx + nx*(biny +ny*binz); 712 } -
trunk/MagicSoft/Mars/mhist/MH3.h
r2043 r2117 17 17 protected: 18 18 // Could be const but root < 3.02/06 doesn't like this... 19 Int_t fDimension; // Number of dimensions of histogram 20 TH1 *fHist; // Histogram to fill 21 22 TString fDataMember[3]; // Data member which should be filled into the histogram x 19 Int_t fDimension; // Number of dimensions of histogram 20 TH1 *fHist; // Histogram to fill 23 21 MDataChain *fData[3]; // Object from which the data is filled 24 22 Double_t fScale[3]; // Scale for the three axis (eg unit) … … 44 42 45 43 Int_t GetDimension() const { return fDimension; } 44 Int_t GetNbins() const; 45 Int_t FindFixBin(Double_t x, Double_t y=0, Double_t z=0) const; 46 46 47 47 void SetName(const char *name); … … 52 52 53 53 TString GetDataMember() const; 54 TString GetRule(const Char_t axis='x') const; 54 55 55 56 TH1 &GetHist() { return *fHist; } -
trunk/MagicSoft/Mars/mimage/MHHillasSrc.cc
r2098 r2117 230 230 231 231 TVirtualPad *savepad = gPad; 232 gPad->cd(4);232 savepad->cd(4); 233 233 gPad->SetLogy(); 234 234 gPad = savepad; -
trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc
r2110 r2117 485 485 // 486 486 MStatusDisplay::MStatusDisplay(Long_t t) 487 : TGMainFrame(gClient->GetRoot(), 1, 1), fTimer(this, t, kTRUE), fStatus(kLoopNone), fLog(&gLog), fLogIdx(-1), fLogTimer(this, 250, kTRUE), fLogBox(NULL) 487 : TGMainFrame(gClient->GetRoot(), 1, 1), fTimer(this, t, kTRUE), fStatus(kLoopNone), fLog(&gLog), fLogIdx(-1), fLogTimer(this, 250, kTRUE), fLogBox(NULL), fIsLocked(0) 488 488 { 489 489 gROOT->GetListOfSpecials()->Add(this); … … 758 758 case kLoopStop: 759 759 case kFileExit: 760 if (id==kFileExit && ! TestBit(kIsLocked))760 if (id==kFileExit && !fIsLocked) 761 761 delete this; 762 762 fStatus = (Status_t)id; … … 1075 1075 void MStatusDisplay::SetNoContextMenu(Bool_t flag) 1076 1076 { 1077 if (fIsLocked>1) 1078 return; 1079 1077 1080 flag ? SetBit(kNoContextMenu) : ResetBit(kNoContextMenu); 1078 1081 for (int i=1; i<fTab->GetNumberOfTabs(); i++) … … 1253 1256 void MStatusDisplay::StartUpdate(Int_t millisec) 1254 1257 { 1258 if (fIsLocked>1) 1259 return; 1260 1255 1261 if (fTimer.GetTime()<TTime(0)) 1256 1262 return; … … 1264 1270 void MStatusDisplay::StopUpdate() 1265 1271 { 1272 if (fIsLocked>1) 1273 return; 1274 1266 1275 fTimer.Stop(); 1267 1276 } -
trunk/MagicSoft/Mars/mmain/MStatusDisplay.h
r2110 r2117 72 72 FontStruct_t fFont; 73 73 74 UInt_t fIsLocked; 75 74 76 void AddMenuBar(); 75 77 void AddProgressBar(); … … 100 102 void UpdatePSHeader(const TString &name) const; 101 103 102 enum {103 kIsLocked = BIT(14)104 };105 104 public: 106 105 MStatusDisplay(Long_t t=1000); … … 152 151 void ClearStatus() { fStatus = kLoopNone; } 153 152 154 void Lock() { SetBit(kIsLocked); }155 void UnLock() { ResetBit(kIsLocked); }153 void Lock() { fIsLocked++; } 154 void UnLock() { if (fIsLocked>0) fIsLocked--; } 156 155 157 156 Bool_t CheckTabForCanvas(int num) const;
Note:
See TracChangeset
for help on using the changeset viewer.