30 using namespace genie;
65 TLorentzVector v4(0,0,0,0);
70 double p = TMath::Sqrt(E*E-M*M);
72 TLorentzVector p4(0,0,p,E);
79 LOG(
"NHL",
pINFO) <<
"Generating decay...";
82 LOG(
"NHL",
pINFO) <<
"Decay product IDs: " << pdgv;
83 assert ( pdgv.
size() > 1);
85 LOG(
"NHL",
pINFO) <<
"Performing a phase space decay...";
91 double * mass =
new double[pdgv.
size()];
93 for(pdg_iter = pdgv.begin(); pdg_iter != pdgv.end(); ++pdg_iter) {
101 <<
"Decaying N = " << pdgv.
size() <<
" particles / total mass = " << sum;
106 TLorentzVector * p4d = nhl->
GetP4();
107 TLorentzVector * v4d = nhl->
GetX4();
116 <<
" *** Phase space decay is not permitted \n" 117 <<
" Total particle mass = " << sum <<
"\n" 125 exception.
SetReason(
"Decay not permitted kinematically");
133 for(
int idec=0; idec<200; idec++) {
135 wmax = TMath::Max(wmax,w);
141 <<
"Max phase space gen. weight @ current hadronic system: " << wmax;
146 bool accept_decay=
false;
155 <<
"Couldn't generate an unweighted phase space decay after " 156 << itry <<
" attempts";
163 exception.
SetReason(
"Couldn't select decay after N attempts");
170 <<
"Decay weight = " << w <<
" > max decay weight = " << wmax;
172 double gw = wmax * rnd->
RndHadro().Rndm();
173 accept_decay = (gw<=
w);
176 <<
"Decay weight = " << w <<
" / R = " << gw
177 <<
" - accepted: " << accept_decay;
182 TLorentzVector v4(*v4d);
184 for(pdg_iter = pdgv.begin(); pdg_iter != pdgv.end(); ++pdg_iter) {
185 int pdgc = *pdg_iter;
188 event->AddParticle(pdgc, ist, nhl_id,-1,-1,-1, *p4fin, v4);
void AddInitialState(GHepRecord *event) const
TLorentzVector * GetX4(void) const
THE MAIN GENIE PROJECT NAMESPACE
static RandomGen * Instance()
Access instance.
Defines the EventRecordVisitorI interface. Concrete implementations of this interface use the 'Visito...
void Configure(const Registry &config)
void GenerateDecayProducts(GHepRecord *event) const
string P4AsString(const TLorentzVector *p)
static const unsigned int kMaxUnweightDecayIterations
~NHLPrimaryVtxGenerator()
A singleton holding random number generator classes. All random number generation in GENIE should tak...
PDGCodeList DecayProductList(NHLDecayMode_t nhldm)
Summary information for an interaction.
An exception thrown by EventRecordVisitorI when the normal processing sequence has to be disrupted (f...
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
TLorentzVector * GetP4(void) const
virtual void Configure(const Registry &config)
int DecayMode(void) const
TRandom3 & RndHadro(void) const
rnd number generator used by hadronization models
void SwitchOnFastForward(void)
static PDGLibrary * Instance(void)
void SetReason(string reason)
TGenPhaseSpace fPhaseSpaceGenerator
A registry. Provides the container for algorithm configuration parameters.
const XclsTag & ExclTag(void) const
void ProcessEventRecord(GHepRecord *event) const
const InitialState & InitState(void) const
TParticlePDG * Find(int pdgc, bool must_exist=true)
NHLDecayMode_t fCurrDecayMode
string AsString(NHLDecayMode_t nhldm)
double ProbeE(RefFrame_t rf) const
GENIE's GHEP MC event record.
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
STDHEP-like event record entry that can fit a particle or a nucleus.
enum genie::ENHLDecayMode NHLDecayMode_t
cet::coded_exception< error, detail::translate > exception
Event finding and building.
enum genie::EGHepStatus GHepStatus_t