some more work towards Nonlocal fitting

This commit is contained in:
nemu 2009-06-30 07:13:01 +00:00
parent dc0f343062
commit 9234cde7dd
6 changed files with 38 additions and 10 deletions

View File

@ -101,7 +101,7 @@ install: all
@echo "Installing shared lib: libPUserFcn.so ( you must be root ;-) )"
ifeq ($(OS),LINUX)
cp -pv $(SHLIB) $(ROOTSYS)/lib
# cp -pv ../include/PNonlocal.h $(ROOTSYS)/include
# cp -pv ../include/PNL_StartupHandler.h $(ROOTSYS)/include
# cp -pv ../include/PNL_PippardFitter.h $(ROOTSYS)/include
# cp -pv PNonlocal.h $(ROOTSYS)/include
# cp -pv PNL_StartupHandler.h $(ROOTSYS)/include
cp -pv PNL_PippardFitter.h $(ROOTSYS)/include
endif

View File

@ -77,6 +77,10 @@ PNL_PippardFitter::PNL_PippardFitter()
saxParser = 0;
}
// check if everything went fine with the startup handler
if (!fStartupHandler->IsValid())
assert(false);
// load all the TRIM.SP rge-files
fRgeHandler = new PNL_RgeHandler(fStartupHandler->GetTrimSpDataPathList());
if (!fRgeHandler->IsValid())
@ -106,7 +110,7 @@ PNL_PippardFitter::~PNL_PippardFitter()
Double_t PNL_PippardFitter::operator()(Double_t t, const std::vector<Double_t> &param) const
{
// expected parameters: energy, temp, thickness, meanFreePath, xi0, lambdaL
assert(param.size() != 6);
assert(param.size() == 6);
return 0.0;
}

View File

@ -138,7 +138,7 @@ Bool_t PNL_RgeHandler::LoadRgeData(const PStringVector &rgeDataPathList)
ifstream fin;
PNL_RgeData data;
Int_t idx=0;
TString dataName;
TString dataName, tstr;
char line[512];
int result;
double dist, val;
@ -173,6 +173,12 @@ Bool_t PNL_RgeHandler::LoadRgeData(const PStringVector &rgeDataPathList)
if (idx == 1)
continue;
// ignore empty lines
tstr = line;
if (tstr.IsWhitespace())
continue;
// get values
result = sscanf(line, "%lf %lf", &dist, &val);
// check if data are valid

View File

@ -45,6 +45,8 @@ ClassImpQ(PNL_StartupHandler)
*/
PNL_StartupHandler::PNL_StartupHandler()
{
fIsValid = true;
fStartupFileFound = false;
fStartupFilePath = "";
@ -150,6 +152,8 @@ void PNL_StartupHandler::OnEndElement(const char *str)
void PNL_StartupHandler::OnCharacters(const char *str)
{
TString tstr;
Double_t dval;
char sstr[128];
switch (fKey) {
case eFourierPoints:
@ -166,7 +170,19 @@ void PNL_StartupHandler::OnCharacters(const char *str)
fTrimSpDataPath = str;
break;
case eEnergy:
tstr = fTrimSpDataPath + TString(str);
tstr = str;
if (tstr.IsFloat()) {
dval = tstr.Atof();
} else {
cout << endl << "PNL_StartupHandler::OnCharacters: **ERROR** when finding energy:";
cout << endl << "\"" << str << "\" is not a double.";
cout << endl;
fIsValid = false;
}
tstr = fTrimSpDataPath;
sprintf(sstr, "%03d", (int)(dval*10.0));
tstr += sstr;
tstr += ".rge";
fTrimSpDataPathList.push_back(tstr);
break;
default:

View File

@ -55,6 +55,7 @@ class PNL_StartupHandler : public TObject
virtual void OnFatalError(const char*); // SLOT
virtual void OnCdataBlock(const char*, Int_t); // SLOT
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; }
@ -65,6 +66,8 @@ class PNL_StartupHandler : public TObject
enum EKeyWords {eEmpty, eComment, eFourierPoints, eDataPath, eEnergy};
EKeyWords fKey;
bool fIsValid;
bool fStartupFileFound;
TString fStartupFilePath;

View File

@ -7,7 +7,7 @@
<fourier_points>200000</fourier_points>
</nonlocal_par>
<trim_sp_part>
<data_path>/afs/psi.ch/project/nemu/analysis/2009/Nonlocal/In-37/In37</data_path>
<data_path>/afs/psi.ch/project/nemu/analysis/2009/Nonlocal/trimsp/InSne</data_path>
<energy_list>
<energy>2.5</energy>
<energy>4.0</energy>
@ -15,11 +15,10 @@
<energy>8.0</energy>
<energy>10.0</energy>
<energy>12.5</energy>
<energy>14.1</energy>
<energy>15.0</energy>
<energy>17.5</energy>
<energy>22.0</energy>
<energy>20.0</energy>
<energy>25.0</energy>
<energy>28.2</energy>
</energy_list>
</trim_sp_part>
</nonlocal>