Commit f2af59b6 authored by Kostyleva D.A's avatar Kostyleva D.A

To function AculCalibration::PeaksFitting trying to add output txt file

parent 0d57c4c1
......@@ -143,7 +143,24 @@ Int_t AculCalibration::PeaksFitting(TH1* hSpectrum, Option_t* option, Double_t s
if (peaksNumber != kRaNOPEAKS) {
Info("PeaksFitting", "In histogram %s was found %d peaks", hSpectrum->GetName(), peaksNumber);
return 1;
}
//creation of output text file with positions of peaks in MeV
TString workFile;
//if ( (lowersubaddress == 0) && (uppersubaddress == ADDRESSNUMBER-1) ) { oFileName.Form("%s[].cal", block); }
//else {
//if (lowersubaddress == uppersubaddress) { oFileName.Form("%s[%d].cal", block, lowersubaddress); }
//else { oFileName.Form("%s[%d-%d].cal", block, lowersubaddress, uppersubaddress); }
//}
workFile.Form("energies.txt");
ofstream outenergfile;
outenergfile.open(workFile.Data());
if (!outenergfile.is_open()) {
Error("PeaksFitting", "Output file %s was not opened", workFile.Data());
return 0;
}
//should be optional output
Info("PeaksFitting", "Number of peaks in %s: %d", hSpectrum->GetName(), peaksNumber);
......@@ -238,7 +255,9 @@ Int_t AculCalibration::PeaksFitting(TH1* hSpectrum, Option_t* option, Double_t s
for (Int_t i = 0; i < peaksNumber; i++) {
printf("\tPeak position is\t%f\n", fPeak[i]);
}
}
}
outenergfile << hSpectrum->GetName() <<"\t"<< fPeak[0] <<"\t"<< fPeak[1] <<"\t"<< fPeak[2] <<"\t"<< fPeak[3] <<endl;
// provest kontrolu pomerne polohy piku,
// jestli jsou spatne, provest urcita opatreni,
......@@ -253,7 +272,8 @@ Int_t AculCalibration::PeaksFitting(TH1* hSpectrum, Option_t* option, Double_t s
return 2;
}
}//for
outenergfile.close();
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment