Skip to content

Commit

Permalink
refs #4201 minor modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
abuts committed Jan 8, 2012
1 parent 95d60db commit 9f88ac3
Showing 1 changed file with 1 addition and 144 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,150 +161,7 @@ class ConvertToMDEvensHistoWS: public IConvertToMDEventsMethods
}
};


//
//
// //// Equivalent of: this->convertEventList(wi);
// //EventList & el = in_ws->getEventList(wi);
//
// //// We want to bind to the right templated function, so we have to know the type of TofEvent contained in the EventList.
// //boost::function<void ()> func;
// //switch (el.getEventType())
// //{
// //case TOF:
// // func = boost::bind(&ConvertToDiffractionMDWorkspace::convertEventList<TofEvent>, &*this, static_cast<int>(wi));
// // break;
// //case WEIGHTED:
// // func = boost::bind(&ConvertToDiffractionMDWorkspace::convertEventList<WeightedEvent>, &*this, static_cast<int>(wi));
// // break;
// //case WEIGHTED_NOTIME:
// // func = boost::bind(&ConvertToDiffractionMDWorkspace::convertEventList<WeightedEventNoTime>, &*this, static_cast<int>(wi));
// // break;
// //default:
// // throw std::runtime_error("EventList had an unexpected data type!");
// //}
//
// //// Give this task to the scheduler
// //double cost = double(el.getNumberEvents());
// //ts->push( new FunctionTask( func, cost) );
//
// //// Keep a running total of how many events we've added
// //eventsAdded += el.getNumberEvents();
// //if (bc->shouldSplitBoxes(eventsAdded, lastNumBoxes))
// //{
// // // Do all the adding tasks
// // tp.joinAll();
// // // Now do all the splitting tasks
// // ws->splitAllIfNeeded(ts);
// // tp.joinAll();
//
// // // Count the new # of boxes.
// // lastNumBoxes = ws->getBoxController()->getTotalNumMDBoxes();
//
// // eventsAdded = 0;
// //}
//
//
// // tp.joinAll();
// // // Do a final splitting of everything
// // ws->splitAllIfNeeded(ts);
// // tp.joinAll();
// //
// // // Recount totals at the end.
// //// cputim.reset();
// // ws->refreshCache();
// // //TODO: Centroid in parallel, maybe?
// // ws->getBox()->refreshCentroid(NULL);
//
//
//
//};


// // This little dance makes the getting vector of events more general (since you can't overload by return type).
// typename std::vector<T> * events_ptr;
// getEventsFrom(el, events_ptr);
// typename std::vector<T> & events = *events_ptr;
//
// // Iterators to start/end
// typename std::vector<T>::iterator it = events.begin();
// typename std::vector<T>::iterator it_end = events.end();
//
// for (; it != it_end; it++)
// {
// // Get the wavenumber in ang^-1 using the previously calculated constant.
// double wavenumber = wavenumber_in_angstrom_times_tof_in_microsec / it->tof();
//
//
// // Q vector = K_final - K_initial = wavenumber * (output_direction - input_direction)
// coord_t center[3] = {Q_dir_x * wavenumber, Q_dir_y * wavenumber, Q_dir_z * wavenumber};
//
//
// // Push the MDLeanEvent with the same weight
// out_events.push_back( MDE(float(it->weight()), float(it->errorSquared()), center) );
//
// }


//template <class T>
//void ConvertToDiffractionMDWorkspace::convertEventList(int workspaceIndex)
// {
// EventList & el = in_ws->getEventList(workspaceIndex);
// size_t numEvents = el.getNumberEvents();
//
// // Get the position of the detector there.
// std::set<detid_t>& detectors = el.getDetectorIDs();
// if (detectors.size() > 0)
// {
// // The 3D MDEvents that will be added into the MDEventWorkspce
// std::vector<MDE> out_events;
// out_events.reserve( el.getNumberEvents() );
//
//
// // This little dance makes the getting vector of events more general (since you can't overload by return type).
// typename std::vector<T> * events_ptr;
// getEventsFrom(el, events_ptr);
// typename std::vector<T> & events = *events_ptr;
//
// // Iterators to start/end
// typename std::vector<T>::iterator it = events.begin();
// typename std::vector<T>::iterator it_end = events.end();
//
// for (; it != it_end; it++)
// {
// // Get the wavenumber in ang^-1 using the previously calculated constant.
// double wavenumber = wavenumber_in_angstrom_times_tof_in_microsec / it->tof();
//
//
// // Q vector = K_final - K_initial = wavenumber * (output_direction - input_direction)
// coord_t center[3] = {Q_dir_x * wavenumber, Q_dir_y * wavenumber, Q_dir_z * wavenumber};
//
//
// // Push the MDLeanEvent with the same weight
// out_events.push_back( MDE(float(it->weight()), float(it->errorSquared()), center) );
//
// }
//
// // Clear out the EventList to save memory
// if (ClearInputWorkspace)
// {
// // Track how much memory you cleared
// size_t memoryCleared = el.getMemorySize();
// // Clear it now
// el.clear();
// // For Linux with tcmalloc, make sure memory goes back, if you've cleared 200 Megs
// MemoryManager::Instance().releaseFreeMemoryIfAccumulated(memoryCleared, (size_t)2e8);
// }
//
// // Add them to the MDEW
// ws->addEvents(out_events);
// }
//
// }





} // endNamespace MDAlgorithms
} // endNamespace Mantid

Expand Down

0 comments on commit 9f88ac3

Please sign in to comment.