diff --git a/AculData/AculCalibration.cpp b/AculData/AculCalibration.cpp index 23bff31b3e3ecbdbb77b21aa95d26dc7b570b0b8..52c3e4321db3f7c81498decc7bdb87342e3f9715 100755 --- a/AculData/AculCalibration.cpp +++ b/AculData/AculCalibration.cpp @@ -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] <