Skip to content

Commit

Permalink
Refs #9643. Implemented the conversion from VULCAN offset to Mantid.
Browse files Browse the repository at this point in the history
Also, the geometry file of VULCAN is slightly modified to make the
definition of bank numbers consistent between Mantid and that VULCAN
uses now.

A unit test data file is added, too.
  • Loading branch information
wdzhou committed Jul 7, 2014
1 parent 02d725a commit d0b66ba
Show file tree
Hide file tree
Showing 5 changed files with 63,001 additions and 62,555 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@
#include "MantidGeometry/Instrument.h"
#include "MantidKernel/System.h"

#include "MantidDataObjects/EventWorkspace.h"


namespace Mantid
{
namespace DataHandling
{

enum VULCAN_OFFSET_LEVEL{VULCAN_OFFSET_BANK, VULCAN_OFFSET_MODULE, VULCAN_OFFSET_STACK};

/** Algorithm to load a 5-column ascii .cal file into up to 3 workspaces:
* a GroupingWorkspace, OffsetsWorkspace and/or MaskWorkspace.
*/
Expand All @@ -40,9 +44,6 @@ namespace DataHandling

void getInstrument3WaysInit();

/// Read VULCAN's offset file
void readOffsetFile(DataObjects::OffsetsWorkspace_sptr offsetws, std::string offsetfilename);

Geometry::Instrument_const_sptr getInstrument();

static void readCalFile(const std::string& calFileName,
Expand All @@ -56,6 +57,44 @@ namespace DataHandling
void init();
/// Run the algorithm
void exec();

void processInOutProperites();

/// Set up grouping workspace
void setupGroupingWorkspace();

void generateOffsetsWorkspace();

/// Read VULCAN's offset file
void readOffsetFile(std::map<detid_t, double> &map_detoffset);

void processOffsets(std::map<detid_t, double> map_detoffset);

/// Convert offsets from VUCLAN's offset to Mantid's
void convertOffsets();

Geometry::Instrument_const_sptr m_instrument;

/// Type of grouping
VULCAN_OFFSET_LEVEL m_groupingType;

std::string m_offsetFilename;
std::string m_badPixFilename;

DataObjects::OffsetsWorkspace_sptr m_offsetsWS;
DataObjects::GroupingWorkspace_sptr m_groupWS;
DataObjects::MaskWorkspace_sptr m_maskWS;

// Verification tool
void alignEventWorkspace();

bool m_doAlignEventWS;
DataObjects::EventWorkspace_sptr m_eventWS;

// Map for bank: eff_L and theta (in degree)
std::map<int, std::pair<double, double> > m_effLTheta;


};


Expand Down

0 comments on commit d0b66ba

Please sign in to comment.