Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // PartonSystems.h is a part of the PYTHIA event generator.
0002 // Copyright (C) 2024 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 // This file contains auxiliary classes for the parton-level processes.
0007 // PartonSystem contains info on a single partonic subcollision.
0008 // PartonSystems describes the set of subcollisions in the whole event.
0009 
0010 #ifndef Pythia8_PartonSystems_H
0011 #define Pythia8_PartonSystems_H
0012 
0013 #include "Pythia8/PythiaStdlib.h"
0014 
0015 namespace Pythia8 {
0016 
0017 //==========================================================================
0018 
0019 // The PartonSystem class contains info on an individual singlet.
0020 // Only to be used inside PartonSystems, so no private members.
0021 
0022 class PartonSystem {
0023 
0024 public:
0025 
0026   // Constructors.
0027   PartonSystem() : hard(false), iInA(0), iInB(0), iInRes(0), sHat(0.),
0028     pTHat(0.) {iOut.reserve(10);}
0029 
0030   // Stored quantities.
0031   bool        hard;
0032   int         iInA, iInB, iInRes;
0033   vector<int> iOut;
0034   double      sHat, pTHat;
0035 
0036 };
0037 
0038 //==========================================================================
0039 
0040 // The PartonSystems class describes the whole set of subcollisions.
0041 
0042 class PartonSystems {
0043 
0044 public:
0045 
0046   // Constructor.
0047   PartonSystems() {systems.resize(0);}
0048 
0049   // Reset system list to empty.
0050   void clear() {systems.resize(0);}
0051 
0052   // Add new subsystem to list; return its index. Number of subsystems.
0053   int addSys() {systems.push_back(PartonSystem());
0054     return systems.size() - 1;}
0055   int sizeSys() const {return systems.size();}
0056 
0057   // Set, add or replace info to one system.
0058   void setHard(int iSys, bool hard) {systems[iSys].hard = hard;}
0059   void setInA(int iSys, int iPos) {systems[iSys].iInA = iPos;}
0060   void setInB(int iSys, int iPos) {systems[iSys].iInB = iPos;}
0061   void setInRes(int iSys, int iPos) {systems[iSys].iInRes = iPos;}
0062   void addOut(int iSys, int iPos) {systems[iSys].iOut.push_back(iPos);}
0063   void popBackOut(int iSys) {systems[iSys].iOut.pop_back();}
0064   void setOut(int iSys, int iMem, int iPos) {systems[iSys].iOut[iMem] = iPos;}
0065   void replace(int iSys, int iPosOld, int iPosNew);
0066   void setSHat(int iSys, double sHatIn) {systems[iSys].sHat = sHatIn;}
0067   void setPTHat(int iSys, double pTHatIn) {systems[iSys].pTHat = pTHatIn;}
0068   void setSizeSys(int iSize) {systems.resize(iSize);}
0069 
0070   // Get info on one system.
0071   bool hasInAB(int iSys)         const {return ( (systems[iSys].iInA > 0)
0072                                         && (systems[iSys].iInB > 0) ) ;}
0073   bool hasInRes(int iSys)        const {return (systems[iSys].iInRes > 0);}
0074   bool getHard(int iSys)         const {return systems[iSys].hard;}
0075   int getInA(int iSys)           const {return systems[iSys].iInA;}
0076   int getInB(int iSys)           const {return systems[iSys].iInB;}
0077   int getInRes(int iSys)         const {return systems[iSys].iInRes;}
0078   int sizeOut(int iSys)          const {return systems[iSys].iOut.size();}
0079   int getOut(int iSys, int iMem) const {return systems[iSys].iOut[iMem];}
0080   int sizeAll(int iSys)          const {return (systems[iSys].iOut.size()
0081       + (hasInAB(iSys) ? 2 : 0) + (hasInRes(iSys) ? 1 : 0));}
0082   int getAll(int iSys, int iMem) const;
0083   double getSHat(int iSys)       const {return systems[iSys].sHat;}
0084   double getPTHat(int iSys)      const {return systems[iSys].pTHat;}
0085 
0086   // Find system of given outgoing parton, optionally also incoming one.
0087   int getSystemOf(int iPos, bool alsoIn = false) const;
0088 
0089   // Find iOut index of given system and event record index
0090   int getIndexOfOut(int iSys, int iPos) const;
0091 
0092   // List all current systems.
0093   void list() const;
0094 
0095   // Remove the last system.
0096   void popBack() { systems.pop_back(); }
0097 
0098 private:
0099 
0100   // List of all separate partonic subsystems.
0101   vector<PartonSystem> systems;
0102 
0103 };
0104 
0105 //==========================================================================
0106 
0107 } // end namespace Pythia8
0108 
0109 #endif // Pythia8_PartonSystems_H