9 #ifndef Pythia8_VinciaQED_H 10 #define Pythia8_VinciaQED_H 13 #include "Pythia8/BeamParticle.h" 14 #include "Pythia8/Event.h" 15 #include "Pythia8/StandardModel.h" 16 #include "Pythia8/PartonSystems.h" 19 #include "Pythia8/VinciaCommon.h" 20 #include "Pythia8/VinciaWeights.h" 37 zetaSav(0.), phiSav(0.), sxjSav(0.), syjSav(0.), alpha(0.), c(0.),
38 hasTrial(false), x(0), y(0), idx(0), idy(0), mx2(0.), my2(0.),
39 ex(0.), ey(0.), m2Ant(0.), sAnt(0.), QQ(0.), isII(false), isIF(false),
40 isFF(false), isRF(false), isIA(true), isDip(false), shh(0.),
41 isInitPtr(false), isInit(false), verbose(1) {;}
46 void init(
Event &event,
int xIn,
int yIn,
double shhIn,
49 void init(
Event &event,
int xIn, vector<int> iRecoilIn,
double shhIn,
53 double alphaIn,
double cIn);
64 double q2Sav, zetaSav, phiSav, sxjSav, syjSav, alpha, c;
74 int spinTypex, spinTypey;
87 bool isII, isIF, isFF, isRF, isIA, isDip;
93 bool isInitPtr, isInit;
107 QEDsystem() : infoPtr(nullptr), partonSystemsPtr(nullptr),
108 particleDataPtr(nullptr), rndmPtr(nullptr), settingsPtr(nullptr),
109 loggerPtr(nullptr), vinComPtr(nullptr), isInitPtr(false), iSys(-1),
110 verbose(0), jNew(0), shat(0.) {;}
123 virtual void setVerbose(
int verboseIn) { verbose = verboseIn; }
125 virtual void prepare(
const int iSysIn,
Event &event,
const double q2CutIn,
126 const int scaleRegionIn,
const vector<double> evolutionWindowsIn,
129 virtual void buildSystem(
Event &event) = 0;
131 virtual double q2Next(
Event &event,
double q2Start) = 0 ;
133 virtual bool acceptTrial(
Event &event) = 0;
135 virtual void updateEvent(
Event &event) = 0;
137 virtual void updatePartonSystems();
139 virtual void print() = 0;
143 virtual bool isInitial() {
return false;};
166 map<int,int> iReplace;
179 QEDemitSystem() : shh(-1.), cMat(0.), trialIsVec(
false), beamAPtr(
nullptr),
180 beamBPtr(
nullptr), qedMode(-1), qedModeMPI(-1),
181 scaleRegion(0), emitBelowHad(
false), q2Cut(-1.), isInit(
false),
182 TINYPDF(-1.), kMapTypeFinal(0) {;}
188 void prepare(
const int iSysIn,
Event &event,
const double q2CutIn,
189 const int scaleRegionIn,
const vector<double> evolutionWindowsIn,
192 void buildSystem(
Event &event)
override;
194 double q2Next(
Event &event,
double q2Start)
override;
196 bool acceptTrial(
Event &event)
override;
198 void updateEvent(
Event &event)
override;
200 bool isInitial()
override {
return eleTrial->isII || eleTrial->isIF;}
202 void print()
override;
209 double pdfRatio(
bool isA,
double eOld,
double eNew,
int id,
double Qt2);
217 vector<vector<QEDemitElemental> > eleMat;
220 vector<QEDemitElemental> eleVec;
226 vector<double> evolutionWindows;
237 int qedMode, qedModeMPI;
238 vector<bool> useSpinsQEDNow, useSpinsQED, useSpinsQEDHadDec;
239 int scaleRegion, emitBelowHad, isHadronDecay;
271 iPhot(iPhotIn), iSpec(iSpecIn), ariWeight(0) {
272 m2Ant = max(VinciaConstants::PICO,
273 m2(event[iPhotIn], event[iSpecIn]));
274 sAnt = max(VinciaConstants::PICO,
275 2.*event[iPhotIn].p()*event[iSpecIn].p());
276 m2Spec = max(0., event[iSpecIn].
m2());
286 double m2Spec, m2Ant, sAnt;
300 totIdWeight(-1.), hasTrial(false),
301 q2Trial(-1.), zTrial(-1.), phiTrial(-1.), idTrial(0), nQuark(-1),
302 nLepton(-1), q2Max(-1.), q2Cut(-1.), scaleRegion(0),
303 beamAPtr(nullptr), beamBPtr(nullptr), isInit(false), kMapTypeFinal(0) {;}
309 void prepare(
const int iSysIn,
Event &event,
const double q2CutIn,
310 const int scaleRegionIn,
const vector<double> evolutionWindowsIn,
313 void buildSystem(
Event &event)
override;
315 double q2Next(
Event &event,
double q2Start)
override;
317 bool acceptTrial(
Event &event)
override;
319 void updateEvent(
Event &event)
override;
323 void print()
override;
331 vector<double> evolutionWindows;
335 vector<double> idWeights;
339 vector<QEDsplitElemental> eleVec;
343 double q2Trial, zTrial, phiTrial, idTrial;
373 iA(-1), iB(-1), isAPhot(false), isBPhot(false), hasTrial(false),
374 iPhotTrial(-1), iSpecTrial(-1), q2Trial(-1.), zTrial(-1.), phiTrial(-1.),
375 idTrial(-1), nQuark(-1), q2Cut(-1.),
376 scaleRegion(0), beamAPtr(nullptr), beamBPtr(nullptr),isInit(false),
383 void prepare(
const int iSysIn,
Event &event,
const double q2CutIn,
384 const int scaleRegionIn,
const vector<double> evolutionWindowsIn,
387 void buildSystem(
Event &event)
override;
389 double q2Next(
Event &event,
double q2Start)
override;
391 bool acceptTrial(
Event &event)
override;
393 void updateEvent(
Event &event)
override;
397 void print()
override;
402 map<int,double> Rhat;
408 vector<double> evolutionWindows;
412 vector<double> idWeights;
413 double totIdWeight, maxIdWeight;
419 bool isAPhot, isBPhot;
423 int iPhotTrial, iSpecTrial;
424 double q2Trial, zTrial, phiTrial, idTrial;
475 bool isInit() {
return isInitSav;}
478 virtual bool polarise(vector<Particle>&) {
return false;}
481 virtual bool prepare(
int iSysIn,
Event &event,
int scaleRegionIn) = 0;
484 virtual void update(
Event &event,
int iSys) = 0;
487 virtual void setVerbose(
int verboseIn) {verbose = verboseIn;}
490 virtual void clear(
int iSys = -1) = 0;
493 virtual double q2Next(
Event &event,
double q2Start,
double q2End) = 0;
496 virtual int sysWin() = 0;
499 virtual bool lastIsSplitting() = 0;
500 virtual bool lastIsInitial() = 0;
501 virtual bool lastIsResonanceDecay() {
return false;}
504 virtual bool acceptTrial(
Event &event) = 0;
507 virtual void updateEvent(
Event &event) = 0;
510 virtual void updatePartonSystems(
Event &event) = 0;
513 virtual double q2minColoured() = 0;
514 virtual double q2min() = 0;
517 virtual unsigned int nBranchers() = 0;
518 virtual unsigned int nResDec() = 0;
534 bool isInitPtr, isInitSav;
558 bool prepare(
int iSysIn,
Event& event,
int scaleRegionIn)
override;
560 void update(
Event& event,
int iSys)
override;
564 emptyQEDemitSystem.setVerbose(verboseIn);
565 emptyQEDsplitSystem.setVerbose(verboseIn);
566 emptyQEDconvSystem.setVerbose(verboseIn);
569 void clear(
int iSys = -1)
override {
570 if (iSys < 0) {emitSystems.clear(); splitSystems.clear();
571 convSystems.clear();}
572 else {emitSystems.erase(iSys); splitSystems.erase(iSys);
573 convSystems.erase(iSys);}
574 qedTrialSysPtr =
nullptr;}
577 double q2Next(
Event& event,
double q2Start,
double)
override;
579 int sysWin()
override {
return iSysTrial;}
582 if (qedTrialSysPtr !=
nullptr)
return qedTrialSysPtr->isSplitting();
584 bool lastIsInitial()
override {
585 if (qedTrialSysPtr !=
nullptr)
return qedTrialSysPtr->isInitial();
588 bool acceptTrial(
Event &event)
override;
590 void updateEvent(
Event &event)
override;
592 void updatePartonSystems(
Event &event)
override;
595 double q2min()
override {
return q2minSav;}
599 int sizeNow = emitSystems.size();
600 sizeNow = max(sizeNow, (
int)splitSystems.size());
601 sizeNow = max(sizeNow, (
int)convSystems.size());
611 void q2NextSystem(map<int, T>& QEDsystemList,
Event& event,
double q2Start);
617 map< int, QEDemitSystem> emitSystems;
618 map< int, QEDsplitSystem> splitSystems;
619 map< int, QEDconvSystem> convSystems;
622 bool doQED, doEmission;
623 int nGammaToLepton, nGammaToQuark;
624 bool doConvertGamma, doConvertQuark;
627 double q2minSav, q2minColouredSav;
638 vector<double> evolutionWindows;
bool isInitial() override
Branching type.
Definition: VinciaQED.h:200
virtual bool isSplitting()
Methods to tell which type of brancher this is.
Definition: VinciaQED.h:142
int jNew
Information for partonSystems.
Definition: VinciaQED.h:165
Class for a QED emission system.
Definition: VinciaQED.h:175
bool isSplitting() override
Branching type: isSplitting() = true.
Definition: VinciaQED.h:321
The Event class holds all info on the generated event.
Definition: Event.h:408
int iSys
Event system.
Definition: VinciaQED.h:158
bool isInitial() override
Branching type: isInitial() = true.
Definition: VinciaQED.h:395
Definition: BeamParticle.h:133
QEDsplitSystem()
Constructor.
Definition: VinciaQED.h:299
unsigned int nResDec() override
This module does not implement resonance decays.
Definition: VinciaQED.h:605
void init(Event &event, int xIn, int yIn, double shhIn, double verboseIn)
Initialize.
Definition: VinciaQED.cc:35
unsigned int nBranchers() override
Getter for number of systems.
Definition: VinciaQED.h:598
Base class for Vincia's QED and EW shower modules.
Definition: VinciaQED.h:456
virtual bool polarise(vector< Particle > &)
Select helicities for a system of particles.
Definition: VinciaQED.h:478
friend class QEDemitSystem
Friends for internal private members.
Definition: VinciaQED.h:33
double generateTrial(Event &event, double q2Start, double q2Low, double alphaIn, double cIn)
Generate a trial point.
Definition: VinciaQED.cc:133
virtual void setVerbose(int verboseIn) override
Set or change verbosity level, and propagate to QED systems.
Definition: VinciaQED.h:562
Class for a QED conversion system.
Definition: VinciaQED.h:367
Definition: StandardModel.h:106
Class for performing QED showers.
Definition: VinciaQED.h:542
QEDconvSystem()
Constructor.
Definition: VinciaQED.h:372
virtual void load()
Some early initialisation (needed for EW shower).
Definition: VinciaQED.h:470
VinciaModule()
Default constructor.
Definition: VinciaQED.h:461
VinciaQED()
Constructor.
Definition: VinciaQED.h:550
Definition: VinciaFSR.h:582
Definition: VinciaCommon.h:494
QEDsplitElemental(Event &event, int iPhotIn, int iSpecIn)
Constructor.
Definition: VinciaQED.h:270
Base class for QED systems.
Definition: VinciaQED.h:102
double q2minColoured() override
Return scales.
Definition: VinciaQED.h:594
QEDemitElemental()
Constuctor.
Definition: VinciaQED.h:36
bool lastIsSplitting() override
Information about last branching.
Definition: VinciaQED.h:581
Class for trial QED splittings.
Definition: VinciaQED.h:262
Class for QED emissions.
Definition: VinciaQED.h:28
double m2(const Vec4 &v1)
The squared invariant mass of one or more four-vectors.
Definition: Basics.cc:598
void clear(int iSys=-1) override
Clear everything, or specific system.
Definition: VinciaQED.h:569
The PartonSystems class describes the whole set of subcollisions.
Definition: PartonSystems.h:42
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
void initPtr(Rndm *rndmPtrIn, PartonSystems *partonSystemsPtrIn)
Initialize the pointers.
Definition: VinciaQED.cc:24
double getKallen()
Kallen function.
Definition: VinciaQED.h:280
This class holds a map of all ParticleDataEntries.
Definition: ParticleData.h:422
int verbose
Verbose setting.
Definition: VinciaQED.h:162
virtual void setVerbose(int verboseIn)
Set verbosity level.
Definition: VinciaQED.h:487
int sysWin() override
Return the system window.
Definition: VinciaQED.h:579
Definition: Settings.h:196
QEDsystem()
Constructor.
Definition: VinciaQED.h:107
Class for a QED splitting system.
Definition: VinciaQED.h:294