From 8a173e4708da33a15a5be70881cb9b8767580d07 Mon Sep 17 00:00:00 2001 From: Vratislav Chudoba Date: Fri, 15 Dec 2017 21:15:41 +0300 Subject: [PATCH] Possible to compile with ROOT6 --- AculData/AculCalibration.cpp | 18 +++++++++--------- AculData/AculCalibration.h | 3 +++ AculData/AculConvert.cpp | 2 +- AculData/AculConvert.h | 2 +- Be/BeAnalysis.cpp | 4 ++-- Be/BeAnalysis.h | 32 ++++++++++++++++---------------- Be/BeEvent.cpp | 2 +- Be/BeReaction.cpp | 2 +- Be/BeWork.cpp | 8 ++++---- makefile | 5 ++++- 10 files changed, 42 insertions(+), 36 deletions(-) diff --git a/AculData/AculCalibration.cpp b/AculData/AculCalibration.cpp index fcecfbd..7f92155 100755 --- a/AculData/AculCalibration.cpp +++ b/AculData/AculCalibration.cpp @@ -295,7 +295,7 @@ Bool_t AculCalibration::SetInputParameters(const char* inputparfile) Char_t identificator[100]; - ifstream fipr; + std::ifstream fipr; fipr.open(inputparfile); if (!fipr.is_open()) { Error("SetInputsParameters", "File with input parameters was not opened"); @@ -381,7 +381,7 @@ Bool_t AculCalibration::SetCalibrationParameters(const char* calparfile) char cA[40], cB[40], cC[40], cD[40]; //open file with calibration parameters - ifstream calFileR; + std::ifstream calFileR; calFileR.open(calparfile); @@ -694,7 +694,7 @@ Bool_t AculCalibration::CalculateCalibParameters(const char* inputfilename, cons // cout << "hovno1" << endl; // cout << outputfilename << endl; // fOutCalFile.open(outputfilename); - ofstream outcalfile; + std::ofstream outcalfile; outcalfile.open(outputfilename); // cout << "hovno2" << endl; // if (!fOutCalFile.is_open()) { @@ -893,7 +893,7 @@ Bool_t AculCalibration::CalculateCalibParameters(const char* inputfile, const ch if (lowersubaddress == uppersubaddress) { sprintf(outputfilename, "%s[%d].cal", block, lowersubaddress); } else { sprintf(outputfilename, "%s[%d-%d].cal", block, lowersubaddress, uppersubaddress); } }//if - ofstream outcalfile; + std::ofstream outcalfile; outcalfile.open(outputfilename); if (!outcalfile.is_open()) { Error("CalculateCalibParameters", "Output file %s was not opened", outputfilename); @@ -1318,8 +1318,8 @@ Bool_t AculCalibration::AddCalFileToList(const char* calfilelist) TString fl = calfilelist; fl.ToLower(); - ofstream fw; - fw.open(fl.Data(), ofstream::app); + std::ofstream fw; + fw.open(fl.Data(), std::ofstream::app); if (!fw.is_open()) { cout << "File " << fl.Data() << " was not opened" << endl; return kFALSE; @@ -1356,7 +1356,7 @@ void AculCalibration::MakeCalibrationFile(Char_t* calibrationfile, Char_t *calfi //calibrationfile: file with calibration parameters to be created //calfilelist: file containing list of existing text files with calibration parameters - ifstream calListR; + std::ifstream calListR; calListR.open(calfilelist); if( !calListR.is_open() ) { cout << "File with list of calibration files was not opened" << endl; @@ -1384,7 +1384,7 @@ void AculCalibration::MakeCalibrationFile(Char_t* calibrationfile, Char_t *calfi // cout << line << endl; sscanf(line, "%s", filename); cout << filename << endl; - ifstream calFileR; + std::ifstream calFileR; calFileR.open(filename); if (calFileR.is_open()) { cout << filename << " processing" << endl; @@ -1408,7 +1408,7 @@ void AculCalibration::MakeCalibrationFile(Char_t* calibrationfile, Char_t *calfi calListR.close(); - ofstream CalibFileW; + std::ofstream CalibFileW; CalibFileW.open(calibrationfile); if (!CalibFileW.is_open()) { cout << "Calibration file was not opened" << endl; diff --git a/AculData/AculCalibration.h b/AculData/AculCalibration.h index cd1024f..1f3c22b 100755 --- a/AculData/AculCalibration.h +++ b/AculData/AculCalibration.h @@ -21,6 +21,7 @@ #include #include +//#include #include #include @@ -34,6 +35,8 @@ using std::setw; using std::setprecision; using std::stringstream; using std::ostringstream; +//using std::ifstream; +//using std::ofstream; class AculCalibration : public TObject { diff --git a/AculData/AculConvert.cpp b/AculData/AculConvert.cpp index 289f3aa..5658753 100644 --- a/AculData/AculConvert.cpp +++ b/AculData/AculConvert.cpp @@ -276,7 +276,7 @@ Int_t AculConvert::ReadFileProtocol(const char* protocolname) } //file protocol opening - ifstream protocolFile; + std::ifstream protocolFile; protocolFile.open(protocolname); if (!protocolFile.is_open()) { diff --git a/AculData/AculConvert.h b/AculData/AculConvert.h index 6986420..955f0f8 100644 --- a/AculData/AculConvert.h +++ b/AculData/AculConvert.h @@ -35,7 +35,7 @@ class /*DllExport*/ AculConvert private: AculRaw *fRawEvent; - ofstream fOutFaultFile; //file for error output + std::ofstream fOutFaultFile; //file for error output UInt_t fMaskC3[BLOCKSNUMBER]; //functions diff --git a/Be/BeAnalysis.cpp b/Be/BeAnalysis.cpp index 32897af..88d5baa 100644 --- a/Be/BeAnalysis.cpp +++ b/Be/BeAnalysis.cpp @@ -357,9 +357,9 @@ void BeAnalysis::SaveEpsilonYHist(Int_t interval, Int_t chain) { } -void BeAnalysis::SaveThetaAHist(Int_t interval, Int_t chain) { +void BeAnalysis::SaveThetaAHist(Int_t interval, Int_t chain, TString outfilename) { - TFile fw("figures/thetaA.root", "UPDATE"); + TFile fw(outfilename.Data(), "UPDATE"); TString hName; diff --git a/Be/BeAnalysis.h b/Be/BeAnalysis.h index 3445c1a..960e81a 100644 --- a/Be/BeAnalysis.h +++ b/Be/BeAnalysis.h @@ -88,7 +88,7 @@ public: void SaveEpsilonYHist(Int_t interval, Int_t chain); - void SaveThetaAHist(Int_t interval, Int_t chain); + void SaveThetaAHist(Int_t interval, Int_t chain, TString outfilename = "figures/thetaA.root"); // @@ -116,25 +116,25 @@ private: Int_t kMaxAngle; //histograms - TH1F *hsSpectra[6]; - TH1F *heSpectra[6]; - TH1F *hSdiff[6]; + TH1F *hsSpectra[6]; //! + TH1F *heSpectra[6]; //! + TH1F *hSdiff[6]; //! - TH1F *hseT[5][6]; - TH1F *heeT[5][6]; - TH1F *hieT[5][6]; + TH1F *hseT[5][6]; //! + TH1F *heeT[5][6]; //! + TH1F *hieT[5][6]; //! - TH1F *hscoskT[5][6]; - TH1F *hecoskT[5][6]; - TH1F *hicoskT[5][6]; + TH1F *hscoskT[5][6]; //! + TH1F *hecoskT[5][6]; //! + TH1F *hicoskT[5][6]; //! - TH1F *hseY[5][6]; - TH1F *heeY[5][6]; - TH1F *hieY[5][6]; + TH1F *hseY[5][6]; //! + TH1F *heeY[5][6]; //! + TH1F *hieY[5][6]; //! - TH1F *hsthetaAT[5][6]; - TH1F *hethetaAT[5][6]; - TH1F *hithetaAT[5][6]; + TH1F *hsthetaAT[5][6]; //! + TH1F *hethetaAT[5][6]; //! + TH1F *hithetaAT[5][6]; //! //cuts TCut cAngles; diff --git a/Be/BeEvent.cpp b/Be/BeEvent.cpp index 54aacf5..c737df7 100644 --- a/Be/BeEvent.cpp +++ b/Be/BeEvent.cpp @@ -126,7 +126,7 @@ BeEvent::~BeEvent() { void BeEvent::ReadConfigFile() { // TString g(generator); - ifstream cfile; + std::ifstream cfile; //generator file opening if (!fConfigFile.IsNull()) { cfile.open(fConfigFile.Data()); diff --git a/Be/BeReaction.cpp b/Be/BeReaction.cpp index 8fcd80f..01f578c 100644 --- a/Be/BeReaction.cpp +++ b/Be/BeReaction.cpp @@ -36,7 +36,7 @@ BeReaction::~BeReaction() { void BeReaction::ReadParameters(const char *parameterfile) { - ifstream parfile; + std::ifstream parfile; parfile.open(parameterfile); //parameter file opening if (!parfile.is_open()) { diff --git a/Be/BeWork.cpp b/Be/BeWork.cpp index 78e75dc..38b5ca3 100644 --- a/Be/BeWork.cpp +++ b/Be/BeWork.cpp @@ -122,7 +122,7 @@ BeWork::~BeWork() void BeWork::ReadConfigFile() { - ifstream cfile; + std::ifstream cfile; //generator file opening if (!fConfigFile.IsNull()) { cfile.open(fConfigFile.Data()); @@ -1076,7 +1076,7 @@ void BeWork::MonteCarloState(const Int_t noevents, const char* generator, TTree Info("BeWork::MonteCarloState", "Function was called"); TString g(generator); - ifstream gen; + std::ifstream gen; //generator file opening if (!g.IsNull()) { gen.open(g.Data()); @@ -1590,7 +1590,7 @@ void BeWork::FillSimKinFile(const char* generator, Int_t INPUTS, // cout << beamenergy << endl; // cout << beamtheta << endl; // cout << beamphi << endl; - ifstream gen; + std::ifstream gen; gen.open(generator); if (!gen.is_open()) { @@ -1713,7 +1713,7 @@ Int_t BeWork::CountLines(const char* file, Int_t maxlinelength) { char countline[maxlinelength]; TString fname(file); - ifstream rfile; + std::ifstream rfile; //generator file opening if (!fname.IsNull()) { rfile.open(fname.Data()); diff --git a/makefile b/makefile index 339293f..2defa3e 100755 --- a/makefile +++ b/makefile @@ -20,6 +20,7 @@ F90 := gfortran ROOTLIBS = $(shell root-config --libdir) ROOTINCS = $(shell root-config --incdir) +ROOTCFLAGS = $(shell root-config --cflags) PWD = $(shell pwd) INSTALLFOLDER = $(HOME)/AculLib @@ -148,7 +149,9 @@ fillExpFile: $(APPSOBJS) @echo 'Invoking: GCC C++ Compiler' # $(CC) -I$(ROOTINCS) -O0 -g3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<" # $(CC) -I$(ROOTINCS) -DTHREADING -I$(BOOSTINCS) -O2 -Wall -mmmx -msse -msse2 -msse3 -mfpmath=sse,387 -march=nocona -mtune=nocona -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<" - $(CC) -I$(ROOTINCS) -O2 -Wall -mmmx -msse -msse2 -msse3 -mfpmath=sse,387 -march=nocona -mtune=nocona -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<" + $(CC) -I$(ROOTINCS) -O2 -std=c++11 -Wall -mmmx -msse -msse2 -msse3 -mfpmath=sse,387 -march=nocona -mtune=nocona -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<" +# $(CC) -I$(ROOTINCS) -O2 $(ROOTCFLAGS) -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<" +# $(CC) -I$(ROOTINCS) -O2 $(ROOTCFLAGS) -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<" @echo 'Finished building: $@' @echo ' ' -- 2.18.1