PYTHIA
8.312
|
Declaration of main UserHooks class to perform Madgraph matching. More...
#include <JetMatching.h>
Public Member Functions | |
JetMatchingMadgraph () | |
Constructor and destructor. | |
bool | initAfterBeams () |
Initialisation. More... | |
bool | canVetoProcessLevel () |
Process level vetos. | |
bool | doVetoProcessLevel (Event &process) |
Process level vetos. More... | |
int | numberVetoStep () |
Shower step vetoes (after the first emission, for Shower-kT scheme) | |
bool | canVetoStep () |
bool | doVetoStep (int, int, int, const Event &) |
vector< double > | getDJR () |
pair< int, int > | nMEpartons () |
Event | getWorkEventJet () |
Event | getProcessSubset () |
bool | getExclusive () |
double | getPTfirst () |
void | sortIncomingProcess (const Event &) |
Different steps of the matching algorithm. More... | |
void | jetAlgorithmInput (const Event &, int) |
Step (2a): pick which particles to pass to the jet algorithm. More... | |
void | runJetAlgorithm () |
bool | matchPartonsToJets (int) |
Step (2c): veto decision (returning true vetoes the event) More... | |
int | matchPartonsToJetsLight () |
int | matchPartonsToJetsHeavy () |
int | matchPartonsToJetsOther () |
bool | doShowerKtVeto (double pTfirst) |
void | clearDJR () |
Functions to clear and set the jet clustering scales. | |
void | setDJR (const Event &event) |
Function to set the jet clustering scales (to be used as output) More... | |
void | clear_nMEpartons () |
Functions to clear and set the jet clustering scales. | |
void | set_nMEpartons (const int nOrig, const int nMatch) |
int | npNLO () |
Public Member Functions inherited from JetMatching | |
JetMatching () | |
Constructor and destructor. | |
~JetMatching () | |
bool | canVetoPartonLevelEarly () |
Parton level vetos (before beam remnants and resonance decays) | |
bool | doVetoPartonLevelEarly (const Event &event) |
Early parton level veto (before beam remnants and resonance showers) More... | |
void | errorMsg (string messageIn) |
Print a message the first few times. Insert in database. More... | |
Public Member Functions inherited from UserHooks | |
virtual | ~UserHooks () |
Destructor. | |
virtual bool | canModifySigma () |
Possibility to modify cross section of process. | |
virtual double | multiplySigmaBy (const SigmaProcess *sigmaProcessPtr, const PhaseSpace *phaseSpacePtr, bool inEvent) |
Multiplicative factor modifying the cross section of a hard process. More... | |
virtual bool | canBiasSelection () |
Possibility to bias selection of events, compensated by a weight. | |
virtual double | biasSelectionBy (const SigmaProcess *sigmaProcessPtr, const PhaseSpace *phaseSpacePtr, bool inEvent) |
Multiplicative factor in the phase space selection of a hard process. More... | |
virtual double | biasedSelectionWeight () |
Event weight to compensate for selection weight above. | |
virtual bool | canSetLowEnergySigma (int, int) const |
virtual double | doSetLowEnergySigma (int, int, double, double, double) const |
virtual bool | canVetoResonanceDecays () |
Possibility to veto resonance decay chain. | |
virtual bool | doVetoResonanceDecays (Event &) |
virtual bool | canVetoPT () |
virtual double | scaleVetoPT () |
Transverse-momentum scale for veto test. | |
virtual bool | doVetoPT (int, const Event &) |
virtual bool | canVetoMPIStep () |
virtual int | numberVetoMPIStep () |
Up to how many MPI steps should be checked. | |
virtual bool | doVetoMPIStep (int, const Event &) |
virtual bool | retryPartonLevel () |
virtual bool | canVetoPartonLevel () |
Possibility to veto event after parton-level selection. | |
virtual bool | doVetoPartonLevel (const Event &) |
virtual bool | canSetResonanceScale () |
Possibility to set initial scale in TimeShower for resonance decay. | |
virtual double | scaleResonance (int, const Event &) |
virtual bool | canVetoISREmission () |
Possibility to veto an emission in the ISR machinery. | |
virtual bool | doVetoISREmission (int, const Event &, int) |
virtual bool | canVetoFSREmission () |
Possibility to veto an emission in the FSR machinery. | |
virtual bool | doVetoFSREmission (int, const Event &, int, bool=false) |
virtual bool | canVetoMPIEmission () |
Possibility to veto an MPI. | |
virtual bool | doVetoMPIEmission (int, const Event &) |
virtual bool | canReconnectResonanceSystems () |
Possibility to reconnect colours from resonance decay systems. | |
virtual bool | doReconnectResonanceSystems (int, Event &) |
virtual bool | canChangeFragPar () |
Can change fragmentation parameters. | |
virtual void | setStringEnds (const StringEnd *, const StringEnd *, vector< int >) |
virtual bool | doChangeFragPar (StringFlav *, StringZ *, StringPT *, int, double, vector< int >, const StringEnd *) |
virtual bool | doVetoFragmentation (Particle, const StringEnd *) |
virtual bool | doVetoFragmentation (Particle, Particle, const StringEnd *, const StringEnd *) |
virtual bool | canVetoAfterHadronization () |
virtual bool | doVetoAfterHadronization (const Event &) |
Do the actual veto after hadronization. | |
virtual bool | canSetImpactParameter () const |
Can set the overall impact parameter for the MPI treatment. | |
virtual double | doSetImpactParameter () |
Set the overall impact parameter for the MPI treatment. | |
virtual bool | onEndHadronLevel (HadronLevel &, Event &) |
Custom processing at the end of HadronLevel::next. | |
Public Member Functions inherited from PhysicsBase | |
void | initInfoPtr (Info &infoPtrIn) |
This function is called from above for physics objects used in a run. More... | |
virtual | ~PhysicsBase () |
Empty virtual destructor. | |
bool | flag (string key) const |
Shorthand to read settings values. | |
int | mode (string key) const |
double | parm (string key) const |
string | word (string key) const |
vector< bool > | fvec (string key) const |
vector< int > | mvec (string key) const |
vector< double > | pvec (string key) const |
vector< string > | wvec (string key) const |
Public Attributes | |
SlowJet * | slowJetDJR |
Additional Inherited Members | |
Public Types inherited from PhysicsBase | |
enum | Status { INCOMPLETE = -1, COMPLETE = 0, CONSTRUCTOR_FAILED, INIT_FAILED, LHEF_END, LOWENERGY_FAILED, PROCESSLEVEL_FAILED, PROCESSLEVEL_USERVETO, MERGING_FAILED, PARTONLEVEL_FAILED, PARTONLEVEL_USERVETO, HADRONLEVEL_FAILED, CHECK_FAILED, OTHER_UNPHYSICAL, HEAVYION_FAILED, HADRONLEVEL_USERVETO } |
Enumerate the different status codes the event generation can have. | |
Protected Types inherited from JetMatching | |
enum | vetoStatus { NONE, LESS_JETS, MORE_JETS, HARD_JET, UNMATCHED_PARTON, INCLUSIVE_VETO } |
enum | partonTypes { ID_CHARM =4, ID_BOT =5, ID_TOP =6, ID_LEPMIN =11, ID_LEPMAX =16, ID_GLUON =21, ID_PHOTON =22 } |
Protected Member Functions inherited from UserHooks | |
UserHooks () | |
Constructor. | |
virtual void | onInitInfoPtr () override |
After initInfoPtr, initialize workEvent. More... | |
void | omitResonanceDecays (const Event &process, bool finalOnly=false) |
omitResonanceDecays omits resonance decay chains from process record. More... | |
void | subEvent (const Event &event, bool isHardest=true) |
subEvent extracts currently resolved partons in the hard process. More... | |
Protected Member Functions inherited from PhysicsBase | |
PhysicsBase () | |
Default constructor. | |
virtual void | onBeginEvent () |
This function is called in the very beginning of each Pythia::next call. | |
virtual void | onEndEvent (Status) |
virtual void | onStat () |
This function is called from the Pythia::stat() call. | |
void | registerSubObject (PhysicsBase &pb) |
Register a sub object that should have its information in sync with this. | |
Protected Attributes inherited from JetMatching | |
bool | doMerge |
Master switch for merging. | |
bool | doShowerKt |
int | nJetMax |
Maximum and current number of jets. | |
int | nJet |
int | jetAlgorithm |
Jet algorithm parameters. | |
double | eTjetMin |
double | coneRadius |
double | etaJetMax |
double | etaJetMaxAlgo |
CellJet * | cellJet |
Internal jet algorithms. | |
SlowJet * | slowJet |
SlowJet * | slowJetHard |
HJSlowJet * | hjSlowJet |
int | slowJetPower |
SlowJet specific. | |
Event | eventProcessOrig |
Event | eventProcess |
Event | workEventJet |
vector< int > | typeIdx [3] |
Sort final-state of incoming process into light/heavy jets and 'other'. | |
set< int > | typeSet [3] |
vector< Vec4 > | jetMomenta |
int | nEta |
CellJet specific. | |
int | nPhi |
double | eTseed |
double | eTthreshold |
int | jetAllow |
Merging procedure parameters. | |
int | jetMatch |
int | exclusiveMode |
double | coneMatchLight |
double | coneRadiusHeavy |
double | coneMatchHeavy |
bool | exclusive |
double | eTpTlightMin |
Store the minimum eT/pT of matched light jets. | |
map< string, int > | messages |
Map for all error messages. | |
Protected Attributes inherited from UserHooks | |
Event | workEvent = {} |
Have one event object around as work area. | |
double | selBias = 1. |
User-imposed selection bias. | |
double | enhancedEventWeight = {} |
Bookkept quantities for boosted event weights. | |
double | pTEnhanced = {} |
double | wtEnhanced = {} |
Protected Attributes inherited from PhysicsBase | |
Info * | infoPtr = {} |
Settings * | settingsPtr = {} |
Pointer to the settings database. | |
ParticleData * | particleDataPtr = {} |
Pointer to the particle data table. | |
Logger * | loggerPtr = {} |
Pointer to logger. | |
HadronWidths * | hadronWidthsPtr = {} |
Pointer to the hadron widths data table. | |
Rndm * | rndmPtr = {} |
Pointer to the random number generator. | |
CoupSM * | coupSMPtr = {} |
Pointers to SM and SUSY couplings. | |
CoupSUSY * | coupSUSYPtr = {} |
BeamSetup * | beamSetupPtr = {} |
BeamParticle * | beamAPtr = {} |
BeamParticle * | beamBPtr = {} |
BeamParticle * | beamPomAPtr = {} |
BeamParticle * | beamPomBPtr = {} |
BeamParticle * | beamGamAPtr = {} |
BeamParticle * | beamGamBPtr = {} |
BeamParticle * | beamVMDAPtr = {} |
BeamParticle * | beamVMDBPtr = {} |
PartonSystems * | partonSystemsPtr = {} |
Pointer to information on subcollision parton locations. | |
SigmaTotal * | sigmaTotPtr = {} |
Pointers to the total/elastic/diffractive cross sections. | |
SigmaCombined * | sigmaCmbPtr = {} |
set< PhysicsBase * > | subObjects |
UserHooksPtr | userHooksPtr |
Static Protected Attributes inherited from JetMatching | |
static const bool | MATCHINGDEBUG = false |
Constants to be changed for debug printout or extra checks. More... | |
static const bool | MATCHINGCHECK = false |
static const int | TIMESTOPRINT = 1 |
Number of times the same error message is repeated, unless overridden. | |
Declaration of main UserHooks class to perform Madgraph matching.
|
inlinevirtual |
Possibility to veto MPI + ISR + FSR evolution and kill event, making decision after fixed number of ISR or FSR steps.
Reimplemented from JetMatching.
|
inline |
Only check veto in the shower-kT scheme.
Reset veto code
Find the (kinematical) pT of the softest (light) parton in the hard process.
Veto if the softest hard process parton is below Qcut.
For non-highest multiplicity, veto if the hardest emission is harder than Qcut.
For highest multiplicity sample, veto if the hardest emission is harder than the hard process parton.
Return veto
|
inlinevirtual |
Process level vetos.
Setup for veto if hard ME has too many partons. This is done to achieve consistency with the Pythia6 implementation.
Clear the event of MPI systems and resonace decay products. Store trimmed event in workEvent.
Veto in case the hard input matrix element already has too many partons.
Done
Reimplemented from JetMatching.
|
inlinevirtual |
Decide whether to veto current event or not, based on event record. Usage: doVetoStep( iPos, nISR, nFSR, event), where iPos as above, nISR and nFSR number of emissions so far for hard interaction only.
Do not perform any veto if not in the Shower-kT scheme.
Do nothing for emissions after the first one.
Do nothing in resonance decay showers.
Clear the event of MPI systems and resonace decay products. Store trimmed event in workEvent.
Get (kinematical) pT of first emission
Get weak bosons, for later checks if the emission is a "QCD emission".
Check if any of the EW bosons are ancestors of this parton. This should never happen for the first non-resonance shower emission. Check just to be sure.
Get position of this parton in the actual event (workEvent does not contain right mother-daughter relations). Stored in daughters.
Done for a QCD emission.
Store things that are necessary to perform the shower-kT veto externally.
Done if only inputs for an external vetoing procedure should be stored.
Check veto.
No veto if come this far.
Reimplemented from JetMatching.
|
inline |
Functions to return the jet clustering scales and number of ME partons. These are useful to investigate the matching systematics.
|
inline |
For systematic variations of the jet matching parameters, it is helpful to decouple the jet matching veto from the internal book-keeping. The veto can then be applied in hindsight by an expert user. The functions below return all the necessary information to do this.
|
inlinevirtual |
Initialisation.
Main implementation of Madgraph UserHooks class. This may be split out to a separate C++ file if desired, but currently included here for ease of use. Initialisation routine automatically called from Pythia::init(). Setup all parts needed for the merging.
Initialise values for stored jet matching veto inputs.
Read in Madgraph specific configuration variables
If Madgraph parameters are present, then parse in MadgraphPar object
Set Madgraph merging parameters from the file if requested
Warn if setMad requested, but one or more parameters not present
Read in FxFx matching parameters
Read in Madgraph merging parameters
Read in jet algorithm parameters
Matching procedure
Read if veto should be performed internally.
If not merging, then done
Exclusive mode; if set to 2, then set based on nJet/nJetMax
No nJet or nJetMax, so default to exclusive mode
Initialise chosen jet algorithm. Currently, this only supports the kT-algorithm in SlowJet. Use the QCD distance measure by default.
For FxFx, also initialise jet algorithm to define matrix element jets. Currently, this only supports the kT-algorithm in SlowJet. Use the QCD distance measure by default.
To access the DJR's
A special version of SlowJet to handle heavy and other partons
Setup local event records
Print information
Implements JetMatching.
|
inlinevirtual |
Step (2a): pick which particles to pass to the jet algorithm.
Take input from 'workEvent' and put output in 'workEventJet'
Loop over particles and decide what to pass to the jet algorithm
jetAllow option to disallow certain particle types
Remove all non-QCD partons from veto list
Get the index of this particle in original event
Start with particle idx, and afterwards track mothers
Light jets
Do not include if originates from heavy jet or 'other'
Made it to start of event record so done
Otherwise next mother and continue
Heavy jets
Only include if originates from heavy jet
Made it to start of event record with no heavy jet mother, so DO NOT include particle
Otherwise next mother and continue
Other jets
Only include if originates from other jet
Made it to start of event record with no heavy jet mother, so DO NOT include particle
Otherwise next mother and continue
if (iType)
while (true)
for (i)
Implements JetMatching.
|
inlinevirtual |
Step (2c): veto decision (returning true vetoes the event)
Use different routines for light/heavy/other jets as different veto conditions and for clarity
Record the jet separations here, also if matchPartonsToJetsLight returns preemptively.
Perform jet matching.
Implements JetMatching.
|
inlinevirtual |
Step(2c): heavy jets Return codes are given indicating the reason for a veto. Although not currently used, they are a useful debugging tool: 0 = no veto as there are no extra jets present 1 = veto as in exclusive mode and extra jets present 2 = veto as in inclusive mode and extra jets were harder than any matched light jet
Currently, heavy jets are unmatched If there are no extra jets, then accept jetMomenta is NEVER used by MadGraph and is always empty. This check does nothing. Rather, if there is any heavy flavor that is harder than what is present at the LHE level, then the event should be vetoed.
if (jetMomenta.empty()) return NONE; Count the number of hard partons
Rescale the heavy partons that are from the hard process to have pT=collider energy. Soft/collinear gluons will cluster onto them, leaving a remnant of hard emissions.
Count the number of clusters with pT>qCut. This includes the original hard partons plus any hard emissions.
Debug printout.
Count of the number of hadronic jets in SlowJet accounting int nCLjets = nClus - nJets; Get number of partons. Different for MLM and FxFx schemes.
Veto event if too few hadronic jets
In exclusive mode, do not allow more hadronic jets than partons
No extra jets were present so no veto
Implements JetMatching.
|
inlinevirtual |
Step(2c): light jets Return codes are given indicating the reason for a veto. Although not currently used, they are a useful debugging tool: 0 = no veto 1 = veto as number of jets less than number of partons 2 = veto as exclusive mode and number of jets greater than number of partons 3 = veto as inclusive mode and there would be an extra jet that is harder than any matched soft jet 4 = veto as there is a parton which does not match a jet
Store things that are necessary to perform the kT-MLM veto externally.
Done if only inputs for an external vetoing procedure should be stored.
Count the number of hard partons
Initialize SlowJet with current working event
Cluster in steps to find all hadronic jets at the scale qCut
Debug printout.
Count of the number of hadronic jets in SlowJet accounting
Get number of partons. Different for MLM and FxFx schemes. Note: Difference compared to old versions of FxFx (cf. arXiv:2108.07826): For FxFx, change nRequested subtracting the typeIdx[2] partons Exclude the highest multiplicity sample in the case of real emissions, exclude all typeIdx[2] particles (npNLO=multiplicity, nJetMax=njmax(shower_card), typeIdx[2]="Weak" jets)
Note: Difference compared to old versions of FxFx (cf. arXiv:2108.07826): For FxFx veto the real emissions that have only typeIdx=2 partons Exclude the highest multiplicity sample
Veto event if too few hadronic jets
In exclusive mode, do not allow more hadronic jets than partons
For FxFx, in the non-highest multipicity, all jets need to matched to partons. For nCLjets > nRequested, this is not possible. Hence, we can veto here already. Note: Difference wrt. old versions of FxFx (cf. arXiv:2108.07826): Change the nRequested to npNLO() in the first condition. This way we correctly select the non-highest multipicity regardless the nRequested
Now continue in inclusive mode. In inclusive mode, there can be more hadronic jets than partons, provided that all partons are properly matched to hadronic jets. Start by setting up the jet algorithm.
For FxFx, continue clustering as long as the jet separation is above qCut.
For MLM, cluster into hadronic jets until there are the same number as partons.
Sort partons in pT. Update local qCut value. Hadronic jets are already sorted in pT.
Update scale if clustering factor is non-zero
Construct a master copy of the event containing only the hardest nParton hadronic clusters. While constructing the event, the parton type (ID_GLUON) and status (98,99) are arbitrary.
This keeps track of which hadronic jets are matched to parton
This keeps track of which partons are matched to which hadronic jets.
Begin matching. Do jet matching for FxFx. Make sure that the nPartonsNow hardest hadronic jets are matched to any of the nPartonsNow (+1) partons. This matching is done by attaching a jet from the list of unmatched hadronic jets, and appending a jet from the list of partonic jets, one at a time. The partonic jet will be clustered with the hadronic jet or the beam if the distance measure is below the cut. The hadronic jet is matched once this happens. Otherwise, another partonic jet is tried. When a hadronic jet is matched to a partonic jet, it is removed from the list of unmatched hadronic jets. This process continues until the nPartonsNow hardest hadronic jets are matched to partonic jets, or it is not possible to make a match for a hadronic jet.
Check if this shower jet matches any partonic jet.
Only assign a parton once. for (int j=0; j < tempSize; ++j ) if ( partonMatchesJet[i][j]) continue;
Attach a single hadronic jet.
Attach the current parton.
Setup jet algorithm.
These are the conditions for the hadronic jet to match the parton at the local qCut scale
End loop over hard partons.
Veto if the jet could not be assigned to any parton.
Continue;
Jet matching veto for FxFx
Note: Difference wrt. old versions of FxFx (cf. arXiv:2108.07826): Change the nRequested to npNLO() in the first condition (cf. above). This way we correctly select the non-highest multipicity regardless the nRequested
Do jet matching for MLM. Take the list of unmatched hadronic jets and append a parton, one at a time. The parton will be clustered with the "closest" hadronic jet or the beam if the distance measure is below the cut. When a hadronic jet is matched to a parton, it is removed from the list of unmatched hadronic jets. This process continues until all hadronic jets are matched to partons or it is not possible to make a match.
Append unmatched hadronic jets
Append the current parton
These are the conditions for the hadronic jet to match the parton at the local qCut scale
Identify the hadronic jet that matches the parton
Minimal eT/pT (CellJet/SlowJet) of matched light jets. Needed later for heavy jet vetos in inclusive mode. This information is not used currently.
Record the jet separations.
No veto
Implements JetMatching.
|
inline |
Step(2c): other jets Return codes are given indicating the reason for a veto. Although not currently used, they are a useful debugging tool: 0 = no veto as there are no extra jets present 1 = veto as in exclusive mode and extra jets present 2 = veto as in inclusive mode and extra jets were harder than any matched light jet
Currently, heavy jets are unmatched If there are no extra jets, then accept jetMomenta is NEVER used by MadGraph and is always empty. This check does nothing. Rather, if there is any heavy flavor that is harder than what is present at the LHE level, then the event should be vetoed.
if (jetMomenta.empty()) return NONE; Count the number of hard partons
Rescale the heavy partons that are from the hard process to have pT=collider energy. Soft/collinear gluons will cluster onto them, leaving a remnant of hard emissions.
Count the number of clusters with pT>qCut. This includes the original hard partons plus any hard emissions.
Debug printout.
Count of the number of hadronic jets in SlowJet accounting int nCLjets = nClus - nJets; Get number of partons. Different for MLM and FxFx schemes.
Veto event if too few hadronic jets
In exclusive mode, do not allow more hadronic jets than partons
No extra jets were present so no veto
|
inline |
Function to get the current number of partons in the Born state, as read from LHE.
|
inlinevirtual |
Step (2b): run jet algorithm and provide common output This does nothing, because the jet algorithm is run several times in the matching algorithm.
Implements JetMatching.
|
inline |
Function to set the jet clustering scales (to be used as output)
Clear members.
Initialize SlowJetDJR jet algorithm with event
Cluster in steps to find all hadronic jets
Save the next clustering scale.
Perform step.
Save clustering scales in reserve order.
|
inlinevirtual |
Different steps of the matching algorithm.
Step (1): sort the incoming particles.
Note: The functions below have been made public to ease the generation of Python bindings. protected:
Remove resonance decays from original process and keep only final state. Resonances will have positive status code after this step.
Note: Compared to older versions (cf. arXiv:2108.07826): No more preclustering for FxFx.
Note: Compared to older versions (cf. arXiv:2108.07826): Set the same eventProcess for both MLM and FxFx. This was done separately for FxFx before. Add the type 2 selection also for FxFx
For jet matching, simply take hard process state from workEvent.
Sort original process final state into light/heavy jets and 'other'. Criteria: 1 <= ID <= nQmatch, or ID == 21 –> light jet (typeIdx[0]) nQMatch < ID –> heavy jet (typeIdx[1]) All else that is colored –> other (typeIdx[2]) Note that 'typeIdx' stores indices into 'eventProcess' (after resonance decays are omitted), while 'typeSet' stores indices into the original process record, 'eventProcessOrig', but these indices are also valid in 'event'.
Ignore non-final state and default to 'other'
Light jets: all gluons and quarks with id less than or equal to nQmatch
Crucial point FxFx: MG5 puts the scale of a not-to-be-matched quark 1 MeV lower than scalup. For such particles, we should keep the default "2"
Crucial point: MG puts the scale of a non-QCD particle to eCM. For such particles, we should keep the default "2"
Heavy jets: all quarks with id greater than nQmatch
Update to include non-SM colored particles
Store
Exclusive mode; if set to 2, then set based on nJet/nJetMax
Inclusive if nJet == nJetMax, exclusive otherwise
Otherwise, just set as given
Extract partons from hardest subsystem + ISR + FSR only into workEvent. Note no resonance showers or MPIs.
Store things that are necessary to perform the kT-MLM veto externally.
Implements JetMatching.
SlowJet* slowJetDJR |
Jet algorithm to access the jet separations in the cleaned event after showering.