Skip to content

Commit

Permalink
Re #10498 fixing conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
raquelalvarezbanos committed Dec 5, 2014
2 parents 0b4d7b2 + f7b1550 commit 7ca1a6c
Show file tree
Hide file tree
Showing 4 changed files with 365 additions and 103 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Mantid
/**Algorithm for calculating Muon spectra.
@author Raquel Alvarez, ISIS, RAL
@date 1/12/2011
@date 1/12/2014
Copyright © 2014-11 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge National Laboratory & European Spallation Source
Expand All @@ -39,12 +39,12 @@ namespace Mantid
{
public:
/// Default constructor
PhaseQuadMuon() : API::Algorithm(), m_muLife(2.19703), m_bigNumber(1e10) {};
PhaseQuadMuon() : API::Algorithm(), m_muLife(2.19703), m_bigNumber(1e10), m_tPulseOver(0), m_pulseTail(182), m_poissonLim(30), m_pulseTwo(0.325) {};
/// Destructor
virtual ~PhaseQuadMuon() {};
/// Algorithm's name for identification overriding a virtual method
virtual const std::string name() const { return "PhaseQuad";}
///Summary of algorithms purpose
///Summary of algorithm's purpose
virtual const std::string summary() const {return "Calculate Muon squashograms from InputWorkspace and PhaseTable.";}

/// Algorithm's version for identification overriding a virtual method
Expand All @@ -54,57 +54,62 @@ namespace Mantid

private:

class HistData { // TODO: do I need all the members?
class HistData {
public:
bool detOK; // Detector is OK
double n0; // Detector n0
double alpha; // Detector efficiency
double phi; // Detector phase
double lag; // Detector time-shift
double dead; // Dead TODO remove if not used
double deadm; // Dead TODO remove if not used
double chisq; // Of silver fit TODO remove if not used
};

/// Initialise the properties
void init();
/// Run the algorithm
void exec();
/// Convert X units from micro-secs to nano-secs and shift to start at t=0
void convertToNanoSecs(API::MatrixWorkspace_sptr inputWs);
/// Convert X units from nano-secs to micro-secs and shift back
void convertToMicroSecs (API::MatrixWorkspace_sptr inputWs);
/// Load the Phase Table
void loadPhaseTable(API::ITableWorkspace_sptr phaseTable);
void loadPhaseTable(API::ITableWorkspace_sptr phaseTable, API::ITableWorkspace_sptr deadTimeTable);
/// Load the Phase List
void loadPhaseList(const std::string& filename);
void loadPhaseList(const std::string& filename, API::ITableWorkspace_sptr deadTimeTable);
/// Apply dead time correction
void deadTimeCorrection(API::MatrixWorkspace_sptr inputWs, API::ITableWorkspace_sptr deadTimeTable, API::MatrixWorkspace_sptr& tempWs);
/// Rescale detector efficiency to maximum value
void normaliseAlphas (std::vector<HistData>& m_histData);
/// Remove exponential decay from input histograms
void loseExponentialDecay (API::MatrixWorkspace_sptr inputWs, API::MatrixWorkspace_sptr outputWs);
void loseExponentialDecay (API::MatrixWorkspace_sptr tempWs);
/// Create squashograms
void squash(API::MatrixWorkspace_sptr tempWs, API::MatrixWorkspace_sptr outputWs);
void squash(const API::MatrixWorkspace_sptr tempWs, API::MatrixWorkspace_sptr outputWs);
/// Put back in exponential decay
void regainExponential(API::MatrixWorkspace_sptr outputWs);
/// Muon lifetime
double m_muLife;
/// Maximum counts expected
double m_bigNumber;
/// Pulse definitely finished by here (bin no)
int m_tPulseOver;
/// Number of bins to exclude after lag-time (ie pulse arrival time)
double m_pulseTail;
/// Poisson limit
double m_poissonLim;
/// Time (microsec) by which a well-def'd point in the first proton/pion pulse leads its counterpart in the second
double m_pulseTwo;
/// Number of input histograms
int m_nHist;
/// Number of datapoints per histogram
int m_nData;
/// TODO: remove if not necessary
/// Time resolution
double m_res;
/// Mean of time-shifts TODO: remove if not necessary
/// Mean of time-shifts
double m_meanLag;
/// Good muons from here on (bin no) TODO: remove if not necessary
size_t m_tValid;
/// Pulse definitely finished by here (bin no) TODO: remove if not necessary
size_t m_tNoPulse;
/// Double-pulse flag TODO: remove if not necessary
/// Good muons from here on (bin no). Unused now but can be needed in the future
int m_tValid;
/// Double-pulse flag
bool m_isDouble;
/// Muon decay curve TODO: remove if not necessary
double m_tau;
/// Freq (of silver run) TODO: remove if not necessary
double m_w;
/// Muon lifetime
double m_muLife;
/// Poisson limit TODO: remove if not necessary
double m_poissonLim;
/// Maximum counts expected
double m_bigNumber;
/// Minimum value of t
double m_tMin;
/// Vector of detector data
std::vector<HistData> m_histData;
};
Expand Down

0 comments on commit 7ca1a6c

Please sign in to comment.