implmented some startup features

This commit is contained in:
nemu
2008-04-03 13:10:49 +00:00
parent 5fc7e14f3f
commit 0652495a3f
13 changed files with 101 additions and 24 deletions

View File

@@ -118,6 +118,7 @@ bool PFitter::DoFit()
SetParameters();
bool status;
bool minosUsed = false;
for (unsigned int i=0; i<fCmdList.size(); i++) {
switch (fCmdList[i]) {
case PMN_INTERACTIVE:
@@ -148,6 +149,7 @@ bool PFitter::DoFit()
break;
case PMN_MINOS:
status = ExecuteMinos();
minosUsed = true;
break;
case PMN_PLOT:
cout << endl << "**WARNING** from PFitter::DoFit() : the command PLOT is not yet implemented.";
@@ -180,6 +182,13 @@ bool PFitter::DoFit()
}
}
// if minos was not used, there are NO valid positive errors
if (!minosUsed) {
for (unsigned int i=0; i<fParams.size(); i++) {
fRunInfo->SetMsrParamPosErrorPresent(i, false);
}
}
return true;
}

View File

@@ -683,6 +683,28 @@ bool PMsrHandler::SetMsrParamStep(unsigned int i, double value)
return true;
}
//--------------------------------------------------------------------------
// SetMsrParamPosErrorPresent (public)
//--------------------------------------------------------------------------
/**
* <p>
*
* \param i
* \param value
*/
bool PMsrHandler::SetMsrParamPosErrorPresent(unsigned int i, bool value)
{
if (i > fParam.size()) {
cout << endl << "PMsrHandler::SetMsrParamPosErrorPresent(): i = " << i << " is larger than the number of parameters " << fParam.size();
cout << endl;
return false;
}
fParam[i].fPosErrorPresent = value;
return true;
}
//--------------------------------------------------------------------------
// SetMsrParamPosError (public)
//--------------------------------------------------------------------------

View File

@@ -62,7 +62,9 @@ PMusrCanvas::PMusrCanvas()
/**
*
*/
PMusrCanvas::PMusrCanvas(const char* title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh)
PMusrCanvas::PMusrCanvas(const char* title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh,
const PIntVector markerList, const PIntVector colorList) :
fMarkerList(markerList), fColorList(colorList)
{
fValid = false;

View File

@@ -52,7 +52,7 @@ using namespace std;
* <p>
*
*/
PRunDataHandler::PRunDataHandler(PMsrHandler *msrInfo)
PRunDataHandler::PRunDataHandler(PMsrHandler *msrInfo, const PStringVector dataPath) : fDataPath(dataPath)
{
// cout << endl << "in PRunDataHandler::PRunDataHandler()";
@@ -63,6 +63,10 @@ PRunDataHandler::PRunDataHandler(PMsrHandler *msrInfo)
fAllDataAvailable = false;
else
fAllDataAvailable = true;
/*for (unsigned int i=0; i<fDataPath.size(); i++)
cout << endl << i << ": " << fDataPath[i].Data();
cout << endl;*/
}
//--------------------------------------------------------------------------
@@ -236,18 +240,26 @@ bool PRunDataHandler::FileExistsCheck(PMsrRunStructure &runInfo)
}
// check if the file is found in the directory given in the startup file
// ** STILL MISSING **
if (pathName.CompareTo("???") == 0) { // not found in local directory search
for (unsigned int i=0; i<fDataPath.size(); i++) {
str = fDataPath[i] + TString("/") + runInfo.fRunName + TString(".") + ext;
if (gSystem->AccessPathName(str.Data())!=true) { // found
pathName = str;
break;
}
}
}
// check if the file is found in the directories given by WKMFULLDATAPATH
const char *wkmpath = gSystem->Getenv("WKMFULLDATAPATH");
if (pathName.CompareTo("???") == 0) { // not found in local directory search
if (pathName.CompareTo("???") == 0) { // not found in local directory and xml path
str = TString(wkmpath);
// WKMFULLDATAPATH has the structure: path_1:path_2:...:path_n
TObjArray *tokens = str.Tokenize(":");
TObjString *ostr;
for (int i=0; i<tokens->GetEntries(); i++) {
ostr = dynamic_cast<TObjString*>(tokens->At(i));
str = ostr->GetString() + "/" + runInfo.fRunName + TString(".") + ext;
str = ostr->GetString() + TString("/") + runInfo.fRunName + TString(".") + ext;
if (gSystem->AccessPathName(str.Data())!=true) { // found
pathName = str;
break;
@@ -276,7 +288,7 @@ bool PRunDataHandler::FileExistsCheck(PMsrRunStructure &runInfo)
// no proper path name found
if (pathName.CompareTo("???") == 0) {
cout << endl << "ERROR: Couldn't find '" << runInfo.fRunName << "' in any standard path.";
cout << endl << "**ERROR** Couldn't find '" << runInfo.fRunName << "' in any standard path.";
cout << endl << " standard search pathes are:";
cout << endl << " 1. the local directory";
cout << endl << " 2. the data directory given in the startup XML file";

View File

@@ -154,6 +154,7 @@ void PStartupHandler::OnCharacters(const char *str)
case eDataPath:
// check that str is a valid path
// add str to the path list
fDataPathList.push_back(str);
break;
case eMarker:
// check that str is a number