+
#include "PNL_StartupHandler.h"
ClassImpQ(PNL_StartupHandler)
@@ -44,46 +46,26 @@ ClassImpQ(PNL_StartupHandler)
*/
PNL_StartupHandler::PNL_StartupHandler()
{
- fIsValid = true;
-
- fStartupFileFound = false;
- fStartupFilePath = "";
-
- fFourierPoints = 0;
- fTrimSpDataPath = TString("");
-
// get default path (for the moment only linux like)
char startup_path_name[512];
char *home_str=0;
// check if the startup file is found in the current directory
strcpy(startup_path_name, "./nonlocal_startup.xml");
- if (StartupFileExists(startup_path_name)) {
+ if (boost::filesystem::exists(startup_path_name)) {
fStartupFileFound = true;
fStartupFilePath = TString(startup_path_name);
} else { // startup file is not found in the current directory
std::cout << std::endl << "PNL_StartupHandler(): **WARNING** Couldn't find nonlocal_startup.xml in the current directory, will try default one." << std::endl;
home_str = getenv("HOME");
snprintf(startup_path_name, sizeof(startup_path_name), "%s/.musrfit/nonlocal_startup.xml", home_str);
- if (StartupFileExists(startup_path_name)) {
+ if (boost::filesystem::exists(startup_path_name)) {
fStartupFileFound = true;
fStartupFilePath = TString(startup_path_name);
}
}
}
-//--------------------------------------------------------------------------
-// Destructor
-//--------------------------------------------------------------------------
-/**
- *
- */
-PNL_StartupHandler::~PNL_StartupHandler()
-{
- fTrimSpDataPathList.clear();
- fTrimSpDataEnergyList.clear();
-}
-
//--------------------------------------------------------------------------
// OnStartDocument
//--------------------------------------------------------------------------
@@ -124,10 +106,6 @@ void PNL_StartupHandler::OnStartElement(const char *str, const TList *attributes
{
if (!strcmp(str, "fourier_points")) {
fKey = eFourierPoints;
- } else if (!strcmp(str, "data_path")) {
- fKey = eDataPath;
- } else if (!strcmp(str, "energy")) {
- fKey = eEnergy;
}
}
@@ -167,23 +145,6 @@ void PNL_StartupHandler::OnCharacters(const char *str)
std::cout << std::endl;
}
break;
- case eDataPath:
- fTrimSpDataPath = str;
- break;
- case eEnergy:
- tstr = str;
- if (tstr.IsFloat()) {
- fTrimSpDataEnergyList.push_back(tstr.Atof());
- tstr = fTrimSpDataPath;
- tstr += str;
- tstr += ".rge";
- fTrimSpDataPathList.push_back(tstr);
- } else {
- std::cout << std::endl << "PNL_StartupHandler::OnCharacters: **ERROR** when finding energy:";
- std::cout << std::endl << "\"" << str << "\" is not a floating point number, will ignore it and use the default value.";
- std::cout << std::endl;
- }
- break;
default:
break;
}
@@ -257,29 +218,6 @@ void PNL_StartupHandler::OnCdataBlock(const char *str, Int_t len)
// nothing to be done for now
}
-//--------------------------------------------------------------------------
-// StartupFileExists
-//--------------------------------------------------------------------------
-/**
- *
- *
- */
-bool PNL_StartupHandler::StartupFileExists(char *fln)
-{
- bool result = false;
-
- std::ifstream ifile(fln);
-
- if (ifile.fail()) {
- result = false;
- } else {
- result = true;
- ifile.close();
- }
-
- return result;
-}
-
// -------------------------------------------------------------------------
// end
// -------------------------------------------------------------------------
diff --git a/src/external/Nonlocal/PNL_StartupHandler.h b/src/external/Nonlocal/PNL_StartupHandler.h
index e70b0614..ea80c2e2 100644
--- a/src/external/Nonlocal/PNL_StartupHandler.h
+++ b/src/external/Nonlocal/PNL_StartupHandler.h
@@ -5,8 +5,6 @@
Author: Andreas Suter
e-mail: andreas.suter@psi.ch
- $Id$
-
***************************************************************************/
/***************************************************************************
@@ -36,13 +34,11 @@
#include
#include
-#include "PNonlocal.h"
-
class PNL_StartupHandler : public TObject
{
public:
PNL_StartupHandler();
- virtual ~PNL_StartupHandler();
+ virtual ~PNL_StartupHandler() {}
virtual void OnStartDocument(); // SLOT
virtual void OnEndDocument(); // SLOT
@@ -58,26 +54,18 @@ class PNL_StartupHandler : public TObject
virtual bool IsValid() { return fIsValid; }
virtual TString GetStartupFilePath() { return fStartupFilePath; }
virtual const Int_t GetFourierPoints() const { return fFourierPoints; }
- virtual const PStringVector GetTrimSpDataPathList() const { return fTrimSpDataPathList; }
- virtual const PDoubleVector GetTrimSpDataVectorList() const { return fTrimSpDataEnergyList; }
-
virtual bool StartupFileFound() { return fStartupFileFound; }
private:
- enum EKeyWords {eEmpty, eComment, eFourierPoints, eDataPath, eEnergy};
+ enum EKeyWords {eEmpty, eFourierPoints};
EKeyWords fKey;
- bool fIsValid;
+ bool fIsValid{true};
- bool fStartupFileFound;
- TString fStartupFilePath;
+ bool fStartupFileFound{false};
+ TString fStartupFilePath{""};
- Int_t fFourierPoints;
- TString fTrimSpDataPath;
- PStringVector fTrimSpDataPathList;
- PDoubleVector fTrimSpDataEnergyList;
-
- bool StartupFileExists(char *fln);
+ Int_t fFourierPoints{0};
ClassDef(PNL_StartupHandler, 1)
};
diff --git a/src/external/Nonlocal/PNonlocal.h b/src/external/Nonlocal/PNonlocal.h
deleted file mode 100644
index 3a315771..00000000
--- a/src/external/Nonlocal/PNonlocal.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/***************************************************************************
-
- PNonlocal.h
-
- Author: Andreas Suter
- e-mail: andreas.suter@psi.ch
-
-***************************************************************************/
-
-/***************************************************************************
- * Copyright (C) 2009-2021 by Andreas Suter *
- * andreas.suter@psi.ch *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- ***************************************************************************/
-
-#ifndef _PNONLOCAL_H_
-#define _PNONLOCAL_H_
-
-#include
-
-#include
-
-//-------------------------------------------------------------
-/**
- * typedef to make to code more readable.
- */
-typedef std::vector PStringVector;
-
-//-------------------------------------------------------------
-/**
- * typedef to make to code more readable.
- */
-typedef std::vector PDoubleVector;
-
-//-------------------------------------------------------------
-/**
- *
- */
-typedef struct {
- Double_t energy;
- PDoubleVector stoppingDistance;
- PDoubleVector stoppingAmplitude;
-} PNL_RgeData;
-
-//-------------------------------------------------------------
-/**
- *
- */
-typedef std::vector PNL_RgeDataList;
-
-#endif // _PNONLOCAL_H_
diff --git a/src/external/Nonlocal/nonlocal_startup.xml b/src/external/Nonlocal/nonlocal_startup.xml
index 26eaa87d..e66722c7 100644
--- a/src/external/Nonlocal/nonlocal_startup.xml
+++ b/src/external/Nonlocal/nonlocal_startup.xml
@@ -1,25 +1,27 @@
- trim.sp meta information
+ Fourier and TrimSp information
262144
-
- /afs/psi.ch/project/nemu/analysis/2009/Nonlocal/trimsp/InSne
+
+ ./profiles/
+ Sn_E
- 2.5
- 4.0
- 6.0
- 8.0
- 10.0
- 12.5
- 14.1
- 17.5
- 22.0
- 25.0
- 28.2
+ 1000
+ 2000
+ 4000
+ 6000
+ 8000
+ 10000
+ 12000
+ 14100
+ 18000
+ 22000
+ 25000
+ 27300
-
+