PYTHIA  8.312
VinciaWeights.h
1 // VinciaWeights.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2024 Peter Skands, 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 header information for the VinciaWeights class.
7 
8 #ifndef Vincia_VinciaWeights_H
9 #define Vincia_VinciaWeights_H
10 
11 #include "Pythia8/Info.h"
12 #include "Pythia8/Settings.h"
13 #include "Pythia8/VinciaCommon.h"
14 #include "Pythia8/Weights.h"
15 
16 namespace Pythia8 {
17 
18 //==========================================================================
19 
20 // Class for storing Vincia weights.
21 
22 class VinciaWeights : public WeightsShower {
23 
24 public:
25 
26  // Friends for internal private members.
27  friend class VinciaFSR;
28  friend class VinciaISR;
29 
30  // Initilize pointers.
31  bool initPtr(Info* infoPtrIn, VinciaCommon* vinComPtrIn);
32 
33  // Initialize.
34  void init( bool doMerging ) override;
35 
36  // Reset all internal values;
37  void clear() override {
38  for (size_t i=0; i < weightValues.size(); ++i) weightValues[i] = 1.;}
39 
40  // Access the weight labels.
41  string weightLabel(int iWeightIn = 0) {
42  return iWeightIn == 0 ? "Vincia" : varLabels[iWeightIn-1];}
43 
44  // Scale the uncertainty band weights.
45  void scaleWeightVar(vector<double> pAccept, bool accept, bool isHard);
46 
47  // Scale the uncertainty band weights if branching is accepted.
48  void scaleWeightVarAccept(vector<double> pAccept);
49 
50  // Scale the uncertainty band weights if branching is rejected.
51  void scaleWeightVarReject(vector<double> pAccept);
52 
53  // Enhanced kernels: reweight if branching is accepted.
54  void scaleWeightEnhanceAccept(double enhanceFac = 1.);
55 
56  // Enhanced kernels: reweight if branching is rejected.
57  void scaleWeightEnhanceReject(double pAcceptUnenhanced,
58  double enhanceFac = 1.);
59 
60  // Helper function for keyword evaluation.
61  int doVarNow(string keyIn, enum AntFunType antFunTypePhys, bool isFSR) ;
62 
63  // Helper function for antenna function.
64  double ant(double antIn, double cNSIn) {return (antIn+cNSIn);}
65 
66 private:
67 
68  // Verbosity.
69  int verbose{0};
70 
71  // Pointers.
72  Settings* settingsPtr{};
73  VinciaCommon* vinComPtr{};
74 
75  // Internal flag.
76  bool isInitPtr{false};
77 
78  // Constants.
79  static const double TINYANT, PACCEPTVARMAX, MINVARWEIGHT;
80 
81  // Parameters taken from settings.
82  bool uncertaintyBands{false};
83  vector<string> varLabels;
84  vector<vector<string> > varKeys;
85  vector<vector<double> > varVals;
86 
87  // Helper parameters.
88  vector<string> allKeywords;
89  map<enum AntFunType, string> antFunTypeToKeyFSR, antFunTypeToKeyISR;
90  bool doMerging{false}, doAlphaSvar{false}, doFiniteVar{false};
91 
92 };
93 
94 //==========================================================================
95 
96 } // end namespace Pythia8
97 
98 #endif // Pythia8_VinciaWeights_H
Purely virtual base class for shower weights.
Definition: Weights.h:144
void scaleWeightVar(vector< double > pAccept, bool accept, bool isHard)
Scale the uncertainty band weights.
Definition: VinciaWeights.cc:175
void scaleWeightEnhanceReject(double pAcceptUnenhanced, double enhanceFac=1.)
Enhanced kernels: reweight if branching is rejected.
Definition: VinciaWeights.cc:208
Definition: Info.h:45
void scaleWeightVarReject(vector< double > pAccept)
Scale the uncertainty band weights if branching is rejected.
Definition: VinciaWeights.cc:193
void scaleWeightVarAccept(vector< double > pAccept)
Scale the uncertainty band weights if branching is accepted.
Definition: VinciaWeights.cc:185
AntFunType
Enumerator for antenna function types, with "void" member NoFun.
Definition: VinciaCommon.h:66
Definition: VinciaFSR.h:582
Definition: VinciaCommon.h:494
Definition: VinciaISR.h:1060
void scaleWeightEnhanceAccept(double enhanceFac=1.)
Enhanced kernels: reweight if branching is accepted.
Definition: VinciaWeights.cc:203
Class for storing Vincia weights.
Definition: VinciaWeights.h:22
bool initPtr(Info *infoPtrIn, VinciaCommon *vinComPtrIn)
Initilize pointers.
Definition: VinciaWeights.cc:29
virtual void init()
Initialize the weights.
Definition: Weights.h:44
double ant(double antIn, double cNSIn)
Helper function for antenna function.
Definition: VinciaWeights.h:64
vector< double > weightValues
Weight values and names.
Definition: Weights.h:132
void clear() override
Reset all internal values;.
Definition: VinciaWeights.h:37
string weightLabel(int iWeightIn=0)
Access the weight labels.
Definition: VinciaWeights.h:41
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
int doVarNow(string keyIn, enum AntFunType antFunTypePhys, bool isFSR)
Helper function for keyword evaluation.
Definition: VinciaWeights.cc:226
Definition: Settings.h:195