Changeset 8704
- Timestamp:
- 08/24/07 09:37:31 (17 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r8703 r8704 18 18 19 19 -*-*- END OF LINE -*-*- 20 21 22 2007/08/24 Thomas Bretz 23 24 * mdata/MDataMember.cc: 25 - added a sanity check in GetValue() 26 27 * mdata/MDataPhrase.[h,cc]: 28 - Allow to use MDataPhrase also with variables x,y,z and t 29 - Allow evaluation of the function with given x,y,z,t 30 31 * mjobs/MJSpectrum.h: 32 - commented IntermediateLoop, was unused 33 34 * mjoptim/MJOptimize.cc: 35 - added two comments 36 37 * mjtrain/MJTrainDisp.cc: 38 - added new MHn to display more information about the test 39 - improved result-histogram 40 - added PreTasks, PostTasks and TestTasks to testing tasklist 41 - some fixes if the user closed the display 42 43 * mjtrain/MJTrainEnergy.cc 44 - added new MHn to display more information about the test 45 - allow to set fTrainParameter and fResultFunction from 46 outside, this allows to train on whatever you like 47 - added TestTasks to testing tasklist 48 - added new member functions to set Train parameter and 49 evaluation function: SetTrainLog/Log and SetTrainFunc 50 51 * mranforest/MRanForestCalc.[h,cc]: 52 - changed evaluatio function-type from TF1 to MDataPhrase 53 54 * mraw/MRawEvtData.cc: 55 - initialize fNumBytesPerSample with 1 56 57 * mraw/MRawRunHeader.[h,cc] 58 - set default FADC type to 1 (Siegen) 59 - it turned out that we use 1/2 and not 0/1 as expected 60 61 62 20 63 21 64 -
trunk/MagicSoft/Mars/NEWS
r8703 r8704 30 30 for example in testing after optimizations or training to produce 31 31 user defined histograms. 32 33 - general: The Random Forest now allows attaching an evaluation 34 function which is applied to its output. This allows to train 35 on whatever you like (eg. train on log10(energy), but return 36 energy) 37 38 - general: TheRandom Forest training of energy (trainenergy.c) and 39 disp (traindisp.C) has been improved by more graphical output to 40 judge the result. 41 42 - general: The training of energy (trainenergy.C) has been improved 43 a lot by training on a different quantity than energy. It gives 44 a result which is highly independant of the source spectrum 45 and shows lower bias than all other options. 32 46 33 47 - merpp: Merpp can read file format version 9 now. Please realize -
trunk/MagicSoft/Mars/mdata/MDataMember.cc
r8073 r8704 97 97 Double_t MDataMember::GetValue() const 98 98 { 99 if (!fObject) 100 { 101 *fLog << err << "ERROR - MDataMember::GetValue: fObject not initialized "; 102 *fLog << "(not PreProcessed)... returning 0." << endl; 103 return 0; 104 } 105 99 106 if (!fCall) 100 107 { … … 138 145 // the original statement "if (fCall)" is replaced by the statement 139 146 if (fCall && !fObject) 140 147 return kTRUE; 141 148 142 149 TString cname(fDataMember); -
trunk/MagicSoft/Mars/mdata/MDataPhrase.cc
r8635 r8704 469 469 // Evaluates and returns the result of the member list. 470 470 // 471 Double_t MDataPhrase:: GetValue() const471 Double_t MDataPhrase::Eval(const Double_t *x) const 472 472 { 473 473 const Int_t n = fMembers.GetEntriesFast(); … … 490 490 491 491 // Evaluate function 492 return fFormula->EvalPar( 0, arr);492 return fFormula->EvalPar(x, arr); 493 493 } 494 494 -
trunk/MagicSoft/Mars/mdata/MDataPhrase.h
r8635 r8704 46 46 Bool_t IsValid() const; 47 47 Bool_t HasValidRule() const { return fFormula ? kTRUE : kFALSE; } 48 Double_t GetValue() const; 48 Double_t GetValue() const { return Eval((Double_t*)NULL); } 49 Double_t Eval(const Double_t *x) const; 50 Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const 51 { 52 const Double_t xx[4] = { x, y, z, t }; 53 return Eval(xx); 54 } 49 55 TString GetRule() const; 50 56 TString GetRuleRaw() const; -
trunk/MagicSoft/Mars/mjoptim/MJOptimize.cc
r8644 r8704 665 665 gMinuit = 0; 666 666 667 // Test with training data 667 668 fEvtLoop->SetDisplay(fDisplay); 668 669 if (!Fcn(fParameters)) … … 674 675 return kTRUE; 675 676 677 // Test with test-data 676 678 loop->SetOperationMode(fTestTrain<0?MMatrixLoop::kEven:MMatrixLoop::kOdd); 677 679 -
trunk/MagicSoft/Mars/mjtrain/MJTrainDisp.cc
r8657 r8704 87 87 #include "MBinning.h" 88 88 #include "MH3.h" 89 #include "MHn.h" 89 90 #include "MHThetaSq.h" 90 91 … … 115 116 line.SetLineWidth(1); 116 117 117 c.cd(i); 118 c.cd(i+4); 119 gPad->SetBorderMode(0); 120 gPad->SetFrameBorderMode(0); 121 //gPad->SetFillColor(kWhite); 122 gPad->SetLogx(); 123 gPad->SetGridx(); 124 gPad->SetGridy(); 125 //gPad->SetLeftMargin(0.12); 126 //gPad->SetRightMargin(0.12); 127 128 const Float_t cutval = hist.GetYaxis()->GetBinLowEdge(4); 129 130 TH1D heff; 131 heff.SetName(Form("Eff%s", hist.GetName())); 132 heff.SetTitle(Form("Cut efficiency vs. %s for \\vartheta<%.3f", hist.GetName(), TMath::Sqrt(cutval))); 133 heff.SetDirectory(0); 134 heff.SetXTitle(hist.GetXaxis()->GetTitle()); 135 heff.SetYTitle("Efficiency"); 136 137 MH::SetBinning(&heff, hist.GetXaxis()); 138 139 140 for (int x=0; x<=hist.GetNbinsX()+1; x++) 141 { 142 const Double_t n0 = hist.Integral(x, x, -1, -1); 143 if (n0>0) 144 heff.SetBinContent(x, hist.Integral(x, x, -1, 3)/n0); 145 } 146 147 heff.SetMinimum(0); 148 heff.SetMaximum(1); 149 heff.DrawCopy(); 150 151 line.DrawLine(10, 0.5, 31623, 0.5); 152 153 c.cd(i+0); 118 154 gPad->SetBorderMode(0); 119 155 gPad->SetFrameBorderMode(0); … … 179 215 { 180 216 TCanvas &c = fDisplay->AddTab("Disp"); 181 c.Divide(2, 2);217 c.Divide(2,3); 182 218 183 219 DisplayHist(c, 1, hsize); … … 215 251 216 252 if (!set.AddFilesOn(readtrn)) 217 return kFALSE; 253 { 254 *fLog << err << "ERROR - Adding SequencesOn." << endl; 255 return kFALSE; 256 } 218 257 if (!set.AddFilesOff(readtst)) 219 return kFALSE; 258 { 259 *fLog << err << "ERROR - Adding SequencesOff." << endl; 260 return kFALSE; 261 } 220 262 221 263 // ----------------------- Setup Matrix ------------------ … … 277 319 278 320 MParameterD par("ThetaSquaredCut"); 279 par.SetVal(0.2 );321 par.SetVal(0.215*0.215); 280 322 plist.AddToList(&par); 281 323 … … 297 339 cont.SetInverted(); 298 340 341 const char *rule = "(MHillasSrc.fDist*MGeomCam.fConvMm2Deg)^2 + (Disp.fVal)^2 - (2*MHillasSrc.fDist*MGeomCam.fConvMm2Deg*Disp.fVal*cos(MHillasSrc.fAlpha*kDeg2Rad))"; 342 343 MParameterCalc calcthetasq(rule, "MThetaSqCalc"); 344 calcthetasq.SetNameParameter("ThetaSquared"); 345 346 MChisqEval eval; 347 eval.SetY1("sqrt(ThetaSquared.fVal)"); 348 349 // ----------- Setup binnings ---------------- 350 MBinning binsS(50, 10, 100000, "BinningSize", "log"); 351 MBinning binsE(70, 10, 31623, "BinningEnergy", "log"); 352 MBinning binsG(50, -10, 10, "BinningSlope", "lin"); 353 MBinning binsX(50, -1, 1, "BinningResidualDist", "lin"); 354 MBinning binsL(50, 0, 0.3, "BinningLeakage", "lin"); 355 MBinning binsT(51, -0.005, 0.505, "BinningTheta", "asin"); 356 MBinning binsC(50, 1e-2, 1, "BinningConc", "log"); 357 MBinning binsW(50, 0, 0.5, "BinningLength", "lin"); 358 MBinning binsM(50, 0, 0.3, "BinningWidth", "lin"); 359 MBinning binsV(75, 0, par.GetVal()*25, "BinningThetaSq", "lin"); 360 361 plist.AddToList(&binsG); 362 plist.AddToList(&binsS); 363 plist.AddToList(&binsX); 364 plist.AddToList(&binsE); 365 plist.AddToList(&binsL); 366 plist.AddToList(&binsT); 367 plist.AddToList(&binsC); 368 plist.AddToList(&binsV); 369 plist.AddToList(&binsW); 370 plist.AddToList(&binsM); 371 372 // ----------- Setup some histograms ---------------- 373 299 374 MHThetaSq hist; 300 375 hist.SkipHistTime(); … … 302 377 hist.SkipHistEnergy(); 303 378 304 MFillH fillh(&hist, "", "FillThetaSq"); 305 306 // 0 = disp^2 - 2*disp*dist*cos(alpha) + dist^2 307 308 // cos^2 -1 = - sin^2 309 310 // disp = +dist* (cos(alpha) +/- sqrt(cos^2(alpha) - 1) ) 311 312 const char *rule = "(MHillasSrc.fDist*MGeomCam.fConvMm2Deg)^2 + (Disp.fVal)^2 - (2*MHillasSrc.fDist*MGeomCam.fConvMm2Deg*Disp.fVal*cos(MHillasSrc.fAlpha*kDeg2Rad))"; 313 314 MParameterCalc calcthetasq(rule, "MThetaSqCalc"); 315 calcthetasq.SetNameParameter("ThetaSquared"); 316 317 MChisqEval eval; 318 eval.SetY1("sqrt(ThetaSquared.fVal)"); 379 // To speed it up we could precalculate it. 380 const char *res = "Disp.fVal-MHillasSrc.fDist*3.37e-3"; 381 382 MHn hres1("Disp1", "Xi Residual (Dist/Disp)"); 383 hres1.AddHist("MHillas.fSize", res); 384 hres1.InitName("ResSize;Size;ResidualDist"); 385 hres1.InitTitle(";S [phe];Disp-Dist [\\circ];"); 386 hres1.SetDrawOption("colz profx"); 387 hres1.AddHist("MHillasExt.fSlopeLong*sign(MHillasSrc.fCosDeltaAlpha)/3.37e-3", res); 388 hres1.InitName("ResSlope;Slope;ResidualDist"); 389 hres1.InitTitle(";Slope;Disp-Dist [\\circ];"); 390 hres1.SetDrawOption("colz profx"); 391 hres1.AddHist("MNewImagePar.fLeakage1", res); 392 hres1.InitName("ResLeak;Leakage;ResidualDist"); 393 hres1.InitTitle(";Leak;Disp-Dist [\\circ];"); 394 hres1.SetDrawOption("colz profx"); 395 hres1.AddHist("MPointingPos.fZd", res); 396 hres1.InitName("ResTheta;Theta;ResidualDist"); 397 hres1.InitTitle(";Zd [\\circ];Disp-Dist [\\circ];"); 398 hres1.SetDrawOption("colz profx"); 399 400 MHn hres2("Disp2", "Dist Residual (Disp-Dist)"); 401 hres2.AddHist("MHillas.fLength*3.37e-3", res); 402 hres2.InitName("ResLength;Length;ResidualDist"); 403 hres2.InitTitle(";L [\\circ];Disp-Dist [\\circ];"); 404 hres2.SetDrawOption("colz profx"); 405 hres2.AddHist("MNewImagePar.fConc1", res); 406 hres2.InitName("ResConc1;Conc;ResidualDist"); 407 hres2.InitTitle(";C;Disp-Dist [\\circ];"); 408 hres2.SetDrawOption("colz profx"); 409 hres2.AddHist("MHillas.fWidth*3.37e-3", res); 410 hres2.InitName("ResWidth;Width;ResidualDist"); 411 hres2.InitTitle(";W [\\circ];Disp-Dist [\\circ];"); 412 hres2.SetDrawOption("colz profx"); 413 hres2.AddHist("MMcEvt.fEnergy", res); 414 hres2.InitName("ResEmc;Energy;ResidualDist"); 415 hres2.InitTitle(";E_{mc} [GeV];Disp-Dist [\\circ];"); 416 hres2.SetDrawOption("colz profx"); 319 417 320 418 MH3 hdisp1("MHillas.fSize", "ThetaSquared.fVal"); 321 419 MH3 hdisp2("MMcEvt.fEnergy", "ThetaSquared.fVal"); 322 hdisp1.SetTitle("\\vartheta distribution vs. Size:Size [phe]:\\vartheta [\\circ]"); 323 hdisp2.SetTitle("\\vartheta distribution vs. Energy:Enerhy [GeV]:\\vartheta [\\circ]"); 324 325 MBinning binsx( 70, 10, 31623, "BinningMH3X", "log"); 326 MBinning binsy( 75, 0, 0.3, "BinningMH3Y", "lin"); 327 328 plist.AddToList(&binsx); 329 plist.AddToList(&binsy); 330 331 MFillH fillh2a(&hdisp1, "", "FillSize"); 332 MFillH fillh2b(&hdisp2, "", "FillEnergy"); 333 fillh2a.SetDrawOption("colz profx"); 334 fillh2b.SetDrawOption("colz profx"); 335 fillh2a.SetNameTab("Size"); 336 fillh2b.SetNameTab("Energy"); 420 hdisp1.SetName("Size;Size;ThetaSq"); 421 hdisp2.SetName("Energy;Energy;ThetaSq"); 422 hdisp1.SetTitle("\\vartheta distribution vs. Size:Size [phe]:\\vartheta^2 [\\circ]"); 423 hdisp2.SetTitle("\\vartheta distribution vs. Energy:Energy [GeV]:\\vartheta^2 [\\circ]"); 424 425 // -------------- Setup fill tasks ---------------- 426 427 MFillH fillh(&hist, "", "FillThetaSq"); 428 MFillH fillh2a(&hres1, "", "FillResiduals1"); 429 MFillH fillh2b(&hres2, "", "FillResiduals2"); 430 MFillH fillh2c(&hdisp1, "", "FillSize"); 431 MFillH fillh2d(&hdisp2, "", "FillEnergy"); 432 fillh2c.SetBit(MFillH::kDoNotDisplay); 433 fillh2d.SetBit(MFillH::kDoNotDisplay); 434 435 // --------------- Setup weighting ------------------- 436 437 if (fEnableWeights) 438 { 439 fillh.SetWeight(); 440 fillh2a.SetWeight(); 441 fillh2b.SetWeight(); 442 fillh2c.SetWeight(); 443 fillh2d.SetWeight(); 444 eval.SetNameWeight(); 445 } 446 447 // --------------- Setup tasklist ------------------- 337 448 338 449 tlist.AddToList(&readtst); 450 tlist.AddToList(fPreTasks); 339 451 tlist.AddToList(&cont); 340 452 tlist.AddToList(&rf); 341 453 tlist.AddToList(&calcthetasq); 454 tlist.AddToList(fPostTasks); 342 455 tlist.AddToList(&fillh); 343 456 tlist.AddToList(&fillh2a); 344 457 tlist.AddToList(&fillh2b); 458 tlist.AddToList(&fillh2c); 459 tlist.AddToList(&fillh2d); 460 tlist.AddToList(fTestTasks); 345 461 tlist.AddToList(&eval); 462 463 // ------------- Setup/run eventloop ----------------- 346 464 347 465 MEvtLoop loop(fTitle); … … 355 473 return kFALSE; 356 474 475 // ---------------- Prepare result ------------------- 476 357 477 // Print the result 358 478 *fLog << inf; … … 361 481 hist.GetAlphaFitter().Print("result"); 362 482 483 // The user has closed the display 484 if (!fDisplay) 485 return kTRUE; 486 363 487 DisplayResult(hdisp1, hdisp2); 364 488 365 489 SetPathOut(out); 366 if (!WriteDisplay(0, "UPDATE")) 367 return kFALSE; 368 369 return kTRUE; 490 return WriteDisplay(0, "UPDATE"); 370 491 } 371 492 -
trunk/MagicSoft/Mars/mjtrain/MJTrainEnergy.cc
r8646 r8704 76 76 77 77 // histograms 78 #include "MHn.h" 79 #include "MBinning.h" 78 80 #include "MHEnergyEst.h" 79 81 … … 128 130 train.AddColumn("MMcEvt.fImpact/100"); 129 131 train.AddColumn("MMcEvt.fTelescopeTheta*TMath::RadToDeg()"); 130 train.AddColumn( "MMcEvt.fEnergy");132 train.AddColumn(fTrainParameter); 131 133 132 134 … … 156 158 rf.SetDebug(fDebug>1); 157 159 rf.SetNameOutput("MEnergyEst"); 160 rf.SetFunction(fResultFunction); 158 161 159 162 /* … … 188 191 cont.SetInverted(); 189 192 193 // ------------------------------------------------------------- 194 MBinning binsS(50, 10, 100000, "BinningSize", "log"); 195 MBinning binsE(70, 10, 31623, "BinningEnergy", "log"); 196 MBinning binsG(50,-10, 10, "BinningSlope", "lin"); 197 MBinning binsR(50, -1, 1, "BinningEnergyResidual", "lin"); 198 MBinning binsL(50, 0, 0.3, "BinningLeakage", "lin"); 199 MBinning binsT(51, -0.005, 0.505, "BinningTheta", "asin"); 200 MBinning binsD(50, 0, 1.6, "BinningDist", "lin"); 201 MBinning binsC(50, 1e-2, 1, "BinningConc", "log"); 202 203 plist.AddToList(&binsG); 204 plist.AddToList(&binsS); 205 plist.AddToList(&binsR); 206 plist.AddToList(&binsE); 207 plist.AddToList(&binsL); 208 plist.AddToList(&binsT); 209 plist.AddToList(&binsD); 210 plist.AddToList(&binsC); 211 190 212 MHEnergyEst hist; 213 214 // To speed it up we could precalculate it. 215 const char *res = "log10(MEnergyEst.fVal)-log10(MMcEvt.fEnergy)"; 216 217 MHn hres1("Energy1", "Energy Residual (lg E_{est} - lg E_{mc})"); 218 hres1.AddHist("MHillas.fSize", res); 219 hres1.InitName("ResSize;Size;EnergyResidual"); 220 hres1.InitTitle(";S [phe];\\Delta lg E;"); 221 hres1.SetDrawOption("colz profx"); 222 hres1.AddHist("MHillasExt.fSlopeLong*sign(MHillasSrc.fCosDeltaAlpha)/3.37e-3", res); 223 hres1.InitName("ResSlope;Slope;EnergyResidual"); 224 hres1.InitTitle(";Slope;\\Delta lg E;"); 225 hres1.SetDrawOption("colz profx"); 226 hres1.AddHist("MNewImagePar.fLeakage1", res); 227 hres1.InitName("ResLeak;Leakage;EnergyResidual"); 228 hres1.InitTitle(";Leak;\\Delta lg E;"); 229 hres1.SetDrawOption("colz profx"); 230 hres1.AddHist("MHillasSrc.fDist*3.37e-3", res); 231 hres1.InitName("ResDist;Dist;EnergyResidual"); 232 hres1.InitTitle(";D [\\circ];\\Delta lg E;"); 233 hres1.SetDrawOption("colz profx"); 234 235 MHn hres2("Energy2", "Energy Residual (lg E_{est} - lg E_{mc})"); 236 hres2.AddHist("MMcEvt.fEnergy", res); 237 hres2.InitName("ResEmc;Energy;EnergyResidual"); 238 hres2.InitTitle(";E_{mc} [GeV];\\Delta lg E;"); 239 hres2.SetDrawOption("colz profx"); 240 hres2.SetAutoRange(kFALSE, kFALSE, kFALSE); 241 hres2.AddHist("MPointingPos.fZd", res); 242 hres2.InitName("ResTheta;Theta;EnergyResidual"); 243 hres2.InitTitle(";Zd [\\circ];\\Delta lg E;"); 244 hres2.SetDrawOption("colz profx"); 245 hres2.AddHist("MEnergyEst.fVal", res); 246 hres2.InitName("ResEest;Energy;EnergyResidual"); 247 hres2.InitTitle(";E_{est} [GeV];\\Delta lg E;"); 248 hres2.SetDrawOption("colz profx"); 249 hres2.SetAutoRange(kFALSE, kFALSE, kFALSE); 250 hres2.AddHist("MNewImagePar.fConc1", res); 251 hres2.InitName("ResConc1;Conc;EnergyResidual"); 252 hres2.InitTitle(";C;\\Delta lg E;"); 253 hres2.SetDrawOption("colz profx"); 254 191 255 MFillH fillh(&hist); 256 MFillH fillh1(&hres1, "", "FillResiduals1"); 257 MFillH fillh2(&hres2, "", "FillResiduals2"); 258 192 259 if (fEnableWeights) 260 { 193 261 fillh.SetWeight(); 262 fillh1.SetWeight(); 263 fillh2.SetWeight(); 264 } 194 265 195 266 tlist.AddToList(&readtst); … … 199 270 tlist.AddToList(fPostTasks); 200 271 tlist.AddToList(&fillh); 272 tlist.AddToList(&fillh1); 273 tlist.AddToList(&fillh2); 274 tlist.AddToList(fTestTasks); 201 275 202 276 MEvtLoop loop(fTitle); -
trunk/MagicSoft/Mars/mjtrain/MJTrainEnergy.h
r7412 r8704 10 10 class MJTrainEnergy : public MJTrainRanForest 11 11 { 12 private: 13 TString fTrainParameter; 14 TString fResultFunction; 15 12 16 public: 13 MJTrainEnergy() { } 17 MJTrainEnergy() { SetTrainLin(); } 18 19 void SetTrainLog() { SetTrainFunc("log10(MMcEvt.fEnergy)", "pow(10, x)"); } 20 void SetTrainLin() { SetTrainFunc("MMcEvt.fEnergy", "x"); } 21 22 void SetTrainFunc(const char *par, const char *res) 23 { 24 fTrainParameter = par; 25 fResultFunction = res; 26 } 27 14 28 Bool_t Train(const char *out, const MDataSet &set, Int_t num); 15 29 -
trunk/MagicSoft/Mars/mranforest/MRanForestCalc.cc
r8698 r8704 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MRanForestCalc.cc,v 1.2 8 2007-08-23 10:25:08 tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MRanForestCalc.cc,v 1.29 2007-08-24 08:33:48 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 63 63 const TString MRanForestCalc::gsDefTitle = "RF for energy estimation"; 64 64 65 const TString MRanForestCalc::gsNameOutput = "RanForestOut"; 65 const TString MRanForestCalc::gsNameOutput = "RanForestOut"; 66 const TString MRanForestCalc::gsNameEvalFunc = "EvalFunction"; 66 67 67 68 MRanForestCalc::MRanForestCalc(const char *name, const char *title) 68 : fData(0), fRFOut(0), fTestMatrix(0), fFunc(" Function", "x"),69 : fData(0), fRFOut(0), fTestMatrix(0), fFunc("x"), 69 70 fNumTrees(-1), fNumTry(-1), fNdSize(-1), fNumObsoleteVariables(1), 70 71 fLastDataColumnHasWeights(kFALSE), … … 73 74 fName = name ? name : gsDefName.Data(); 74 75 fTitle = title ? title : gsDefTitle.Data(); 75 76 gROOT->GetListOfFunctions()->Remove(&fFunc);77 76 78 77 // FIXME: … … 93 92 Bool_t MRanForestCalc::SetFunction(const char *func) 94 93 { 95 return !fFunc. Compile(func);94 return !fFunc.SetRule(func); 96 95 } 97 96 … … 267 266 usedrules.Write("rules"); 268 267 268 fFunc.Write(gsNameEvalFunc); 269 269 270 return kTRUE; 270 271 } … … 302 303 } 303 304 304 if (fileRF.GetListOfKeys()->FindObject("Function")) 305 fFunc.Read("Function"); 305 if (fileRF.GetListOfKeys()->FindObject(gsNameEvalFunc)) 306 { 307 if (fFunc.Read(gsNameEvalFunc)<=0) 308 { 309 *fLog << err << "ERROR - Reading '" << gsNameEvalFunc << "' from file " << fFileName << endl; 310 return kFALSE; 311 } 312 313 *fLog << inf << "Evaluation function found in file: " << fFunc.GetRule() << endl; 314 } 306 315 307 316 return kTRUE; … … 325 334 326 335 *fLog << inf << "RF read from " << fFileName << endl; 336 337 if (!fFunc.PreProcess(plist)) 338 { 339 *fLog << err << "PreProcessing of evaluation function failed... aborting." << endl; 340 return kFALSE; 341 } 327 342 328 343 if (fTestMatrix) -
trunk/MagicSoft/Mars/mranforest/MRanForestCalc.h
r8698 r8704 14 14 #endif 15 15 16 #ifndef ROOT_ TF117 #include <TF1.h>16 #ifndef ROOT_MDataPhrase 17 #include "MDataPhrase.h" 18 18 #endif 19 19 … … 33 33 34 34 private: 35 static const TString gsDefName; //! Default Name 36 static const TString gsDefTitle; //! Default Title 37 static const TString gsNameOutput; //! Default Output name 35 static const TString gsDefName; //! Default Name 36 static const TString gsDefTitle; //! Default Title 37 static const TString gsNameOutput; //! Default Output name 38 static const TString gsNameEvalFunc; //! Evaluation function name 38 39 39 40 MDataArray *fData; //! Used to store the MDataChains to get the event values 40 41 MParameterD *fRFOut; //! Used to store result 41 42 MHMatrix *fTestMatrix; //! Test Matrix used in Process (together with MMatrixLoop) 42 TF1fFunc; //! Function to apply to the result43 MDataPhrase fFunc; //! Function to apply to the result 43 44 44 45 TObjArray fEForests; //! List of forests read or to be written -
trunk/MagicSoft/Mars/mraw/MRawEvtData.cc
r8571 r8704 108 108 // 109 109 MRawEvtData::MRawEvtData(const char *name, const char *title) 110 : fRunHeader(0) 110 : fRunHeader(0), fNumBytesPerSample(1) 111 111 { 112 112 fName = name ? name : "MRawEvtData"; -
trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc
r8699 r8704 157 157 fTelescopeNumber=1; 158 158 fCameraVersion=1; 159 fFadcType= 0;159 fFadcType=1; 160 160 fRunType=kRTNone; // use 0xffff for invalidation, 0 means: Data run 161 161 fRunNumber=0; … … 415 415 416 416 417 fFadcType = 0;417 fFadcType = 1; 418 418 if (fFormatVersion>7) 419 419 fin.read((char*)&fFadcType, 2); … … 573 573 *fLog << "Telescope: " << fTelescopeNumber << endl; 574 574 if (fFormatVersion>7) 575 *fLog << "FadcType: " << fFadcType << endl; 575 *fLog << "FadcType: " << fFadcType << " ("; 576 switch (fFadcType) 577 { 578 case 1: *fLog << "Siegen"; break; 579 case 2: *fLog << "MUX"; break; 580 default: *fLog << "unknown"; 581 } 582 *fLog << ")" << endl; 576 583 *fLog << "RunNumber: " << fRunNumber << " (Type=" << GetRunTypeStr() << ")" << endl; 577 584 *fLog << "ProjectName: '" << fProjectName << "'" << endl; -
trunk/MagicSoft/Mars/mraw/MRawRunHeader.h
r8699 r8704 41 41 UShort_t fFormatVersion; // File format version 42 42 UShort_t fSoftVersion; // DAQ software version 43 UShort_t fFadcType; // FADC type ( 0=Siegen, 1=MUX)43 UShort_t fFadcType; // FADC type (1=Siegen, 2=MUX) 44 44 UShort_t fCameraVersion; // Camera Version (1=MAGIC I) 45 45 UShort_t fTelescopeNumber; // Telescope number (1=Magic I)
Note:
See TracChangeset
for help on using the changeset viewer.