PYTHIA  8.311
Classes | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
EvtGenDecays Class Reference

#include <EvtGen.h>

Classes

struct  Signal
 Map of signal particle info. More...
 

Public Member Functions

 EvtGenDecays (Pythia *pythiaPtrIn, string decayFile, string particleDataFile, EvtExternalGenList *extPtrIn=0, EvtAbsRadCorr *fsrPtrIn=0, int mixing=1, bool xml=false, bool limit=true, bool extUse=true, bool fsrUse=true)
 Constructor. More...
 
 ~EvtGenDecays ()
 Destructor.
 
double decay ()
 Perform all decays and return the event weight. More...
 
void exclude (int id)
 Stop EvtGen decaying a particle.
 
void updatePythia ()
 Update the Pythia particle database from EvtGen. More...
 
void updateEvtGen ()
 Update the EvtGen particle database from Pythia. More...
 
void readDecayFile (string decayFile, bool xml=false)
 Read an EvtGen user decay file.
 

Public Attributes

bool extOwner
 External model pointer and FSR model pointer.
 
bool fsrOwner
 
EvtExternalGenList * extPtr
 
EvtAbsRadCorr * fsrPtr
 
std::list< EvtDecayBase * > models
 
map< int, Signalsignals
 
string signalSuffix
 The suffix indicating an EvtGen particle or alias is signal.
 

Protected Member Functions

void updateData (bool final=false)
 Update the particles to decay with EvtGen, and the selected signals. More...
 
void updateEvent (Particle *pyPro, EvtParticle *egPro, vector< int > *pySigs=0, vector< EvtParticle * > *egSigs=0, vector< double > *bfs=0, double *wgt=0)
 Update the Pythia event record with an EvtGen decay tree. More...
 
bool checkVertex (Particle *pyPro)
 Check if a particle can decay. More...
 
bool checkSignal (Particle *pyPro)
 Check if a particle is signal.
 
bool checkOsc (EvtParticle *egPro)
 Check if an EvtGen particle has oscillated. More...
 

Protected Attributes

PythiapythiaPtr
 The pointer to the associated Pythia object.
 
EvtGenRandom rndm
 Random number wrapper for EvtGen.
 
EvtGen * evtgen
 The EvtGen object.
 
set< int > incIds
 Set of particle IDs to include and exclude decays with EvtGen.
 
set< int > excIds
 
bool updated
 Flag whether the final particle update has been performed.
 
map< int, Signal >::iterator signal
 The selected signal iterator.
 
double tau0Max
 Parameters used to check if a particle should decay (as set via Pythia).
 
double tauMax
 
double rMax
 
double xyMax
 
double zMax
 
bool limitTau0
 
bool limitTau
 
bool limitRadius
 
bool limitCylinder
 
bool limitDecay
 

Static Protected Attributes

static const int NTRYDECAY = 1000
 Number of times to try a decay sampling (constant).
 

Detailed Description

A class to perform decays via the external EvtGen decay program, see http:///evtgen.warwick.ac.uk/, the program manual provided with the EvtGen distribution, and D. J. Lange, Nucl. Instrum. Meth. A462, 152 (2001) for details. EvtGen performs a series of decays from some initial particle decay, rather than just a single decay, and so EvtGen cannot be interfaced through the standard external DecayHandler class without considerable complication. Consequently, EvtGen is called on the complete event record after all steps of Pythia are completed. Oftentimes a specific "signal" decay is needed to occur once in an event, and all other decays performed normally. This is possible via reading in a user decay file (with readDecayFile) and creating aliased particles with names ending with signalSuffix. By default, this is "_SIGNAL". When decay() is called, all particles in the Pythia event record that are of the same types as the signal particles are collected. One is selected at random and decayed via the channel(s) defined for that aliased signal particle. All other particles are decayed normally. The weight for the event is calculated and returned. It is also possible to specify a status needed to consider a particle as a signal candidate. This can be done by modifying the signals map, e.g. if the tau- is a signal candidate, then EvtGenDecays.signals[15].status = 201 will only only select as candidates any tau- with this status. This allows the event record to be changed before decays, so only certain particles are selected as possible signal candidates (e.g. passing kinematic requirements). Please note that particles produced from a signal candidate decay are not searched for additional signal candidates. This means that if B0 and tau- have been designated as signal, then a tau- from a W- decay would be a signal candidate, while a tau- from a B0 decay would not. This restriction arises from the additional complexity of allowing recursive signal decays. The following statuses are used: 93 for particles decayed with EvtGen, 94 for particles oscillated with EvtGen, 95 for signal particles, and 96 for signal particles from an oscillation.

Constructor & Destructor Documentation

EvtGenDecays ( Pythia pythiaPtrIn,
string  decayFile,
string  particleDataFile,
EvtExternalGenList *  extPtrIn = 0,
EvtAbsRadCorr *  fsrPtrIn = 0,
int  mixing = 1,
bool  xml = false,
bool  limit = true,
bool  extUse = true,
bool  fsrUse = true 
)

Constructor.

The constructor.

The EvtGenDecays object is associated with a single Pythia instance. This is to ensure a consistent random number generator across the two, as well as any updates to particle data, etc. Note that if multiple EvtGenDecays objects exist, that they will modify one anothers particle databases due to the design of EvtGen. This constructor also sets all particles to be decayed by EvtGen as stable within Pythia. The parameters within Pythia used to check if a particle should be decayed, as described in the "Particle Decays" section of the Pythia manual, are set. Note that if the variable "limit" is set to "false", then no check will be made before decaying a particle with EvtGen. The constructor is designed to have the exact same form as the EvtGen constructor except for these five differences. (1) The first variable is the pointer to the Pythia object. (2) The third last argument is a flag to limit decays based on the Pythia criteria (based on the particle decay vertex). (3) The second last argument is a flag if external models should be passed to EvtGen (default is true). (4) The last argument is a flag if an FSR model should be passed to EvtGen (default is true). (5) No random engine pointer is passed, as this is obtained from Pythia. pythiaPtrIn: the pointer to the associated Pythia object. decayFile: the name of the decay file to pass to EvtGen. particleDataFile: the name of the particle data file to pass to EvtGen. extPtrIn: the optional EvtExternalGenList pointer, this must be be provided if fsrPtrIn is provided to avoid double initializations. fsrPtrIn: the EvtAbsRadCorr pointer to pass to EvtGen. mixing: the mixing type to pass to EvtGen. xml: flag to use XML files to pass to EvtGen. limit: flag to limit particle decays based on Pythia criteria. extUse: flag to use external models with EvtGen. fsrUse: flag to use radiative correction engine with EvtGen.

Initialize EvtGen.

Get the Pythia decay limits.

Member Function Documentation

bool checkOsc ( EvtParticle *  egPro)
protected

Check if an EvtGen particle has oscillated.

The criteria defined here for oscillation is a single daughter but with a different ID from the mother.

bool checkVertex ( Particle pyPro)
protected

Check if a particle can decay.

Modified slightly from ParticleDecays::checkVertex.

double decay ( )

Perform all decays and return the event weight.

All particles in the event record that can be decayed by EvtGen are decayed. If a particle is a signal particle, then this is stored in a vector of signal particles. A signal particle is only stored if its status is the same as the status provided in the signals map. A negative status in the signal map indicates that all statuses should be accepted. After all signal particles are identified, one is randomly chosen and decayed as signal. The remainder are decayed normally. Forcing a signal decay changes the weight of an event from unity, and so the relative event weight is returned, given the forced signal decay. A weight of 0 indicates no signal in the event, while a weight of -1 indicates something is wrong, e.g. either the Pythia or EvtGen pointers are not available or the number of tries has been exceeded. For the event weight to be valid, one should not change the absolute branching fractions in the signal and inclusive definitions, but rather just remove the unwanted decay channels from the signal decay definition.

Reset the signal and signal counters.

Loop over all particles in the Pythia event.

Check particle is final and can be decayed by EvtGen.

Decay the progenitor with EvtGen.

Add oscillations to event record.

Undo decay if signal (duplicate to stop oscillations).

If not signal, add to event record.

Determine the decays of the signal particles (signal or background).

Decay the signal particles and mark forced decay.

Delete all EvtGen particles and return weight.

void updateData ( bool  final = false)
protected

Update the particles to decay with EvtGen, and the selected signals.

If final is false, then only signals are initialized in the signal map. Any particle or alias that ends with signalSuffix is taken as a signal particle. If final is true all particle entries in EvtGen are checked to see if they should be set stable in Pythia. If an EvtGen particle has no decay modes, then Pythia is still allowed to decay the particle. Additionally, the signal decay channels are turned off for the non-aliased signal particle.

Loop over the EvtGen entries.

Stop Pythia from decaying the particle and include in decay set.

Check for signal.

Get the signal and background decay modes.

Sum signal branching fractions.

Sum remaining background branching fractions.

void updateEvent ( Particle pyPro,
EvtParticle *  egPro,
vector< int > *  pySigs = 0,
vector< EvtParticle * > *  egSigs = 0,
vector< double > *  bfs = 0,
double *  wgt = 0 
)
protected

Update the Pythia event record with an EvtGen decay tree.

The production vertex of each particle (which can also be obtained in EvtGen via EvtParticle::get4Pos()) is set by the decay vertex of its mother, which in turn is calculated from the mother's lifetime. The status code 93 is used to indicate an external decay, while the status code 94 is used to indicate an oscillated external decay. If the progenitor has a single daughter with the same ID, this daughter is used as the progenitor. This is used to prevent double oscillations. If the arguments after egPro are no NULL and a particle in the decay tree is a signal particle, the decay for this particle is removed and the particle is stored as a signal candidate in the pySigs and egSigs vectors, to be decayed later. However, if any of these arguments is NULL then the entire tree is written.

Set up the mother vector.

Loop over the mothers.

Check if particle can decay.

Set the children of the mother.

void updateEvtGen ( )

Update the EvtGen particle database from Pythia.

The particle update database between Pythia and EvtGen is not symmetric. Particularly, it is not possible to update the spin type, charge, or nominal lifetime in the EvtGen particle database.

void updatePythia ( )

Update the Pythia particle database from EvtGen.

Note that only the particle spin type, charge type, nominal mass, width, minimum mass, maximum mass, and nominal lifetime are set. The name string is not set.


The documentation for this class was generated from the following file: