23 #include <TClonesArray.h>
24 #include <TParticlePDG.h>
25 #include <TIterator.h>
40 using namespace genie;
45 using std::setprecision;
49 ostream &
operator<< (ostream & stream,
const TClonesArray * particle_list);
53 void Decay(
const Decayer * decayer,
int pdgc,
double E,
int ndecays);
67 <<
"Asking the AlgFactory for a genie::PythiaDecayer\\Default instance";
94 <<
" **** Inhibiting all but the `tau- --> nu_mu_bar + mu- + nu_tau' decay channel"
159 <<
" **** Restoring all tau- decay channels"
170 <<
" **** Inhibit all tau- decay channels"
181 DecayerInputs_t dinp;
192 TParticlePDG * pp = pdglib->
Find(pdgc);
196 <<
"Decaying a " << pp->GetName() <<
" with E = " << p4.Energy();
199 for(
int idec = 0; idec < ndecays; idec++) {
202 TClonesArray * particle_list = decayer->Decay(dinp);
206 <<
"\n ** Decay nu.: " << idec <<
" ==> NULL particle list";
212 <<
"\n ** Decay nu.: " << idec
213 <<
" (weight = " << decayer->Weight() <<
") : \n "
217 particle_list->Delete();
218 delete particle_list;
223 ostream &
operator<< (ostream & stream,
const TClonesArray * particle_list)
226 TObjArrayIter particle_iter(particle_list);
230 << setfill(
' ') << setw(10) <<
"name "
231 << setfill(
' ') << setw(10) <<
"PDG"
232 << setfill(
' ') << setw(10) <<
"Status"
233 << setfill(
' ') << setw(15) <<
"E (GeV)"
234 << setfill(
' ') << setw(15) <<
"Px (GeV/c)"
235 << setfill(
' ') << setw(15) <<
"Py (GeV/c)"
236 << setfill(
' ') << setw(15) <<
"Pz (GeV/c)"
237 << setfill(
' ') << setw(15) <<
"t (mm/c)"
238 << setfill(
' ') << setw(15) <<
"x (mm)"
239 << setfill(
' ') << setw(15) <<
"y (mm)"
240 << setfill(
' ') << setw(15) <<
"z (mm)"
243 while( (p = (
GHepParticle *) particle_iter.Next()) ) stream << p;
245 stream << setfill(
'-') << setw(100) <<
"|";
253 << std::scientific << setprecision(6);
256 << setfill(
' ') << setw(10) << p->
Name()
257 << setfill(
' ') << setw(10) << p->
Pdg()
258 << setfill(
' ') << setw(10) << p->
Status()
259 << setfill(
' ') << setw(15) << p->
Energy()
260 << setfill(
' ') << setw(15) << p->
Px()
261 << setfill(
' ') << setw(15) << p->
Py()
262 << setfill(
' ') << setw(15) << p->
Pz()
263 << setfill(
' ') << setw(15) << p->
Vt() /(
units::mm)
264 << setfill(
' ') << setw(15) << p->
Vx() /(
units::mm)
265 << setfill(
' ') << setw(15) << p->
Vy() /(
units::mm)
266 << setfill(
' ') << setw(15) << p->
Vz() /(
units::mm)
virtual void UnInhibitDecay(int pdgc, TDecayChannel *dc=0) const =0
void TestPythiaTauDecays(void)
void Decay(const Decayer *decayer, int pdgc, double E, int ndecays)
double Pz(void) const
Get Pz.
GHepStatus_t Status(void) const
double Energy(void) const
Get energy.
int main(int argc, char **argv)
virtual const Registry & GetConfig(void) const
double Px(void) const
Get Px.
double Vt(void) const
Get production time.
string Name(void) const
Name that corresponds to the PDG code.
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
const Algorithm * GetAlgorithm(const AlgId &algid)
virtual void InhibitDecay(int pdgc, TDecayChannel *dc=0) const =0
virtual const AlgId & Id(void) const
Get algorithm ID.
static PDGLibrary * Instance(void)
static AlgFactory * Instance()
Singleton class to load & serve a TDatabasePDG.
double Vz(void) const
Get production z.
ostream & operator<<(ostream &stream, const AlgConfigPool &config_pool)
A registry. Provides the container for algorithm configuration parameters.
Base class for decayer classes. Implements common configuration, allowing users to toggle on/off flag...
static constexpr double mm
TParticlePDG * Find(int pdgc, bool must_exist=true)
double Vy(void) const
Get production y.
The GENIE Algorithm Factory.
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.
double Vx(void) const
Get production x.
string Config(void) const
double Py(void) const
Get Py.