[1] | 1 | // PartonSystems.h is a part of the PYTHIA event generator. |
---|
| 2 | // Copyright (C) 2012 Torbjorn Sjostrand. |
---|
| 3 | // PYTHIA is licenced under the GNU GPL version 2, 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 "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() : iInA(0), iInB(0), sHat(0.) {iOut.reserve(10);} |
---|
| 28 | |
---|
| 29 | // Stored quantities. |
---|
| 30 | int iInA, iInB; |
---|
| 31 | vector<int> iOut; |
---|
| 32 | double sHat, pTHat; |
---|
| 33 | |
---|
| 34 | }; |
---|
| 35 | |
---|
| 36 | //========================================================================== |
---|
| 37 | |
---|
| 38 | // The PartonSystems class describes the whole set of subcollisions. |
---|
| 39 | |
---|
| 40 | class PartonSystems { |
---|
| 41 | |
---|
| 42 | public: |
---|
| 43 | |
---|
| 44 | // Constructor. |
---|
| 45 | PartonSystems() {systems.resize(0);} |
---|
| 46 | |
---|
| 47 | // Reset system list to empty. |
---|
| 48 | void clear() {systems.resize(0);} |
---|
| 49 | |
---|
| 50 | // Add new subsystem to list; return its index. Number of subsystems. |
---|
| 51 | int addSys() {systems.push_back(PartonSystem()); |
---|
| 52 | return systems.size() - 1;} |
---|
| 53 | int sizeSys() const {return systems.size();} |
---|
| 54 | |
---|
| 55 | // Set, add or replace info to one system. |
---|
| 56 | void setInA(int iSys, int iPos) {systems[iSys].iInA = iPos;} |
---|
| 57 | void setInB(int iSys, int iPos) {systems[iSys].iInB = iPos;} |
---|
| 58 | void addOut(int iSys, int iPos) {systems[iSys].iOut.push_back(iPos);} |
---|
| 59 | void setOut(int iSys, int iMem, int iPos) {systems[iSys].iOut[iMem] = iPos;} |
---|
| 60 | void replace(int iSys, int iPosOld, int iPosNew); |
---|
| 61 | void setSHat(int iSys, double sHatIn) {systems[iSys].sHat = sHatIn;} |
---|
| 62 | void setPTHat(int iSys, double pTHatIn) {systems[iSys].pTHat = pTHatIn;} |
---|
| 63 | |
---|
| 64 | // Get info on one system. |
---|
| 65 | bool hasInAB(int iSys) const {return ( (systems[iSys].iInA > 0) |
---|
| 66 | || (systems[iSys].iInB > 0) ) ;} |
---|
| 67 | int getInA(int iSys) const {return systems[iSys].iInA;} |
---|
| 68 | int getInB(int iSys) const {return systems[iSys].iInB;} |
---|
| 69 | int sizeOut(int iSys) const {return systems[iSys].iOut.size();} |
---|
| 70 | int getOut(int iSys, int iMem) const {return systems[iSys].iOut[iMem];} |
---|
| 71 | int sizeAll(int iSys) const {return (hasInAB(iSys)) |
---|
| 72 | ? systems[iSys].iOut.size() + 2 : systems[iSys].iOut.size();} |
---|
| 73 | int getAll(int iSys, int iMem) const; |
---|
| 74 | double getSHat(int iSys) const {return systems[iSys].sHat;} |
---|
| 75 | double getPTHat(int iSys) const {return systems[iSys].pTHat;} |
---|
| 76 | |
---|
| 77 | // Find system of given outgoing parton, optionally also incoming one. |
---|
| 78 | int getSystemOf(int iPos, bool alsoIn = false) const; |
---|
| 79 | |
---|
| 80 | // Find iOut index of given system and event record index |
---|
| 81 | int getIndexOfOut(int iSys, int iPos) const; |
---|
| 82 | |
---|
| 83 | // List all current systems. |
---|
| 84 | void list(ostream& os = cout) const; |
---|
| 85 | |
---|
| 86 | private: |
---|
| 87 | |
---|
| 88 | // List of all separate partonic subsystems. |
---|
| 89 | vector<PartonSystem> systems; |
---|
| 90 | |
---|
| 91 | }; |
---|
| 92 | |
---|
| 93 | //========================================================================== |
---|
| 94 | |
---|
| 95 | } // end namespace Pythia8 |
---|
| 96 | |
---|
| 97 | #endif // Pythia8_PartonSystems_H |
---|