diff --git a/src/ToDo.txt b/src/ToDo.txt index 83bec8e7..a1b4dc8b 100644 --- a/src/ToDo.txt +++ b/src/ToDo.txt @@ -55,6 +55,7 @@ short term: * something is strange with the coordinate system in TPaveText! **CHECK** * check problem with the mathmore implementation of 1F1(m;n;z) + 2008-04-07 cannot reproduce Bastians problem!?!?! --------------------- intermediate term: diff --git a/src/classes/PRunAsymmetry.cpp b/src/classes/PRunAsymmetry.cpp index dfe33409..e2a474b3 100644 --- a/src/classes/PRunAsymmetry.cpp +++ b/src/classes/PRunAsymmetry.cpp @@ -609,7 +609,8 @@ bool PRunAsymmetry::PrepareFitData(PRawRunData* runData, unsigned int histoNo[2] double asym; double f, b, ef, eb; // fill data time start, and step - fData.fDataTimeStart = fTimeResolution*((double)fRunInfo->fPacking/2.0); + // data start at data_start-t0 + fData.fDataTimeStart = fTimeResolution*(((double)start[0]-t0[0])+(double)fRunInfo->fPacking/2.0); fData.fDataTimeStep = fTimeResolution*(double)fRunInfo->fPacking; for (unsigned int i=0; ifPacking/2.0); + fData.fDataTimeStart = fTimeResolution*(((double)start-t0)+(double)fRunInfo->fPacking/2.0); fData.fDataTimeStep = fTimeResolution*fRunInfo->fPacking; for (unsigned i=start; ifPacking == 0) && (i != start)) { // fill data diff --git a/src/musrfit.cpp b/src/musrfit.cpp index 8f859fde..473b3ab8 100644 --- a/src/musrfit.cpp +++ b/src/musrfit.cpp @@ -29,6 +29,10 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#include +#include +#include + #include #include using namespace std; @@ -503,11 +507,24 @@ int main(int argc, char *argv[]) return PMUSR_WRONG_STARTUP_SYNTAX; } + // get default path (for the moment only linux like) + char *pmusrpath; + char musrpath[128]; + pmusrpath = getenv("MUSRFITPATH"); + if (pmusrpath == 0) { // not set, will try default one + strcpy(musrpath, "/home/nemu/analysis/bin"); + cout << endl << "**WARNING** MUSRFITPATH environment variable not set will try " << musrpath << endl; + } else { + strncpy(musrpath, pmusrpath, sizeof(musrpath)); + } + // read startup file + char startup_path_name[128]; + sprintf(startup_path_name, "%s/musrfit_startup.xml", musrpath); TSAXParser *saxParser = new TSAXParser(); PStartupHandler *startupHandler = new PStartupHandler(); saxParser->ConnectToHandler("PStartupHandler", startupHandler); - status = saxParser->ParseFile("musrfit_startup.xml"); + status = saxParser->ParseFile(startup_path_name); // check for parse errors if (status) { // error cout << endl << "**ERROR** reading/parsing musrfit_startup.xml. Fix it."; diff --git a/src/musrview.cpp b/src/musrview.cpp index c22c73f2..f2a84739 100644 --- a/src/musrview.cpp +++ b/src/musrview.cpp @@ -29,6 +29,10 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#include +#include +#include + #include using namespace std; @@ -93,11 +97,24 @@ int main(int argc, char *argv[]) return PMUSR_WRONG_STARTUP_SYNTAX; } + // get default path (for the moment only linux like) + char *pmusrpath; + char musrpath[128]; + pmusrpath = getenv("MUSRFITPATH"); + if (pmusrpath == 0) { // not set, will try default one + strcpy(musrpath, "/home/nemu/analysis/bin"); + cout << endl << "**WARNING** MUSRFITPATH environment variable not set will try " << musrpath << endl; + } else { + strncpy(musrpath, pmusrpath, sizeof(musrpath)); + } + // read startup file + char startup_path_name[128]; + sprintf(startup_path_name, "%s/musrfit_startup.xml", musrpath); TSAXParser *saxParser = new TSAXParser(); PStartupHandler *startupHandler = new PStartupHandler(); saxParser->ConnectToHandler("PStartupHandler", startupHandler); - status = saxParser->ParseFile("musrfit_startup.xml"); + status = saxParser->ParseFile(startup_path_name); // check for parse errors if (status) { // error cout << endl << "**ERROR** reading/parsing musrfit_startup.xml. Fix it."; @@ -144,7 +161,7 @@ int main(int argc, char *argv[]) // feed all the necessary histogramms for the view runListCollection = new PRunListCollection(msrHandler, dataHandler); for (unsigned int i=0; i < msrHandler->GetMsrRunList()->size(); i++) { - success = runListCollection->Add(i); + success = runListCollection->Add(i, kView); if (!success) { cout << endl << "**ERROR** Couldn't handle run no " << i << " "; cout << (*msrHandler->GetMsrRunList())[i].fRunName.Data(); @@ -174,13 +191,6 @@ int main(int argc, char *argv[]) break; } // ugly but rootcint cannot handle the spirit-parser framework -// musrCanvas->SetParamInfo(*msrHandler->GetMsrParamList()); -// musrCanvas->SetTheoryInfo(*msrHandler->GetMsrTheory()); -// musrCanvas->SetFunctionsInfo(*msrHandler->GetMsrFunctions()); -// musrCanvas->SetRunsInfo(*msrHandler->GetMsrRunList()); -// musrCanvas->SetPlotInfo(msrHandler->GetMsrPlotList()->at(i)); -// musrCanvas->SetStatisticsInfo(*msrHandler->GetMsrStatistic()); - musrCanvas->SetMsrHandler(msrHandler); musrCanvas->SetRunListCollection(runListCollection);