StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
PartonSystems.h
1 // PartonSystems.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 // This file contains auxiliary classes for the parton-level processes.
7 // PartonSystem contains info on a single partonic subcollision.
8 // PartonSystems describes the set of subcollisions in the whole event.
9 
10 #ifndef Pythia8_PartonSystems_H
11 #define Pythia8_PartonSystems_H
12 
13 #include "Pythia8/PythiaStdlib.h"
14 
15 namespace Pythia8 {
16 
17 //==========================================================================
18 
19 // The PartonSystem class contains info on an individual singlet.
20 // Only to be used inside PartonSystems, so no private members.
21 
22 class PartonSystem {
23 
24 public:
25 
26  // Constructors.
27  PartonSystem() : hard(false), iInA(0), iInB(0), iInRes(0), sHat(0.),
28  pTHat(0.) {iOut.reserve(10);}
29 
30  // Stored quantities.
31  bool hard;
32  int iInA, iInB, iInRes;
33  vector<int> iOut;
34  double sHat, pTHat;
35 
36 };
37 
38 //==========================================================================
39 
40 // The PartonSystems class describes the whole set of subcollisions.
41 
42 class PartonSystems {
43 
44 public:
45 
46  // Constructor.
47  PartonSystems() {systems.resize(0);}
48 
49  // Reset system list to empty.
50  void clear() {systems.resize(0);}
51 
52  // Add new subsystem to list; return its index. Number of subsystems.
53  int addSys() {systems.push_back(PartonSystem());
54  return systems.size() - 1;}
55  int sizeSys() const {return systems.size();}
56 
57  // Set, add or replace info to one system.
58  void setHard(int iSys, bool hard) {systems[iSys].hard = hard;}
59  void setInA(int iSys, int iPos) {systems[iSys].iInA = iPos;}
60  void setInB(int iSys, int iPos) {systems[iSys].iInB = iPos;}
61  void setInRes(int iSys, int iPos) {systems[iSys].iInRes = iPos;}
62  void addOut(int iSys, int iPos) {systems[iSys].iOut.push_back(iPos);}
63  void popBackOut(int iSys) {systems[iSys].iOut.pop_back();}
64  void setOut(int iSys, int iMem, int iPos) {systems[iSys].iOut[iMem] = iPos;}
65  void replace(int iSys, int iPosOld, int iPosNew);
66  void setSHat(int iSys, double sHatIn) {systems[iSys].sHat = sHatIn;}
67  void setPTHat(int iSys, double pTHatIn) {systems[iSys].pTHat = pTHatIn;}
68  void setSizeSys(int iSize) {systems.resize(iSize);}
69 
70  // Get info on one system.
71  bool hasInAB(int iSys) const {return ( (systems[iSys].iInA > 0)
72  && (systems[iSys].iInB > 0) ) ;}
73  bool hasInRes(int iSys) const {return (systems[iSys].iInRes > 0);}
74  bool getHard(int iSys) const {return systems[iSys].hard;}
75  int getInA(int iSys) const {return systems[iSys].iInA;}
76  int getInB(int iSys) const {return systems[iSys].iInB;}
77  int getInRes(int iSys) const {return systems[iSys].iInRes;}
78  int sizeOut(int iSys) const {return systems[iSys].iOut.size();}
79  int getOut(int iSys, int iMem) const {return systems[iSys].iOut[iMem];}
80  int sizeAll(int iSys) const {return (systems[iSys].iOut.size()
81  + (hasInAB(iSys) ? 2 : 0) + (hasInRes(iSys) ? 1 : 0));}
82  int getAll(int iSys, int iMem) const;
83  double getSHat(int iSys) const {return systems[iSys].sHat;}
84  double getPTHat(int iSys) const {return systems[iSys].pTHat;}
85 
86  // Find system of given outgoing parton, optionally also incoming one.
87  int getSystemOf(int iPos, bool alsoIn = false) const;
88 
89  // Find iOut index of given system and event record index
90  int getIndexOfOut(int iSys, int iPos) const;
91 
92  // List all current systems.
93  void list() const;
94 
95  // Remove the last system.
96  void popBack() { systems.pop_back(); }
97 
98 private:
99 
100  // List of all separate partonic subsystems.
101  vector<PartonSystem> systems;
102 
103 };
104 
105 //==========================================================================
106 
107 } // end namespace Pythia8
108 
109 #endif // Pythia8_PartonSystems_H