Changeset 8775 for trunk/MagicSoft/Mars/mhflux
- Timestamp:
- 12/03/07 17:44:59 (17 years ago)
- Location:
- trunk/MagicSoft/Mars/mhflux
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhflux/MAlphaFitter.cc
r8767 r8775 630 630 } 631 631 */ 632 632 633 Bool_t MAlphaFitter::FitAlpha(const TH3D &hon, const TH3D &hof, Bool_t paint) 633 634 { … … 646 647 647 648 return rc; 649 } 650 651 Bool_t MAlphaFitter::ApplyScaling(const TH3D &hon, TH3D &hof, UInt_t bin) const 652 { 653 const TString name1(Form("TempAlpha%06d_on", gRandom->Integer(1000000))); 654 const TString name0(Form("TempAlpha%06d_off", gRandom->Integer(1000000))); 655 656 TH1D *h1 = hon.ProjectionZ(name1, -1, -1, bin, bin, "E"); 657 TH1D *h0 = hof.ProjectionZ(name0, -1, -1, bin, bin, "E"); 658 h1->SetDirectory(0); 659 h0->SetDirectory(0); 660 661 const Double_t scale = Scale(*h0, *h1); 662 663 delete h0; 664 delete h1; 665 666 for (int x=0; x<=hof.GetNbinsX()+1; x++) 667 for (int z=0; z<=hof.GetNbinsZ()+1; z++) 668 { 669 hof.SetBinContent(x, bin, z, hof.GetBinContent(x, bin, z)*scale); 670 hof.SetBinError( x, bin, z, hof.GetBinError( x, bin, z)*scale); 671 } 672 673 return scale>0; 674 } 675 676 Bool_t MAlphaFitter::ApplyScaling(const TH3D &hon, TH3D &hof) const 677 { 678 for (int y=0; y<=hof.GetNbinsY()+1; y++) 679 ApplyScaling(hon, hof, y); 680 681 return kTRUE; 648 682 } 649 683 -
trunk/MagicSoft/Mars/mhflux/MAlphaFitter.h
r8767 r8775 237 237 Double_t Scale(TH1D &off, const TH1D &on) const; 238 238 239 Bool_t ApplyScaling(const TH3D &hon, TH3D &hof, UInt_t bin) const; 240 Bool_t ApplyScaling(const TH3D &hon, TH3D &hof) const; 241 239 242 // Interface to result 240 243 void PaintResult(Float_t x=0.04, Float_t y=0.94, Float_t size=0.035, Bool_t draw=kFALSE) const; -
trunk/MagicSoft/Mars/mhflux/MHAlpha.cc
r8695 r8775 1010 1010 Bool_t MHAlpha::Finalize() 1011 1011 { 1012 //TH1D *h = fHist.ProjectionZ("AlphaExc_px", -1, 9999, -1, 9999, "E"); 1013 //h->SetDirectory(0); 1014 //Bool_t rc = fFit.Fit(*h); 1015 //delete h; 1016 1017 if (!fFit.FitAlpha(fHist, fOffData)) 1012 if (!FitAlpha()) 1018 1013 { 1019 1014 *fLog << warn << "MAlphaFitter - Fit failed..." << endl; … … 1099 1094 } 1100 1095 1096 void MHAlpha::ApplyScaling() 1097 { 1098 if (!fOffData) 1099 return; 1100 1101 fFit.ApplyScaling(fHist, *const_cast<TH3D*>(fOffData)); 1102 } 1103 1101 1104 Int_t MHAlpha::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 1102 1105 { -
trunk/MagicSoft/Mars/mhflux/MHAlpha.h
r8636 r8775 104 104 const TH1D &GetHEnergy() const { return fHEnergy; } 105 105 106 const TH3D *GetOffData() const { return fOffData; } 107 106 108 // Setter 107 109 void SetNameParameter(const char *name) { fNameParameter=name; } … … 132 134 void ForceUsingSize(Bool_t b=kTRUE) { fForceUsingSize=b; } 133 135 136 Bool_t FitAlpha() 137 { 138 return fFit.FitAlpha(fHist, fOffData); 139 } 140 134 141 void DrawNicePlot(const char *title="MAGIC Telescope observation", const char *watermark="preliminary") { DrawNicePlot(kTRUE, title, watermark); } //*MENU* 135 142 void DrawNicePlot(Bool_t newc, const char *title=0, const char *watermark=0); … … 139 146 virtual void InitMapping(MHMatrix *mat, Int_t type=0); 140 147 void StopMapping(); 148 149 void ApplyScaling(); 141 150 142 151 // TObject
Note:
See TracChangeset
for help on using the changeset viewer.