Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:06:19

0001 // DeuteronProduction.h is a part of the PYTHIA event generator.
0002 // Copyright (C) 2024 Philip Ilten, Torbjorn Sjostrand.
0003 // PYTHIA is licenced under the GNU GPL v2 or later, see COPYING for details.
0004 // Please respect the MCnet Guidelines, see GUIDELINES for details.
0005 
0006 #ifndef Pythia8_DeuteronProduction_H
0007 #define Pythia8_DeuteronProduction_H
0008 
0009 #include "Pythia8/Basics.h"
0010 #include "Pythia8/Event.h"
0011 #include "Pythia8/ParticleData.h"
0012 #include "Pythia8/PhysicsBase.h"
0013 #include "Pythia8/PythiaStdlib.h"
0014 #include "Pythia8/Settings.h"
0015 
0016 namespace Pythia8 {
0017 
0018 //==========================================================================
0019 
0020 // The DeuteronProduction class.
0021 
0022 class DeuteronProduction : public PhysicsBase {
0023 
0024 public:
0025 
0026   // Constructor.
0027   DeuteronProduction() : valid(true), models(), ids(), parms(), masses(),
0028     norm(), mPion(), mSafety(), kMin(), kMax(), kTol(), kSteps() {}
0029 
0030   // Find settings. Precalculate table used to find momentum shifts.
0031   bool init();
0032 
0033   // Form deuterons in an event.
0034   bool combine(Event& event);
0035 
0036 private:
0037 
0038   bool valid;                            // Flag if class has been initialized.
0039   vector<int> models;                    // Cross-section mode per channel.
0040   vector<vector<int> > ids;              // IDs and charges per channel.
0041   vector<vector<double> > parms, masses; // Parameters and masses per channel.
0042   double norm;                           // Overall normalization scale.
0043   double mPion;                          // Mass of the pion.
0044   double mSafety;                        // Safety margin for decays.
0045   double kMin, kMax, kTol;               // Bracketing/tolerance in k for max.
0046   int kSteps;                            // Number of steps for grid search.
0047 
0048   // Constants: could only be changed in the code itself.
0049   static const int NTRYDECAY;           // Number of times to try a decay.
0050   static const double WTCORRECTION[11]; // M-generator parameters.
0051 
0052   // Bind the nucleon-pair combinations.
0053   void bind(Event& event, vector<int>& prts);
0054 
0055   // Build the nucleon-pair combinations and shuffle.
0056   void combos(Event& event, vector<int>& prts, vector<pair<int, int> > &cmbs);
0057 
0058   // Single pion final state fit, equations 10/13/14 of arXiv:1504.07242.
0059   double fit(double k, vector<double>& c, int i);
0060 
0061   // Return the cross-section for a given channel.
0062   double sigma(double k, int chn);
0063 
0064   // N-body decay using the M-generator algorithm.
0065   bool decay(Event& event, int idx0, int idx1, int chn);
0066 
0067   // Helper methods.
0068   void maximum(double& k, double& s, int chn); // Find cross-section max.
0069   vector<int> parseIds(string line);           // Parse the ID strings.
0070   vector<double> parseParms(string line);      // Parse the parameter strings.
0071 
0072 };
0073 
0074 //==========================================================================
0075 
0076 } // end namespace Pythia8
0077 
0078 #endif // Pythia8_DeuteronProduction_H