Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // DireMergingHooks.h is a part of the PYTHIA event generator.
0002 // Copyright (C) 2024 Stefan Prestel, 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 // Header file for Dire merging hooks.
0007 
0008 #ifndef Pythia8_DireMergingHooks_H
0009 #define Pythia8_DireMergingHooks_H
0010 
0011 #define DIRE_MERGINGHOOKS_VERSION "2.002"
0012 
0013 #include "Pythia8/Basics.h"
0014 #include "Pythia8/BeamParticle.h"
0015 #include "Pythia8/Event.h"
0016 #include "Pythia8/Info.h"
0017 #include "Pythia8/ParticleData.h"
0018 #include "Pythia8/PartonSystems.h"
0019 #include "Pythia8/PythiaStdlib.h"
0020 #include "Pythia8/Settings.h"
0021 
0022 #include "Pythia8/DireBasics.h"
0023 
0024 namespace Pythia8 {
0025 
0026 class PartonLevel;
0027 
0028 //==========================================================================
0029 
0030 // Declaration of hard process class
0031 // This class holds information on the desired hard 2->2 process
0032 // for the merging.
0033 // This class is a container class for History class use.
0034 
0035 class DireHardProcess : public HardProcess {
0036 
0037 public:
0038 
0039 
0040   // Constructor with core process input
0041   void initOnProcess( string process, ParticleData* particleData);
0042 
0043   // Function to translate the process string (in MG/ME notation)
0044   void translateProcessString( string process);
0045 
0046   // Function to check whether the sets of candidates Pos1, Pos2, together
0047   // with the proposed candidate iPos give an allowed hard process state
0048   bool allowCandidates(int iPos, vector<int> Pos1, vector<int> Pos2,
0049     const Event& event);
0050   // Function to identify the hard subprocess in the current event
0051   void storeCandidates( const Event& event, string process);
0052   // Function to check if the particle event[iPos] matches any of
0053   // the stored outgoing particles of the hard subprocess
0054   bool matchesAnyOutgoing(int iPos, const Event& event);
0055   // Function to check if instead of the particle event[iCandidate], another
0056   // particle could serve as part of the hard process. Assumes that iCandidate
0057   // is already stored as part of the hard process.
0058   bool findOtherCandidates(int iPos, const Event& event, bool doReplace);
0059   // Function to exchange a stored hard process candidate with another choice.
0060   bool exchangeCandidates( vector<int> candidates1, vector<int> candidates2,
0061     unordered_map<int,int> further1, unordered_map<int,int> further2);
0062 
0063 };
0064 
0065 //==========================================================================
0066 
0067 // DireMergingHooks is base class for user input to the merging procedure.
0068 
0069 class DireMergingHooks : public MergingHooks {
0070 
0071 public:
0072 
0073   // Function to return the number of clustering steps for the current event
0074   virtual int getNumberOfClusteringSteps(const Event& event,
0075     bool resetNjetMax = false);
0076 
0077   // Functions used as default merging scales.
0078 
0079   // Function to check if the input particle is a light jet, i.e. should be
0080   // checked against the merging scale defintion.
0081   bool checkAgainstCut( const Particle& particle);
0082   // Function to return the value of the merging scale function in the
0083   // current event.
0084   double tmsNow( const Event& event );
0085   // Find the minimal Lund pT between coloured partons in the event
0086   //double scalems( const Event& event, bool withColour);
0087   double scalems( const Event& event);
0088 
0089   // Functions to steer shower evolution (public to allow for PS plugin).
0090 
0091   // Flag to indicate trial shower usage.
0092   void doIgnoreEmissions( bool doIgnoreIn ) {
0093     doIgnoreEmissionsSave = doIgnoreIn;
0094   }
0095   // Function to allow not counting a trial emission.
0096   bool canVetoEmission() { return !doIgnoreEmissionsSave; }
0097   // Function to check if emission should be rejected.
0098   bool doVetoEmission( const Event& );
0099 
0100   void init();
0101 
0102 protected:
0103 
0104   // Functions to steer merging code.
0105 
0106   // Flag to indicate if events should be vetoed.
0107   void doIgnoreStep( bool doIgnoreIn ) { doIgnoreStepSave = doIgnoreIn; }
0108   // Function to allow event veto.
0109   bool canVetoStep() { return !doIgnoreStepSave; }
0110 
0111 public:
0112 
0113   // Function to check event veto.
0114   virtual bool doVetoStep( const Event& process, const Event& event,
0115     bool doResonance = false );
0116 
0117   // Set starting scales
0118   virtual bool setShowerStartingScales( bool isTrial, bool doMergeFirstEmm,
0119     double& pTscaleIn, const Event& event,
0120     double& pTmaxFSRIn, bool& limitPTmaxFSRin,
0121     double& pTmaxISRIn, bool& limitPTmaxISRin,
0122     double& pTmaxMPIIn, bool& limitPTmaxMPIin );
0123 
0124   bool doMOPSSave;
0125   bool doMOPS() { return doMOPSSave; }
0126 
0127   bool doMEMSave;
0128   bool doMEM() { return doMEMSave; }
0129 
0130   vector<double> stoppingScales() { return stoppingScalesSave; }
0131 
0132 protected:
0133 
0134   // Functions for internal merging scale definions.
0135 
0136   // Function to compute "pythia pT separation" from Particle input
0137   double rhoPythia(const Event& event, int rad, int emt, int rec,
0138     int ShowerType);
0139 
0140   // Function to find a colour (anticolour) index in the input event,
0141   // used to find colour-connected recoilers
0142   int findColour(int col, int iExclude1, int iExclude2,
0143     const Event& event, int type, bool isHardIn);
0144 
0145   bool isInit, isStored;
0146   void store();
0147   void restore();
0148 
0149   // Member variables to store and restore to.
0150   int    nReclusterStore, nRequestedStore, nJetMaxStore, nJetMaxNLOStore,
0151          nMinMPIStore, nJetMaxLocalStore, nJetMaxNLOLocalStore, nHardNowStore,
0152          nJetNowStore;
0153   double pT0ISRStore, pTcutStore, muMIStore, tmsValueStore, tmsValueNowStore,
0154          DparameterStore, muFStore, muRStore, muFinMEStore, muRinMEStore,
0155          pTstore, tmsHardNowStore, tmsNowStore;
0156   bool   doOrderHistoriesStore, doIgnoreEmissionsStore, doIgnoreStepStore,
0157          hasJetMaxLocalStore;
0158   Event inputEventStore;
0159   vector< pair<int,int> > resonancesStore;
0160   HardProcess hardProcessStore;
0161 
0162   vector<double> stoppingScalesSave;
0163 
0164 };
0165 
0166 //==========================================================================
0167 
0168 } // end namespace Pythia8
0169 
0170 #endif // Pythia8_DireMergingHooks_H