9 #ifndef Pythia8_VinciaQED_H
10 #define Pythia8_VinciaQED_H
20 #include "Pythia8/BeamParticle.h"
21 #include "Pythia8/Event.h"
22 #include "Pythia8/StandardModel.h"
23 #include "Pythia8/PartonSystems.h"
26 #include "Pythia8/VinciaCommon.h"
27 #include "Pythia8/VinciaWeights.h"
80 double solve(std::vector <std::vector<double> >& distMatrix,
81 std::vector<int>& assignment);
87 void optimal(
int *assignment,
double *cost,
double *distMatrix,
88 int nOfRows,
int nOfColumns);
90 void vect(
int *assignment,
bool *starMatrix,
int nOfRows,
93 void calcCost(
int *assignment,
double *cost,
double *distMatrix,
96 void step2a(
int *assignment,
double *distMatrix,
bool *starMatrix,
97 bool *newStarMatrix,
bool *primeMatrix,
bool *coveredColumns,
98 bool *coveredRows,
int nOfRows,
int nOfColumns,
int minDim);
100 void step2b(
int *assignment,
double *distMatrix,
bool *starMatrix,
101 bool *newStarMatrix,
bool *primeMatrix,
bool *coveredColumns,
102 bool *coveredRows,
int nOfRows,
int nOfColumns,
int minDim);
104 void step3(
int *assignment,
double *distMatrix,
bool *starMatrix,
105 bool *newStarMatrix,
bool *primeMatrix,
bool *coveredColumns,
106 bool *coveredRows,
int nOfRows,
int nOfColumns,
int minDim);
108 void step4(
int *assignment,
double *distMatrix,
bool *starMatrix,
109 bool *newStarMatrix,
bool *primeMatrix,
bool *coveredColumns,
110 bool *coveredRows,
int nOfRows,
int nOfColumns,
int minDim,
113 void step5(
int *assignment,
double *distMatrix,
bool *starMatrix,
114 bool *newStarMatrix,
bool *primeMatrix,
bool *coveredColumns,
115 bool *coveredRows,
int nOfRows,
int nOfColumns,
int minDim);
130 QEDemitElemental() : rndmPtr(
nullptr), partonSystemsPtr(
nullptr), q2Sav(0.),
131 zetaSav(0.), phiSav(0.), sxjSav(0.), syjSav(0.), alpha(0.), c(0.),
132 hasTrial(
false), x(0), y(0), idx(0), idy(0), mx2(0.), my2(0.),
133 ex(0.), ey(0.), m2Ant(0.), sAnt(0.), QQ(0.), isII(
false), isIF(
false),
134 isFF(
false), isRF(
false), isIA(
true), isDip(
false), shh(0.),
135 isInitPtr(
false), isInit(
false), verbose(1) {;}
140 void init(
Event &event,
int xIn,
int yIn,
double shhIn,
143 void init(
Event &event,
int xIn, vector<int> iRecoilIn,
double shhIn,
146 double generateTrial(
Event &event,
double q2Start,
double q2Low,
147 double alphaIn,
double cIn);
158 double q2Sav, zetaSav, phiSav;
159 double sxjSav, syjSav;
181 bool isII, isIF, isFF, isRF, isIA, isDip;
187 bool isInitPtr, isInit;
201 iSys(-1), shh(-1.), cMat(0.), eleTrial(
nullptr), trialIsVec(
false),
202 beamAPtr(
nullptr), beamBPtr(
nullptr), infoPtr(
nullptr),
203 partonSystemsPtr(
nullptr), particleDataPtr(
nullptr), rndmPtr(
nullptr),
204 settingsPtr(
nullptr), vinComPtr(
nullptr), mode(-1), verbose(-1),
205 useFullWkernel(
false), q2Cut(-1.), isBelowHad(
false),
206 emitBelowHad(
false), isInitPtr(
false), isInit(
false), TINYPDF(-1.) {;}
213 void prepare(
int iSysIn,
Event &event,
double q2CutIn,
bool isBelowHadIn,
214 vector<double> evolutionWindowsIn,
AlphaEM alIn);
221 double PDFratio(
bool isA,
double eOld,
double eNew,
int id,
double Qt2);
223 void buildSystem(
Event &event);
225 double generateTrialScale(
Event &event,
double q2Start);
227 bool checkVeto(
Event &event);
238 vector<vector<QEDemitElemental> > eleMat;
241 vector<QEDemitElemental> eleVec;
247 vector<double> evolutionWindows;
271 bool isInitPtr, isInit;
294 iPhot(iPhotIn), iSpec(iSpecIn), ariWeight(0) {
295 m2Ant = m2(event[iPhotIn], event[iSpecIn]);
296 sAnt = 2.*
event[iPhotIn].p()*
event[iSpecIn].p();
297 m2Spec =
event[iSpecIn].m2();}
300 double getKallen() {
return m2Ant/(m2Ant - m2Spec);}
305 int iPhot{}, iSpec{};
306 double m2Spec{}, m2Ant{}, sAnt{};
320 iSys(-1), totIdWeight(-1.), maxIdWeight(-1.), hasTrial(
false),
321 q2Trial(-1.), zTrial(-1.), phiTrial(-1.), idTrial(0), eleTrial(
nullptr),
322 nQuark(-1), nLepton(-1), verbose(-1), q2Max(-1.), q2Cut(-1.),
323 isBelowHad(
false), beamAPtr(
nullptr), beamBPtr(
nullptr), infoPtr(
nullptr),
324 partonSystemsPtr(
nullptr), particleDataPtr(
nullptr), rndmPtr(
nullptr),
325 settingsPtr(
nullptr), vinComPtr(
nullptr), isInitPtr(
false), isInit(
false)
333 void prepare(
int iSysIn,
Event &event,
double q2CutIn,
bool isBelowHadIn,
334 vector<double> evolutionWindowsIn,
AlphaEM alIn);
336 void buildSystem(
Event &event);
338 double generateTrialScale(
Event &event,
double q2Start);
340 bool checkVeto(
Event &event);
353 vector<double> evolutionWindows;
357 vector<double> idWeights;
358 double totIdWeight, maxIdWeight;
361 vector<QEDsplitElemental> eleVec;
365 double q2Trial, zTrial, phiTrial, idTrial;
369 int nQuark, nLepton, verbose;
384 bool isInitPtr, isInit;
397 QEDconvSystem() : totIdWeight(-1.), maxIdWeight(-1.), iSys(-1), shh(-1.),
398 s(-1.), iA(-1), iB(-1), isAPhot(
false), isBPhot(
false), hasTrial(
false),
399 iPhotTrial(-1), iSpecTrial(-1), q2Trial(-1.), zTrial(-1.), phiTrial(-1.),
400 idTrial(-1), nQuark(-1), verbose(-1), q2Cut(-1.),
401 isBelowHad(
false), beamAPtr(
nullptr), beamBPtr(
nullptr),
402 infoPtr(
nullptr), partonSystemsPtr(
nullptr), particleDataPtr(
nullptr),
403 rndmPtr(
nullptr), settingsPtr(
nullptr), vinComPtr(
nullptr),
404 isInitPtr(
false), isInit(
false), TINYPDF(-1.) {;}
411 void prepare(
int iSysIn,
Event &event,
double q2CutIn,
bool isBelowHadIn,
412 vector<double> evolutionWindowsIn,
AlphaEM alIn);
414 void buildSystem(
Event &event);
416 double generateTrialScale(
Event &event,
double q2Start);
418 bool checkVeto(
Event &event);
425 map<int,double> Rhat;
431 vector<double> evolutionWindows;
435 vector<double> idWeights;
436 double totIdWeight, maxIdWeight;
443 bool isAPhot, isBPhot;
447 int iPhotTrial, iSpecTrial;
448 double q2Trial, zTrial, phiTrial, idTrial;
466 bool isInitPtr, isInit;
490 void prepare(
int iSysIn,
Event &event,
bool isBelowHadIn);
492 void update(
Event &event,
int iSys);
494 void setVerbose(
int verboseIn) {verbose = verboseIn;}
496 double generateTrialScale(
Event &event,
double q2Start);
498 bool checkVeto(
Event &event);
500 bool isInit() {
return isInitSav;}
502 int sysWin() {
return iSysTrial;}
504 double q2minColoured() {
return q2minColouredSav;}
505 double q2min() {
return q2minSav;}
510 vector<int> iSystems;
511 vector<QEDemitSystem> emitSystems;
512 vector<QEDsplitSystem> splitSystems;
513 vector<QEDconvSystem> convSystems;
519 int nGammaToLepton, nGammaToQuark;
520 bool doConvertGamma, doConvertQuark;
523 double q2minSav, q2minColouredSav;
547 vector<double> evolutionWindows;
550 bool isInitPtr, isInitSav;
558 #endif // end Pythia8_VinciaQED_H