Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-06-26 07:05:02

0001 //
0002 // Created by romanov on 8/30/21.
0003 //
0004 
0005 #ifndef EICAFTERBURNER_SMEARER_HH
0006 #define EICAFTERBURNER_SMEARER_HH
0007 
0008 #include <memory>
0009 
0010 #include <gsl/gsl_rng.h>
0011 #include <gsl/gsl_randist.h>
0012 
0013 namespace ab {
0014     //! supported function distributions
0015     enum class SmearFuncs
0016     {
0017         /** uniform distribution with half width set via set_vertex_distribution_width() */
0018         Uniform,
0019 
0020         /** normal distribution with sigma width set via set_vertex_distribution_width() */
0021         Gauss
0022     };
0023 
0024     class Smearer {
0025 
0026     public:
0027 
0028         explicit Smearer(unsigned int seed);
0029 
0030         double smear(double position, double width, SmearFuncs dist=SmearFuncs::Gauss) const;
0031 
0032         double gauss(double mean, double width) const;
0033 
0034         double gauss(double width) const;
0035 
0036     private:
0037         std::unique_ptr<gsl_rng> m_generator;
0038     };
0039 
0040     /// SmearFunc-s to std::string conversion
0041     std::string smear_func_to_str(ab::SmearFuncs smear_func);
0042 }
0043 
0044 
0045 #endif //EICAFTERBURNER_SMEARER_HH