Skip to content
Snippets Groups Projects
Select Git revision
  • fd064cd63af38b771a92cd5f7a8156c65d3a4c4b
  • master default
  • main protected
3 results

eisnoise.h

  • user avatar
    Carl Philipp Klemm authored
    fd064cd6
    History
    eisnoise.h 1015 B
    #pragma once
    
    #include <eisgenerator/eistype.h>
    #include <vector>
    #include <exception>
    #include <string>
    
    class EisNoise
    {
    private:
    
    	struct Noise
    	{
    		std::string name;
    		fvalue omegaMax;
    		fvalue omegaMin;
    		eis::EisSpectra spectra;
    	};
    	std::vector<Noise> noises;
    
    	static void addImpl(std::vector<eis::DataPoint>& spectra, const Noise& noise, fvalue intensity, bool ignFreq);
    
    	fvalue calcMaxIntensity(std::vector<eis::DataPoint>& spectra);
    
    public:
    	class apply_err: public std::exception
    	{
    		std::string whatStr;
    	public:
    		apply_err(const std::string& whatIn): whatStr(whatIn)
    		{}
    		virtual const char* what() const noexcept override
    		{
    			return whatStr.c_str();
    		}
    	};
    
    	EisNoise(fvalue maxIntensity = -1);
    	~EisNoise() = default;
    
    	void add(std::vector<eis::DataPoint>& spectra, fvalue intensity = 1.0, bool ignFreq = false);
    	void addSpecific(std::vector<eis::DataPoint>& spectra, const std::string& name , fvalue intensity = 1.0,  bool ignFreq = false);
    	std::vector<std::string> getAvailable();
    };