StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
DeuteronProduction.h
1 // DeuteronProduction.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2020 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