Changeset 5100
- Timestamp:
- 09/17/04 15:07:15 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r5090 r5100 19 19 20 20 -*-*- END OF LINE -*-*- 21 2004/09/17: Thomas Bretz 22 23 * mhcalib/MH*.[h,cc]: 24 - redone some changes from yesterday - for unknown reason they 25 were lost 26 27 * mbase/MTask.cc: 28 - make sure that the correct number of executions is returned 29 counter which cannot be reset properly) 30 31 * mdata/MDataArray.cc: 32 - some changes to Print-output 33 34 * mfbase/MF.[h,cc]: 35 - added GetRule 36 37 * mfileio/MReadTree.cc: 38 - some improvements to output 39 40 * mhbase/MHMatrix.cc: 41 - some improvements in Print 42 43 * mhflux/MAlphaFitter.[h,cc]: 44 - calculate the significance also from the first bins 45 - added Copy 46 - added print 47 48 * mhflux/MHAlpha.[h,cc]: 49 - added some fFit.Print to keep track of what's going on 50 51 * mhflux/MHFalseSource.cc: 52 - made lines of 2D-Gauss smaller 53 54 21 55 22 56 2004/09/16: Abelardo Moralejo … … 31 65 32 66 67 33 68 2004/09/16: Markus Gaug 34 69 … … 40 75 - re-installed the Clone-function. Without, DrawClone() does not 41 76 Clone() 77 42 78 43 79 -
trunk/MagicSoft/Mars/mbase/MTask.cc
r5064 r5100 201 201 Int_t MTask::CallPreProcess(MParList *plist) 202 202 { 203 fStopwatch->Reset(); 203 // This does not reset the counter! 204 // fStopwatch->Reset(); 205 206 delete fStopwatch; 207 fStopwatch = new TStopwatch; 204 208 205 209 *fLog << all << fName << "... " << flush; -
trunk/MagicSoft/Mars/mdata/MDataArray.cc
r3572 r5100 135 135 while ((data=(MData*)Next())) 136 136 { 137 *fLog << all << " Line " << setw(3) << n++ << ":" << flush;137 *fLog << all << " " << fName << "[" << setw(3) << n++ << "] = " << flush; 138 138 data->Print(); 139 139 *fLog << endl; -
trunk/MagicSoft/Mars/mfbase/MF.h
r3573 r5100 37 37 ~MF(); 38 38 39 TString GetRule() const { return fF ? fF->GetRule() : MFilter::GetRule(); } 40 39 41 Bool_t IsExpressionTrue() const; 40 42 -
trunk/MagicSoft/Mars/mfileio/MReadTree.cc
r4895 r5100 724 724 fChain->SetBranchAddress(bname, pcont); 725 725 726 *fLog << inf << "Master branch address " << bname << "[";726 *fLog << inf << "Master branch address '" << bname << "' ["; 727 727 *fLog << classname << "] setup for reading." << endl; 728 728 -
trunk/MagicSoft/Mars/mhbase/MHMatrix.cc
r4656 r5100 369 369 370 370 if (fData && str.Contains("cols", TString::kIgnoreCase)) 371 { 372 fData->SetName(fName); 371 373 fData->Print(); 374 } 372 375 373 376 if (str.Contains("data", TString::kIgnoreCase)) -
trunk/MagicSoft/Mars/mhflux/MAlphaFitter.cc
r5012 r5100 84 84 Bool_t MAlphaFitter::Fit(TH1D &h, Bool_t paint) 85 85 { 86 Double_t sigint=fSigInt;87 86 Double_t sigmax=fSigMax; 88 87 Double_t bgmin =fBgMin; 89 88 Double_t bgmax =fBgMax; 89 90 //*fLog << inf << "Fit: " << sigmax << " " << fSigInt << " " << bgmin << " " << bgmax << endl; 90 91 91 92 //TF1 fFunc("", Form("gaus(0) + pol%d(3)", fPolynomOrder), 0, 90); … … 167 168 } 168 169 // ------------------------------------ 169 const Double_t s = fFunc->Integral(0, sigint)/alphaw; 170 fFunc->SetParameter(0, 0); 171 fFunc->SetParameter(2, 1); 172 const Double_t b = fFunc->Integral(0, sigint)/alphaw; 173 fSignificance = MMath::SignificanceLiMaSigned(s, b); 174 175 const Double_t uin = 1.25*sigint; 176 const Int_t bin = h.GetXaxis()->FindFixBin(uin); 170 171 //const Double_t s = fFunc->Integral(0, fSigInt)/alphaw; 172 fFunc->SetParameter(0, 0); 173 fFunc->SetParameter(2, 1); 174 //const Double_t b = fFunc->Integral(0, fSigInt)/alphaw; 175 //fSignificance = MMath::SignificanceLiMaSigned(s, b); 176 177 178 const Int_t bin = h.GetXaxis()->FindFixBin(fSigInt*0.999); 177 179 178 180 fIntegralMax = h.GetBinLowEdge(bin+1); … … 180 182 fEventsSignal = h.Integral(0, bin); 181 183 fEventsExcess = fEventsSignal-fEventsBackground; 182 //fSignificance = MMath::SignificanceLiMaSigned(fEventsSignal, fEventsBackground); 184 fSignificance = MMath::SignificanceLiMaSigned(fEventsSignal, fEventsBackground); 185 186 if (fEventsExcess<0) 187 fEventsExcess=0; 183 188 184 189 return kTRUE; … … 187 192 void MAlphaFitter::PaintResult(Float_t x, Float_t y, Float_t size) const 188 193 { 189 TLatex text(x, y, Form("\\sigma_{Li/Ma}=%.1f (\\alpha<%.1f\\circ)\\omega=%.1f\\circ E=%d (\\alpha<%.1f\\circ) (\\chi_{b}^{2}=%.1f \\chi_{s}^{2}=%.1f)",190 fSignificance, fSigInt,GetGausSigma(),194 TLatex text(x, y, Form("\\sigma_{Li/Ma}=%.1f \\omega=%.1f\\circ E=%d (\\alpha<%.1f\\circ) (\\chi_{b}^{2}=%.1f \\chi_{s}^{2}=%.1f)", 195 fSignificance, GetGausSigma(), 191 196 (int)fEventsExcess, fIntegralMax, 192 197 fChiSqBg, fChiSqSignal)); … … 196 201 text.Paint(); 197 202 } 203 204 void MAlphaFitter::Copy(TObject &o) const 205 { 206 MAlphaFitter &f = static_cast<MAlphaFitter&>(o); 207 208 f.fSigInt = fSigInt; 209 f.fSigMax = fSigMax; 210 f.fBgMin = fBgMin; 211 f.fBgMax = fBgMax; 212 f.fPolynomOrder = fPolynomOrder; 213 f.fCoefficients.Set(fCoefficients.GetSize()); 214 f.fCoefficients.Reset(); 215 216 TF1 *fcn = f.fFunc; 217 f.fFunc = new TF1(*fFunc); 218 gROOT->GetListOfFunctions()->Remove(f.fFunc); 219 delete fcn; 220 } 221 222 void MAlphaFitter::Print(Option_t *o) const 223 { 224 *fLog << inf << GetDescriptor() << ": Fitting..." << endl; 225 *fLog << " ...background from " << fBgMin << " to " << fBgMax << endl; 226 *fLog << " ...signal to " << fSigMax << " (integrate into bin at " << fSigInt << ")" << endl; 227 *fLog << " ...polynom order " << fPolynomOrder << endl; 228 } -
trunk/MagicSoft/Mars/mhflux/MAlphaFitter.h
r5080 r5100 19 19 { 20 20 private: 21 TF1 *fFunc;22 23 21 Float_t fSigInt; 24 22 Float_t fSigMax; … … 38 36 TArrayD fCoefficients; 39 37 38 TF1 *fFunc; 39 40 40 public: 41 41 // Implementing the function yourself is only about 5% faster 42 MAlphaFitter( ) : fFunc(new TF1("", "gaus(0) + pol1(3)", 0, 90)), fSigInt(10), fSigMax(75), fBgMin(45), fBgMax(85), fPolynomOrder(1), fCoefficients(3+fPolynomOrder+1)42 MAlphaFitter(const char *name=0, const char *title=0) : fSigInt(15), fSigMax(75), fBgMin(45), fBgMax(85), fPolynomOrder(2), fCoefficients(3+fPolynomOrder+1), fFunc(new TF1("", Form("gaus(0) + pol%d(3)", fPolynomOrder), 0, 90)) 43 43 { 44 fName = name ? name : "MAlphaFitter"; 45 fTitle = title ? title : "Fit alpha"; 46 44 47 gROOT->GetListOfFunctions()->Remove(fFunc); 45 48 } … … 54 57 } 55 58 56 void Copy(TObject &o) const 57 { 58 MAlphaFitter &f = static_cast<MAlphaFitter&>(o); 59 60 f.fSigInt = fSigInt; 61 f.fSigMax = fSigMax; 62 f.fBgMin = fBgMin; 63 f.fBgMax = fBgMax; 64 f.fPolynomOrder = fPolynomOrder; 65 f.fCoefficients.Set(fCoefficients.GetSize()); 66 f.fCoefficients.Reset(); 67 68 TF1 *fcn = f.fFunc; 69 f.fFunc = new TF1(*fFunc); 70 gROOT->GetListOfFunctions()->Remove(f.fFunc); 71 delete fcn; 72 } 59 void Print(Option_t *o=0) const; 60 void Copy(TObject &o) const; 73 61 74 62 void SetSignalIntegralMax(Float_t s) { fSigInt = s; } -
trunk/MagicSoft/Mars/mhflux/MHAlpha.cc
r5012 r5100 277 277 fit->Copy(fFit); 278 278 279 fFit.Print(); 280 279 281 return kTRUE; 280 282 } … … 540 542 // Store the final result in fFit 541 543 TH1D *h = fHAlpha.ProjectionZ("AlphaExc_px", -1, 9999, -1, 9999, "E"); 544 fFit.Print(); 542 545 Bool_t rc = fFit.Fit(*h); 543 546 delete h; -
trunk/MagicSoft/Mars/mhflux/MHAlpha.h
r5012 r5100 84 84 { 85 85 private: 86 MAlphaFitter fFit; // !SEEMS THAT STREAMER HAS SOME PROBLEMS... MAYBE IF FUNC IS USED AT THE SAME TIME FOR FITS (PAINT)86 MAlphaFitter fFit; // SEEMS THAT STREAMER HAS SOME PROBLEMS... MAYBE IF FUNC IS USED AT THE SAME TIME FOR FITS (PAINT) 87 87 88 88 TH3D fHAlpha; // Alpha vs. theta and energy -
trunk/MagicSoft/Mars/mhflux/MHFalseSource.cc
r5080 r5100 740 740 741 741 //Gaus(Double_t x, Double_t mean=0, Double_t sigma=1, Bool_t norm=kFALSE); 742 return par[0]* (g0+g1);742 return par[0]*g0*g1; 743 743 } 744 744 … … 942 942 943 943 944 TF2 f2d("", FcnGauss2d, -1.5, 1.5, -1.5, 1.5, 6); 944 TF2 f2d("Gaus-2D", FcnGauss2d, -1.5, 1.5, -1.5, 1.5, 6); 945 f2d.SetLineWidth(1); 945 946 f2d.SetParName(0, "Max sigma"); 946 947 f2d.SetParName(1, "Mean_1 deg"); … … 954 955 f2d.SetParLimits(4, 0, 1); // sigma_2 955 956 f2d.SetParLimits(5, 0, 90); // phi 956 f2d.SetParameter(0, maxs); // A957 f2d.SetParameter(1, 0); // mu_1958 f2d.SetParameter(2, 0. 2);// sigma_1959 f2d.SetParameter(3, 0); // mu_2960 f2d.SetParameter(4, 0. 2);// sigma_2961 f2d.SetParameter(5, 0); // phi962 hist->Fit(&f2d, " IN0");963 //f2d.DrawClone("cont2same")->SetBit(kCanDelete);957 f2d.SetParameter(0, maxs); // A 958 f2d.SetParameter(1, 0); // mu_1 959 f2d.SetParameter(2, 0.5); // sigma_1 960 f2d.SetParameter(3, 0); // mu_2 961 f2d.SetParameter(4, 0.5); // sigma_2 962 f2d.SetParameter(5, 0); // phi 963 hist->Fit(&f2d, "NI0"); 964 f2d.DrawCopy("cont2same"); 964 965 965 966
Note:
See TracChangeset
for help on using the changeset viewer.