8 #ifndef Pythia8_VinciaMergingHooks_H 9 #define Pythia8_VinciaMergingHooks_H 11 #include "Pythia8/MergingHooks.h" 12 #include "Pythia8/PartonLevel.h" 13 #include "Pythia8/UserHooks.h" 14 #include "Pythia8/VinciaCommon.h" 58 vector<ParticleLocator>& mothersIn) :
59 isMultiparticle(false), pid(idIn), multiPtr(nullptr),
60 loc(locIn), listPtr(listPtrIn), mothers(mothersIn) {
61 isResSav = pdata->isResonance(); coltype = pdata->colType(pid);
62 charge = pdata->chargeType(pid); isColSav = coltype != 0;
63 nameSav = pdata->name(pid);}
68 vector<ParticleLocator> & mothersIn) :
69 isMultiparticle(true), nameSav(nameIn), multiPtr(multiPtrIn),
70 loc(locIn), listPtr(listPtrIn), mothers(mothersIn) {
71 pid = multiPtr->id;
charge = multiPtr->charge;
72 isResSav = multiPtr->isRes;
73 coltype = multiPtr->coltypes.size() != 0 ? multiPtr->coltypes.at(0) : 0;
74 isColSav = coltype !=0;}
77 bool isFinal()
const {
return daughters.size() == 0;}
80 bool isBeam()
const {
return loc.level == 0;}
86 bool isRes()
const {
return isResSav;}
87 bool isCol()
const {
return isColSav;}
88 bool isMulti()
const {
return isMultiparticle;}
89 string name()
const {
return nameSav;}
90 int id()
const {
return pid;}
91 int chargeType()
const {
return charge;}
92 int colType()
const {
return coltype;}
93 vector<ParticleLocator> getDaughters()
const {
return daughters;}
101 bool isMultiparticle;
123 vector<ParticleLocator> mothers;
126 vector<ParticleLocator> daughters;
142 pair<HardProcessParticle*, HardProcessParticle*>
getBeams() {
144 if (!particles.empty() && particles[0].size() == 2) {
145 beamAPtr = &particles[0][0]; beamBPtr = &particles[0][1];}
146 return make_pair(beamAPtr,beamBPtr);}
150 if (particles.find(i) != particles.end())
return &particles[i];
151 else return nullptr;}
155 if (particles.find(loc.
level) != particles.end() &&
156 int(particles[loc.
level].size()) > loc.
pos)
157 return &particles[loc.
level].at(loc.
pos);
162 vector<ParticleLocator>& mothersIn);
166 vector<ParticleLocator>& mothersIn);
170 vector<ParticleLocator>& daughters);
175 if (particles.find(level) == particles.end())
176 particles[level] = vector<HardProcessParticle>();
184 map<int, vector<HardProcessParticle>> particles;
199 vector<HardProcessParticle*> leptons;
203 vector<int> resMinusHad;
204 vector<int> resNeutralFCHad;
205 vector<int> resNeutralFNHad;
209 vector<int> resMinusLep;
210 vector<int> resNeutralFCLep;
211 vector<int> resNeutralFNLep;
216 vector<int> resMinusUndecayed;
217 vector<int> resNeutralUndecayed;
224 int nMinBeamChains{0};
225 int nMaxBeamChains{0};
238 bool doHEFTIn,
bool doVBFIn) :
239 verbose(verboseIn), loggerPtr(loggerPtrIn),
240 resolveDecays(resolveDecaysIn), doHEFT(doHEFTIn), doVBF(doVBFIn),
241 isInit(false) {defineMultiparticles();}
244 void initOnProcess(
string process,
ParticleData* particleData)
override;
252 void list()
const {parts.list();}
253 void listLookup()
const;
267 void defineMultiparticles();
269 bool isBeamID(
int id);
274 bool splitProcess(
string process, vector<string>& inWords,
275 vector<string>& outWords);
278 void splitbyWhitespace(
string wordIn, vector<string>& wordsOut,
279 bool atFront =
false);
283 vector<string> inWords,
284 vector<string> outWords);
288 vector<string> inWords,
289 vector<string> outWords,
291 vector<ParticleLocator>& mothersIn,
292 vector<ParticleLocator>& mothersNow);
295 bool addParticle(
ParticleData* particleDataPtr,
int level,
bool isIncoming,
296 string name, vector<ParticleLocator>& mothersIn,
ParticleLocator& loc);
300 vector<ParticleLocator>& daughters) {parts.setDaughters(mother,daughters);}
315 map<string, int> lookupIDfromName;
318 map<int, bool> isFCNres;
321 map<string, MultiParticle> multiparticles;
345 void init()
override;
348 bool setShowerStartingScales(
bool isTrial,
bool,
349 double& pTscaleIn,
const Event& event,
double& pTmaxFSRIn,
bool&,
350 double& pTmaxISRIn,
bool&,
double& pTmaxMPIIn,
bool&)
override;
356 virtual double tmsNow(
const Event& event)
override;
359 virtual bool canVetoStep()
override;
360 virtual bool doVetoStep(
const Event& process,
const Event& event,
bool)
374 virtual bool useShowerPlugin()
override {
return false;}
382 int getVerbose() {
return verbose;}
388 vector<HardProcessParticle*>
getLeptons() {
return colStructSav.leptons;}
392 return int(colStructSav.resPlusUndecayed.size());}
393 int getNResMinusUndecayed() {
394 return int(colStructSav.resMinusUndecayed.size());}
395 int getNResNeutralUndecayed() {
396 return int(colStructSav.resNeutralUndecayed.size());}
400 return colStructSav.resPlusUndecayed;}
401 vector<int> getResMinusUndecayed() {
402 return colStructSav.resMinusUndecayed;}
403 vector<int> getResNeutralUndecayed() {
404 return colStructSav.resNeutralUndecayed;}
408 vector<int> getResMinusLep() {
return colStructSav.resMinusLep;}
409 vector<int> getResNeutralFCLep() {
return colStructSav.resNeutralFCLep;}
410 vector<int> getResNeutralFNLep() {
return colStructSav.resNeutralFNLep;}
414 vector<int> getResMinusHad() {
return colStructSav.resMinusHad;}
415 vector<int> getResNeutralFCHad() {
return colStructSav.resNeutralFCHad;}
416 vector<int> getResNeutralFNHad() {
return colStructSav.resNeutralFNHad;}
420 int getNResMinusHad() {
return colStructSav.resMinusHad.size();}
421 int getNResNeutralFCHad() {
return colStructSav.resNeutralFCHad.size();}
422 int getNResNeutralFNHad() {
return colStructSav.resNeutralFNHad.size();}
423 int getNResHad() {
return getNResPlusHad() + getNResMinusHad() +
424 getNResNeutralFCHad() + getNResNeutralFNHad();}
429 colStructSav.resPlusLep.size();}
430 int getNResMinus() {
return colStructSav.resMinusHad.size() +
431 colStructSav.resMinusLep.size();}
432 int getNResNeutralFC() {
return colStructSav.resNeutralFCHad.size() +
433 colStructSav.resNeutralFCLep.size();}
434 int getNResNeutralFN() {
return colStructSav.resNeutralFNHad.size() +
435 colStructSav.resNeutralFNLep.size();}
439 int getNChainsMax() {
return colStructSav.nMaxBeamChains;}
440 int getNPartons() {
return colStructSav.nColoured;}
441 int getNQPairs() {
return colStructSav.nQQbarPairs;}
459 void setScaleRes(
int iRes,
double scale) {resSysRestartScale[iRes] = scale;}
463 return resSysRestartScale.find(iRes) != resSysRestartScale.end() ?
464 resSysRestartScale[iRes] : tmsCut();}
468 bool canClusRF() {
return doRF;}
469 bool canClusII() {
return doII;}
470 bool canClusIF() {
return doIF;}
473 bool isAboveMS(
const Event& event);
499 double kTmin(
const Event& event);
500 vector<double> cutsMin(
const Event& event);
504 bool setColourStructure();
505 void printColStruct();
508 bool isResDecayProd(
int iPtcl,
const Event& event);
511 vector<int> getJetsInEvent(
const Event& event);
524 bool doFF, doRF, doII, doIF;
527 bool doHEFT{
false}, doVBF{
false};
545 if (vinMergingHooksPtr ==
nullptr || !vinMergingHooksPtr->initSuccess() )
547 else canMergeRes = vinMergingHooksPtr->
canMergeRes();}
552 return vinMergingHooksPtr->getScaleRes(iRes,event);}
557 shared_ptr<VinciaMergingHooks> vinMergingHooksPtr;
bool doVetoNotInResSav
Tell Vincia whether to veto emissions from non-resonance systems.
Definition: VinciaMergingHooks.h:491
map< int, double > resSysRestartScale
Saved information about resonance restart scales.
Definition: VinciaMergingHooks.h:494
pair< HardProcessParticle *, HardProcessParticle * > getBeams()
Fetch pointers to the beams.
Definition: VinciaMergingHooks.h:142
int getNResPlusUndecayed()
Get number of undecayed resonances.
Definition: VinciaMergingHooks.h:391
HardProcessParticle * getPart(ParticleLocator loc)
Get a single particle, given a location.
Definition: VinciaMergingHooks.h:154
vector< int > getResPlusLep()
Get list of leptonically decaying resonances in the hard process.
Definition: VinciaMergingHooks.h:407
virtual bool doVetoEmission(const Event &) override
Overridden base class methods.
Definition: VinciaMergingHooks.h:364
int charge
QED charge,if it has a unique one, otherwise 999.
Definition: VinciaMergingHooks.h:28
virtual bool doVetoTrialEmission(const Event &, const Event &) override
Function to check if trial emission should be rejected.
Definition: VinciaMergingHooks.h:372
Definition: VinciaMergingHooks.h:49
The Event class holds all info on the generated event.
Definition: Event.h:453
vector< int > resPlusUndecayed
Definition: VinciaMergingHooks.h:215
int getNResPlusHad()
Get number of hadronically decaying resonances in the hard process.
Definition: VinciaMergingHooks.h:419
bool hasSetColourStructure()
Get informations about whether colour structure has been set yet.
Definition: VinciaMergingHooks.h:444
vector< HardProcessParticle > * getLevel(int i)
Fetch pointer to particles at i-th level.
Definition: VinciaMergingHooks.h:149
virtual bool canVetoEmission() override
Function to allow not counting a trial emission.
Definition: VinciaMergingHooks.h:365
int getNResPlus()
Definition: VinciaMergingHooks.h:428
HardProcessParticle(int idIn, ParticleDataEntryPtr pdata, ParticleLocator locIn, HardProcessParticleList *listPtrIn, vector< ParticleLocator > &mothersIn)
Construct from particle data.
Definition: VinciaMergingHooks.h:56
void setScaleRes(int iRes, double scale)
Fetch shower restarting scale for resonances.
Definition: VinciaMergingHooks.h:459
Definition: VinciaMergingHooks.h:536
vector< HardProcessParticle * > getLeptons()
Get list of leptons in the hard process.
Definition: VinciaMergingHooks.h:388
virtual bool canCutOnRecState() override
Definition: VinciaMergingHooks.h:369
int nJetMaxResSave
Maximal number of additional jets per resonance system.
Definition: VinciaMergingHooks.h:482
virtual double hardProcessME(const Event &) override
Function to calculate the hard process matrix element.
Definition: VinciaMergingHooks.h:375
double scaleResonance(int iRes, const Event &event) override
Definition: VinciaMergingHooks.h:551
vector< int > getResPlusHad()
Get list of hadronically decaying resonances in the hard process.
Definition: VinciaMergingHooks.h:413
bool canClusFF()
Check if clusterings are allowed.
Definition: VinciaMergingHooks.h:467
void list() const
Print functions.
Definition: VinciaMergingHooks.h:252
bool isFinal() const
Check if final.
Definition: VinciaMergingHooks.h:77
vector< int > resPlusHad
IDs of hadronically decaying resonances.
Definition: VinciaMergingHooks.h:202
vector< int > getResPlusUndecayed()
Get list of undecayed resonances in the hard process.
Definition: VinciaMergingHooks.h:399
void setVerbose(int verboseIn)
Set verbosity.
Definition: VinciaMergingHooks.h:256
vector< HardProcessParticle * > coloured
Pointers to coloured partons, leptons and resonances.
Definition: VinciaMergingHooks.h:198
virtual double dampenIfFailCuts(const Event &) override
Definition: VinciaMergingHooks.h:366
bool isIntermediate() const
Check if intermediate particle.
Definition: VinciaMergingHooks.h:83
virtual bool usesVincia() override
This MergingHooks is for Vincia only.
Definition: VinciaMergingHooks.h:353
~VinciaMergingHooks()
Destructor.
Definition: VinciaMergingHooks.h:342
void setVerbose(int verboseIn)
Set and get verbosity.
Definition: VinciaMergingHooks.h:381
bool isBeam() const
Check if beam particle.
Definition: VinciaMergingHooks.h:80
int nMergeResSys
Number of resonance systems allowed to produce additional jets.
Definition: VinciaMergingHooks.h:485
HardProcessParticle(string nameIn, const MultiParticle *multiPtrIn, ParticleLocator locIn, HardProcessParticleList *listPtrIn, vector< ParticleLocator > &mothersIn)
Construct from multiparticle.
Definition: VinciaMergingHooks.h:66
Definition: VinciaMergingHooks.h:36
ParticleLocator getNextLoc(int level)
Get the next location.
Definition: VinciaMergingHooks.h:173
int pos
Position in vector at a given level.
Definition: VinciaMergingHooks.h:40
int getNChainsMin()
Get information about the beam chains.
Definition: VinciaMergingHooks.h:438
void storeCandidates(const Event &, string) override
Redundant inherited methods - only dummy versions here.
Definition: VinciaMergingHooks.h:247
Definition: MergingHooks.h:38
VinciaHardProcess(Logger *loggerPtrIn, int verboseIn, bool resolveDecaysIn, bool doHEFTIn, bool doVBFIn)
Constructor.
Definition: VinciaMergingHooks.h:237
int id
id, if it has a unique one, otherwise 0.
Definition: VinciaMergingHooks.h:26
Class for Vincia to perform merging.
Definition: VinciaMergingHooks.h:335
int nMaxJetsRes()
Get maximum number of additional jets from resonance decay systems.
Definition: VinciaMergingHooks.h:456
Storage device for containing colour structure of hard process.
Definition: VinciaMergingHooks.h:192
bool canMergeRes()
Check if we are merging in resonance systems.
Definition: VinciaMergingHooks.h:447
Storage device for multiparticle.
Definition: VinciaMergingHooks.h:22
bool isRes() const
Getter methods.
Definition: VinciaMergingHooks.h:86
bool matchesAnyOutgoing(int, const Event &) override
Definition: VinciaMergingHooks.h:248
bool doMergeInVBF()
Check if we are merging in VBF system.
Definition: VinciaMergingHooks.h:450
bool initSuccess()
Check if initialised.
Definition: VinciaMergingHooks.h:259
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
UserHooks is base class for user access to program execution.
Definition: UserHooks.h:32
bool findOtherCandidates(int, const Event &, bool) override
Definition: VinciaMergingHooks.h:249
bool canSetResonanceScale() override
Start resonance showers at a scale of m.
Definition: VinciaMergingHooks.h:550
List of hard particles.
Definition: VinciaMergingHooks.h:134
VinciaMergingHooks()
Constructor.
Definition: VinciaMergingHooks.h:340
virtual double tmsDefinition(const Event &) override
Others.
Definition: VinciaMergingHooks.h:378
bool doMergeRes
Flag to decide if we can merge in resonance systems.
Definition: VinciaMergingHooks.h:488
MergeResScaleHook(MergingHooksPtr mergingHooksPtrIn)
Constructor.
Definition: VinciaMergingHooks.h:541
MergingHooks is base class for user input to the merging procedure.
Definition: MergingHooks.h:166
virtual int getNumberOfClusteringSteps(const Event &, bool) override
Function to return the number of clustering steps for the current event.
Definition: VinciaMergingHooks.h:367
This class holds a map of all ParticleDataEntries.
Definition: ParticleData.h:422
Container for the hard process used in Vincia merging.
Definition: VinciaMergingHooks.h:232
bool allowHEFT()
Check if we are allowing HEFT couplings.
Definition: VinciaMergingHooks.h:453
vector< int > resPlusLep
IDs of leptonically decaying resonances.
Definition: VinciaMergingHooks.h:208
bool initSuccess()
Check if initialisation succeeded.
Definition: VinciaMergingHooks.h:385
virtual bool doCutOnRecState(const Event &) override
Definition: VinciaMergingHooks.h:370
double getScaleRes(int iRes, const Event &)
Fetch shower starting scale for resonances.
Definition: VinciaMergingHooks.h:462
int level
Increment level for every resonance decay.
Definition: VinciaMergingHooks.h:38
virtual bool canVetoTrialEmission() override
Function to allow not counting a trial emission.
Definition: VinciaMergingHooks.h:371