本文整理汇总了C++中typenameMDEventWorkspace::displayNormalizationHisto方法的典型用法代码示例。如果您正苦于以下问题:C++ typenameMDEventWorkspace::displayNormalizationHisto方法的具体用法?C++ typenameMDEventWorkspace::displayNormalizationHisto怎么用?C++ typenameMDEventWorkspace::displayNormalizationHisto使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类typenameMDEventWorkspace
的用法示例。
在下文中一共展示了typenameMDEventWorkspace::displayNormalizationHisto方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slice
//.........这里部分代码省略.........
// Sort boxes by file position IF file backed. This reduces seeking time,
// hopefully.
bool fileBackedWS = bc->isFileBacked();
if (fileBackedWS)
API::IMDNode::sortObjByID(boxes);
auto prog = new Progress(this, 0.0, 1.0, boxes.size());
// The root of the output workspace
MDBoxBase<OMDE, ond> *outRootBox = outWS->getBox();
// if target workspace has events, we should count them as added
uint64_t totalAdded = outWS->getNEvents();
uint64_t numSinceSplit = 0;
// Go through every box for this chunk.
// PARALLEL_FOR_IF( !bc->isFileBacked() )
for (int i = 0; i < int(boxes.size()); i++) {
MDBox<MDE, nd> *box = dynamic_cast<MDBox<MDE, nd> *>(boxes[i]);
// Perform the binning in this separate method.
if (box && !box->getIsMasked()) {
// An array to hold the rotated/transformed coordinates
coord_t outCenter[ond];
const std::vector<MDE> &events = box->getConstEvents();
for (auto it = events.cbegin(); it != events.cend(); ++it) {
// Cache the center of the event (again for speed)
const coord_t *inCenter = it->getCenter();
if (function->isPointContained(inCenter)) {
// Now transform to the output dimensions
m_transformFromOriginal->apply(inCenter, outCenter);
// Create the event
OMDE newEvent(it->getSignal(), it->getErrorSquared(), outCenter);
// Copy extra data, if any
copyEvent(*it, newEvent);
// Add it to the workspace
if (outRootBox->addEvent(newEvent))
numSinceSplit++;
}
}
box->releaseEvents();
// Ask BC if one needs to split boxes
if (obc->shouldSplitBoxes(totalAdded, numSinceSplit, lastNumBoxes))
// if (numSinceSplit > 20000000 || (i == int(boxes.size()-1)))
{
// This splits up all the boxes according to split thresholds and sizes.
Kernel::ThreadScheduler *ts = new ThreadSchedulerFIFO();
ThreadPool tp(ts);
outWS->splitAllIfNeeded(ts);
tp.joinAll();
// Accumulate stats
totalAdded += numSinceSplit;
numSinceSplit = 0;
lastNumBoxes = obc->getTotalNumMDBoxes();
// Progress reporting
if (!fileBackedWS)
prog->report(i);
}
if (fileBackedWS) {
if (!(i % 10))
prog->report(i);
}
} // is box
} // for each box in the vector
prog->report();
outWS->splitAllIfNeeded(nullptr);
// Refresh all cache.
outWS->refreshCache();
// Account for events that were added after the last split
totalAdded += numSinceSplit;
g_log.notice() << totalAdded << " " << OMDE::getTypeName()
<< "s added to the output workspace.\n";
if (outWS->isFileBacked()) {
// Update the file-back-end
g_log.notice() << "Running SaveMD\n";
IAlgorithm_sptr alg = createChildAlgorithm("SaveMD");
alg->setProperty("UpdateFileBackEnd", true);
alg->setProperty("InputWorkspace", outWS);
alg->executeAsChildAlg();
}
// Pass on the display normalization from the input event workspace to the
// output event workspace
IMDEventWorkspace_sptr outEvent =
boost::dynamic_pointer_cast<IMDEventWorkspace>(outWS);
outEvent->setDisplayNormalization(ws->displayNormalization());
outEvent->setDisplayNormalizationHisto(ws->displayNormalizationHisto());
// return the size of the input workspace write buffer to its initial value
// bc->setCacheParameters(sizeof(MDE),writeBufSize);
this->setProperty("OutputWorkspace", outEvent);
delete prog;
}