fixed wrong data start time. Added slightly more flexibile startup path file handling
This commit is contained in:
parent
a5d079d0a1
commit
5d363ce953
@ -55,6 +55,7 @@ short term:
|
|||||||
* something is strange with the coordinate system in TPaveText! **CHECK**
|
* something is strange with the coordinate system in TPaveText! **CHECK**
|
||||||
|
|
||||||
* check problem with the mathmore implementation of 1F1(m;n;z)
|
* check problem with the mathmore implementation of 1F1(m;n;z)
|
||||||
|
2008-04-07 cannot reproduce Bastians problem!?!?!
|
||||||
|
|
||||||
---------------------
|
---------------------
|
||||||
intermediate term:
|
intermediate term:
|
||||||
|
@ -609,7 +609,8 @@ bool PRunAsymmetry::PrepareFitData(PRawRunData* runData, unsigned int histoNo[2]
|
|||||||
double asym;
|
double asym;
|
||||||
double f, b, ef, eb;
|
double f, b, ef, eb;
|
||||||
// fill data time start, and step
|
// 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;
|
fData.fDataTimeStep = fTimeResolution*(double)fRunInfo->fPacking;
|
||||||
for (unsigned int i=0; i<forwardPacked.fValue.size(); i++) {
|
for (unsigned int i=0; i<forwardPacked.fValue.size(); i++) {
|
||||||
// to make the formulae more readable
|
// to make the formulae more readable
|
||||||
|
@ -397,8 +397,9 @@ bool PRunSingleHisto::PrepareFitData(unsigned int start, unsigned int end, doubl
|
|||||||
PRawRunData* runData, unsigned int histoNo)
|
PRawRunData* runData, unsigned int histoNo)
|
||||||
{
|
{
|
||||||
double value = 0.0;
|
double value = 0.0;
|
||||||
|
// data start at data_start-t0
|
||||||
// time shifted so that packing is included correctly, i.e. t0 == t0 after packing
|
// time shifted so that packing is included correctly, i.e. t0 == t0 after packing
|
||||||
fData.fDataTimeStart = fTimeResolution*((double)fRunInfo->fPacking/2.0);
|
fData.fDataTimeStart = fTimeResolution*(((double)start-t0)+(double)fRunInfo->fPacking/2.0);
|
||||||
fData.fDataTimeStep = fTimeResolution*fRunInfo->fPacking;
|
fData.fDataTimeStep = fTimeResolution*fRunInfo->fPacking;
|
||||||
for (unsigned i=start; i<end; i++) {
|
for (unsigned i=start; i<end; i++) {
|
||||||
if (((i-start) % fRunInfo->fPacking == 0) && (i != start)) { // fill data
|
if (((i-start) % fRunInfo->fPacking == 0) && (i != start)) { // fill data
|
||||||
|
@ -29,6 +29,10 @@
|
|||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@ -503,11 +507,24 @@ int main(int argc, char *argv[])
|
|||||||
return PMUSR_WRONG_STARTUP_SYNTAX;
|
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
|
// read startup file
|
||||||
|
char startup_path_name[128];
|
||||||
|
sprintf(startup_path_name, "%s/musrfit_startup.xml", musrpath);
|
||||||
TSAXParser *saxParser = new TSAXParser();
|
TSAXParser *saxParser = new TSAXParser();
|
||||||
PStartupHandler *startupHandler = new PStartupHandler();
|
PStartupHandler *startupHandler = new PStartupHandler();
|
||||||
saxParser->ConnectToHandler("PStartupHandler", startupHandler);
|
saxParser->ConnectToHandler("PStartupHandler", startupHandler);
|
||||||
status = saxParser->ParseFile("musrfit_startup.xml");
|
status = saxParser->ParseFile(startup_path_name);
|
||||||
// check for parse errors
|
// check for parse errors
|
||||||
if (status) { // error
|
if (status) { // error
|
||||||
cout << endl << "**ERROR** reading/parsing musrfit_startup.xml. Fix it.";
|
cout << endl << "**ERROR** reading/parsing musrfit_startup.xml. Fix it.";
|
||||||
|
@ -29,6 +29,10 @@
|
|||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@ -93,11 +97,24 @@ int main(int argc, char *argv[])
|
|||||||
return PMUSR_WRONG_STARTUP_SYNTAX;
|
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
|
// read startup file
|
||||||
|
char startup_path_name[128];
|
||||||
|
sprintf(startup_path_name, "%s/musrfit_startup.xml", musrpath);
|
||||||
TSAXParser *saxParser = new TSAXParser();
|
TSAXParser *saxParser = new TSAXParser();
|
||||||
PStartupHandler *startupHandler = new PStartupHandler();
|
PStartupHandler *startupHandler = new PStartupHandler();
|
||||||
saxParser->ConnectToHandler("PStartupHandler", startupHandler);
|
saxParser->ConnectToHandler("PStartupHandler", startupHandler);
|
||||||
status = saxParser->ParseFile("musrfit_startup.xml");
|
status = saxParser->ParseFile(startup_path_name);
|
||||||
// check for parse errors
|
// check for parse errors
|
||||||
if (status) { // error
|
if (status) { // error
|
||||||
cout << endl << "**ERROR** reading/parsing musrfit_startup.xml. Fix it.";
|
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
|
// feed all the necessary histogramms for the view
|
||||||
runListCollection = new PRunListCollection(msrHandler, dataHandler);
|
runListCollection = new PRunListCollection(msrHandler, dataHandler);
|
||||||
for (unsigned int i=0; i < msrHandler->GetMsrRunList()->size(); i++) {
|
for (unsigned int i=0; i < msrHandler->GetMsrRunList()->size(); i++) {
|
||||||
success = runListCollection->Add(i);
|
success = runListCollection->Add(i, kView);
|
||||||
if (!success) {
|
if (!success) {
|
||||||
cout << endl << "**ERROR** Couldn't handle run no " << i << " ";
|
cout << endl << "**ERROR** Couldn't handle run no " << i << " ";
|
||||||
cout << (*msrHandler->GetMsrRunList())[i].fRunName.Data();
|
cout << (*msrHandler->GetMsrRunList())[i].fRunName.Data();
|
||||||
@ -174,13 +191,6 @@ int main(int argc, char *argv[])
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// ugly but rootcint cannot handle the spirit-parser framework
|
// 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->SetMsrHandler(msrHandler);
|
||||||
musrCanvas->SetRunListCollection(runListCollection);
|
musrCanvas->SetRunListCollection(runListCollection);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user