Changeset 6949 for trunk/MagicSoft/Mars/mjobs
- Timestamp:
- 04/18/05 10:35:54 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mjobs
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
r6919 r6949 726 726 tlist2.AddToList(&pedlo3); 727 727 //----------------------------------------------------------- 728 729 MTaskList tlist3; 730 tlist3.SetFilter(&fcalib); 731 732 MContinue contcal; 728 733 if (fIsInterlaced) 729 734 { 730 pinext.SetFilter(&fcalib);731 bldext.SetFilter(&fcalib);732 taskenv3.SetFilter(&fcalib);733 pacalc.SetFilter(&fcalib);734 filcam.SetFilter(&fcalib);735 filtme.SetFilter(&fcalib);736 filbnd.SetFilter(&fcalib);737 filpin.SetFilter(&fcalib);738 chcalc.SetFilter(&fcalib);739 recalc.SetFilter(&fcalib);740 741 735 tlist2.AddToList(&fcalib); 742 tlist2.AddToList(&pinext); 743 tlist2.AddToList(&bldext); 744 tlist2.AddToList(&taskenv3); 745 tlist2.AddToList(&pacalc); 746 tlist2.AddToList(&filcam); 736 tlist2.AddToList(&tlist3); 737 738 tlist3.AddToList(&pinext); 739 tlist3.AddToList(&bldext); 740 tlist3.AddToList(&taskenv3); 741 tlist3.AddToList(&pacalc); 742 tlist3.AddToList(&filcam); 747 743 if (fIsRelTimesUpdate) 748 tlist 2.AddToList(&filtme);744 tlist3.AddToList(&filtme); 749 745 if (IsUseBlindPixel()) 750 tlist 2.AddToList(&filbnd);746 tlist3.AddToList(&filbnd); 751 747 if (IsUsePINDiode()) 752 tlist 2.AddToList(&filpin);753 tlist 2.AddToList(&chcalc);748 tlist3.AddToList(&filpin); 749 tlist3.AddToList(&chcalc); 754 750 if (fIsRelTimesUpdate) 755 tlist2.AddToList(&recalc); 756 } 751 tlist3.AddToList(&recalc); 752 tlist3.AddToList(&fill8); 753 tlist3.AddToList(&contcal); 754 } 757 755 758 756 tlist2.AddToList(&conttp); … … 772 770 if (extractor2 || extractor1->InheritsFrom("MExtractTimeAndCharge")) 773 771 tlist2.AddToList(&caltm); 774 if (fIsInterlaced)775 tlist2.AddToList(&fill8);776 772 tlist2.AddToList(&bpcal); 777 773 tlist2.AddToList(&treat); -
trunk/MagicSoft/Mars/mjobs/MJCut.cc
r6948 r6949 45 45 46 46 #include "MReadReports.h" 47 #include "MReadMarsFile.h" 47 48 #include "MPrint.h" 48 49 #include "MContinue.h" … … 74 75 MJCut::MJCut(const char *name, const char *title) 75 76 : fStoreSummary(kFALSE), fStoreResult(kFALSE), fWriteOnly(kFALSE), 76 fIsWobble(kFALSE), f FullDisplay(kFALSE), /*fSubstraction(kFALSE),*/77 fIsWobble(kFALSE), fIsMonteCarlo(kFALSE), fFullDisplay(kFALSE), /*fSubstraction(kFALSE),*/ 77 78 fEstimateEnergy(0), fCalcHadronness(0) 78 79 { … … 181 182 return kFALSE; 182 183 } 183 env1 = o ? (MTask*)o->Clone() : NULL;184 env1 = o ? (MTask*)o->Clone() : FNULL; 184 185 185 186 o = file.Get("CalcHadronness"); … … 212 213 *fLog << inf << "Writing to file: " << oname << endl; 213 214 214 TFile file(oname, fOverwrite?"RECREATE":"NEW", "File created by MJCut", 9); 215 if (!file.IsOpen()) 215 TFile *file = 0; 216 if (fNameResult.IsNull()) 217 { 218 file = (TFile*)gROOT->GetListOfFiles()->FindObject(oname); 219 if (file) 220 file->cd(); 221 } 222 else 223 file = TFile::Open(oname, fOverwrite?"RECREATE":"NEW", "File created by MJCut", 9); 224 225 if (!file) 216 226 { 217 227 *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl; … … 219 229 } 220 230 221 return WriteContainer(cont); 231 const Bool_t rc = WriteContainer(cont); 232 233 if (!fNameResult.IsNull()) 234 delete file; 235 236 return rc; 222 237 } 223 238 … … 260 275 EnableStorageOfResult(GetEnv("ResultFile", fStoreResult)); 261 276 EnableWobbleMode(GetEnv("WobbleMode", fIsWobble)); 277 EnableMonteCarloMode(GetEnv("MonteCarlo", fIsMonteCarlo)); 262 278 EnableFullDisplay(GetEnv("FullDisplay", fFullDisplay)); 263 279 //EnableSubstraction(GetEnv("HistogramSubstraction", fSubstraction)); … … 292 308 write->AddContainer("MHadronness", "Events", kFALSE); 293 309 write->AddContainer("MEnergyEst", "Events", kFALSE); 310 write->AddContainer("MMcEvt", "Events", kFALSE); 294 311 write->AddContainer("DataType", "Events"); 295 312 … … 398 415 399 416 // ------------- Loop Off Data -------------------- 400 MReadReports readoff; 401 readoff.AddTree("Events", "MTime.", kTRUE); 402 readoff.AddTree("Drive"); 403 readoff.AddTree("EffectiveOnTime"); 417 MReadReports readoffdata; 418 readoffdata.AddTree("Events", "MTime.", kTRUE); 419 readoffdata.AddTree("Drive"); 420 readoffdata.AddTree("EffectiveOnTime"); 421 422 MReadMarsFile readoffmc("Events"); 423 readoffmc.DisableAutoScheme(); 424 425 MRead &readoff = fIsMonteCarlo ? (MRead&)readoffmc : (MRead&)readoffdata; 404 426 if (fIsWobble) 405 427 set.AddFilesOn(readoff); … … 411 433 TString fname1(path); 412 434 fname0 += fNameSummary.IsNull() ? (TString) Form("ganymed%08d-summary.root", set.GetNumAnalysis()) : fNameSummary; 413 fname1 += fNameResult.IsNull() ? (TString) Form("ganymed%08d -result.root",set.GetNumAnalysis()) : fNameResult;435 fname1 += fNameResult.IsNull() ? (TString) Form("ganymed%08d.root", set.GetNumAnalysis()) : fNameResult; 414 436 415 437 MWriteRootFile *write0 = CanStoreSummary() ? new MWriteRootFile(fPathOut.IsNull()?0:fname0.Data(), fOverwrite?"RECREATE":"NEW") : 0; … … 443 465 444 466 MPrint print2("MEffectiveOnTime"); 467 print2.EnableSkip(); 445 468 446 469 // How to get source position from off- and on-data? … … 460 483 if (fIsWobble) 461 484 tlist2.AddToList(&hcalc2); 462 tlist2.AddToList(&taskenv1);463 485 tlist2.AddToList(&taskenv2); 464 486 tlist2.AddToList(&cont0); … … 468 490 tlist2.AddToList(&fill1a); 469 491 tlist2.AddToList(&cont1); 492 tlist2.AddToList(&taskenv1); 470 493 if (!fWriteOnly && !fIsWobble) 471 494 tlist2.AddToList(&ffs); … … 503 526 return kFALSE; 504 527 528 TObjArray cont; 529 cont.Add(&fit); 530 cont.Add(&cont0); 531 cont.Add(&cont1); 532 cont.Add(&cont2); 533 cont.Add(&cont3); 534 if (taskenv1.GetTask()) 535 cont.Add(taskenv1.GetTask()); 536 if (taskenv2.GetTask()) 537 cont.Add(taskenv2.GetTask()); 538 539 if (!WriteTasks(set.GetNumAnalysis(), cont)) 540 return kFALSE; 541 505 542 if (set.HasOffSequences() || fIsWobble) 506 543 { … … 524 561 525 562 // ------------- Loop On Data -------------------- 526 MReadReports readon; 527 readon.AddTree("Events", "MTime.", kTRUE); 528 readon.AddTree("Drive"); 529 readon.AddTree("EffectiveOnTime"); 563 MReadReports readondata; 564 readondata.AddTree("Events", "MTime.", kTRUE); 565 readondata.AddTree("Drive"); 566 readondata.AddTree("EffectiveOnTime"); 567 568 MReadMarsFile readonmc("Events"); 569 readonmc.DisableAutoScheme(); 570 571 MRead &readon = fIsMonteCarlo ? (MRead&)readonmc : (MRead&)readondata; 530 572 set.AddFilesOn(readon); 531 573 … … 614 656 tlist2.Replace(&ffs2); 615 657 616 tlist.AddToList(&fillvs, "EffectiveOnTime"); 658 if (!fIsMonteCarlo) 659 tlist.AddToList(&fillvs, "EffectiveOnTime"); 617 660 } 618 661 619 662 par.SetVal(1); 620 621 TObjArray cont;622 cont.Add(&cont0);623 cont.Add(&cont1);624 cont.Add(&cont2);625 cont.Add(&cont3);626 if (taskenv1.GetTask())627 cont.Add(taskenv1.GetTask());628 if (taskenv2.GetTask())629 cont.Add(taskenv2.GetTask());630 631 if (!WriteTasks(set.GetNumAnalysis(), cont))632 return kFALSE;633 663 634 664 // Execute first analysis -
trunk/MagicSoft/Mars/mjobs/MJCut.h
r6948 r6949 18 18 Bool_t fWriteOnly; 19 19 Bool_t fIsWobble; 20 Bool_t fIsMonteCarlo; 20 21 Bool_t fFullDisplay; 21 22 //Bool_t fSubstraction; … … 48 49 void EnableWriteOnly(Bool_t b=kTRUE) { fWriteOnly = b; } 49 50 void EnableWobbleMode(Bool_t b=kTRUE) { fIsWobble = b; } 51 void EnableMonteCarloMode(Bool_t b=kTRUE) { fIsMonteCarlo = b; } 50 52 void EnableFullDisplay(Bool_t b=kTRUE) { fFullDisplay = b; } 51 53 //void EnableSubstraction(Bool_t b=kTRUE) { fSubstraction = b; } -
trunk/MagicSoft/Mars/mjobs/MJOptimize.cc
r6948 r6949 94 94 #include "MGeomCamCT1.h" 95 95 #include "MFEventSelector.h" 96 #include "MFDataMember.h" 96 97 #include "MReadTree.h" 97 98 #include "MHMatrix.h" … … 111 112 #include "MContinue.h" 112 113 #include "MGeomCamMagic.h" 113 #include " ../mimage/MHillasSrcCalc.h"114 #include "MHillasSrcCalc.h" 114 115 #include "MHMatrix.h" 115 116 #include "MMatrixLoop.h" … … 118 119 #include "../mhflux/MHEnergyEst.h" 119 120 #include "MDirIter.h" 120 #include " ../mjobs/MSequence.h"121 #include "MSequence.h" 121 122 122 123 using namespace std; … … 999 1000 MParList parlist; 1000 1001 1002 MParameterI par("DataType"); 1003 par.SetVal(1); 1004 parlist.AddToList(&par); 1005 1006 MFDataMember filter("DataType.fVal", '>', 0.5); 1007 fPreCuts.Add(&filter); 1008 1001 1009 MGeomCamMagic geom; // For GetConvMm2Deg 1002 1010 parlist.AddToList(&geom); … … 1023 1031 return kFALSE; 1024 1032 1033 fPreCuts.Remove(&filter); 1034 1025 1035 MTaskList tasklist; 1026 1036 parlist.Replace(&tasklist);
Note:
See TracChangeset
for help on using the changeset viewer.