9 #include "Pythia8/Dire.h"
19 void Dire::createPointers() {
24 weightsPtr =
new DireWeightContainer(settingsPtr);
28 timesPtr = make_shared<DireTimes>( mergingHooksPtr, partonVertexPtr);
32 spacePtr = make_shared<DireSpace>( mergingHooksPtr, partonVertexPtr);
35 hasOwnTimesDec =
true;
36 timesDecPtr = make_shared<DireTimes>( mergingHooksPtr, partonVertexPtr);
39 mergingPtr = make_shared<DireMerging>();
41 if (!hardProcessPtr) {
42 hasOwnHardProcess =
true;
43 hardProcessPtr =
new DireHardProcess();
45 if (!mergingHooksPtr) {
46 hasOwnMergingHooks =
true;
47 mergingHooksPtr = make_shared<DireMergingHooks>();
54 void Dire::initTune() {
56 initNewSettings =
true;
59 int iTune = settingsPtr->mode(
"Dire:Tune");
73 settingsPtr->readString(
"TimeShower:alphaSvalue = 0.1201");
74 settingsPtr->readString(
"SpaceShower:alphaSvalue = 0.1201");
75 settingsPtr->readString(
"TimeShower:alphaSorder = 2");
76 settingsPtr->readString(
"SpaceShower:alphaSorder = 2");
79 settingsPtr->readString(
"StringPT:sigma = 0.2952");
80 settingsPtr->readString(
"StringZ:aLund = 0.9704");
81 settingsPtr->readString(
"StringZ:bLund = 1.0809");
82 settingsPtr->readString(
"StringZ:aExtraDiquark = 1.3490");
83 settingsPtr->readString(
"StringFlav:probStoUD = 0.2046");
84 settingsPtr->readString(
"StringZ:rFactB = 0.8321");
85 settingsPtr->readString(
"StringZ:aExtraSQuark = 0.0");
86 settingsPtr->readString(
"TimeShower:pTmin = 0.9");
89 settingsPtr->readString(
"SpaceShower:pTmin = 0.9");
90 settingsPtr->readString(
"MultipartonInteractions:alphaSvalue = 0.1309");
91 settingsPtr->readString(
"MultipartonInteractions:pT0Ref = 1.729");
92 settingsPtr->readString(
"MultipartonInteractions:expPow = 1.769");
93 settingsPtr->readString(
"ColourReconnection:range = 2.1720");
94 settingsPtr->readString(
"BeamRemnants:primordialKThard = 2.2873");
95 settingsPtr->readString(
"BeamRemnants:primordialKTsoft = 0.25");
96 settingsPtr->readString(
"BeamRemnants:reducedKTatHighY = 0.47");
102 if ( settingsPtr->flag(
"TimeShower:U1newShowerByL")
103 || settingsPtr->flag(
"TimeShower:U1newShowerByQ")
104 || settingsPtr->flag(
"SpaceShower:U1newShowerByL")
105 || settingsPtr->flag(
"SpaceShower:U1newShowerByQ")) {
106 if (!particleDataPtr->isParticle(900032)) {
107 settingsPtr->readString(
"900032:all = Zp void 1 0 0 1. 0.01 0. 0. 0.");
108 settingsPtr->readString(
"900032:addChannel = 1 0.33 101 11 -11");
109 settingsPtr->readString(
"900032:addChannel = 1 0.33 101 13 -13");
110 settingsPtr->readString(
"900032:addChannel = 1 0.34 101 211 -211");
111 settingsPtr->readString(
"900032:isResonance = true");
113 if (!particleDataPtr->isParticle(900012)) {
114 settingsPtr->readString(
"900012:all = nup nup_bar"
115 " 1 0 0 0.0 0.0 0. 0. 0.");
125 void Dire::initShowersAndWeights() {
127 if (isInitShower)
return;
131 hasOwnWeights =
true;
132 weightsPtr =
new DireWeightContainer(settingsPtr);
136 timesPtr = make_shared<DireTimes>( mergingHooksPtr, partonVertexPtr);
140 spacePtr = make_shared<DireSpace>( mergingHooksPtr, partonVertexPtr);
143 hasOwnTimesDec =
true;
144 timesDecPtr = make_shared<DireTimes>( mergingHooksPtr, partonVertexPtr);
147 mergingPtr = make_shared<DireMerging>();
149 if (!hardProcessPtr) {
150 hasOwnHardProcess =
true;
151 hardProcessPtr =
new DireHardProcess();
153 if (!mergingHooksPtr) {
154 hasOwnMergingHooks =
true;
155 mergingHooksPtr = make_shared<DireMergingHooks>();
158 mergingHooksPtr->setHardProcessPtr(hardProcessPtr);
159 mergingHooksPtr->init();
161 timesPtr->setWeightContainerPtr(weightsPtr);
162 spacePtr->setWeightContainerPtr(weightsPtr);
163 timesDecPtr->setWeightContainerPtr(weightsPtr);
171 void Dire::setup(BeamParticle* beamA, BeamParticle* beamB) {
177 hasOwnSplittings =
true;
178 splittings =
new DireSplittingLibrary();
183 if ( !spacePtr->isInit() && timesPtr->isInit()
184 && beamA != 0 && beamB != 0)
185 spacePtr->init( beamA, beamB );
188 timesPtr->reinitPtr(infoPtr, mergingHooksPtr, splittings, &direInfo);
189 spacePtr->reinitPtr(infoPtr, mergingHooksPtr, splittings, &direInfo);
190 timesDecPtr->reinitPtr(infoPtr, mergingHooksPtr, splittings, &direInfo);
193 if ( settingsPtr->flag(
"ShowerPDF:usePDFmasses")
194 && ( beamA != NULL || beamB != NULL) ) {
195 for (
int i=1; i <= 5; ++i) {
197 double mPDF = (abs(beamA->id()) > 30)
198 ? beamA->mQuarkPDF(i)
199 : (abs(beamB->id()) > 30)
200 ? beamB->mQuarkPDF(i) : -1.0;
202 if (beamA != NULL && mPDF < 0.)
203 mPDF = beamA->mQuarkPDF(i);
204 if (beamB != NULL && mPDF < 0.)
205 mPDF = beamB->mQuarkPDF(i);
207 stringstream resetMass;
208 resetMass << i <<
":m0 = " << mPDF;
209 settingsPtr->readString(resetMass.str());
216 hooksPtr->initPtr( infoPtr, beamA, beamB);
218 splittings->setKernelHooks(hooksPtr);
222 splittings->init( infoPtr, beamA, beamB, &direInfo, hooksPtr);
225 splittings->setTimesPtr(timesPtr);
226 splittings->setTimesDecPtr(timesDecPtr);
227 splittings->setSpacePtr(spacePtr);
231 timesDecPtr->initSplits();
232 timesPtr->initSplits();
233 spacePtr->initSplits();
235 weightsPtr->initPtrs(beamA, beamB, settingsPtr, infoPtr, &direInfo);
236 timesDecPtr->initVariations();
237 timesPtr->initVariations();
238 spacePtr->initVariations();
239 if (mergingPtr) mergingPtr->initPtrs( weightsPtr, timesPtr,
240 spacePtr, &direInfo);
248 bool Dire::initAfterBeams() {
250 if (isInit)
return true;
253 initShowersAndWeights();
258 if ( settingsPtr->flag(
"Dire:doMerging")
259 || settingsPtr->flag(
"Dire:doMECs")
260 || settingsPtr->flag(
"Dire:doMEM")) {
261 settingsPtr->flag(
"Merging:doMerging",
true);
262 settingsPtr->flag(
"Merging:useShowerPlugin",
true);
265 if ( settingsPtr->flag(
"Dire:doMECs")
266 || settingsPtr->flag(
"Dire:doMEM")) {
267 settingsPtr->parm(
"Merging:TMS",0.0);
271 weightsPtr->initPtrs(beamAPtr, beamBPtr, settingsPtr, infoPtr, &direInfo);
273 setup(beamAPtr, beamBPtr);
276 printBannerSave = printBannerSave && !settingsPtr->flag(
"Print:quiet");
277 if (printBannerSave) printBanner();
278 printBannerSave =
false;
284 void Dire::printBanner() {
287 <<
" *--------------- Welcome to the DIRE parton shower "
288 <<
" -------------*\n"
291 <<
" | Please consider citing Eur.Phys.J. C75 (2015)"
293 <<
" | if you use this program for scientific purposes."
297 cout <<
" *----------------------------------------"
298 <<
"--------------------------*" << endl;