Changeset 7555 for trunk/MagicSoft/Mars
- Timestamp:
- 03/01/06 17:29:22 (19 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r7554 r7555 52 52 - updated how the units are printed in Print() 53 53 54 * mjobs/MJCut.cc: 55 - added a new loop to fill the source position of the on-data 56 - the acceleration of the two main loops are disabled because 57 they are not yet tested. 54 58 55 59 -
trunk/MagicSoft/Mars/mjobs/MJCut.cc
r7517 r7555 86 86 : fStoreSummary(kFALSE), fStoreResult(kTRUE), fWriteOnly(kFALSE), 87 87 fIsWobble(kFALSE), fIsMonteCarlo(kFALSE), fFullDisplay(kTRUE), 88 f NameHist("MHThetaSq"), fCalcHadronness(0), fCalcDisp(0)88 fRndmSrcPos(kFALSE), fNameHist("MHThetaSq"), fCalcHadronness(0), fCalcDisp(0) 89 89 { 90 90 fName = name ? name : "MJCut"; … … 323 323 EnableMonteCarloMode(GetEnv("MonteCarlo", fIsMonteCarlo)); 324 324 EnableFullDisplay(GetEnv("FullDisplay", fFullDisplay)); 325 EnableRandomSrcPos(GetEnv("RandomSourcePosition", fRndmSrcPos)); 325 326 //EnableSubstraction(GetEnv("HistogramSubstraction", fSubstraction)); 326 327 … … 426 427 } 427 428 429 Bool_t MJCut::FillSrcPosCam(const MDataSet &set, MPointingPos &source) 430 { 431 *fLog << inf; 432 fLog->Separator(GetDescriptor()); 433 *fLog << "Filling MHSrcPosCam " << set.GetName() << endl; 434 *fLog << endl; 435 436 // -------------------------------------------------------------------------------- 437 438 // Setup Parlist 439 MParList plist; 440 plist.AddToList(this); // take care of fDisplay! 441 442 // Setup Tasklist 443 MTaskList tlist; 444 plist.AddToList(&tlist); 445 446 // La Palma Magic1, Possible source position 447 MObservatory obs; 448 plist.AddToList(&obs); 449 plist.AddToList(&source); 450 451 // Initialize default binnings 452 // MBinning bins1(18, 0, 90, "BinningSrcPosCam", "lin"); 453 // plist.AddToList(&bins1); 454 455 // ------------- Loop Off Data -------------------- 456 MReadReports read; 457 458 read.EnableAutoScheme(); 459 read.AddToBranchList("MTimeEffectiveOnTime.*"); 460 read.AddToBranchList("MEffectiveOnTime.*"); 461 462 read.AddTree("Events", "MTime.", MReadReports::kMaster); 463 read.AddTree("Drive", MReadReports::kRequired); 464 read.AddTree("Starguider", MReadReports::kRequired); 465 read.AddTree("EffectiveOnTime"); 466 467 set.AddFilesOn(read); 468 469 MFillH fill("MHSrcPosCam", "MSrcPosCam", "FillSrcPosCam"); 470 fill.SetNameTab("SrcPos"); 471 472 // How to get source position from off- and on-data? 473 MSrcPosCorrect scor; 474 MSrcPosCalc scalc; 475 scalc.SetMode(MSrcPosCalc::kDefault); 476 477 MPointingDevCalc devcalc; 478 479 tlist.AddToList(&read); 480 tlist.AddToList(&devcalc, "Starguider"); 481 tlist.AddToList(&scalc, "Events"); 482 tlist.AddToList(&scor, "Events"); 483 tlist.AddToList(&fill, "Events"); 484 485 // by setting it here it is distributed to all consecutive tasks 486 tlist.SetAccelerator(MTask::kAccDontReset|MTask::kAccDontTime); 487 read.SetAccelerator();//MTask::kAccDontReset|MTask::kAccDontCount); 488 489 // Create and setup the eventloop 490 MEvtLoop evtloop(fName); 491 evtloop.SetParList(&plist); 492 evtloop.SetDisplay(fDisplay); 493 evtloop.SetLogStream(fLog); 494 if (!SetupEnv(evtloop)) 495 return kFALSE; 496 497 // Execute first analysis 498 if (!evtloop.Eventloop(fMaxEvents)) 499 { 500 *fLog << err << GetDescriptor() << ": Processing of on-sequences failed." << endl; 501 return kFALSE; 502 } 503 504 if (!evtloop.GetDisplay()) 505 { 506 *fLog << err << GetDescriptor() << ": Execution stopped by user." << endl; 507 return kFALSE; 508 } 509 510 *fLog << all << GetDescriptor() << ": Done." << endl; 511 *fLog << endl << endl; 512 513 return kTRUE; 514 } 515 428 516 Bool_t MJCut::Process(const MDataSet &set) 429 517 { … … 435 523 436 524 CheckEnv(); 525 526 // -------------------------------------------------------------------------------- 527 528 // Possible source position (eg. Wobble Mode) 529 MPointingPos source("MSourcePos"); 530 if (set.HasSource()) 531 { 532 if (!set.GetSourcePos(source)) 533 return kFALSE; 534 *fLog << all; 535 source.Print("RaDec"); 536 } 537 else 538 *fLog << all << "No source position applied..." << endl; 539 540 if (!fIsWobble && source.IsInitialized() && fRndmSrcPos) 541 if (!FillSrcPosCam(set, source)) 542 return kFALSE; 437 543 438 544 // -------------------------------------------------------------------------------- … … 460 566 plist.AddToList(&obs); 461 567 462 // Possible source position (eg. Wobble Mode) 463 MPointingPos source("MSourcePos"); 464 if (set.HasSource()) 465 { 466 if (!set.GetSourcePos(source)) 467 return kFALSE; 568 if (source.IsInitialized()) 468 569 plist.AddToList(&source); 469 *fLog << all;470 source.Print("RaDec");471 }472 else473 *fLog << inf << "No source position applied..." << endl;474 570 475 571 // Initialize default binnings … … 546 642 SetupWriter(write1, "WriteAfterCut3"); 547 643 548 /*549 MEnergyEstimate est;550 551 MTaskEnv taskenv1("EstimateEnergy");552 taskenv1.SetDefault(fEstimateEnergy ? fEstimateEnergy : &est);553 */554 644 MTaskEnv taskenv2("CalcHadronness"); 555 645 taskenv2.SetDefault(fCalcHadronness); … … 632 722 tlist.AddToList(&devcalc, "Starguider"); 633 723 tlist.AddToList(&tlist2, "Events"); 724 725 // by setting it here it is distributed to all consecutive tasks 726 //tlist.SetAccelerator(MTask::kAccDontReset|MTask::kAccDontTime); 634 727 635 728 par.SetVal(0); … … 795 888 } 796 889 890 // by setting it here it is distributed to all consecutive tasks 891 //tlist.SetAccelerator(MTask::kAccDontReset|MTask::kAccDontTime); 892 797 893 par.SetVal(1); 798 894 -
trunk/MagicSoft/Mars/mjobs/MJCut.h
r7413 r7555 12 12 class MH; 13 13 class MWriteRootFile; 14 class MPointingPos; 14 15 15 16 class MJCut : public MJob … … 22 23 Bool_t fIsMonteCarlo; 23 24 Bool_t fFullDisplay; 25 Bool_t fRndmSrcPos; 24 26 //Bool_t fSubstraction; 25 27 … … 32 34 33 35 //MTask *fEstimateEnergy; 34 MTask *fCalcHadronness;35 MTask *fCalcDisp;36 MTask *fCalcHadronness; 37 MTask *fCalcDisp; 36 38 37 39 TString GetOutputFile(UInt_t num) const; … … 45 47 Bool_t CanStoreSummary() const { return !fPathOut.IsNull() && fStoreSummary; } 46 48 Bool_t CanStoreResult() const { return !fPathOut.IsNull() && fStoreResult; } 49 50 Bool_t FillSrcPosCam(const MDataSet &set, MPointingPos &source); 47 51 48 52 public: … … 58 62 void EnableMonteCarloMode(Bool_t b=kTRUE) { fIsMonteCarlo = b; } 59 63 void EnableFullDisplay(Bool_t b=kTRUE) { fFullDisplay = b; } 64 void EnableRandomSrcPos(Bool_t b=kTRUE) { fRndmSrcPos = b; } 60 65 //void EnableSubstraction(Bool_t b=kTRUE) { fSubstraction = b; } 61 66
Note:
See TracChangeset
for help on using the changeset viewer.