38#include <QActionGroup>
45#include <QRegularExpression>
46#include <QSignalMapper>
60std::string expandEnvironmentVariables(
const std::string &target) {
61 std::string result = target;
66 while ((pos = result.find(
'%', pos)) != std::string::npos) {
67 size_t end = result.find(
'%', pos + 1);
68 if (end == std::string::npos)
71 std::string varName = result.substr(pos + 1, end - pos - 1);
72 const char *envValue = std::getenv(varName.c_str());
75 result.replace(pos, end - pos + 1, envValue);
76 pos += std::strlen(envValue);
84 while ((pos = result.find(
'$', pos)) != std::string::npos) {
89 if (pos + 1 < result.length() && result[pos + 1] ==
'{') {
91 end = result.find(
'}', pos + 2);
92 if (end == std::string::npos) {
96 varName = result.substr(pos + 2, end - pos - 2);
101 while (end < result.length() && (std::isalnum(result[end]) || result[end] ==
'_')) {
104 varName = result.substr(pos + 1, end - pos - 1);
107 if (!varName.empty()) {
108 const char *envValue = std::getenv(varName.c_str());
110 result.replace(start, end - start, envValue);
111 pos = start + std::strlen(envValue);
128 : QWidget(parent), m_mantidDisplayModel(mdb), m_viewOnly(viewOnly), m_updateCount(0), m_treeUpdating(false),
131 setObjectName(
"exploreMantid");
144 static bool registered_addtional_types =
false;
145 if (!registered_addtional_types) {
146 registered_addtional_types =
true;
147 qRegisterMetaType<TopLevelItems>();
156 m_tree->setDragEnabled(
true);
158 auto presenter = std::make_shared<WorkspacePresenter>(
this);
159 m_presenter = std::dynamic_pointer_cast<ViewNotifiable>(presenter);
176 m_tree->setHeaderLabel(
"Workspaces");
182 m_saveButton->setToolTip(
"Save the selected workspaces");
188 m_groupButton->setToolTip(
"Group together two or more selected workspaces");
190 m_sortButton->setToolTip(
"Sort all workspaces by name, size, or the last time they were modified");
208 auto *layout =
new QVBoxLayout();
209 layout->setContentsMargins(0, 0, 0, 0);
210 layout->addLayout(buttonLayout);
212 layout->addWidget(
m_tree);
213 this->setLayout(layout);
219 QAction *loadFileAction =
new QAction(
"File",
this);
220 QAction *liveDataAction =
new QAction(
"Live Data",
this);
221 connect(loadFileAction, SIGNAL(triggered()),
this, SLOT(
onClickLoad()));
222 connect(liveDataAction, SIGNAL(triggered()),
this, SLOT(
onClickLiveData()));
233 connect(
m_tree, SIGNAL(itemClicked(QTreeWidgetItem *,
int)),
this, SLOT(
clickedWorkspace(QTreeWidgetItem *,
int)));
237 m_tree->setContextMenuPolicy(Qt::CustomContextMenu);
238 connect(
m_tree, SIGNAL(customContextMenuRequested(
const QPoint &)),
this, SLOT(
popupMenu(
const QPoint &)));
240 Qt::QueuedConnection);
258 return std::dynamic_pointer_cast<WorkspacePresenter>(
m_presenter);
265 auto items =
m_tree->selectedItems();
267 names.reserve(
static_cast<size_t>(items.size()));
268 std::transform(items.cbegin(), items.cend(), std::back_inserter(names),
269 [](
auto const &item) { return item->text(0).toStdString(); });
275 auto items =
m_tree->selectedItems();
278 for (
auto &item : items) {
279 names.append(item->text(0));
288 auto items =
m_tree->selectedItems();
289 auto data = items[0]->data(0, Qt::UserRole).value<
Workspace_sptr>();
295 return QMessageBox::question(parentWidget(), QString::fromStdString(caption), QString::fromStdString(message),
296 QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes;
300 QMessageBox::critical(parentWidget(), QString::fromStdString(caption), QString::fromStdString(message));
304 QObject *sender = QObject::sender();
309 QString fn = MantidQt::API::AlgorithmInputHistory::Instance().previousInput(
"Load",
"Filename");
315 QMetaObject::invokeMethod(
dynamic_cast<QObject *
>(
m_mantidDisplayModel),
"showAlgorithmDialog", Qt::QueuedConnection,
316 Q_ARG(QString,
"Load"));
320 QMetaObject::invokeMethod(
dynamic_cast<QObject *
>(
m_mantidDisplayModel),
"showAlgorithmDialog", Qt::QueuedConnection,
321 Q_ARG(QString,
"StartLiveData"));
329 for (
const auto &ws : wsNames)
330 names.append(QString::fromStdString(ws));
343 QString qs_oldName = QString::fromStdString(oldName);
344 QString qs_newName = QString::fromStdString(newName);
346 QMutexLocker renameMapLock(&
m_mutex);
350 if (!oldNames.isEmpty()) {
351 for (
const auto &
name : oldNames)
366 return askUserYesNo(
"Delete Workspaces",
"Are you sure you want to delete the selected Workspaces?\n\nThis prompt "
367 "can be disabled from:\nFile->Settings->General");
372 for (
const auto &ws : wsNames)
373 names.append(QString::fromStdString(ws));
405 static int counter = 1;
444 const QAction *sendingAction =
dynamic_cast<QAction *
>(sender());
448 QString actionName = sendingAction->text();
450 if (actionName.compare(
"Nexus") == 0)
452 else if (actionName.compare(
"ASCII") == 0)
457 if (selectedNames.size() > 1) {
460 }
else if (selectedNames.size() == 1) {
470 if (!wsName.empty()) {
471 presets[
"InputWorkspace"] = QString::fromStdString(wsName);
474 std::string algorithmName;
478 algorithmName =
"SaveNexus";
481 algorithmName =
"SaveAscii";
490 if (items.size() < 2)
497 if (res != QFileDialog::Accepted)
502 std::string algorithmName;
503 std::string fileExtension;
507 algorithmName =
"SaveAscii";
508 fileExtension =
".dat";
512 algorithmName =
"SaveNexus";
513 fileExtension =
".nxs";
517 IAlgorithm_sptr saveAlg = AlgorithmManager::Instance().create(algorithmName);
518 saveAlg->initialize();
520 for (
auto &wsName : wsNames) {
521 std::string filename = folder +
"/" + wsName + fileExtension;
523 saveAlg->setProperty(
"InputWorkspace", wsName);
524 saveAlg->setProperty(
"Filename", filename);
526 }
catch (std::exception &ex) {
527 docklog.error() <<
"Error saving workspace " << wsName <<
": " << ex.what() <<
'\n';
535 const QString text = QString::fromStdString(filterText).trimmed();
536 QRegularExpression filterRegEx(text, QRegularExpression::CaseInsensitiveOption);
539 QTreeWidgetItemIterator unhideIter(
m_tree);
540 while (*unhideIter) {
541 (*unhideIter)->setHidden(
false);
546 if (!text.isEmpty()) {
550 QStringList expanded;
551 int n =
m_tree->topLevelItemCount();
552 for (
int i = 0; i <
n; ++i) {
553 auto item =
m_tree->topLevelItem(i);
554 if (item->isExpanded()) {
555 expanded << item->text(0);
559 item->setExpanded(
true);
564 QTreeWidgetItemIterator it(
m_tree, QTreeWidgetItemIterator::All);
566 QTreeWidgetItem *item = (*it);
567 QVariant userData = item->data(0, Qt::UserRole);
569 if (!userData.isNull()) {
573 if (item->text(0).contains(filterRegEx)) {
579 visibleGroups.append(item);
580 item->setHidden(
false);
583 if (item->parent() ==
nullptr) {
585 item->setHidden(
false);
589 item->setHidden(
false);
590 if (item->parent()->isHidden()) {
593 item->parent()->setHidden(
false);
594 expanded << item->parent()->text(0);
599 item->setHidden(
true);
608 for (
auto group : visibleGroups) {
609 for (
int i = 0; i <
group->childCount(); i++) {
610 QTreeWidgetItem *child =
group->child(i);
611 if (child->isHidden()) {
614 child->setHidden(
false);
620 for (
int i = 0; i <
n; ++i) {
621 auto item =
m_tree->topLevelItem(i);
622 item->setExpanded(expanded.contains(item->text(0)));
627 if (hiddenCount > 0) {
628 QString headerString = QString(
"Workspaces (%1 filtered)").arg(QString::number(hiddenCount));
629 m_tree->headerItem()->setText(0, headerString);
631 m_tree->headerItem()->setText(0,
"Workspaces");
642 item->setIcon(0, QIcon(WORKSPACE_ICONS.
getIcon(wsID)));
643 }
catch (std::runtime_error &) {
644 docklog.warning() <<
"Cannot find icon for workspace ID '" << wsID <<
"'\n";
652 m_showData =
new QAction(tr(
"Show Data"),
this);
655 m_showInst =
new QAction(tr(
"Show Instrument"),
this);
658 m_plotSpec =
new QAction(tr(
"Plot Spectrum..."),
this);
661 m_plotSpecErr =
new QAction(tr(
"Plot Spectrum with Errors..."),
this);
667 m_colorFill =
new QAction(tr(
"Color Fill Plot"),
this);
673 m_showBoxData =
new QAction(tr(
"Show Box Data Table"),
this);
688 icon.addFile(QString::fromUtf8(
":/SliceViewer/icons/SliceViewerWindow_icon.png"), QSize(), QIcon::Normal,
694 m_showLogs =
new QAction(tr(
"Sample Logs..."),
this);
700 m_showHist =
new QAction(tr(
"Show History"),
this);
706 m_rename =
new QAction(tr(
"Rename"),
this);
709 m_delete =
new QAction(tr(
"Delete"),
this);
723 m_clearUB =
new QAction(tr(
"Clear UB Matrix"),
this);
732 QMenu *sortMenu =
new QMenu(
this);
734 QAction *ascendingSortAction =
new QAction(
"Ascending",
this);
735 QAction *descendingSortAction =
new QAction(
"Descending",
this);
736 QAction *byNameChoice =
new QAction(
"Name",
this);
737 QAction *byLastModifiedChoice =
new QAction(
"Last Modified",
this);
738 QAction *byMemorySize =
new QAction(
"Size",
this);
740 ascendingSortAction->setCheckable(
true);
741 ascendingSortAction->setEnabled(
true);
743 descendingSortAction->setCheckable(
true);
744 descendingSortAction->setEnabled(
true);
746 QActionGroup *sortDirectionGroup =
new QActionGroup(sortMenu);
747 sortDirectionGroup->addAction(ascendingSortAction);
748 sortDirectionGroup->addAction(descendingSortAction);
749 sortDirectionGroup->setExclusive(
true);
750 ascendingSortAction->setChecked(
true);
752 byNameChoice->setCheckable(
true);
753 byNameChoice->setEnabled(
true);
755 byLastModifiedChoice->setCheckable(
true);
756 byLastModifiedChoice->setEnabled(
true);
758 byMemorySize->setCheckable(
true);
759 byMemorySize->setEnabled(
true);
761 QActionGroup *sortChoiceGroup =
new QActionGroup(sortMenu);
762 sortChoiceGroup->addAction(byNameChoice);
763 sortChoiceGroup->addAction(byLastModifiedChoice);
764 sortChoiceGroup->addAction(byMemorySize);
765 sortChoiceGroup->setExclusive(
true);
766 byNameChoice->setChecked(
true);
768 connect(ascendingSortAction, SIGNAL(triggered()),
this, SLOT(
sortAscending()));
769 connect(descendingSortAction, SIGNAL(triggered()),
this, SLOT(
sortDescending()));
770 connect(byNameChoice, SIGNAL(triggered()),
this, SLOT(
chooseByName()));
774 sortMenu->addActions(sortDirectionGroup->actions());
775 sortMenu->addSeparator();
776 sortMenu->addActions(sortChoiceGroup->actions());
785 QVariant userData = item->data(0, Qt::UserRole);
786 if (userData.isNull())
790 while (item->childCount() > 0) {
791 auto *widgetItem = item->takeChild(0);
797 if (
auto group = std::dynamic_pointer_cast<WorkspaceGroup>(
workspace)) {
798 auto members =
group->getAllItems();
799 auto visibleNames = AnalysisDataService::Instance().getObjectNames();
800 for (
const auto &ws : members) {
801 if (std::find(visibleNames.begin(), visibleNames.end(), ws->getName()) != visibleNames.end()) {
802 auto *node =
addTreeEntry(std::make_pair(ws->getName(), ws), item);
805 node->setSelected(
true);
812 }
catch (std::runtime_error &e) {
813 details = QString(
"Error: %1").arg(e.what());
815 QStringList rows = details.split(QLatin1Char(
'\n'), Qt::SkipEmptyParts);
816 rows.append(QString(
"Memory used: ") +
workspace->getMemorySizeAsStr().c_str());
818 auto iend = rows.constEnd();
819 for (
auto itr = rows.constBegin(); itr !=
iend; ++itr) {
821 data->setFlags(Qt::NoItemFlags);
823 item->addChild(data);
849 for (QTreeWidgetItem *item : selected) {
855 auto iend = topLevelItems.end();
856 for (
auto it = topLevelItems.begin(); it !=
iend; ++it) {
858 QString
name = node->text(0);
859 if (expanded.contains(
name))
860 node->setExpanded(
true);
863 node->setSelected(
true);
881 QTreeWidgetItem *parent) {
883 node->setData(0, Qt::UserRole, QVariant::fromValue(item.second));
887 const std::string wsID = item.second->id();
889 idNode->setFlags(Qt::NoItemFlags);
890 node->addChild(idNode);
894 parent->addChild(node);
896 m_tree->addTopLevelItem(node);
908 if (!renamed.isEmpty()) {
909 return std::any_of(renamed.cbegin(), renamed.cend(),
910 [&](
const auto &oldName) { return m_selectedNames.contains(oldName); });
919 auto items =
m_tree->selectedItems();
922 if (items.size() == 1) {
924 auto wsSptr = items.first()->data(0, Qt::UserRole).value<
Workspace_sptr>();
925 auto grpSptr = std::dynamic_pointer_cast<WorkspaceGroup>(wsSptr);
933 }
else if (items.size() >= 2) {
936 m_groupButton->setToolTip(
"Group together two or more selected workspaces");
937 }
else if (items.size() == 0) {
940 m_groupButton->setToolTip(
"Group together two or more selected workspaces");
950 if (items.size() > 0) {
951 auto item = *(items.begin());
970 m_showInst->setEnabled(matrixWS->getInstrument() && !matrixWS->getInstrument()->getName().empty() &&
971 matrixWS->getAxis(1)->isSpectra());
972 menu->addSeparator();
978 bool multipleBins =
false;
980 multipleBins = (matrixWS->blocksize() > 1);
982 const size_t numHist = matrixWS->getNumberHistograms();
983 for (
size_t i = 0; i < numHist; ++i) {
984 if (matrixWS->y(i).size() > 1) {
998 m_colorFill->setEnabled((matrixWS->axes() > 1 && matrixWS->getNumberHistograms() > 1));
1000 menu->addSeparator();
1043 menu->addSeparator();
1062 menu->addSeparator();
1084 QMenu *clearMenu =
new QMenu(tr(
"Clear Options"),
this);
1089 menu->addMenu(clearMenu);
1094 Workspace_sptr ws = AnalysisDataService::Instance().retrieve(wsName);
1097 hasUB = wsIMD->hasOrientedLattice();
1111 if (menuEntryName.isEmpty())
1112 menuEntryName = algorithmString;
1115 QAction *saveAction =
new QAction(menuEntryName,
this);
1116 saveAction->setData(QVariant(algorithmString));
1144 return askUserYesNo(
"Clear Workspaces",
"This will delete all the workspaces, are you sure?");
1162 if (selectedNames.empty())
1178 if (qButtonName ==
"Group") {
1180 }
else if (qButtonName ==
"Ungroup") {
1203 QStringList expanded;
1204 int n =
m_tree->topLevelItemCount();
1205 for (
int i = 0; i <
n; ++i) {
1206 auto item =
m_tree->topLevelItem(i);
1207 if (item->isExpanded()) {
1208 expanded << item->text(0);
1245 m_tree->selectionModel()->clear();
1247 QMenu *menu(
nullptr);
1254 menu =
new QMenu(
this);
1255 menu->setObjectName(
"WorkspaceContextMenu");
1260 if (
auto matrixWS = std::dynamic_pointer_cast<const Mantid::API::MatrixWorkspace>(ws)) {
1262 }
else if (
auto mdeventWS = std::dynamic_pointer_cast<const IMDEventWorkspace>(ws)) {
1264 }
else if (
auto mdWS = std::dynamic_pointer_cast<const IMDWorkspace>(ws)) {
1266 }
else if (
auto peaksWS = std::dynamic_pointer_cast<const IPeaksWorkspace>(ws)) {
1268 }
else if (
auto groupWS = std::dynamic_pointer_cast<const WorkspaceGroup>(ws)) {
1270 }
else if (std::dynamic_pointer_cast<const Mantid::API::ITableWorkspace>(ws)) {
1279 std::vector<std::string> programNames =
1280 (Mantid::Kernel::ConfigService::Instance().getKeys(
"workspace.sendto.name"));
1281 bool firstPass(
true);
1283 for (
const auto &programName : programNames) {
1284 std::string visible =
1285 Mantid::Kernel::ConfigService::Instance().getString(
"workspace.sendto." + programName +
".visible");
1286 std::string target =
1287 Mantid::Kernel::ConfigService::Instance().getString(
"workspace.sendto." + programName +
".target");
1288 if (Mantid::Kernel::ConfigService::Instance().isExecutable(target) && visible ==
"Yes") {
1289 bool compatible(
true);
1290 std::string saveUsing(
1291 Mantid::Kernel::ConfigService::Instance().getString(
"workspace.sendto." + programName +
".saveusing"));
1294 alg->setPropertyValue(
"InputWorkspace",
selectedWsName.toStdString());
1295 }
catch (std::exception &) {
1306 QString
name = QString::fromStdString(programName);
1330 menu->addSeparator();
1335 menu->popup(QCursor::pos());
1358 std::map<std::string, std::string> programKeysAndDetails;
1359 programKeysAndDetails[
"name"] =
m_programName.toStdString();
1363 std::vector<std::string> programKeys = (Mantid::Kernel::ConfigService::Instance().getKeys(
1364 (
"workspace.sendto." + programKeysAndDetails.find(
"name")->second)));
1366 for (
const auto &programKey : programKeys) {
1368 programKeysAndDetails[programKey] = (Mantid::Kernel::ConfigService::Instance().getString(
1369 (
"workspace.sendto." + programKeysAndDetails.find(
"name")->second +
"." + programKey)));
1373 if ((programKeysAndDetails.count(
"name") != 0) && (programKeysAndDetails.count(
"target") != 0) &&
1374 (programKeysAndDetails.count(
"saveusing") != 0)) {
1375 std::string expTarget = expandEnvironmentVariables(programKeysAndDetails.find(
"target")->second);
1377 QFileInfo target(QString::fromStdString(expTarget));
1378 if (target.exists()) {
1381 QString saveUsing = QString::fromStdString(programKeysAndDetails.find(
"saveusing")->second);
1387 Property *prop = alg->getProperty(
"Filename");
1395 alg->setPropertyValue(
"fileName",
"auto_save_" +
selectedWsName.toStdString() + ext);
1398 alg->setPropertyValue(
"InputWorkspace",
selectedWsName.toStdString());
1401 if (programKeysAndDetails.count(
"saveparameters") != 0) {
1402 QString saveParametersGrouped = QString::fromStdString(programKeysAndDetails.find(
"saveparameters")->second);
1403 QStringList saveParameters = saveParametersGrouped.split(
',');
1406 for (
int i = 0; i < saveParameters.size(); i++) {
1407 QStringList sPNameAndDetail = saveParameters[i].split(
'=');
1408 std::string saveParameterName = sPNameAndDetail[0].trimmed().toStdString();
1409 std::string saveParameterDetail = sPNameAndDetail[1].trimmed().toStdString();
1410 if (saveParameterDetail ==
"True")
1411 alg->setProperty(saveParameterName,
true);
1412 else if (saveParameterDetail ==
"False")
1413 alg->setProperty(saveParameterName,
false);
1416 alg->setPropertyValue(saveParameterName, saveParameterDetail);
1425 QString savedFile = QString::fromStdString(alg->getProperty(
"Filename"));
1426 QStringList arguments;
1429 if (programKeysAndDetails.count(
"arguments") != 0) {
1430 QString temp = QString::fromStdString(programKeysAndDetails.find(
"arguments")->second);
1431 temp.replace(QString(
"[file]"), savedFile);
1433 arguments = temp.split(
",");
1435 arguments.insert(0, savedFile);
1438 std::vector<std::string> argumentsV;
1440 for (
int i = 0; i < arguments.size(); i++) {
1441 argumentsV.assign(1, (arguments[i].toStdString()));
1446 Mantid::Kernel::ConfigService::Instance().launchProcess(expTarget, argumentsV);
1447 }
catch (std::runtime_error &) {
1448 QMessageBox::information(
this,
"Error",
1449 "User tried to open program from: " + QString::fromStdString(expTarget) +
1450 " There was an error opening the program. "
1451 "Please check the target and arguments list "
1452 "to ensure that these are correct");
1454 }
catch (std::exception &) {
1455 QMessageBox::information(
this,
"Mantid - Send to Program",
1456 "A file property wasn't found. Please check that the correct" +
1457 QString(
"save algorithm was used.\n(View -> Preferences -> "
1458 "Mantid -> SendTo -> Edit -> SaveUsing)"));
1461 QMessageBox::information(
this,
"Target Path Error",
1462 "User tried to open program from: " + QString::fromStdString(expTarget) +
1463 " The target file path for the program "
1464 "can't be found. Please check that the full "
1483 const bool isAdvanced = type ==
"Advanced";
1487 if (userInput.plots.empty()) {
1490 bool showErrorBars = ((type ==
"Errors") || (type ==
"Advanced" && userInput.errors));
1493 if (userInput.tiled) {
1495 }
else if (userInput.simple || userInput.waterfall) {
1496 if (userInput.isAdvanced) {
1497 const auto advancedUserInput = userInput.advanced.value();
1499 userInput.waterfall, advancedUserInput.logName, advancedUserInput.customLogValues);
1502 userInput.waterfall);
1505 }
else if (userInput.surface) {
1506 const auto advancedUserInput = userInput.advanced.value();
1508 advancedUserInput.axisName, advancedUserInput.logName,
1509 advancedUserInput.customLogValues, advancedUserInput.workspaceNames);
1510 }
else if (userInput.contour) {
1511 const auto advancedUserInput = userInput.advanced.value();
1513 advancedUserInput.axisName, advancedUserInput.logName,
1514 advancedUserInput.customLogValues, advancedUserInput.workspaceNames);
1529 auto items =
m_tree->selectedItems();
1535 QStringList allWsNames;
1537 for (
auto &item : items) {
1540 if (
auto wsGroup = std::dynamic_pointer_cast<WorkspaceGroup>(ws)) {
1541 for (
const auto &
name : wsGroup->getNames())
1542 allWsNames.append(QString::fromStdString(
name));
1544 allWsNames.append(item->text(0));
1548 allWsNames.removeDuplicates();
1555 case Qt::Key_Delete:
1556 case Qt::Key_Backspace:
1571 QMessageBox::information(
this,
"Error", QString(
"Cannot create detectors tables for workspace ") + ws);
IPeaksWorkspace_sptr workspace
This class should be the basis for all customised algorithm dialogs.
Defines a mapping between a workspace ID and a pixmap to use for an icon.
QPixmap getIcon(const std::string &workspaceID) const
Returns an icon for the given ID.
A specialized class for dealing with file properties.
const std::string & getDefaultExt() const
Returns the main file extension that's used.
The Logger class is in charge of the publishing messages from the framework through various channels.
Base class for properties.
EXPORT_OPT_MANTIDQT_COMMON QPixmap getQPixmap(const std::string &name)
Function that returns a QPixmap given a string name.
std::shared_ptr< const IMDEventWorkspace > IMDEventWorkspace_const_sptr
Shared pointer to Mantid::API::IMDEventWorkspace (const version)
std::shared_ptr< IAlgorithm > IAlgorithm_sptr
shared pointer to Mantid::API::IAlgorithm
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
std::shared_ptr< const IMDWorkspace > IMDWorkspace_const_sptr
Shared pointer to the IMDWorkspace base class (const version)
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
std::shared_ptr< IMDWorkspace > IMDWorkspace_sptr
Shared pointer to the IMDWorkspace base class.
std::shared_ptr< const IPeaksWorkspace > IPeaksWorkspace_const_sptr
shared pointer to Mantid::API::IPeaksWorkspace (const version)