Changeset 6988 for trunk/MagicSoft/Mars/mjobs
- Timestamp:
- 05/02/05 10:17:41 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mjobs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJCut.cc
r6979 r6988 77 77 MJCut::MJCut(const char *name, const char *title) 78 78 : fStoreSummary(kFALSE), fStoreResult(kTRUE), fWriteOnly(kFALSE), 79 fIsWobble(kFALSE), fIsMonteCarlo(kFALSE), fFullDisplay(kFALSE), /*fSubstraction(kFALSE),*/80 /*fEstimateEnergy(0),*/fCalcHadronness(0)79 fIsWobble(kFALSE), fIsMonteCarlo(kFALSE), fFullDisplay(kFALSE), 80 fNameHist("MHTheta"), fCalcHadronness(0) 81 81 { 82 82 fName = name ? name : "MJCut"; … … 258 258 259 259 // Save also the result, not only the setup 260 const MHAlpha *halpha = (MHAlpha*)plist.FindObject( "MHAlpha");260 const MHAlpha *halpha = (MHAlpha*)plist.FindObject(fNameHist, "MHAlpha"); 261 261 if (halpha) 262 262 arr.Add((TObject*)(&halpha->GetAlphaFitter())); … … 285 285 // MJCut.WriteResult: yes, no 286 286 // MJCut.ResultFile: filename 287 // MJCut.HistName: MHAlpha 287 288 // 288 289 Bool_t MJCut::CheckEnvLocal() … … 301 302 EnableFullDisplay(GetEnv("FullDisplay", fFullDisplay)); 302 303 //EnableSubstraction(GetEnv("HistogramSubstraction", fSubstraction)); 304 305 SetNameHist(GetEnv("NameHist", fNameHist)); 303 306 304 307 return kTRUE; … … 341 344 } 342 345 343 void MJCut::DisplayResult(const MParList &plist) const 344 { 345 /* 346 TObject *h1 = plist.FindObject("MHHillasOffPre", "MHHillas"); 347 TObject *h2 = plist.FindObject("MHHillasOffPost", "MHHillas"); 348 TObject *h3 = plist.FindObject("MHVsSizeOffPost", "MHVsSize"); 349 TObject *h4 = plist.FindObject("MHHilExtOffPost", "MHHillasExt"); 350 TObject *h5 = plist.FindObject("MHHilSrcOffPost", "MHHillasSrc"); 351 TObject *h6 = plist.FindObject("MHImgParOffPost", "MHImagePar"); 352 TObject *h7 = plist.FindObject("MHNewParOffPost", "MHNewImagePar"); 353 */ 346 // -------------------------------------------------------------------------- 347 // 348 // Create a new instance of an object with name name of class 349 // type fNameHist in parlist. It must derive from MHAlpha. 350 // Call ForceUsingSize for it and return its pointer. 351 // If something fails NULL is returned. 352 // 353 MHAlpha *MJCut::CreateNewHist(MParList &plist, const char *name) const 354 { 355 TClass *cls = gROOT->GetClass(fNameHist); 356 if (!cls) 357 { 358 *fLog << err << "Class " << fNameHist << " not found in dictionary... abort." << endl; 359 return NULL; 360 } 361 if (!cls->InheritsFrom(MHAlpha::Class())) 362 { 363 *fLog << err << "Class " << fNameHist << " doesn't inherit from MHAlpha... abort." << endl; 364 return NULL; 365 } 366 367 const TString objname(Form("%s%s", fNameHist.Data(), name)); 368 MHAlpha *h = (MHAlpha*)plist.FindCreateObj(fNameHist, objname); 369 if (!h) 370 return NULL; 371 372 h->ForceUsingSize(); 373 374 return h; 354 375 } 355 376 … … 424 445 fit.SetScaleMode(MAlphaFitter::kNone); 425 446 426 MHAlpha halphaoff("MHAlphaOff"); 427 halphaoff.ForceUsingSize(); 428 plist.AddToList(&halphaoff); 429 430 MFillH falpha("MHAlphaOff [MHAlpha]", "MHillasSrc", "FillAlpha"); 447 MHAlpha *halphaoff = CreateNewHist(plist, "Off"); 448 MFillH falpha(halphaoff, "MHillasSrc", "FillAlpha"); 431 449 MFillH ffs("MHFalseSourceOff [MHFalseSource]", "MHillas", "FillFS"); 432 450 … … 655 673 } 656 674 */ 657 MHAlpha halphaon("MHAlpha"); 658 halphaon.ForceUsingSize(); 659 plist.AddToList(&halphaon); 660 661 MFillH falpha2("MHAlpha", "MHillasSrc", "FillAlpha"); 675 MHAlpha *halphaon=CreateNewHist(plist); 676 MFillH falpha2(halphaon, "MHillasSrc", "FillAlpha"); 662 677 MFillH ffs2("MHFalseSource", "MHillas", "FillFS"); 663 678 … … 706 721 tlist.PrintStatistics(); 707 722 708 DisplayResult(plist);709 710 723 // FIXME: Perform fit and plot energy dependant alpha plots 711 724 // and fit result to new tabs! -
trunk/MagicSoft/Mars/mjobs/MJCut.h
r6979 r6988 9 9 class MDataSet; 10 10 class MParList; 11 class MHAlpha; 11 12 class MWriteRootFile; 12 13 … … 26 27 TString fNameOutput; 27 28 29 TString fNameHist; 30 28 31 //MTask *fEstimateEnergy; 29 32 MTask *fCalcHadronness; 30 33 31 TString GetOutputFile(UInt_t num) const;32 Bool_t CheckEnvLocal();33 void SetupWriter(MWriteRootFile *write, const char *name) const;34 Bool_t WriteTasks(UInt_t num, TObjArray &cont) const;35 Bool_t WriteResult(const MParList &plist, UInt_t num) const;36 void DisplayResult(const MParList &plist) const;34 TString GetOutputFile(UInt_t num) const; 35 Bool_t CheckEnvLocal(); 36 void SetupWriter(MWriteRootFile *write, const char *name) const; 37 Bool_t WriteTasks(UInt_t num, TObjArray &cont) const; 38 Bool_t WriteResult(const MParList &plist, UInt_t num) const; 39 MHAlpha *CreateNewHist(MParList &plist, const char *name="") const; 37 40 38 Bool_t CanStoreSummary() const { return !fPathOut.IsNull() && fStoreSummary; }39 Bool_t CanStoreResult() const { return !fPathOut.IsNull() && fStoreResult; }41 Bool_t CanStoreSummary() const { return !fPathOut.IsNull() && fStoreSummary; } 42 Bool_t CanStoreResult() const { return !fPathOut.IsNull() && fStoreResult; } 40 43 41 44 public: … … 57 60 void SetNameOutFile(const char *name="") { fNameOutput=name; } 58 61 62 void SetNameHist(const char *name) { fNameHist=name; } 63 59 64 //void SetEnergyEstimator(const MTask *task=0); 60 65 void SetHadronnessCalculator(const MTask *task=0);
Note:
See TracChangeset
for help on using the changeset viewer.