--- PamCut/CollectionActions/RigFillAction/RigFillAction.cpp 2009/08/26 16:34:15 1.4 +++ PamCut/CollectionActions/RigFillAction/RigFillAction.cpp 2009/10/27 10:18:21 1.5 @@ -15,9 +15,9 @@ // Initializing histograms _rootHisto.SetName("rfHisto"); - _rootHisto.SetTitle(Form("Rc Vs R (thr.: %.2f)", _thresholdCoeff)); - _rootHisto.GetXaxis()->SetTitle("R (GV)"); - _rootHisto.GetYaxis()->SetTitle("Rc (GV)"); + _rootHisto.SetTitle(Form("R Vs Rc (thr.: %.2f)", _thresholdCoeff)); + _rootHisto.GetXaxis()->SetTitle("Rc (GV)"); + _rootHisto.GetYaxis()->SetTitle("R (GV)"); Double_t *auxArray = new Double_t[_bins.size()]; @@ -71,10 +71,8 @@ _rootHisto.Fill(rigThreshold, rig); // X,Y in the ROOT histogram // Event rigidity bin identification. - -// cout << rig << endl; + if (rig < _bins[0] || rig >= _bins[(int) _textHisto.GetNRows()]) { -// cout << "found!" << endl; return; } @@ -85,9 +83,11 @@ i--; // Threshold rigidity bin identification. - - if (rigThreshold < 0 || rigThreshold >= _bins[(int) _textHisto.GetNRows()]) return; - + + if (rigThreshold < 0 || rigThreshold >= _bins[(int) _textHisto.GetNRows()]) { + return; + } + if (0 <= rigThreshold && rigThreshold < _bins[0]) _zeroCutoffBins[i]++; else { @@ -99,7 +99,7 @@ _textHisto[i][j]++; _totalTextHisto[i]++; - + } } @@ -108,7 +108,7 @@ // Write the text file if (_outFileBase != "") { - ofstream outTextFile((_outFileBase + ".txt").Data(), ios_base::out); + ofstream outTextFile((_outFileBase + "-" + GetName() + ".txt").Data(), ios_base::out); for (unsigned int i = 0; i < _textHisto.GetNRows(); i++) { for (unsigned int j = 0; j < _textHisto.GetNCols(); j++) { outTextFile << setw(7) << _textHisto[i][j] << " "; @@ -118,14 +118,13 @@ outTextFile.close(); // Write the report file, where zero bins are recorded - outTextFile.open((_outFileBase + "-report.txt").Data(), ios_base::out); - outTextFile << "Zero bins for cutoff rigidity: \n"; + outTextFile.open((_outFileBase + "-" + GetName() + "-InfBins.txt").Data(), ios_base::out); for (unsigned int i = 0; i < _zeroCutoffBins.size(); i++) outTextFile << GetHistoThreshInfBin()[i] << "\n"; outTextFile.close(); // Write the ROOT file - TFile outRootFile((_outFileBase + ".root"), "RECREATE"); + TFile outRootFile((_outFileBase + "-" + GetName() + ".root"), "RECREATE"); outRootFile.cd(); _rootHisto.Write(); outRootFile.Close();