PYTHIA  8.312
DeuteronProduction.h
1 // DeuteronProduction.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2024 Philip Ilten, Torbjorn Sjostrand.
3 // PYTHIA is licenced under the GNU GPL v2 or later, see COPYING for details.
4 // Please respect the MCnet Guidelines, see GUIDELINES for details.
5 
6 #ifndef Pythia8_DeuteronProduction_H
7 #define Pythia8_DeuteronProduction_H
8 
9 #include "Pythia8/Basics.h"
10 #include "Pythia8/Event.h"
11 #include "Pythia8/ParticleData.h"
12 #include "Pythia8/PhysicsBase.h"
13 #include "Pythia8/PythiaStdlib.h"
14 #include "Pythia8/Settings.h"
15 
16 namespace Pythia8 {
17 
18 //==========================================================================
19 
20 // The DeuteronProduction class.
21 
23 
24 public:
25 
26  // Constructor.
27  DeuteronProduction() : valid(true), models(), ids(), parms(), masses(),
28  norm(), mPion(), mSafety(), kMin(), kMax(), kTol(), kSteps() {}
29 
30  // Find settings. Precalculate table used to find momentum shifts.
31  bool init();
32 
33  // Form deuterons in an event.
34  bool combine(Event& event);
35 
36 private:
37 
38  bool valid; // Flag if class has been initialized.
39  vector<int> models; // Cross-section mode per channel.
40  vector<vector<int> > ids; // IDs and charges per channel.
41  vector<vector<double> > parms, masses; // Parameters and masses per channel.
42  double norm; // Overall normalization scale.
43  double mPion; // Mass of the pion.
44  double mSafety; // Safety margin for decays.
45  double kMin, kMax, kTol; // Bracketing/tolerance in k for max.
46  int kSteps; // Number of steps for grid search.
47 
48  // Constants: could only be changed in the code itself.
49  static const int NTRYDECAY; // Number of times to try a decay.
50  static const double WTCORRECTION[11]; // M-generator parameters.
51 
52  // Bind the nucleon-pair combinations.
53  void bind(Event& event, vector<int>& prts);
54 
55  // Build the nucleon-pair combinations and shuffle.
56  void combos(Event& event, vector<int>& prts, vector<pair<int, int> > &cmbs);
57 
58  // Single pion final state fit, equations 10/13/14 of arXiv:1504.07242.
59  double fit(double k, vector<double>& c, int i);
60 
61  // Return the cross-section for a given channel.
62  double sigma(double k, int chn);
63 
64  // N-body decay using the M-generator algorithm.
65  bool decay(Event& event, int idx0, int idx1, int chn);
66 
67  // Helper methods.
68  void maximum(double& k, double& s, int chn); // Find cross-section max.
69  vector<int> parseIds(string line); // Parse the ID strings.
70  vector<double> parseParms(string line); // Parse the parameter strings.
71 
72 };
73 
74 //==========================================================================
75 
76 } // end namespace Pythia8
77 
78 #endif // Pythia8_DeuteronProduction_H
Definition: PhysicsBase.h:27
The Event class holds all info on the generated event.
Definition: Event.h:453
bool combine(Event &event)
Form deuterons in an event.
Definition: DeuteronProduction.cc:152
bool init()
Find settings. Precalculate table used to find momentum shifts.
Definition: DeuteronProduction.cc:34
DeuteronProduction()
Constructor.
Definition: DeuteronProduction.h:27
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
The DeuteronProduction class.
Definition: DeuteronProduction.h:22