Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // VinciaWeights.h is a part of the PYTHIA event generator.
0002 // Copyright (C) 2024 Peter Skands, 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 header information for the VinciaWeights class.
0007 
0008 #ifndef Vincia_VinciaWeights_H
0009 #define Vincia_VinciaWeights_H
0010 
0011 #include "Pythia8/Info.h"
0012 #include "Pythia8/Settings.h"
0013 #include "Pythia8/VinciaCommon.h"
0014 #include "Pythia8/Weights.h"
0015 
0016 namespace Pythia8 {
0017 
0018 //==========================================================================
0019 
0020 // Class for storing Vincia weights.
0021 
0022 class VinciaWeights : public WeightsShower {
0023 
0024 public:
0025 
0026   // Friends for internal private members.
0027   friend class VinciaFSR;
0028   friend class VinciaISR;
0029 
0030   // Initilize pointers.
0031   bool initPtr(Info* infoPtrIn, VinciaCommon* vinComPtrIn);
0032 
0033   // Initialize.
0034   void init( bool doMerging ) override;
0035 
0036   // Reset all internal values;
0037   void clear() override {
0038     for (size_t i=0; i < weightValues.size(); ++i) weightValues[i] = 1.;}
0039 
0040   // Access the weight labels.
0041   string weightLabel(int iWeightIn = 0) {
0042     return iWeightIn == 0 ? "Vincia" : varLabels[iWeightIn-1];}
0043 
0044   // Scale the uncertainty band weights.
0045   void scaleWeightVar(vector<double> pAccept, bool accept, bool isHard);
0046 
0047   // Scale the uncertainty band weights if branching is accepted.
0048   void scaleWeightVarAccept(vector<double> pAccept);
0049 
0050   // Scale the uncertainty band weights if branching is rejected.
0051   void scaleWeightVarReject(vector<double> pAccept);
0052 
0053   // Enhanced kernels: reweight if branching is accepted.
0054   void scaleWeightEnhanceAccept(double enhanceFac = 1.);
0055 
0056   // Enhanced kernels: reweight if branching is rejected.
0057   void scaleWeightEnhanceReject(double pAcceptUnenhanced,
0058     double enhanceFac = 1.);
0059 
0060   // Helper function for keyword evaluation.
0061   int doVarNow(string keyIn, enum AntFunType antFunTypePhys, bool isFSR) ;
0062 
0063   // Helper function for antenna function.
0064   double ant(double antIn, double cNSIn) {return (antIn+cNSIn);}
0065 
0066 private:
0067 
0068   // Verbosity.
0069   int verbose{0};
0070 
0071   // Pointers.
0072   Settings*     settingsPtr{};
0073   VinciaCommon* vinComPtr{};
0074 
0075   // Internal flag.
0076   bool isInitPtr{false};
0077 
0078   // Constants.
0079   static const double TINYANT, PACCEPTVARMAX, MINVARWEIGHT;
0080 
0081   // Parameters taken from settings.
0082   bool uncertaintyBands{false};
0083   vector<string> varLabels;
0084   vector<vector<string> > varKeys;
0085   vector<vector<double> > varVals;
0086 
0087   // Helper parameters.
0088   vector<string> allKeywords;
0089   map<enum AntFunType, string> antFunTypeToKeyFSR, antFunTypeToKeyISR;
0090   bool doMerging{false}, doAlphaSvar{false}, doFiniteVar{false};
0091 
0092 };
0093 
0094 //==========================================================================
0095 
0096 } // end namespace Pythia8
0097 
0098 #endif // Pythia8_VinciaWeights_H