--- PamCut/CollectionActions/FluxHistoAction/FluxHistoAction.cpp 2009/05/29 10:08:48 1.1 +++ PamCut/CollectionActions/FluxHistoAction/FluxHistoAction.cpp 2009/06/08 10:37:35 1.2 @@ -9,10 +9,10 @@ #include "FluxHistoAction.h" -FluxHistoAction::FluxHistoAction(const char *actionName, TString outFileBase, TString rigBinsFile) : - CollectionAction(actionName), _outFileBase(outFileBase), _bins(0), _rootHisto(), _textHisto(0) +FluxHistoAction::FluxHistoAction(const char *actionName, TString outFileBase, TString rigBinsFile, TString mode) : + CollectionAction(actionName), _outFileBase(outFileBase), _bins(0), _rootHisto(), _textHisto(0), _mode(mode) #ifdef DEBUGPAMCUT - , _outUp(0), _outDown(0) +, _outUp(0), _outDown(0) #endif { @@ -66,12 +66,12 @@ } #ifdef DEBUGPAMCUT else - _outUp++; + _outUp++; #endif } #ifdef DEBUGPAMCUT else - _outDown++; + _outDown++; #endif } @@ -79,6 +79,7 @@ void FluxHistoAction::Finalize() { // Write the text file + // Currently, text output doesn't support append. ofstream outTextFile((_outFileBase + ".txt").Data(), ios_base::out); streamsize oldPrec = cout.precision(); streamsize newPrec = 4; @@ -91,7 +92,7 @@ outTextFile << resetiosflags(ios::floatfield); // Write the ROOT file - TFile outRootFile((_outFileBase + ".root"), "RECREATE"); + TFile outRootFile((_outFileBase + ".root"), _mode); outRootFile.cd(); _rootHisto.Write(); //outRootFile.Close();