Changeset 8719 for trunk/MagicSoft/Mars/mjtrain
- Timestamp:
- 08/28/07 13:03:04 (17 years ago)
- Location:
- trunk/MagicSoft/Mars/mjtrain
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjtrain/MJTrainDisp.cc
r8704 r8719 43 43 // opt.Train("rf-disp.root", set, 30000); // Number of train events 44 44 // 45 // // Two of the displayed histograms show the cut efficiency for 46 // // a given Theta-Cut. The default is 0.215. It can be overwritten 47 // // by 48 // opt.SetThetaCut(0.165); 49 // 45 50 // 46 51 // Random Numbers: … … 227 232 Bool_t MJTrainDisp::Train(const char *out, const MDataSet &set, Int_t num) 228 233 { 229 SetTitle(Form("Train Disp: %s", out));234 SetTitle(Form("Train%s: %s", fNameOutput.Data(), out)); 230 235 231 236 if (fDisplay) … … 282 287 283 288 // ------------------------ Train RF -------------------------- 284 MRanForestCalc rf("Train Disp", fTitle);289 MRanForestCalc rf("Train", fTitle); 285 290 rf.SetNumTrees(fNumTrees); 286 291 rf.SetNdSize(fNdSize); … … 292 297 rf.SetFileName(out); 293 298 rf.SetDebug(fDebug>1); 294 rf.SetNameOutput("Disp"); 299 rf.SetNameOutput(fNameOutput); 300 rf.SetFunction(fResultFunction); 295 301 296 302 /* … … 319 325 320 326 MParameterD par("ThetaSquaredCut"); 321 par.SetVal( 0.215*0.215);327 par.SetVal(fThetaCut*fThetaCut); 322 328 plist.AddToList(&par); 323 329 -
trunk/MagicSoft/Mars/mjtrain/MJTrainDisp.h
r8656 r8719 17 17 18 18 TString fTrainParameter; 19 TString fResultFunction; 20 21 Float_t fThetaCut; 22 23 // To be moved to a base class 24 TString fNameOutput; 19 25 20 26 void DisplayHist(TCanvas &c, Int_t i, MH3 &mh3) const; … … 22 28 23 29 public: 24 MJTrainDisp() : fTrainParameter(fgTrainParameter) { }30 MJTrainDisp() : fTrainParameter(fgTrainParameter), fResultFunction("x"), fThetaCut(0.215), fNameOutput("Disp") { } 25 31 26 32 void SetTrainParameter(const char *txt) { fTrainParameter=txt; } 33 34 void SetThetaCut(Float_t cut=0.215) { fThetaCut=cut; } 27 35 28 36 Bool_t Train(const char *out, const MDataSet &set, Int_t num); -
trunk/MagicSoft/Mars/mjtrain/MJTrainEnergy.cc
r8704 r8719 89 89 Bool_t MJTrainEnergy::Train(const char *out, const MDataSet &set, Int_t num) 90 90 { 91 SetTitle(Form("Train Energy: %s", out));91 SetTitle(Form("Train%s: %s", fNameOutput.Data(), out)); 92 92 93 93 if (fDisplay) … … 128 128 if (fEnableWeights) 129 129 train.AddColumn("MWeight.fVal"); 130 train.AddColumn("MMcEvt.fImpact/100");131 train.AddColumn("MMcEvt.fTelescopeTheta*TMath::RadToDeg()");132 130 train.AddColumn(fTrainParameter); 133 134 131 135 132 // ----------------------- Fill Matrix RF ---------------------- … … 147 144 148 145 // ------------------------ Train RF -------------------------- 149 MRanForestCalc rf("Train Energy", fTitle);146 MRanForestCalc rf("Train", fTitle); 150 147 rf.SetNumTrees(fNumTrees); 151 148 rf.SetNdSize(fNdSize); 152 149 rf.SetNumTry(fNumTry); 153 rf.SetNumObsoleteVariables( 3);150 rf.SetNumObsoleteVariables(1); 154 151 rf.SetLastDataColumnHasWeights(fEnableWeights); 155 152 rf.SetDisplay(fDisplay); … … 157 154 rf.SetFileName(out); 158 155 rf.SetDebug(fDebug>1); 159 rf.SetNameOutput( "MEnergyEst");156 rf.SetNameOutput(fNameOutput); 160 157 rf.SetFunction(fResultFunction); 161 158 … … 175 172 176 173 gLog.Separator("Test"); 174 175 MH::SetPalette("pretty"); 177 176 178 177 MParList plist; -
trunk/MagicSoft/Mars/mjtrain/MJTrainEnergy.h
r8704 r8719 14 14 TString fResultFunction; 15 15 16 // To be moved to a base class 17 TString fNameOutput; 18 16 19 public: 17 MJTrainEnergy() { SetTrainLin(); }20 MJTrainEnergy() : fNameOutput("MEnergyEst") { SetTrainLin(); } 18 21 19 22 void SetTrainLog() { SetTrainFunc("log10(MMcEvt.fEnergy)", "pow(10, x)"); }
Note:
See TracChangeset
for help on using the changeset viewer.