Changeset 7109 for trunk/MagicSoft/Mars/mjobs
- Timestamp:
- 05/30/05 18:12:10 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mjobs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJCut.cc
r7075 r7109 304 304 305 305 SetNameHist(GetEnv("NameHist", fNameHist)); 306 SetNameHistFS(GetEnv("NameHistFS", fNameHistFS)); 306 307 307 308 return kTRUE; … … 366 367 } 367 368 368 const TString objname(Form(" %s%s", "Hist"/*fNameHist.Data()*/, name));369 const TString objname(Form("Hist%s", name)); 369 370 MHAlpha *h = (MHAlpha*)plist.FindCreateObj(fNameHist, objname); 370 371 if (!h) … … 374 375 375 376 return h; 377 } 378 379 // -------------------------------------------------------------------------- 380 // 381 // Create a new instance of an object with name name of class 382 // type fNameHistFS in parlist. It must derive from MHFalseSource 383 // If something fails NULL is returned. 384 // 385 MH *MJCut::CreateNewHistFS(MParList &plist, const char *name) const 386 { 387 const TString cname(fNameHistFS.IsNull()?"MHFalseSource":fNameHistFS); 388 389 TClass *cls = gROOT->GetClass(cname); 390 if (!cls) 391 { 392 *fLog << err << "Class " << cname << " not found in dictionary... abort." << endl; 393 return NULL; 394 } 395 if (!cls->InheritsFrom("MHFalseSource")) 396 { 397 *fLog << err << "Class " << cname << " doesn't inherit from MHFalseSource... abort." << endl; 398 return NULL; 399 } 400 401 const TString objname(Form("FS%s", name)); 402 return (MH*)plist.FindCreateObj(cname, objname); 376 403 } 377 404 … … 452 479 MHAlpha *halphaoff = CreateNewHist(plist, "Off"); 453 480 MFillH falpha(halphaoff, "", "FillHist"); 454 MFillH ffs("MHFalseSourceOff [MHFalseSource]", "MHillas", "FillFS"); 481 MH *hfsoff = CreateNewHistFS(plist, "Off"); 482 MFillH ffs(hfsoff, "MHillas", "FillFS"); 455 483 456 484 // FIXME: If fPathIn read cuts and energy estimator from file! … … 531 559 tlist2.AddToList(&scalc); 532 560 tlist2.AddToList(&hcalc); 533 if (fIsWobble)561 //if (fIsWobble) 534 562 tlist2.AddToList(&hcalc2); 535 563 //tlist2.AddToList(&taskenv1); … … 541 569 tlist2.AddToList(&fill1a); 542 570 tlist2.AddToList(&cont1); 543 if (!fWriteOnly && !fIsWobble)571 if (!fWriteOnly && (!fIsWobble || !fNameHistFS.IsNull())) 544 572 tlist2.AddToList(&ffs); 545 573 tlist2.AddToList(&cont2); … … 679 707 MHAlpha *halphaon=CreateNewHist(plist); 680 708 MFillH falpha2(halphaon, "", "FillHist"); 681 MFillH ffs2("MHFalseSource", "MHillas", "FillFS"); 709 MH *hfs=CreateNewHistFS(plist); 710 MFillH ffs2(hfs, "MHillas", "FillFS"); 682 711 683 712 tlist.Replace(&readon); … … 702 731 } 703 732 tlist2.Replace(&falpha2); 704 if (!fIsWobble )733 if (!fIsWobble/* || !fNameHist.IsNull()*/) 705 734 tlist2.Replace(&ffs2); 735 if (fIsWobble && !fNameHist.IsNull()) 736 tlist2.RemoveFromList(&ffs); 706 737 707 738 if (!fIsMonteCarlo) -
trunk/MagicSoft/Mars/mjobs/MJCut.h
r6988 r7109 10 10 class MParList; 11 11 class MHAlpha; 12 class MH; 12 13 class MWriteRootFile; 13 14 … … 28 29 29 30 TString fNameHist; 31 TString fNameHistFS; 30 32 31 33 //MTask *fEstimateEnergy; … … 38 40 Bool_t WriteResult(const MParList &plist, UInt_t num) const; 39 41 MHAlpha *CreateNewHist(MParList &plist, const char *name="") const; 42 MH *CreateNewHistFS(MParList &plist, const char *name="") const; 40 43 41 44 Bool_t CanStoreSummary() const { return !fPathOut.IsNull() && fStoreSummary; } … … 61 64 62 65 void SetNameHist(const char *name) { fNameHist=name; } 66 void SetNameHistFS(const char *name) { fNameHistFS=name; } 63 67 64 68 //void SetEnergyEstimator(const MTask *task=0);
Note:
See TracChangeset
for help on using the changeset viewer.