17 |
_textHisto.assign(_bins.size() - 1, 0); |
_textHisto.assign(_bins.size() - 1, 0); |
18 |
_rootHisto.SetName("ltHisto"); |
_rootHisto.SetName("ltHisto"); |
19 |
_rootHisto.SetTitle(Form("Live time (thr.: %.2f)", _thresholdCoeff)); |
_rootHisto.SetTitle(Form("Live time (thr.: %.2f)", _thresholdCoeff)); |
20 |
_rootHisto.GetXaxis()->SetTitle("R"); |
_rootHisto.GetXaxis()->SetTitle("R [GV]"); |
21 |
_rootHisto.GetYaxis()->SetTitle("Events"); |
_rootHisto.GetYaxis()->SetTitle("Events"); |
22 |
|
|
23 |
Double_t *auxArray = new Double_t[_bins.size()]; |
Double_t *auxArray = new Double_t[_bins.size()]; |
112 |
if (_outFileBase != "") { |
if (_outFileBase != "") { |
113 |
|
|
114 |
// Write the text file |
// Write the text file |
115 |
ofstream outTextFile((_outFileBase + ".txt").Data(), ios_base::out); |
ofstream outTextFile((_outFileBase + "-" + GetName() + ".txt").Data(), ios_base::out); |
116 |
streamsize oldPrec = cout.precision(); |
streamsize oldPrec = cout.precision(); |
117 |
streamsize newPrec = 4; |
streamsize newPrec = 4; |
118 |
outTextFile.precision(newPrec); |
outTextFile.precision(newPrec); |
120 |
for (unsigned int i = 0; i < _textHisto.size(); i++) |
for (unsigned int i = 0; i < _textHisto.size(); i++) |
121 |
outTextFile << _textHisto[i] << "\n"; |
outTextFile << _textHisto[i] << "\n"; |
122 |
outTextFile.close(); |
outTextFile.close(); |
123 |
outTextFile.open((_outFileBase + "-report.txt").Data(), ios_base::out); |
outTextFile.open((_outFileBase + "-" + GetName() + "-InfBin.txt").Data(), ios_base::out); |
124 |
outTextFile << "Inferior bin: " << GetLTInfBin() << "\n"; |
outTextFile << GetLTInfBin() << endl; |
|
outTextFile << "Total live time within normal bins: " << GetTotalLTHisto() << "\n"; |
|
125 |
outTextFile.close(); |
outTextFile.close(); |
126 |
outTextFile.precision(oldPrec); |
outTextFile.precision(oldPrec); |
127 |
outTextFile << resetiosflags(ios::floatfield); |
outTextFile << resetiosflags(ios::floatfield); |
128 |
|
|
129 |
// Write the ROOT file |
// Write the ROOT file |
130 |
TFile outRootFile((_outFileBase + ".root"), "RECREATE"); |
TFile outRootFile((_outFileBase + "-" + GetName() + ".root"), "RECREATE"); |
131 |
outRootFile.cd(); |
outRootFile.cd(); |
132 |
_rootHisto.Write(); |
_rootHisto.Write(); |
133 |
outRootFile.Close(); |
outRootFile.Close(); |