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

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

parent 0d57c4c1
......@@ -145,6 +145,23 @@ Int_t AculCalibration::PeaksFitting(TH1* hSpectrum, Option_t* option, Double_t s
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);
......@@ -240,6 +257,8 @@ Int_t AculCalibration::PeaksFitting(TH1* hSpectrum, Option_t* option, Double_t s
}
}
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,
// napr. zapis daneho histogramu do souboru,
......@@ -254,6 +273,7 @@ Int_t AculCalibration::PeaksFitting(TH1* hSpectrum, Option_t* option, Double_t s
}
}//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