evtgen is hosted by Hepforge, IPPP Durham
EvtGen  2.0.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
EvtPythia6CommandConverter.cpp
Go to the documentation of this file.
1 
2 /***********************************************************************
3 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
4 * *
5 * This file is part of EvtGen. *
6 * *
7 * EvtGen is free software: you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation, either version 3 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * EvtGen is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
19 ***********************************************************************/
20 
22 
23 #include "EvtGenBase/EvtReport.hh"
24 
25 #include <iostream>
26 #include <stdlib.h>
27 
28 using std::endl;
29 
30 std::vector<std::string> convertPythia6Command( Command command )
31 {
32  std::string module = command["MODULE"];
33  std::string param = command["PARAM"];
34  std::string value = command["VALUE"];
35  std::vector<std::string> commandStrings;
36  if ( module == "MSTJ" ) {
37  switch ( atoi( param.c_str() ) ) {
38  //1,2,3
39  case 11:
40  switch ( atoi( value.c_str() ) ) {
41  case 3:
42  commandStrings.push_back( "StringZ:usePetersonC = on" );
43  commandStrings.push_back( "StringZ:usePetersonB = on" );
44  commandStrings.push_back( "StringZ:usePetersonH = on" );
45  break;
46  case 1:
47  case 4:
48  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
49  << "Pythia6 parameter: MSTJ(11)=" << value
50  << " is only implicitly supported." << endl;
51  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
52  << "Please use MSTJ(11)=5 and ensure PARJ(46) and PARJ(47) are both set appropriately."
53  << endl;
54  ::abort();
55  case 5:
56  commandStrings.push_back( "StringZ:usePetersonC = off" );
57  commandStrings.push_back( "StringZ:usePetersonB = off" );
58  commandStrings.push_back( "StringZ:usePetersonH = off" );
59  break;
60  default:
61  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
62  << "Pythia6 parameter: MSTJ(11)=" << value
63  << " is not currently supported." << endl;
64  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
65  << "Please use MSTJ(11)=3 or MSTJ(11)=5." << endl;
66  ::abort();
67  }
68  break;
69  case 12:
70  switch ( atoi( value.c_str() ) ) {
71  case 2:
72  commandStrings.push_back(
73  "StringFlav:suppressLeadingB = off" );
74  break;
75  case 3:
76  commandStrings.push_back(
77  "StringFlav:suppressLeadingB = on" );
78  break;
79  default:
80  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
81  << "Pythia6 parameter: MSTJ(12)=" << value
82  << " is not currently supported." << endl;
83  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
84  << "Please use MSTJ(12)=2 or MSTJ(12)=3." << endl;
85  ::abort();
86  }
87  break;
88  //13-19,21-24
89  case 26:
90  switch ( atoi( value.c_str() ) ) {
91  case 0:
92  commandStrings.push_back( "ParticleDecays:mixB = off" );
93  break;
94  case 1:
95  case 2:
96  commandStrings.push_back( "ParticleDecays:mixB = on" );
97  break;
98  }
99  break;
100  //28,38-50
101  //51 Inclusion of BE effects - TODO
102  case 52:
103  switch ( atoi( value.c_str() ) ) {
104  case 9:
105  commandStrings.push_back( "BoseEinstein:Eta = on" );
106  [[fallthrough]];
107  case 7:
108  commandStrings.push_back( "BoseEinstein:Kaon = on" );
109  [[fallthrough]];
110  case 3:
111  commandStrings.push_back( "BoseEinstein:Pion = on" );
112  break;
113  default:
114  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
115  << "Pythia6 parameter: MSTJ(52)=" << value
116  << " is not allowed." << endl;
117  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
118  << "Please select 3,7 or 9." << endl;
119  ::abort();
120  }
121  break;
122  //53-57,91-93,101-121
123  default:
124  EvtGenReport( EVTGEN_WARNING, "EvtGen" )
125  << "Pythia6 parameter: " << module << "(" << param
126  << ") is not currently supported and will be ignored."
127  << endl;
128  EvtGenReport( EVTGEN_WARNING, "EvtGen" )
129  << "A similar Pythia8 parameter may be available." << endl;
130  }
131  } else if ( module == "PARJ" ) {
132  switch ( atoi( param.c_str() ) ) {
133  case 1:
134  commandStrings.push_back( "StringFlav:probQQtoQ = " + value );
135  break;
136  case 2:
137  commandStrings.push_back( "StringFlav:probStoUD = " + value );
138  break;
139  case 3:
140  commandStrings.push_back( "StringFlav:probSQtoQQ = " + value );
141  break;
142  case 4:
143  commandStrings.push_back( "StringFlav:probQQ1toQQ0 = " + value );
144  break;
145  case 5:
146  commandStrings.push_back( "StringFlav:popcornRate = " + value );
147  break;
148  case 6:
149  commandStrings.push_back( "StringFlav:popcornSpair = " + value );
150  break;
151  case 7:
152  commandStrings.push_back( "StringFlav:popcornSmeson = " + value );
153  break;
154  //8-10 Advanced popcorn model - can't find these in Pythia8 (unsupported?)
155  case 11:
156  commandStrings.push_back( "StringFlav:mesonUDvector = " + value );
157  break;
158  case 12:
159  commandStrings.push_back( "StringFlav:mesonSvector = " + value );
160  break;
161  case 13:
162  commandStrings.push_back( "StringFlav:mesonCvector = " + value );
163  commandStrings.push_back( "StringFlav:mesonBvector = " + value );
164  break;
165  case 14:
166  commandStrings.push_back( "StringFlav:mesonUDL1S0J1 = " + value );
167  commandStrings.push_back( "StringFlav:mesonSL1S0J1 = " + value );
168  commandStrings.push_back( "StringFlav:mesonCL1S0J1 = " + value );
169  commandStrings.push_back( "StringFlav:mesonBL1S0J1 = " + value );
170  break;
171  case 15:
172  commandStrings.push_back( "StringFlav:mesonUDL1S1J0 = " + value );
173  commandStrings.push_back( "StringFlav:mesonSL1S1J0 = " + value );
174  commandStrings.push_back( "StringFlav:mesonCL1S1J0 = " + value );
175  commandStrings.push_back( "StringFlav:mesonBL1S1J0 = " + value );
176  break;
177  case 16:
178  commandStrings.push_back( "StringFlav:mesonUDL1S1J1 = " + value );
179  commandStrings.push_back( "StringFlav:mesonSL1S1J1 = " + value );
180  commandStrings.push_back( "StringFlav:mesonCL1S1J1 = " + value );
181  commandStrings.push_back( "StringFlav:mesonBL1S1J1 = " + value );
182  break;
183  case 17:
184  commandStrings.push_back( "StringFlav:mesonUDL1S1J2 = " + value );
185  commandStrings.push_back( "StringFlav:mesonSL1S1J2 = " + value );
186  commandStrings.push_back( "StringFlav:mesonCL1S1J2 = " + value );
187  commandStrings.push_back( "StringFlav:mesonBL1S1J2 = " + value );
188  break;
189  case 18:
190  commandStrings.push_back( "StringFlav:decupletSup = " + value );
191  break;
192  case 19:
193  commandStrings.push_back( "StringFlav:lightLeadingBSup = " +
194  value );
195  commandStrings.push_back( "StringFlav:heavyLeadingBSup = " +
196  value );
197  break;
198  //21-24 Gaussian PT distributions for primary hadrons - can't find these in Pythia8
199  case 25:
200  commandStrings.push_back( "StringFlav:etaSup = " + value );
201  break;
202  case 26:
203  commandStrings.push_back( "StringFlav:etaPrimeSup = " + value );
204  break;
205  //31,32
206  case 33:
207  commandStrings.push_back( "StringFragmentation:stopMass = " +
208  value );
209  break;
210  //34 Stop mass for MSTJ(11)=2 - can't find MSTJ(11)=2 analogue in Pythia 8 so leaving this out too
211  //36
212  case 37:
213  commandStrings.push_back( "StringFragmentation:stopSmear = " +
214  value );
215  break;
216  //39,40
217  case 41:
218  commandStrings.push_back( "StringZ:aLund = " + value );
219  break;
220  case 42:
221  commandStrings.push_back( "StringZ:bLund = " + value );
222  break;
223  //43,44
224  case 45:
225  commandStrings.push_back( "StringZ:aExtraDiquark = " + value );
226  break;
227  case 46:
228  commandStrings.push_back( "StringZ:rFactC = " + value );
229  break;
230  case 47:
231  commandStrings.push_back( "StringZ:rFactB = " + value );
232  break;
233  //48,49,50,51-55,59,61-63,64,65,66,71,72,73,74
234  case 76:
235  commandStrings.push_back( "ParticleDecays:xBdMix = " + value );
236  break;
237  case 77:
238  commandStrings.push_back( "ParticleDecays:xBsMix = " + value );
239  break;
240  //80-90 Time-like parton showers - can't find these in Pythia8
241  case 91:
242  commandStrings.push_back( "BoseEinstein:widthSep = " + value );
243  break;
244  case 92:
245  commandStrings.push_back( "BoseEinstein:lambda = " + value );
246  break;
247  case 93:
248  commandStrings.push_back( "BoseEinstein:QRef = " + value );
249  break;
250  //94-96 Further BE parameters - can't find these in Pythia8
251  //121-171 parameters for ee event generation - can't find these in Pythia8
252  //180-195 Various coupling constants & parameters related to couplings - can't find these in Pythia8
253  default:
254  EvtGenReport( EVTGEN_WARNING, "EvtGen" )
255  << "Pythia6 parameter: " << module << "(" << param
256  << ") is not currently supported and will be ignored."
257  << endl;
258  EvtGenReport( EVTGEN_WARNING, "EvtGen" )
259  << "A similar Pythia8 parameter may be available." << endl;
260  }
261  } else {
262  EvtGenReport( EVTGEN_WARNING, "EvtGen" )
263  << "Pythia6 parameter: " << module << "(" << param
264  << ") is not currently supported and will be ignored." << endl;
265  EvtGenReport( EVTGEN_WARNING, "EvtGen" )
266  << "A similar Pythia8 parameter may be available." << endl;
267  }
268  return commandStrings;
269 }
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=0)
Definition: EvtReport.cpp:33
std::map< std::string, std::string > Command
std::vector< std::string > convertPythia6Command(Command command)