Changeset 7778 for trunk/MagicSoft/Mars/mhflux
- Timestamp:
- 07/05/06 12:39:47 (19 years ago)
- Location:
- trunk/MagicSoft/Mars/mhflux
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhflux/MHAlpha.cc
r7755 r7778 54 54 #include <TStopwatch.h> 55 55 56 #include "MGeomCam.h"57 56 #include "MSrcPosCam.h" 58 57 #include "MHillasSrc.h" … … 82 81 MHAlpha::MHAlpha(const char *name, const char *title) 83 82 : fNameParameter("MHillasSrc"), fParameter(0), 84 fOffData(0), fResult(0), /*fExcess(0),*/ fEnergy(0),83 fOffData(0), fResult(0), fEnergy(0), fBin(0), 85 84 fPointPos(0), fTimeEffOn(0), fTime(0), fNumTimeBins(10), 86 85 fHillas(0), fMatrix(0), fSkipHistTime(kFALSE), fSkipHistTheta(kFALSE), … … 295 294 if (!fSigma) 296 295 return kFALSE; 296 fBin = (MParameterI*)const_cast<MParList*>(pl)->FindCreateObj("MParameterI", "Bin"); 297 if (!fBin) 298 return kFALSE; 297 299 298 300 //fExcess = (MParameterD*)const_cast<MParList*>(pl)->FindCreateObj("MParameterD", "MExcess"); … … 440 442 } 441 443 444 void MHAlpha::SetBin(Int_t ibin) 445 { 446 // Is this necessary? 447 // Could be speed up up searching for it only once. 448 const Float_t max = fFit.GetSignalIntegralMax(); 449 const Int_t bin0 = fHist.GetZaxis()->FindFixBin(max); 450 451 const Int_t nbinsx = fHist.GetNbinsX(); 452 const Int_t nbinsy = fHist.GetNbinsY(); 453 const Int_t nxy = (nbinsx+2)*(nbinsy+2); 454 455 const Int_t binz = ibin/nxy; 456 457 const Bool_t issignal = binz>0 && binz<bin0; 458 459 fBin->SetVal(issignal ? binz : -binz); 460 } 461 442 462 // -------------------------------------------------------------------------- 443 463 // … … 479 499 480 500 // Fill histograms 481 fHist.Fill(theta, energy, TMath::Abs(alpha), w); 501 const Int_t ibin = fHist.Fill(theta, energy, TMath::Abs(alpha), w); 502 SetBin(ibin); 482 503 483 504 if (!fSkipHistTime) … … 769 790 void MHAlpha::DrawAll(Bool_t newc) 770 791 { 771 if ( newc && !fDisplay)792 if (!newc && !fDisplay) 772 793 return; 773 794 … … 843 864 { 844 865 *fLog << dbg << "Bin " << i << ": sigmaexc=" << fit.GetSignificanceExc() << " omega=" << fit.GetGausSigma() << " events=" << fit.GetEventsExcess() << " scale=" << fit.GetScaleFactor() << endl; 845 fit. PaintResult();866 fit.DrawResult(); 846 867 } 847 868 /* -
trunk/MagicSoft/Mars/mhflux/MHAlpha.h
r7742 r7778 20 20 class MParList; 21 21 class MParameterD; 22 class MParameterI; 22 23 class MHillas; 23 24 class MHMatrix; … … 46 47 MParameterD *fSigma; //! 47 48 MParameterD *fEnergy; //! 49 MParameterI *fBin; //! 48 50 MPointingPos *fPointPos; //! 49 51 … … 73 75 void InitAlphaTime(const MTime &t); 74 76 void FinalAlphaTime(MBinning &bins); 77 78 void SetBin(Int_t bin); 75 79 76 80 void PaintText(Double_t val, Double_t error) const;
Note:
See TracChangeset
for help on using the changeset viewer.