Changeset 2318 for trunk/MagicSoft/Mars/manalysis
- Timestamp:
- 08/26/03 13:50:39 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MCT1FindSupercuts.cc
r2310 r2318 38 38 39 39 #include <TFile.h> 40 #include <TArrayD.h> 40 41 #include <TMinuit.h> 41 42 #include <TCanvas.h> … … 117 118 // transfer current parameter values to MCT1Supercuts 118 119 // 119 super->SetParameters(TArrayD(npar, par)); 120 120 // Attention : npar is the number of variable parameters 121 // not the total number of parameters 122 // 123 Double_t fMin, fEdm, fErrdef; 124 Int_t fNpari, fNparx, fIstat; 125 gMinuit->mnstat(fMin, fEdm, fErrdef, fNpari, fNparx, fIstat); 126 127 super->SetParameters(TArrayD(fNparx, par)); 128 129 //$$$$$$$$$$$$$$$$$$$$$ 130 // for testing 131 //TArrayD checkparameters = super->GetParameters(); 132 //gLog << "fcnsupercuts : i, par, checkparameters =" << endl; 133 //for (Int_t i=0; i<fNparx; i++) 134 //{ 135 // gLog << i << ", " << par[i] << ", " << checkparameters[i] << endl; 136 //} 137 //$$$$$$$$$$$$$$$$$$$$$ 121 138 122 139 // … … 629 646 // 630 647 // - for the minimization, the starting values of the parameters are taken as 631 // MCT1Supercuts::GetParam s(fVinit)648 // MCT1Supercuts::GetParameters(fVinit) 632 649 // 633 650 //---------------------------------------------------------------------- … … 651 668 { 652 669 *fLog << "MCT1FindSupercuts::FindParams; training matrix is not defined... aborting" 670 << endl; 671 return kFALSE; 672 } 673 674 if (fMatrixTrain->GetM().GetNrows() <= 0) 675 { 676 *fLog << "MCT1FindSupercuts::FindParams; training matrix has no entries" 653 677 << endl; 654 678 return kFALSE; … … 737 761 // 738 762 739 // get initial values of parameters from MCT1Supercuts Calc763 // get initial values of parameters from MCT1Supercuts 740 764 fVinit = super.GetParameters(); 741 765 742 766 TString name[fVinit.GetSize()]; 743 744 for (Int_t i=0; i<fVinit.GetSize(); i++) 767 fStep.Set(fVinit.GetSize()); 768 fLimlo.Set(fVinit.GetSize()); 769 fLimup.Set(fVinit.GetSize()); 770 fFix.Set(fVinit.GetSize()); 771 772 fNpar = fVinit.GetSize(); 773 774 for (UInt_t i=0; i<fNpar; i++) 745 775 { 746 776 name[i] = "p"; 747 777 name[i] += i+1; 748 778 fStep[i] = TMath::Abs(fVinit[i]/10.0); 749 fLimlo[i] = -10 .0;750 fLimup[i] = 10 .0;779 fLimlo[i] = -100.0; 780 fLimup[i] = 100.0; 751 781 fFix[i] = 0; 782 783 // vary only first 48 parameters 784 if (i >= 48) 785 { 786 fStep[i] = 0.0; 787 fFix[i] = 1; 788 } 752 789 } 753 790 … … 757 794 TStopwatch clock; 758 795 clock.Start(); 796 797 *fLog << "before calling CallMinuit" << endl; 759 798 760 799 MMinuitInterface inter; … … 763 802 &evtloopfcn, "SIMPLEX", kFALSE); 764 803 804 *fLog << "after calling CallMinuit" << endl; 805 765 806 *fLog << "Time spent for the minimization in MINUIT : " << endl;; 766 807 clock.Stop(); … … 812 853 if (fMatrixTest->GetM().GetNrows() <= 0) 813 854 { 814 *fLog << "MCT1FindSupercuts::TestParams; test matrix is empty... aborting" << endl; 855 *fLog << "MCT1FindSupercuts::TestParams; test matrix has no entries" 856 << endl; 815 857 return kFALSE; 816 858 } -
trunk/MagicSoft/Mars/manalysis/MCT1Supercuts.cc
r2308 r2318 162 162 { 163 163 if (d.GetSize() != fParameters.GetSize()) 164 // *fLog << err << ... 164 { 165 *fLog << err << "Sizes of d and of fParameters are different : " 166 << d.GetSize() << ", " << fParameters.GetSize() << endl; 165 167 return kFALSE; 168 } 166 169 167 170 fParameters = d; 171 168 172 return kTRUE; 169 173 } 174 175 176 177 178 179 180 181 182 183 184 185 -
trunk/MagicSoft/Mars/manalysis/MMinuitInterface.cc
r2313 r2318 89 89 //.............................................. 90 90 // Set the maximum number of parameters 91 TMinuit *const save = gMinuit;91 //TMinuit *const save = gMinuit; 92 92 93 93 TMinuit &minuit = *new TMinuit(vinit.GetSize()); … … 284 284 minuit.mnexcm("CALL", &iflag, 1, errfcn3); 285 285 286 delete &minuit; 287 gMinuit = save; 286 // WW : the following statements were commented out because the 287 // Minuit object will still be used; 288 // this may be changed in the future 289 //delete &minuit; 290 //gMinuit = save; 288 291 289 292 return kTRUE;
Note:
See TracChangeset
for help on using the changeset viewer.