Changeset 19874
 Timestamp:
 Nov 18, 2019, 11:33:03 AM (10 months ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/Mars/fact/analysis/gain/fit_spectra.C
r19860 r19874 23 23 24 24 //  25 // After fit_spectra_bt2b.C 25 26 26 27 // Fit function for a single pe spectrum … … 35 36 const Double_t expo = par[6]; 36 37 38 const Double_t P = cross*TMath::Exp(cross); 39 37 40 Double_t y = 0; 38 41 for (int N=1; N<14; N++) … … 41 44 const Double_t sigN = TMath::Sqrt(N*sigma*sigma + noise*noise); 42 45 43 const Double_t p = TMath::Power(cross, N1) * TMath::Power(N, expo); 46 const Double_t p = 47 TMath::Power(N*P, N1)/TMath::Power(TMath::Factorial(N1), expo); 44 48 45 49 y += TMath::Gaus(xx[0], muN, sigN) * p / sigN; … … 56 60 Double_t expo = f.GetParameter(6); 57 61 62 const Double_t P = cross*TMath::Exp(cross); 63 58 64 Double_t y = 0; 59 65 for (int N=2; N<14; N++) 60 y += TMath::Power(cross, N1) * TMath::Power(N, expo); 66 y += 67 TMath::Power(N*P, N1)/TMath::Power(TMath::Factorial(N1), expo); 61 68 62 69 return y / (y + 1); … … 71 78 const Double_t expo = func.GetParameter(6); 72 79 80 const Double_t P = cross*TMath::Exp(cross); 81 73 82 Double_t sum = 0; 74 83 for (int N=1; N<14; N++) 75 sum += TMath::Power(cross, N1) * TMath::Power(N, expo); 84 sum += 85 TMath::Power(N*P, N1)/TMath::Power(TMath::Factorial(N1), expo); 76 86 77 87 const Double_t scale = hist.GetBinWidth(1); … … 383 393 if (!fixednoise) 384 394 func.SetParLimits(5, 0, 150); // Noise 395 func.SetParLimits(6, 0, 2); // Expo 385 396 386 397 func.SetParameter(0, ampl); // Amplitude … … 394 405 func.SetParameter(5, 0.1*maxpos); // Noise 395 406 396 func.SetParameter(6, 0. 4);// Expo407 func.SetParameter(6, 0.95); // Expo 397 408 398 409 func.SetRange(fitmin, fitmax);
Note: See TracChangeset
for help on using the changeset viewer.