141 RESTDebug <<
"TRestRawSignalGeneralFitProcess::ProcessEvent. Event ID : " <<
fRawSignalEvent->GetID()
144 Double_t SigmaMean = 0;
146 Double_t RatioSigmaMaxPeakMean = 0;
147 vector<Double_t> RatioSigmaMaxPeak(
fRawSignalEvent->GetNumberOfSignals());
148 Double_t ChiSquareMean = 0;
167 std::vector<map<int, Double_t>> param(fFitFunc->GetNpar());
168 std::vector<map<int, Double_t>> paramErr(fFitFunc->GetNpar());
195 TH1D* h =
new TH1D(
"histo",
"Signal to histo", nBins, 0, nBins);
197 for (
int i = 0; i < nBins; i++) {
202 h->Fit(fFitFunc,
"NWW",
"", 0, 511);
205 for (
int j = fFunctionRange.X(); j < fFunctionRange.Y(); j++) {
206 sigma += (singleSignal->
GetRawData(j) - fFitFunc->Eval(j)) *
207 (singleSignal->
GetRawData(j) - fFitFunc->Eval(j));
209 Sigma[s] = TMath::Sqrt(sigma / (fFunctionRange.Y() - fFunctionRange.X()));
210 RatioSigmaMaxPeak[s] = Sigma[s] / singleSignal->
GetRawData(MaxPeakBin);
211 RatioSigmaMaxPeakMean += RatioSigmaMaxPeak[s];
212 SigmaMean += Sigma[s];
213 ChiSquare[s] = fFitFunc->GetChisquare();
214 ChiSquareMean += ChiSquare[s];
216 for (
int i = 0; i < fFitFunc->GetNpar(); i++) {
217 param[i][singleSignal->
GetID()] = fFitFunc->GetParameter(i);
218 paramErr[i][singleSignal->
GetID()] = fFitFunc->GetParError(i);
219 RESTDebug <<
"Parameter " << i <<
": " << param[i][singleSignal->
GetID()] <<
RESTendl;
220 RESTDebug <<
"Error parameter " << i <<
": " << paramErr[i][singleSignal->
GetID()] <<
RESTendl;
243 for (
int i = 0; i < fFitFunc->GetNpar(); i++) {
253 Double_t sigmaMeanStdDev = 0;
255 sigmaMeanStdDev += (Sigma[k] - SigmaMean) * (Sigma[k] - SigmaMean);
257 Double_t SigmaMeanStdDev = TMath::Sqrt(sigmaMeanStdDev /
fRawSignalEvent->GetNumberOfSignals());
265 RatioSigmaMaxPeakMean = RatioSigmaMaxPeakMean /
fRawSignalEvent->GetNumberOfSignals();
268 RESTDebug <<
"SigmaMean: " << SigmaMean <<
RESTendl;
269 RESTDebug <<
"SigmaMeanStdDev: " << SigmaMeanStdDev <<
RESTendl;
270 RESTDebug <<
"ChiSquareMean: " << ChiSquareMean <<
RESTendl;
271 RESTDebug <<
"RatioSigmaMaxPeakMean: " << RatioSigmaMaxPeakMean <<
RESTendl;
273 RESTDebug <<
"Standard deviation of signal number " << k <<
": " << Sigma[k] <<
RESTendl;
274 RESTDebug <<
"Chi square of fit signal number " << k <<
": " << ChiSquare[k] <<
RESTendl;
275 RESTDebug <<
"Sandard deviation divided by amplitude of signal number " << k <<
": "
276 << RatioSigmaMaxPeak[k] <<
RESTendl;
295 sgnl->InitializePointsOverThreshold(TVector2(fPointThreshold,
297 fNPointsOverThreshold);
303 if (ApplyCut())
return nullptr;