Changeset 8775 for trunk/MagicSoft/Mars
- Timestamp:
- 12/03/07 17:44:59 (17 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r8770 r8775 18 18 19 19 -*-*- END OF LINE -*-*- 20 21 2007/12/03 Thomas Bretz 22 23 * mdata/MData.h: 24 - added Print to context menu 25 26 * mhflux/MAlphaFitter.[h,cc]: 27 - added new member functions to apply scaling to off-data 28 29 * mhflux/MHAlpha.[h,cc]: 30 - added new member functions to apply scaling to off-data 31 - added a public member function which allows to reinitiate fitting 32 33 * mhist/MHCamera.cc: 34 - replaced a loop to reset the used pixels by a call to fUsed.Reset() 35 36 * mmuon/MHSingleMuon.[h,cc]: 37 - keep mean and rms of relative arrival time of the fit 38 - increased class Version accordingly 39 40 * mmuon/MMuonCalibPar.[h,cc]: 41 - keep mean and rms of relative arrival time of the fit 42 - increased class Version accordingly 43 44 * mmuon/MMuonCalibParCalc.cc: 45 - copy result of arrival time fit from histogram to storage container 46 47 20 48 21 49 2007/11/28 Daniela Dorner -
trunk/MagicSoft/Mars/mdata/MData.h
r1574 r8775 25 25 Double_t operator()() { return GetValue(); } 26 26 27 void Print(Option_t *opt = "") const; 27 void Print(Option_t *opt = "") const; //*MENU* 28 28 Bool_t AsciiWrite(ostream &out) const; 29 29 -
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 -
trunk/MagicSoft/Mars/mhist/MHCamera.cc
r8756 r8775 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MHCamera.cc,v 1.10 6 2007-10-13 18:56:27tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MHCamera.cc,v 1.107 2007-12-03 17:44:46 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 165 165 rc->SetDirectory(NULL); 166 166 167 // fGeomCam need special treatment due to its TObjArray 167 168 if (rc->fGeomCam && fGeomCam) 168 169 { … … 191 192 192 193 fUsed.Set(geom.GetNumPixels()); 193 for (Int_t i=0; i<fNcells-2; i++) 194 ResetUsed(i); 194 fUsed.Reset(); 195 195 196 196 fBinEntries.Set(geom.GetNumPixels()+2); -
trunk/MagicSoft/Mars/mmuon/MHSingleMuon.cc
r8660 r8775 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MHSingleMuon.cc,v 1.1 6 2007-08-06 16:50:45tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MHSingleMuon.cc,v 1.17 2007-12-03 17:44:59 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 70 70 // your results!! 71 71 // 72 // Input container:72 // InputContainer: 73 73 // - MGeomCam 74 74 // - MMuonSearchPar 75 75 // 76 // 77 // Class Version 2: 78 // ---------------- 79 // + Double_t fRelTimeMean; // Result of the gaus fit to the arrival time 80 // + Double_t fRelTimeSigma; // Result of the gaus fit to the arrival time 76 81 // 77 82 //////////////////////////////////////////////////////////////////////////// … … 194 199 Bool_t MHSingleMuon::Fill(const MParContainer *par, const Stat_t w) 195 200 { 201 fRelTimeMean = 0; 202 fRelTimeSigma = -1; 203 196 204 fHistPhi.Reset(); 197 205 fHistWidth.Reset(); … … 247 255 fHistTime.Fit(&g1, "QNB"); 248 256 249 // Double_t err; 250 Double_t sig, mean, dummy; 251 gMinuit->GetParameter(1, mean, dummy); // get the mean value 252 gMinuit->GetParameter(2, sig, dummy); // get the sigma value 257 Double_t dummy; 258 gMinuit->GetParameter(1, fRelTimeMean, dummy); // get the mean value 259 gMinuit->GetParameter(2, fRelTimeSigma, dummy); // get the sigma value 253 260 254 261 // The mean arrival time which was subtracted before will 255 262 // be added again, now 256 const Double_t tm0 = fMuonSearchPar->GetTime()+ mean;263 const Double_t tm0 = fMuonSearchPar->GetTime()+fRelTimeMean; 257 264 258 265 for (Int_t i=0; i<entries; i++) … … 268 275 // if the signal is not near the estimated circle, it is ignored. 269 276 if (TMath::Abs(dist-fMuonSearchPar->GetRadius())<fMargin && 270 TMath::Abs(pix.GetArrivalTime()-tm0) < 2* sig)277 TMath::Abs(pix.GetArrivalTime()-tm0) < 2*fRelTimeSigma) 271 278 { 272 279 fHistPhi.Fill(TMath::ATan2(dx, dy)*TMath::RadToDeg(), pix.GetNumPhotons());
Note:
See TracChangeset
for help on using the changeset viewer.