/[PAMELA software]/PamCut/CollectionActions/FluxHistoAction/FluxHistoAction.cpp
ViewVC logotype

Diff of /PamCut/CollectionActions/FluxHistoAction/FluxHistoAction.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by pam-fi, Mon Jun 8 10:37:35 2009 UTC revision 1.5 by pam-fi, Fri Aug 14 10:34:28 2009 UTC
# Line 5  Line 5 
5   *      Author: Nicola Mori   *      Author: Nicola Mori
6   */   */
7    
8  /*! @file FluxHistoAction.cpp The FluxHistoAction class implementation file */  /*! @file FluxHistoAction.cpp The FluxHistoAction class implementation file. */
9    
10  #include "FluxHistoAction.h"  #include "FluxHistoAction.h"
11    
# Line 31  FluxHistoAction::FluxHistoAction(const c Line 31  FluxHistoAction::FluxHistoAction(const c
31    
32    // Initializing histograms    // Initializing histograms
33    _textHisto.assign(_bins.size() - 1, 0);    _textHisto.assign(_bins.size() - 1, 0);
34    _rootHisto.SetName("rigHisto");    _rootHisto.SetName(GetName());
35    _rootHisto.SetTitle("Rigidity histogram");    _rootHisto.SetTitle("Rigidity histogram");
36    _rootHisto.GetXaxis()->SetTitle("R");    _rootHisto.GetXaxis()->SetTitle("R");
37    _rootHisto.GetYaxis()->SetTitle("Events");    _rootHisto.GetYaxis()->SetTitle("Events");
38    
39    Double_t *auxArray = new Double_t[_bins.size()];    Double_t *auxArray = new Double_t[_bins.size()];
40    
41    for (unsigned int i = 1; i < _bins.size(); i++) {    for (unsigned int i = 0; i < _bins.size(); i++) {
42      auxArray[i] = _bins[i];      auxArray[i] = _bins[i];
43    }    }
44    
# Line 86  void FluxHistoAction::Finalize() { Line 86  void FluxHistoAction::Finalize() {
86    outTextFile.precision(newPrec);    outTextFile.precision(newPrec);
87    outTextFile.setf(ios::fixed, ios::floatfield);    outTextFile.setf(ios::fixed, ios::floatfield);
88    for (unsigned int i = 0; i < _textHisto.size(); i++)    for (unsigned int i = 0; i < _textHisto.size(); i++)
89      outTextFile << _bins[i] << "  " << _bins[i + 1] << "  " << _textHisto[i] << "\n";      outTextFile << _textHisto[i] << "\n";
90    outTextFile.close();    outTextFile.close();
91    outTextFile.precision(oldPrec);    outTextFile.precision(oldPrec);
92    outTextFile << resetiosflags(ios::floatfield);    outTextFile << resetiosflags(ios::floatfield);
# Line 95  void FluxHistoAction::Finalize() { Line 95  void FluxHistoAction::Finalize() {
95    TFile outRootFile((_outFileBase + ".root"), _mode);    TFile outRootFile((_outFileBase + ".root"), _mode);
96    outRootFile.cd();    outRootFile.cd();
97    _rootHisto.Write();    _rootHisto.Write();
98    //outRootFile.Close();    outRootFile.Close();
99    
100  #ifdef DEBUGPAMCUT  #ifdef DEBUGPAMCUT
101    cout << "Debug informations from " << GetName() << ":\n";    cout << "Debug informations from " << GetName() << ":\n";

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.23