Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:13:55

0001 #ifndef GeneratorInterface_Pythia8Interface_SuepShower_h
0002 #define GeneratorInterface_Pythia8Interface_SuepShower_h
0003 
0004 #include <vector>
0005 #include <utility>
0006 #include <cmath>
0007 #include <boost/math/tools/roots.hpp>
0008 #include <boost/bind/bind.hpp>
0009 #include "Pythia8/Pythia.h"
0010 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0011 
0012 class SuepShower {
0013 public:
0014   // Constructor
0015   SuepShower(double mass, double temperature, Pythia8::Rndm* rndmPtr);
0016 
0017   // Empty destructor
0018   ~SuepShower();
0019 
0020   // Method to generate 4-momenta of dark mesons after the showering
0021   std::vector<Pythia8::Vec4> generateShower(double energy);
0022 
0023 private:
0024   // private variables
0025   // Shower parameters
0026   double darkmeson_mass_;
0027   double mass_over_T_;
0028 
0029   // Overall energy of the decaying particle
0030   double mediator_energy_;
0031 
0032   // For the numerical algorithm precision
0033   boost::math::tools::eps_tolerance<double> tolerance_;
0034 
0035   // Several auxiliar variables for generating the 4-momentum of showered particles. Following the naming of Appendix 1 of https://arxiv.org/pdf/1305.5226.pdf
0036   // Median momentum in the M-B distribution
0037   double p_m_;
0038   // Two values of momentum at fMB(x)/fMB(p_m_) = e
0039   double p_plus_, p_minus_;
0040   // Auxiliars: fMB(p_plus_)/f'(p_plus_),  fMB(p_minus_)/f'(p_minus_)
0041   double lambda_plus_, lambda_minus_;
0042   // More auxiliars: lambda_plus_/(p_plus_ + p_minus_), lambda_minus_/(p_plus_ + p_minus_), 1-q_plus_-q_minus_
0043   double q_plus_, q_minus_, q_m_;
0044 
0045   // Pythia random number generator, to get the randomness into the shower
0046   Pythia8::Rndm* fRndmPtr_;
0047 
0048   // Methods
0049   // Maxwell-Boltzmann distribution as a function of |p|, slightly massaged, Eq. 6 of https://arxiv.org/pdf/1305.5226.pdf
0050   const double fMaxwellBoltzmann(double p);
0051   // Maxwell-Boltzmann derivative as a function of |p|, slightly massaged
0052   const double fMaxwellBoltzmannPrime(double p);
0053   // Log(fMaxwellBoltzmann(x)/fMaxwellBoltzmann(xmedian))+1, as a function of |p|, to be solved to find p_plus_, p_minus_
0054   const double logTestFunction(double p);
0055   // Generate the four vector of a particle (dark meson) in the shower
0056   const Pythia8::Vec4 generateFourVector();
0057   // sum(scale*scale*p*p + m*m) - E*E, find roots in scale to reballance momenta and impose E conservation
0058   const double reballanceFunction(double scale, const std::vector<Pythia8::Vec4>& shower);
0059 };
0060 
0061 #endif