Merged muonspin/musrfit:root6 into master

This commit is contained in:
Zaher Salman
2022-04-12 16:25:25 +02:00
9 changed files with 61 additions and 22 deletions

View File

@@ -153,11 +153,14 @@ set_target_properties(PRgeHandler
#--- make sure that the include directory is found ----------------------------
target_include_directories(
PUserFcnBase BEFORE PRIVATE $<BUILD_INTERFACE:${MUSRFIT_INC}>
PUserFcnBase BEFORE PRIVATE
$<BUILD_INTERFACE:${MUSRFIT_INC}>
)
target_include_directories(
PRgeHandler BEFORE PRIVATE $<BUILD_INTERFACE:${MUSRFIT_INC}>
PRgeHandler BEFORE PRIVATE
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
$<BUILD_INTERFACE:${MUSRFIT_INC}>
)
#--- add ROOT Version >= 6.24 compile options if needed -----------------------

View File

@@ -1308,7 +1308,9 @@ bool PMsr2Data::PrepareGlobalInputFile(unsigned int tempRun, const std::string &
std::ostringstream oss;
oss << path << "musrfit" << " " << *fRunVectorIter << "-OneRunFit" << fFileExtension << ".msr";
std::cout << std::endl << ">> msr2data: **INFO** Calling " << oss.str() << std::endl;
system(oss.str().c_str());
if (system(oss.str().c_str()) == -1) {
std::cerr << std::endl << "**ERROR** system call: " << oss.str().c_str() << " failed." << std::endl;
}
++fRunVectorIter;
}

View File

@@ -6728,9 +6728,9 @@ TString PMsrHandler::BeautifyFourierPhaseParameterString()
if (phaseIter) {
if (phaseRef != -1) {
str = TString::Format("parR(%d, %d, %d)", fFourier.fPhaseParamNo[0], offset, fFourier.fPhaseParamNo.size());
str = TString::Format("parR(%d, %d, %lu)", fFourier.fPhaseParamNo[0], offset, fFourier.fPhaseParamNo.size());
} else {
str = TString::Format("par(%d, %d, %d)", fFourier.fPhaseParamNo[0], offset, fFourier.fPhaseParamNo.size());
str = TString::Format("par(%d, %d, %lu)", fFourier.fPhaseParamNo[0], offset, fFourier.fPhaseParamNo.size());
}
} else {
str = TString("");

View File

@@ -724,7 +724,9 @@ Bool_t PRunDataHandler::ReadWriteFilesList()
sprintf(cmd, "tar -zcf %s %s", fln.Data(), fAny2ManyInfo->outPathFileName[0].Data());
else // bzip2
sprintf(cmd, "tar -jcf %s %s", fln.Data(), fAny2ManyInfo->outPathFileName[0].Data());
system(cmd);
if (system(cmd) == -1) {
std::cerr << "**ERROR** cmd: " << cmd << " failed." << std::endl;
}
} else {
fln += TString(".tar");
for (UInt_t i=0; i<fAny2ManyInfo->outPathFileName.size(); i++) {
@@ -733,7 +735,9 @@ Bool_t PRunDataHandler::ReadWriteFilesList()
} else {
sprintf(cmd, "tar -rf %s %s", fln.Data(), fAny2ManyInfo->outPathFileName[i].Data());
}
system(cmd);
if (system(cmd) == -1) {
std::cerr << "**ERROR** cmd: " << cmd << " failed." << std::endl;
}
}
if (fAny2ManyInfo->compressionTag == 1) { // gzip
sprintf(cmd, "gzip %s", fln.Data());
@@ -742,7 +746,9 @@ Bool_t PRunDataHandler::ReadWriteFilesList()
sprintf(cmd, "bzip2 -z %s", fln.Data());
fln += ".bz2";
}
system(cmd);
if (system(cmd) == -1) {
std::cerr << "**ERROR** cmd: " << cmd << " failed." << std::endl;
}
}
// check if the compressed file shall be streamed to the stdout

View File

@@ -2761,7 +2761,7 @@ int PNeXus::ReadFileIdf1()
char cstr[128];
int ival;
float fval;
int attlen, atttype;
int attlen, atttype, rank, dims[32];
NXname data_value, nxAttrName;
// open file
@@ -2775,7 +2775,7 @@ int PNeXus::ReadFileIdf1()
// collect the NXroot attribute information
do {
status = NXgetnextattr(fFileHandle, nxAttrName, &attlen, &atttype);
status = NXgetnextattra(fFileHandle, nxAttrName, &rank, dims, &atttype);
if (status == NX_OK) {
if (!strcmp(nxAttrName, "HDF_version")) {
attlen = VGNAMELENMAX - 1;
@@ -3153,7 +3153,7 @@ int PNeXus::ReadFileIdf1()
// get data
// get information of the current nexus entity
int rank, type, dims[32], size, noOfElements;
int type, size, noOfElements;
if (!ErrorHandler(NXgetinfo(fFileHandle, &rank, dims, &type), PNEXUS_GET_META_INFO_ERROR, "couldn't get data info!")) return NX_ERROR;
// calculate the needed size
@@ -3354,7 +3354,7 @@ int PNeXus::ReadFileIdf2()
// collect the NXroot attribute information
do {
status = NXgetnextattr(fFileHandle, nxAttrName, &attlen, &atttype);
status = NXgetnextattra(fFileHandle, nxAttrName, &rank, dims, &atttype);
if (status == NX_OK) {
if (!strcmp(nxAttrName, "HDF_version")) {
attlen = VGNAMELENMAX - 1;
@@ -5432,21 +5432,23 @@ bool PNeXus::SearchInGroup(std::string str, std::string tag, NXname &nxname, NXn
* - false otherwise
*
* \param str label of the attribute to be looked for
* \param length of the attribute data it entry is found
* \param length of the attribute data if entry is found
* \param dataType of the entry if entry is found
*/
bool PNeXus::SearchAttrInData(std::string str, int &length, int &dataType)
{
bool found = false;
int status;
int status, rank, dims[32];
char name[128];
memset(name, 0, sizeof(name));
NXinitattrdir(fFileHandle);
do {
status = NXgetnextattr(fFileHandle, name, &length, &dataType);
status = NXgetnextattra(fFileHandle, name, &rank, dims, &dataType);
if (!str.compare(name)) {
if (rank == 1)
length = dims[0];
found = true;
break;
}

View File

@@ -893,7 +893,9 @@ int main(int argc, char *argv[])
std::ostringstream oss;
oss << path << "musrfit" << " " << strInfile.str() << " " << musrfitOptions;
std::cout << std::endl << ">> msr2data: **INFO** Calling " << oss.str() << std::endl;
system(oss.str().c_str());
if (system(oss.str().c_str()) == -1) {
std::cerr << "**ERROR** cmd: " << oss.str().c_str() << " failed." << std::endl;
}
}
}
@@ -982,7 +984,9 @@ int main(int argc, char *argv[])
std::ostringstream oss;
oss << path << "musrfit" << " " << strInfile.str() << " " << musrfitOptions;
std::cout << std::endl << ">> msr2data: **INFO** Calling " << oss.str() << std::endl;
system(oss.str().c_str());
if (system(oss.str().c_str()) == -1) {
std::cerr << "**ERROR** cmd: " << oss.str().c_str() << " failed." << std::endl;
}
}
}

View File

@@ -574,10 +574,16 @@ bool msr2msr_finalize_theory(char *fln, int theoryTag, int noOfAddionalParams)
// cp __temp.msr fln
sprintf(str, "cp __temp.msr %s", fln);
system(str);
if (system(str) == -1) {
std::cerr << "**ERROR** cmd: " << str << " failed." << std::endl;
return false;
}
// rm __temp.msr
strcpy(str, "rm __temp.msr");
system(str);
if (system(str) == -1) {
std::cerr << "**ERROR** cmd: " << str << " failed." << std::endl;
return false;
}
return true;
}
@@ -704,7 +710,10 @@ int main(int argc, char *argv[])
// check if conversion seems to be OK
if (!success) {
sprintf(str, "rm -rf %s", argv[2]);
system(str);
if (system(str) == -1) {
std::cerr << "**ERROR** cmd: " << str << " failed." << std::endl;
return 0;
}
}
if (theoryTag != -1) {

View File

@@ -123,7 +123,14 @@ PDumpOutputHandler::~PDumpOutputHandler()
#else
qDebug() << msg << Qt::endl;
#endif
system(cmd.toLatin1());
if (system(cmd.toLatin1()) == -1) {
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
qDebug() << "**ERROR** " << msg << " failed." << endl;
#else
qDebug() << "**ERROR** " << msg << " failed." << Qt::endl;
#endif
}
}
if (fProc) {
delete fProc;

View File

@@ -126,7 +126,13 @@ PFitOutputHandler::~PFitOutputHandler()
#else
qDebug() << msg << Qt::endl;
#endif
system(cmd.toLatin1());
if (system(cmd.toLatin1()) == -1) {
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
qDebug() << "**ERROR** " << msg << " - failed!" << endl;
#else
qDebug() << "**ERROR** " << msg << " - failed!" << Qt::endl;
#endif
}
}
if (fProc) {
delete fProc;