Changeset 7151 for trunk/MagicSoft/Mars/mjobs
- Timestamp:
- 06/13/05 10:20:58 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mjobs
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/JobsLinkDef.h
r7121 r7151 19 19 #pragma link C++ class MJSpectrum+; 20 20 21 #pragma link C++ class MJOptimize+;22 #pragma link C++ class MJOptimizeCuts+;23 #pragma link C++ class MJOptimizeEnergy+;24 25 21 #endif -
trunk/MagicSoft/Mars/mjobs/MJOptimize.cc
r7121 r7151 158 158 MParList *plist = fEvtLoop->GetParList(); 159 159 160 MParameterD *eval = (MParameterD*)plist->FindObject( "MinimizationValue", "MParameterD");160 MParameterD *eval = (MParameterD*)plist->FindObject(fNameMinimizationValue, "MParameterD"); 161 161 MParContainer *pars = (MParContainer*)plist->FindObject("MParameters", "MParContainer"); 162 162 … … 172 172 *fLog << endl; 173 173 } 174 174 175 175 pars->SetVariables(par); 176 176 eval->SetVal(0); … … 225 225 } 226 226 227 MJOptimize::MJOptimize() : fDebug(-1), fNumEvents(0), fType(kSimplex), fNumMaxCalls(0), fTolerance(0), fTestTrain(0) 227 MJOptimize::MJOptimize() : fDebug(-1), fNumEvents(0), fType(kSimplex), fNumMaxCalls(0), fTolerance(0), fTestTrain(0), fNameMinimizationValue("MinimizationValue") 228 228 { 229 229 fRules.SetOwner(); … … 648 648 { 649 649 // Checks to make sure, that fcn doesn't crash 650 if (!parlist.FindCreateObj("MParameterD", "MinimizationValue"))650 if (!parlist.FindCreateObj("MParameterD", fNameMinimizationValue)) 651 651 return kFALSE; 652 652 -
trunk/MagicSoft/Mars/mjobs/MJOptimize.h
r7142 r7151 73 73 Float_t fTolerance; 74 74 Int_t fTestTrain; 75 TString fNameMinimizationValue; 75 76 76 77 Bool_t Optimize(MEvtLoop &evtloop); … … 112 113 void SetTolerance(Float_t tol=0) { fTolerance=tol; } 113 114 void EnableTestTrain(Int_t b=1) { fTestTrain=b; } // Use 1 and -1 115 void SetNameMinimizationValue(const char *name="MinimizationValue") { fNameMinimizationValue = name; } 114 116 115 117 // Parameter access -
trunk/MagicSoft/Mars/mjobs/MJOptimizeEnergy.cc
r7121 r7151 27 27 // MJOptimize 28 28 // 29 // Class for otimizing the parameters of the supercuts 29 // Class for otimizing a rule to estimate the energy. For more details see 30 // MJOptimize. 30 31 // 31 // Minimization Control32 // ====================32 // Example: 33 // -------- 33 34 // 34 // To choose the minimization algorithm use: 35 // void SetOptimizer(Optimizer_t o); 36 // 37 // Allowed options are: 38 // enum Optimizer_t 39 // { 40 // kMigrad, // Minimize by the method of Migrad 41 // kSimplex, // Minimize by the method of Simplex 42 // kMinimize, // Migrad + Simplex (if Migrad fails) 43 // kMinos, // Minos error determination 44 // kImprove, // Local minimum search 45 // kSeek, // Minimize by the method of Monte Carlo 46 // kNone // Skip optimization 47 // }; 48 // 49 // For more details on the methods see TMinuit. 50 // 51 // 52 // You can change the behaviour of the minimization using 53 // 54 // void SetNumMaxCalls(UInt_t num=0); 55 // void SetTolerance(Float_t tol=0); 56 // 57 // While NumMaxCalls is the first, Tolerance the second arguement. 58 // For more details start root and type 59 // 60 // gMinuit->mnhelp("command") 61 // 62 // while command can be 63 // * MIGRAD 64 // * SIMPLEX 65 // * MINIMIZE 66 // * MINOS 67 // * IMPROVE 68 // * SEEK 69 // 70 // The default (num==0 and tol==0) should always give you the 71 // corresponding defaults used in Minuit. 72 // 73 // 74 // FIXME: Implement changing cut in hadronness... 75 // FIXME: Show MHSignificance on MStatusDisplay during filling... 76 // FIXME: Choose step-size percentage as static data membewr 77 // FIXME: Choose minimization method 35 // MJOptimizeEnergy opt; 36 // opt.SetDebug(2); 37 // opt.SetOptimizer(MJOptimize::kMigrad); 38 // opt.SetNumEvents(20000); 39 // opt.EnableTestTrain(); 40 // opt.AddParameter("MHillas.fSize"); 41 // opt.SetParameter(0, 1, 0, 2); 42 // char *r = "[0]*M[0]"; //Rule to calculate estimated energy 43 // MStatusDisplay *d = new MStatusDisplay; 44 // opt.SetDisplay(d); 45 // opt.RunDisp("ganymed-summary.root", r); 78 46 // 79 47 ///////////////////////////////////////////////////////////////////////////// … … 116 84 // energy estimator. 117 85 // 118 Bool_t MJOptimizeEnergy::RunEnergy(const char *fname, const char *rule )86 Bool_t MJOptimizeEnergy::RunEnergy(const char *fname, const char *rule, MTask *weights) 119 87 { 120 88 fLog->Separator("Preparing Energy optimization"); … … 139 107 hist.InitMapping(&m); 140 108 141 M EnergyEstimate est("MParameters");142 est.Set Rule(rule);109 MParameterCalc est(rule, "MParameters"); 110 est.SetNameParameter("MEnergyEst"); 143 111 parlist.AddToList(&est); 144 112 … … 159 127 160 128 MFillH fill(&hist); 129 if (weights) 130 fill.SetWeight(); 161 131 162 132 MMatrixLoop loop(&m); … … 164 134 tasklist.AddToList(&loop); 165 135 tasklist.AddToList(&est); 136 if (weights) 137 tasklist.AddToList(weights); 166 138 tasklist.AddToList(&fill); 167 139 -
trunk/MagicSoft/Mars/mjobs/MJOptimizeEnergy.h
r7121 r7151 6 6 #endif 7 7 8 class MTask; 9 8 10 class MJOptimizeEnergy : public MJOptimize 9 11 { 10 12 public: 13 MJOptimizeEnergy() : MJOptimize() { } 14 11 15 // Special optimizing routines 12 Bool_t RunEnergy(const char *fname, const char *rule );13 Bool_t RunEnergy(const char *rule )16 Bool_t RunEnergy(const char *fname, const char *rule, MTask *weights=0); 17 Bool_t RunEnergy(const char *rule, MTask *weights=0) 14 18 { 15 return RunEnergy(0, rule );19 return RunEnergy(0, rule, weights); 16 20 } 17 21
Note:
See TracChangeset
for help on using the changeset viewer.