Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-10-16 08:19:02

0001 #ifndef FLOWAFTERBURNER_AFTERBURNERALGO_H
0002 #define FLOWAFTERBURNER_AFTERBURNERALGO_H
0003 
0004 #include <string>
0005 #include <iostream>
0006 
0007 namespace CLHEP
0008 {
0009   class HepRandomEngine;
0010 }
0011 
0012 class AfterburnerAlgo
0013 {
0014  public:
0015     //! flowAfterburner algorithms
0016     //! minbias_algorithm: standard flowAfterburner algorithm
0017     //! minbias_v2_algorithm: flowAfterburner algorithm with v2 only
0018     //! custom_algorithm: user defined flowAfterburner algorithm
0019     enum flowAfterburnerAlgorithm
0020     {
0021         minbias_algorithm,
0022         minbias_v2_algorithm,
0023         custom_algorithm
0024     }; // flowAfterburner algorithms
0025     
0026     AfterburnerAlgo() = default;
0027     explicit AfterburnerAlgo(flowAfterburnerAlgorithm algorithm = minbias_algorithm);
0028     
0029     ~AfterburnerAlgo() = default;
0030 
0031     void print( std::ostream &os = std::cout) const; // debugging output
0032 
0033     // set by an event
0034     void set_impact_parameter(double b)
0035     {
0036       m_impact_parameter = b;
0037     }
0038 
0039 
0040     // to scale the calculated vn values by a constant factor
0041     // only 1 harmonic ( set to 0 to disable ) or all harmonics
0042     void set_single_scale_N( const unsigned int n, const float scale ); 
0043     void set_scale_all( const float scale ); // set scale for all harmonics
0044     
0045     void enable_fluctuations(bool enable = true) { _do_fluctuations = enable; }
0046 
0047     void calc_flow(double eta, double pt, CLHEP::HepRandomEngine* engine = nullptr);
0048     void flucatate( CLHEP::HepRandomEngine* engine, float &v1, float &v2, float &v3, float &v4, float &v5, float &v6) const; // implements event-by-event fluctuations flow
0049 
0050     // getter
0051     float get_vn(unsigned int n) const;
0052 
0053     static std::string getAlgoName(flowAfterburnerAlgorithm algo);
0054     static flowAfterburnerAlgorithm getAlgoFromName(const std::string &name);
0055 
0056  private:
0057 
0058     flowAfterburnerAlgorithm m_algorithm = minbias_algorithm; // flowAfterburner algorithm
0059     double m_impact_parameter = 0.0; // impact parameter in fm
0060     float m_vn[6] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; // v1 to v6
0061     float m_vn_scalefactors[6] = {1.0, 1.0, 1.0, 1.0, 1.0, 1.0}; // scale factors for v1 to v6
0062     bool _do_fluctuations = false; // enable or disable event-by-event fluctuations flow
0063 
0064     static float calc_v2(double b, double eta, double pt);
0065 
0066 
0067 };
0068 
0069 #endif // FLOWAFTERBURNER_AFTERBURNERALGO_H