StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Vincia.cc
1 // VinciaCommon.cc is a part of the PYTHIA event generator.
2 // Copyright (C) 2020 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 // Function definitions (not found in the headers) for the Vincia class.
7 
8 #include "Pythia8/Vincia.h"
9 #include "Pythia8/Merging.h"
10 #include "Pythia8/MergingHooks.h"
11 
12 namespace Pythia8 {
13 
14 //==========================================================================
15 
16 // Vincia parton shower class.
17 
18 //--------------------------------------------------------------------------
19 
20 // Initialize.
21 
22 bool Vincia::init(MergingPtr mrgPtrIn, MergingHooksPtr mrgHooksPtrIn,
23  PartonVertexPtr partonVertexPtrIn,
24  WeightContainer* weightContainerPtrIn) {
25 
26  // Clear Vincia's register of PhysicsBase objects
27  subObjects.clear();
28 
29  // Set and register merging pointers
30  mergingPtr = mrgPtrIn;
31  if ( mergingPtr ) registerSubObject(*mergingPtr);
32  mergingHooksPtr = mrgHooksPtrIn;
33  if ( mergingHooksPtr ) registerSubObject(*mergingHooksPtr);
34 
35  // Create and register VinciaFSR and VinciaISR instances
36  timesPtr = make_shared<VinciaFSR>() ;
37  registerSubObject(*timesPtr);
38  spacePtr = make_shared<VinciaISR>() ;
39  registerSubObject(*spacePtr);
40  timesDecPtr = timesPtr;
41 
42  // Set pointers in showers.
43  timesPtr->initPtrs( mergingHooksPtr, partonVertexPtrIn,
44  weightContainerPtrIn);
45  spacePtr->initPtrs( mergingHooksPtr, partonVertexPtrIn,
46  weightContainerPtrIn);
47 
48  // Verbosity level.
49  setVerbose(settingsPtr->mode("Vincia:verbose"));
50  if (verbose >= quiteloud) printOut(__METHOD_NAME__, "setting pointers...");
51 
52  // Init FSR shower pointers and default settings, beyond those set
53  // by the non-virtual TimeShower::initPtr().
54  timesPtr->initVinciaPtrs(&colour,spacePtr,&qedShower,&mecs,
55  &resolution, &vinCom,&vinWeights);
56 
57  // Init ISR shower pointers and default settings, beyond those set
58  // by the non-virtual SpaceShower::initPtr().
59  spacePtr->initVinciaPtrs(&colour,timesPtr,&qedShower,&mecs,
60  &resolution, &vinCom,&vinWeights);
61 
62  // FSR and ISR antenna sets.
63  antennaSetFSR.initPtr(infoPtr, &dglap);
64  antennaSetISR.initPtr(infoPtr, &dglap);
65 
66  // QED Shower module.
67  qedShower.initPtr(infoPtr, &vinCom);
68 
69  // Hand antenna set pointers to shower and matching objects.
70  timesPtr->initAntPtr(&antennaSetFSR);
71  spacePtr->initAntPtr(&antennaSetISR);
72  mecs.initAntPtr(&antennaSetFSR, &antennaSetISR);
73 
74  // Set SLHA pointer
75  slhaPtr = coupSUSYPtr->slhaPtr;
76 
77  // Load the matrix element correction plugin.
78  string melib = settingsPtr->word("Vincia:MEplugin");
79  if (melib.size() > 0)
80  mg5mes = ShowerMEsPlugin("libpythia8mg5" + melib + ".so");
81 
82  // Pass pointers on to objects that require them.
83  resolution.initPtr(settingsPtr);
84  rambo.initPtr(rndmPtr);
85  vinCom.initPtr(infoPtr);
86  mg5mes.initPtrVincia(infoPtr, slhaPtr, &vinCom);
87  mecs.initPtr(infoPtr, &mg5mes, &vinCom);
88  colour.initPtr(infoPtr);
89  vinWeights.initPtr(infoPtr, &vinCom);
90 
91  // Now set tune parameters
92  bool vinciaOn = settingsPtr->mode("PartonShowers:model") == 2;
93  int baseTune = settingsPtr->mode("Vincia:Tune");
94  if (vinciaOn && baseTune >= 0) {
95  // Store user-specified settings before overwriting with tune parameters
96  vector<string> userSettings = settingsPtr->getReadHistory();
97  if (initTune(baseTune)) {
98  // Reapply user settings
99  for (int i=0; i<(int)userSettings.size(); ++i) {
100  string lineNow = userSettings[i];
101  string lineNowLower = toLower(lineNow);
102  if (lineNowLower.find("tune:ee") == string::npos &&
103  lineNowLower.find("tune:pp") == string::npos)
104  settingsPtr->readString(lineNow);
105  }
106  }
107  }
108 
109  // Initialise Vincia auxiliary classes (showers initialised by Pythia)
110  vinCom.init();
111  resolution.init();
112  colour.init();
113  vinWeights.init();
114 
115  // MECs depend on Pythia/SLHA Couplings
116  mecs.init();
117 
118  // Print VINCIA header and list of parameters
119  if (verbose >= 1 && vinciaOn) timesPtr->header();
120 
121  // Verbose output
122  if(verbose >= veryloud) printOut(__METHOD_NAME__, "end --------------");
123  return true;
124 
125 }
126 
127 //--------------------------------------------------------------------------
128 
129 // Vincia tune settings.
130 
131 bool Vincia::initTune(int iTune) {
132 
133  // iTune = 0 : default Vincia tune from Pythia 8.302
134  if (iTune == 0) {
135  // Z fractions in string breaks
136  settingsPtr->parm("StringZ:aLund ", 0.55 );
137  settingsPtr->parm("StringZ:bLund ", 0.78 );
138  settingsPtr->parm("StringZ:aExtraDiquark ", 0.90 );
139  // Z fractions for heavy quarks
140  settingsPtr->parm("StringZ:rFactC ", 1.15 );
141  settingsPtr->parm("StringZ:rFactB ", 0.85 );
142  // pT in string breaks
143  settingsPtr->parm("StringPT:sigma", 0.305);
144  settingsPtr->parm("StringPT:enhancedFraction", 0.01);
145  settingsPtr->parm("StringPT:enhancedWidth", 2.0);
146  // String breakup flavour parameters
147  settingsPtr->parm("StringFlav:probStoUD ", 0.205);
148  settingsPtr->parm("StringFlav:mesonUDvector ", 0.42 );
149  settingsPtr->parm("StringFlav:mesonSvector ", 0.53 );
150  settingsPtr->parm("StringFlav:mesonCvector ", 1.3 );
151  settingsPtr->parm("StringFlav:mesonBvector ", 2.2 );
152  settingsPtr->parm("StringFlav:probQQtoQ ", 0.077);
153  settingsPtr->parm("StringFlav:probSQtoQQ ", 1.0 );
154  settingsPtr->parm("StringFlav:probQQ1toQQ0 ", 0.025);
155  settingsPtr->parm("StringFlav:etaSup ", 0.5 );
156  settingsPtr->parm("StringFlav:etaPrimeSup ", 0.1 );
157  settingsPtr->parm("StringFlav:decupletSup ", 1.0 );
158  settingsPtr->parm("StringFlav:popcornSpair ", 0.75 );
159  settingsPtr->parm("StringFlav:popcornSmeson ", 0.75 );
160  // Primordial kT
161  settingsPtr->parm("BeamRemnants:primordialKThard ", 0.4 );
162  settingsPtr->parm("BeamRemnants:primordialKTsoft ", 0.25);
163  // MB/UE tuning parameters (MPI)
164  // Use a "low" alphaS and 2-loop running everywhere, also for MPI
165  settingsPtr->parm("SigmaProcess:alphaSvalue ", 0.119);
166  settingsPtr->mode("SigmaProcess:alphaSorder ", 2);
167  settingsPtr->parm("MultiPartonInteractions:alphaSvalue", 0.119);
168  settingsPtr->mode("MultiPartonInteractions:alphaSorder", 2);
169  settingsPtr->parm("MultiPartonInteractions:pT0ref ", 2.24);
170  settingsPtr->parm("MultiPartonInteractions:expPow ", 1.75);
171  settingsPtr->parm("MultiPartonInteractions:ecmPow ", 0.21);
172  // Use PYTHIA 8's baseline CR model
173  settingsPtr->flag("ColourReconnection:reconnect", true);
174  settingsPtr->parm("ColourReconnection:range ", 1.75);
175  // Diffraction: switch off Pythia's perturbative MPI
176  // (colours in diffractive systems not yet handled by Vincia)
177  settingsPtr->parm("Diffraction:mMinPert", 1000000.0);
178  return true;
179  }
180  // Unknown iTune.
181  else return false;
182 }
183 
184 //--------------------------------------------------------------------------
185 
186 // Automatically set verbose level in all members.
187 
188 void Vincia::setVerbose(int verboseIn) {
189 
190  verbose = verboseIn;
191  vinCom.setVerbose(verboseIn);
192  resolution.setVerbose(verboseIn);
193  timesPtr->setVerbose(verboseIn);
194  qedShower.setVerbose(verboseIn);
195  spacePtr->setVerbose(verboseIn);
196  colour.setVerbose(verboseIn);
197  mg5mes.setVerboseVincia(verboseIn);
198  mecs.setVerbose(verboseIn);
199 
200 }
201 
202 //==========================================================================
203 
204 } // end namespace Pythia8