Changeset 6907 for trunk/MagicSoft/Mars/mjobs
- Timestamp:
- 04/04/05 10:18:01 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mjobs
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
r6906 r6907 866 866 867 867 MGeomCam &geomcam = *(MGeomCam*)plist.FindObject("MGeomCam"); 868 868 /* 869 869 // 870 870 // Get container from list … … 894 894 disp21.CamDraw(c0, 2, 2, 1); 895 895 } 896 896 */ 897 897 if (!fIsHiLoCalibration) 898 898 return; -
trunk/MagicSoft/Mars/mjobs/MJCut.cc
r6892 r6907 56 56 #include "../mhflux/MAlphaFitter.h" 57 57 #include "MBinning.h" 58 #include "MWeight.h" 58 59 #include "MDataSet.h" 59 60 #include "MParameters.h" … … 71 72 MJCut::MJCut(const char *name, const char *title) 72 73 : fStoreSummary(kFALSE), fStoreResult(kFALSE), fWriteOnly(kFALSE), 73 fIsWobble(kFALSE), fEstimateEnergy(0), fCalcHadronness(0) 74 fIsWobble(kFALSE), fFullDisplay(kFALSE), fEstimateEnergy(0), 75 fCalcHadronness(0) 74 76 { 75 77 fName = name ? name : "MJCut"; 76 fTitle = title ? title : "Standard program to perform g/h-sep eration cuts";78 fTitle = title ? title : "Standard program to perform g/h-separation cuts"; 77 79 } 78 80 … … 260 262 // "DataType" to "Events" 261 263 // 262 void MJCut::SetupWriter(MWriteRootFile &write, const char *name) const 263 { 264 write.SetName(name); 265 write.AddContainer("MHillas", "Events"); 266 write.AddContainer("MHillasSrc", "Events"); 267 write.AddContainer("MHillasSrcAnti", "Events", kFALSE); 268 write.AddContainer("MHadronness", "Events", kFALSE); 269 write.AddContainer("MEnergyEst", "Events", kFALSE); 270 write.AddContainer("DataType", "Events"); 264 void MJCut::SetupWriter(MWriteRootFile *write, const char *name) const 265 { 266 if (!write) 267 return; 268 269 write->SetName(name); 270 write->AddContainer("MHillas", "Events"); 271 write->AddContainer("MHillasSrc", "Events"); 272 write->AddContainer("MHillasSrcAnti", "Events", kFALSE); 273 write->AddContainer("MNewImagePar", "Events", kFALSE); 274 write->AddContainer("MNewImagePar2", "Events", kFALSE); 275 write->AddContainer("MHadronness", "Events", kFALSE); 276 write->AddContainer("MEnergyEst", "Events", kFALSE); 277 write->AddContainer("DataType", "Events"); 271 278 272 279 // Should not be the default: Either as option, or as … … 326 333 MBinning bins3(50, 0, 60, "BinningTheta", "cos"); 327 334 MBinning bins4("BinningFalseSource"); 335 //MBinning bins5("BinningWidth"); 336 //MBinning bins6("BinningLength"); 337 //MBinning bins7("BinningDist"); 328 338 plist.AddToList(&bins1); 329 339 plist.AddToList(&bins2); 330 340 plist.AddToList(&bins3); 331 341 plist.AddToList(&bins4); 342 //plist.AddToList(&bins5); 343 //plist.AddToList(&bins6); 344 //plist.AddToList(&bins7); 332 345 333 346 // -------------------------------------------------------------------------------- … … 368 381 fname1 += fNameResult.IsNull() ? (TString) Form("ganymed%08d-result.root", set.GetNumAnalysis()) : fNameResult; 369 382 370 MWriteRootFile write0(fPathOut.IsNull()?0:fname0.Data(), fOverwrite?"RECREATE":"NEW"); 371 MWriteRootFile write1(fPathOut.IsNull()?0:fname1.Data(), fOverwrite?"RECREATE":"NEW"); 372 if (CanStoreSummary()) 373 SetupWriter(write0, "WriteAfterCut0"); 374 if (CanStoreSummary()) 375 SetupWriter(write1, "WriteAfterCut3"); 383 MWriteRootFile *write0 = CanStoreSummary() ? new MWriteRootFile(fPathOut.IsNull()?0:fname0.Data(), fOverwrite?"RECREATE":"NEW") : 0; 384 MWriteRootFile *write1 = CanStoreResult() ? new MWriteRootFile(fPathOut.IsNull()?0:fname1.Data(), fOverwrite?"RECREATE":"NEW") : 0; 385 SetupWriter(write0, "WriteAfterCut0"); 386 SetupWriter(write1, "WriteAfterCut3"); 376 387 377 388 … … 384 395 taskenv2.SetDefault(fCalcHadronness); 385 396 386 MFillH fill1a("MHHillasOffPre [MHHillas]", "MHillas", "FillHillasPre"); 387 MFillH fill2a("MHHillasOffPost [MHHillas]", "MHillas", "FillHillasPost"); 388 MFillH fill3a("MHVsSizeOffPost [MHVsSize]", "MHillasSrc", "FillVsSizePost"); 397 MFillH fill1a("MHHillasOffPre [MHHillas]", "MHillas", "FillHillasPre"); 398 MFillH fill2a("MHHillasOffPost [MHHillas]", "MHillas", "FillHillasPost"); 399 MFillH fill3a("MHVsSizeOffPost [MHVsSize]", "MHillasSrc", "FillVsSizePost"); 400 MFillH fill4a("MHHilExtOffPost [MHHillasExt]", "MHillasSrc", "FillHilExtPost"); 401 MFillH fill5a("MHHilSrcOffPost [MHHillasSrc]", "MHillasSrc", "FillHilSrcPost"); 402 MFillH fill6a("MHImgParOffPost [MHImagePar]", "MImagePar", "FillImgParPost"); 403 MFillH fill7a("MHNewParOffPost [MHNewImagePar]", "MNewImagePar", "FillNewParPost"); 389 404 fill1a.SetNameTab("PreCut"); 390 405 fill2a.SetNameTab("PostCut"); 391 406 fill3a.SetNameTab("VsSize"); 407 fill4a.SetNameTab("HilExt"); 408 fill5a.SetNameTab("HilSrc"); 409 fill6a.SetNameTab("ImgPar"); 410 fill7a.SetNameTab("NewPar"); 392 411 393 412 MPrint print2("MEffectiveOnTime"); … … 412 431 tlist2.AddToList(&taskenv2); 413 432 tlist2.AddToList(&cont0); 414 if ( CanStoreSummary())415 tlist2.AddToList( &write0);433 if (write0) 434 tlist2.AddToList(write0); 416 435 if (!fWriteOnly) 417 436 tlist2.AddToList(&fill1a); 418 437 tlist2.AddToList(&cont1); 419 if (!fWriteOnly )438 if (!fWriteOnly && !fIsWobble) 420 439 tlist2.AddToList(&ffs); 421 440 tlist2.AddToList(&cont2); … … 423 442 { 424 443 tlist2.AddToList(&fill2a); 425 tlist2.AddToList(&fill3a); 444 if (fFullDisplay) 445 { 446 tlist2.AddToList(&fill3a); 447 tlist2.AddToList(&fill4a); 448 tlist2.AddToList(&fill5a); 449 tlist2.AddToList(&fill6a); 450 tlist2.AddToList(&fill7a); 451 } 426 452 } 427 453 if (!fWriteOnly) 428 454 tlist2.AddToList(&falpha); 429 455 tlist2.AddToList(&cont3); 430 if ( CanStoreResult())431 tlist2.AddToList( &write1);456 if (write1) 457 tlist2.AddToList(write1); 432 458 433 459 tlist.AddToList(&readoff); … … 461 487 return kFALSE; 462 488 } 489 490 //plist.FindObject("MTimeEffectiveOnTime")->Clear(); 463 491 } 464 492 … … 473 501 scalc.SetWobbleMode(kFALSE); /********************/ 474 502 475 MFillH fill1b("MHHillasOnPre [MHHillas]", "MHillas", "FillHillasPre"); 476 MFillH fill2b("MHHillasOnPost [MHHillas]", "MHillas", "FillHillasPost"); 477 MFillH fill3b("MHVsSizeOnPost [MHVsSize]", "MHillasSrc", "FillVsSizePost"); 503 MFillH fill1b("MHHillasOnPre [MHHillas]", "MHillas", "FillHillasPre"); 504 MFillH fill2b("MHHillasOnPost [MHHillas]", "MHillas", "FillHillasPost"); 505 MFillH fill3b("MHVsSizeOnPost [MHVsSize]", "MHillasSrc", "FillVsSizePost"); 506 MFillH fill4b("MHHilExtOnPost [MHHillasExt]", "MHillasSrc", "FillHilExtPost"); 507 MFillH fill5b("MHHilSrcOnPost [MHHillasSrc]", "MHillasSrc", "FillHilSrcPost"); 508 MFillH fill6b("MHImgParOnPost [MHImagePar]", "MImagePar", "FillImgParPost"); 509 MFillH fill7b("MHNewParOnPost [MHNewImagePar]", "MNewImagePar", "FillNewParPost"); 478 510 fill1b.SetNameTab("PreCut"); 479 511 fill2b.SetNameTab("PostCut"); 480 512 fill3b.SetNameTab("VsSize"); 513 fill4b.SetNameTab("HilExt"); 514 fill5b.SetNameTab("HilSrc"); 515 fill6b.SetNameTab("ImgPar"); 516 fill7b.SetNameTab("NewPar"); 481 517 fill1b.SetDrawOption(set.HasOffSequences()||fIsWobble?"same":""); 482 518 fill2b.SetDrawOption(set.HasOffSequences()||fIsWobble?"same":""); 483 519 fill3b.SetDrawOption(set.HasOffSequences()||fIsWobble?"same":""); 484 520 fill4b.SetDrawOption(set.HasOffSequences()||fIsWobble?"same":""); 521 fill5b.SetDrawOption(set.HasOffSequences()||fIsWobble?"same":""); 522 fill6b.SetDrawOption(set.HasOffSequences()||fIsWobble?"same":""); 523 fill7b.SetDrawOption(set.HasOffSequences()||fIsWobble?"same":""); 524 /* 525 MWeight weight; 526 weight.SetWeight(-1); 527 fill2a.SetWeight(&weight); 528 fill3a.SetWeight(&weight); 529 */ 485 530 MFillH falpha2("MHAlpha", "MHillasSrc", "FillAlpha"); 486 531 MFillH ffs2("MHFalseSource", "MHillas", "FillFS"); … … 490 535 { 491 536 tlist2.Replace(&fill1b); 537 /* if (fIsWobble) 538 { 539 tlist2.AddToListAfter(&fill2b, &fill2a); 540 tlist2.AddToListAfter(&fill3b, &fill3a); 541 } 542 else 543 */ 492 544 tlist2.Replace(&fill2b); 493 tlist2.Replace(&fill3b); 545 if (fFullDisplay) 546 { 547 tlist2.Replace(&fill3b); 548 tlist2.Replace(&fill4b); 549 tlist2.Replace(&fill5b); 550 tlist2.Replace(&fill6b); 551 tlist2.Replace(&fill7b); 552 } 494 553 tlist2.Replace(&falpha2); 495 tlist2.Replace(&ffs2); 554 if (!fIsWobble) 555 tlist2.Replace(&ffs2); 496 556 } 497 557 … … 518 578 } 519 579 580 if (write0) 581 delete write0; 582 if (write1) 583 delete write1; 584 520 585 tlist.PrintStatistics(); 521 586 -
trunk/MagicSoft/Mars/mjobs/MJCut.h
r6874 r6907 17 17 Bool_t fWriteOnly; 18 18 Bool_t fIsWobble; 19 Bool_t fFullDisplay; 19 20 20 21 TString fNameSummary; … … 27 28 TString GetOutputFile(UInt_t num) const; 28 29 Bool_t CheckEnvLocal(); 29 void SetupWriter(MWriteRootFile &write, const char *name) const;30 void SetupWriter(MWriteRootFile *write, const char *name) const; 30 31 Bool_t WriteTasks(UInt_t num, TObjArray &cont) const; 31 32 Bool_t WriteResult(UInt_t num) const; … … 44 45 void EnableWriteOnly(Bool_t b=kTRUE) { fWriteOnly = b; } 45 46 void EnableWobbleMode(Bool_t b=kTRUE) { fIsWobble = b; } 47 void EnableFullDisplay(Bool_t b=kTRUE) { fFullDisplay = b; } 46 48 47 49 void SetNameSummaryFile(const char *name=""); … … 52 54 void SetHadronnessCalculator(const MTask *task=0); 53 55 54 ClassDef(MJCut, 0) // Standard program to perform g/h-sep eration cuts56 ClassDef(MJCut, 0) // Standard program to perform g/h-separation cuts 55 57 }; 56 58 -
trunk/MagicSoft/Mars/mjobs/MJOptimize.cc
r6900 r6907 497 497 498 498 gMinuit = new TMinuit(fParameters.GetSize()); 499 //gMinuit->SetPrintLevel(-1);500 499 501 500 gMinuit->SetFCN(fcn); 502 501 gMinuit->SetObjectFit(this); 502 gMinuit->SetPrintLevel(-1); // Don't print when DefineParameter 503 503 504 504 // … … 526 526 gMinuit->FixParameter(i); 527 527 } 528 529 gMinuit->SetPrintLevel(1); // Switch on pritning again 530 gMinuit->mnprin(1,0); // Print all parameters 528 531 529 532 fEvtLoop = &evtloop;
Note:
See TracChangeset
for help on using the changeset viewer.