GENIEGenerator
Loading...
Searching...
No Matches
genie::Pythia6Decayer2023 Class Reference

Interface to PYTHIA particle decayer.
The Pythia6Decayer2023 is a concrete implementation of the Decayer interface. More...

#include <Pythia6Decayer2023.h>

Inheritance diagram for genie::Pythia6Decayer2023:
[legend]
Collaboration diagram for genie::Pythia6Decayer2023:
[legend]

Public Member Functions

 Pythia6Decayer2023 ()
 Pythia6Decayer2023 (string config)
virtual ~Pythia6Decayer2023 ()
void ProcessEventRecord (GHepRecord *event) const

Private Member Functions

void Initialize (void) const
bool IsHandled (int pdgc) const
void InhibitDecay (int pdgc, TDecayChannel *ch=0) const
void UnInhibitDecay (int pdgc, TDecayChannel *ch=0) const
bool Decay (int ip, GHepRecord *event) const
double SumOfBranchingRatios (int kc) const
int FindPythiaDecayChannel (int kc, TDecayChannel *ch) const
bool MatchDecayChannels (int ic, TDecayChannel *ch) const

Private Attributes

double fWeight

Additional Inherited Members

Protected Member Functions inherited from genie::Decayer
 Decayer ()
 Decayer (string name)
 Decayer (string name, string config)
virtual void LoadConfig (void)
virtual bool ToBeDecayed (int pdgc, GHepStatus_t ist) const
virtual bool IsUnstable (int pdgc) const
virtual ~Decayer ()
void Configure (const Registry &config)
void Configure (string config)
Protected Member Functions inherited from genie::EventRecordVisitorI
 EventRecordVisitorI ()
 EventRecordVisitorI (string name)
 EventRecordVisitorI (string name, string config)
virtual ~EventRecordVisitorI ()
Protected Member Functions inherited from genie::Algorithm
 Algorithm ()
 Algorithm (string name)
 Algorithm (string name, string config)
void Initialize (void)
void DeleteConfig (void)
void DeleteSubstructure (void)
RegistryExtractLocalConfig (const Registry &in) const
RegistryExtractLowerConfig (const Registry &in, const string &alg_key) const
 Split an incoming configuration Registry into a block valid for the sub-algo identified by alg_key.
template<class T>
bool GetParam (const RgKey &name, T &p, bool is_top_call=true) const
template<class T>
bool GetParamDef (const RgKey &name, T &p, const T &def) const
template<class T>
int GetParamVect (const std::string &comm_name, std::vector< T > &v, bool is_top_call=true) const
 Handle to load vectors of parameters.
int GetParamVectKeys (const std::string &comm_name, std::vector< RgKey > &k, bool is_top_call=true) const
template<class T>
int GetParamMat (const std::string &comm_name, TMatrixT< T > &mat, bool is_top_call=true) const
 Handle to load matrix of parameters.
template<class T>
int GetParamMatSym (const std::string &comm_name, TMatrixTSym< T > &mat, bool is_top_call=true) const
int GetParamMatKeys (const std::string &comm_name, std::vector< RgKey > &k, bool is_top_call=true) const
int AddTopRegistry (Registry *rp, bool owns=true)
 add registry with top priority, also update ownership
int AddLowRegistry (Registry *rp, bool owns=true)
 add registry with lowest priority, also update ownership
int MergeTopRegistry (const Registry &r)
int AddTopRegisties (const vector< Registry * > &rs, bool owns=false)
 Add registries with top priority, also udated Ownerships.
virtual ~Algorithm ()
virtual void FindConfig (void)
virtual const RegistryGetConfig (void) const
RegistryGetOwnedConfig (void)
virtual const AlgIdId (void) const
 Get algorithm ID.
virtual AlgStatus_t GetStatus (void) const
 Get algorithm status.
virtual bool AllowReconfig (void) const
virtual AlgCmp_t Compare (const Algorithm *alg) const
 Compare with input algorithm.
virtual void SetId (const AlgId &id)
 Set algorithm ID.
virtual void SetId (string name, string config)
const AlgorithmSubAlg (const RgKey &registry_key) const
void AdoptConfig (void)
void AdoptSubstructure (void)
virtual void Print (ostream &stream) const
 Print algorithm info.
Static Protected Member Functions inherited from genie::Algorithm
static string BuildParamVectKey (const std::string &comm_name, unsigned int i)
static string BuildParamVectSizeKey (const std::string &comm_name)
static string BuildParamMatKey (const std::string &comm_name, unsigned int i, unsigned int j)
static string BuildParamMatRowSizeKey (const std::string &comm_name)
static string BuildParamMatColSizeKey (const std::string &comm_name)
Protected Attributes inherited from genie::Decayer
bool fGenerateWeighted
 generate weighted or unweighted decays?
bool fRunBefHadroTransp
 is invoked before or after FSI?
PDGCodeList fParticlesToDecay
 list of particles to be decayed
PDGCodeList fParticlesNotToDecay
 list of particles for which decay is inhibited
Protected Attributes inherited from genie::Algorithm
bool fAllowReconfig
bool fOwnsSubstruc
 true if it owns its substructure (sub-algs,...)
AlgId fID
 algorithm name and configuration set
vector< Registry * > fConfVect
vector< bool > fOwnerships
 ownership for every registry in fConfVect
AlgStatus_t fStatus
 algorithm execution status
AlgMapfOwnedSubAlgMp
 local pool for owned sub-algs (taken out of the factory pool)

Detailed Description

Interface to PYTHIA particle decayer.
The Pythia6Decayer2023 is a concrete implementation of the Decayer interface.

Author
Costas Andreopoulos <c.andreopoulos \at cern.ch> University of Liverpool
Created:\n June 20, 2004
License:\n Copyright (c) 2003-2025, The GENIE Collaboration
For the full text of the license visit http://copyright.genie-mc.org

Definition at line 33 of file Pythia6Decayer2023.h.

Constructor & Destructor Documentation

◆ Pythia6Decayer2023() [1/2]

Pythia6Decayer2023::Pythia6Decayer2023 ( )

Definition at line 52 of file Pythia6Decayer2023.cxx.

52 :
53Decayer("genie::Pythia6Decayer2023")
54{
55 this->Initialize();
56}

References genie::Decayer::Decayer(), and Initialize().

◆ Pythia6Decayer2023() [2/2]

Pythia6Decayer2023::Pythia6Decayer2023 ( string config)

Definition at line 58 of file Pythia6Decayer2023.cxx.

58 :
59Decayer("genie::Pythia6Decayer2023", config)
60{
61 this->Initialize();
62}

References genie::Decayer::Decayer(), and Initialize().

◆ ~Pythia6Decayer2023()

Pythia6Decayer2023::~Pythia6Decayer2023 ( )
virtual

Definition at line 64 of file Pythia6Decayer2023.cxx.

65{
66
67}

Member Function Documentation

◆ Decay()

bool Pythia6Decayer2023::Decay ( int ip,
GHepRecord * event ) const
private

Definition at line 102 of file Pythia6Decayer2023.cxx.

103{
104 fWeight = 1.; // reset previous decay weight
105
106#ifdef __GENIE_PYTHIA6_ENABLED__
107 // Get particle to be decayed
108 GHepParticle * decay_particle = event->Particle(decay_particle_id);
109 if(!decay_particle) return 0;
110
111 // Get the particle 4-momentum, 4-position and PDG code
112 TLorentzVector decay_particle_p4 = *(decay_particle->P4());
113 int decay_particle_pdg_code = decay_particle->Pdg();
114
115 // Convert to PYTHIA6 particle code and check whether decay is inhibited
116 int kc = fPythia->Pycomp(decay_particle_pdg_code);
117 int mdcy = fPythia->GetMDCY(kc, 1);
118 if(mdcy == 0) {
119 LOG("Pythia6Decay", pNOTICE)
120 << (PDGLibrary::Instance())->Find(decay_particle_pdg_code)->GetName()
121 << " decays are inhibited!";
122 return false;
123 }
124
125 // Get sub of BRs and compute weight if decay channels were inhibited
126 double sumbr = this->SumOfBranchingRatios(kc);
127 if(sumbr <= 0) {
128 LOG("Pythia6Decay", pWARN)
129 << "The sum of enabled "
130 << (PDGLibrary::Instance())->Find(decay_particle_pdg_code)->GetName()
131 << " decay channel branching ratios is non-positive!";
132 return false;
133 }
134 fWeight = 1./sumbr; // update weight to account for inhibited channels
135
136 // Run PYTHIA6 decay
137 int ip = 0;
138 double E = decay_particle_p4.Energy();
139 double theta = decay_particle_p4.Theta();
140 double phi = decay_particle_p4.Phi();
141 fPythia->SetMSTJ(22,1);
142 py1ent_(&ip, &decay_particle_pdg_code, &E, &theta, &phi);
143
144 // Get decay products
145 fPythia->GetPrimaries();
146 TClonesArray * impl = (TClonesArray *) fPythia->ImportParticles("All");
147 if(!impl) {
148 LOG("Pythia6Decay", pWARN)
149 << "TPythia6::ImportParticles() returns a null list!";
150 return false;
151 }
152
153 // Copy the PYTHIA6 container to the GENIE event record
154
155 // Check whether the interaction is off a nuclear target or free nucleon
156 // Depending on whether this module is run before or after the hadron
157 // transport module it would affect the daughters status code
158 GHepParticle * target_nucleus = event->TargetNucleus();
159 bool in_nucleus = (target_nucleus!=0);
160
161 // the values of space coordinates from pythia are in mm.
162 // our conventions want it in fm
163 constexpr double space_scale = units::mm / units::fm ;
164
165 // the values of time coordinate from pythia is in mm/c.
166 // our conventions want it in ys
167 constexpr double time_scale = 1e21 * units::m / units::s ;
168
169 TMCParticle * p = 0;
170 TIter particle_iter(impl);
171 while( (p = (TMCParticle *) particle_iter.Next()) ) {
172 // Convert from TMCParticle to GHepParticle
173 GHepParticle mcp = GHepParticle(
174 p->GetKF(), // pdg
175 GHepStatus_t(p->GetKS()), // status
176 p->GetParent(), // first parent
177 0, // second parent
178 p->GetFirstChild(), // first daughter
179 p->GetLastChild(), // second daughter
180 p->GetPx(), // px
181 p->GetPy(), // py
182 p->GetPz(), // pz
183 p->GetEnergy(), // e
184 p->GetVx() * space_scale , // x
185 p->GetVy() * space_scale , // y
186 p->GetVz() * space_scale , // z
187 p->GetTime() * time_scale // t
188 );
189
190 if(mcp.Status()==kIStNucleonTarget) continue; // mother particle, already in GHEP
191
192 int daughter_pdg_code = mcp.Pdg();
193 SLOG("Pythia6Decay", pINFO)
194 << "Adding daughter particle wit PDG code = "
195 << daughter_pdg_code << ", m = " << mcp.Mass()
196 << " GeV, E = " << mcp.Energy() << " GeV)";
197
198 bool is_hadron = pdg::IsHadron(daughter_pdg_code);
199 bool hadron_in_nuc = (in_nucleus && is_hadron && fRunBefHadroTransp);
200
201 GHepStatus_t daughter_status_code = (hadron_in_nuc) ?
203
204 TLorentzVector daughter_p4(
205 mcp.Px(),mcp.Py(),mcp.Pz(),mcp.Energy());
206
207 event->AddParticle(
208 daughter_pdg_code, daughter_status_code,
209 decay_particle_id,-1,-1,-1,
210 daughter_p4, * mcp.X4() );
211 }
212
213 // Update the event weight for each weighted particle decay
214 double weight = event->Weight() * fWeight;
215 event->SetWeight(weight);
216
217 // Mark input particle as a 'decayed state' & add its daughter links
218 decay_particle->SetStatus(kIStDecayedState);
219
220 return true;
221#else
222 LOG("Pythia6Decay", pFATAL)
223 << "calling GENIE/PYTHIA6 decay without enabling PYTHIA6";
224 gAbortingInErr = true;
225 std::exit(1);
226
227return false;
228#endif
229}
#define pNOTICE
Definition Messenger.h:61
#define pINFO
Definition Messenger.h:62
#define pFATAL
Definition Messenger.h:56
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Definition Messenger.h:96
#define pWARN
Definition Messenger.h:60
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition Messenger.h:84
bool fRunBefHadroTransp
is invoked before or after FSI?
Definition Decayer.h:57
int Pdg(void) const
const TLorentzVector * P4(void) const
double Mass(void) const
Mass that corresponds to the PDG code.
const TLorentzVector * X4(void) const
void SetStatus(GHepStatus_t s)
double Px(void) const
Get Px.
double Pz(void) const
Get Pz.
double Py(void) const
Get Py.
double Energy(void) const
Get energy.
GHepStatus_t Status(void) const
static PDGLibrary * Instance(void)
double SumOfBranchingRatios(int kc) const
bool IsHadron(int pdgc)
Definition PDGUtils.cxx:392
static constexpr double m
Definition Units.h:71
static constexpr double mm
Definition Units.h:65
static constexpr double fm
Definition Units.h:75
static constexpr double s
Definition Units.h:95
@ kIStHadronInTheNucleus
Definition GHepStatus.h:37
@ kIStStableFinalState
Definition GHepStatus.h:30
@ kIStDecayedState
Definition GHepStatus.h:32
@ kIStNucleonTarget
Definition GHepStatus.h:34
bool gAbortingInErr
Definition Messenger.cxx:34
enum genie::EGHepStatus GHepStatus_t

References genie::GHepParticle::Energy(), genie::units::fm, genie::Decayer::fRunBefHadroTransp, fWeight, genie::gAbortingInErr, genie::PDGLibrary::Instance(), genie::pdg::IsHadron(), genie::kIStDecayedState, genie::kIStHadronInTheNucleus, genie::kIStNucleonTarget, genie::kIStStableFinalState, LOG, genie::units::m, genie::GHepParticle::Mass(), genie::units::mm, genie::GHepParticle::P4(), genie::GHepParticle::Pdg(), pFATAL, pINFO, pNOTICE, pWARN, genie::GHepParticle::Px(), genie::GHepParticle::Py(), genie::GHepParticle::Pz(), genie::units::s, genie::GHepParticle::SetStatus(), SLOG, genie::GHepParticle::Status(), SumOfBranchingRatios(), and genie::GHepParticle::X4().

Referenced by ProcessEventRecord().

◆ FindPythiaDecayChannel()

int Pythia6Decayer2023::FindPythiaDecayChannel ( int kc,
TDecayChannel * ch ) const
private

Definition at line 366 of file Pythia6Decayer2023.cxx.

367{
368 if(!dc) return -1;
369
370#ifdef __GENIE_PYTHIA6_ENABLED__
371 int first_channel = fPythia->GetMDCY(kc,2);
372 int last_channel = fPythia->GetMDCY(kc,2) + fPythia->GetMDCY(kc,3) - 1;
373
374 bool found_match = false;
375
376 // loop over pythia decay channels
377 for(int ichannel = first_channel;
378 ichannel < last_channel; ichannel++) {
379
380 // does the current pythia channel matches the input TDecayChannel?
381 LOG("Pythia6Decay", pINFO)
382 << "\nComparing PYTHIA's channel = " << ichannel
383 << " with TDecayChannel = " << dc->Number();
384
385 found_match = this->MatchDecayChannels(ichannel,dc);
386 if(found_match) {
387 LOG("Pythia6Decay", pNOTICE)
388 << " ** TDecayChannel id = " << dc->Number()
389 << " corresponds to PYTHIA6 channel id = " << ichannel;
390 return ichannel;
391 }//match?
392 }//loop pythia decay ch.
393
394 LOG("Pythia6Decay", pWARN)
395 << " ** No PYTHIA6 decay channel match found for "
396 << "TDecayChannel id = " << dc->Number();
397#else
398 LOG("Pythia6Decay", pFATAL)
399 << "calling GENIE/PYTHIA6 decay without enabling PYTHIA6";
400 gAbortingInErr = true;
401 std::exit(1);
402#endif
403
404
405 return -1;
406}
bool MatchDecayChannels(int ic, TDecayChannel *ch) const

References genie::gAbortingInErr, LOG, MatchDecayChannels(), pFATAL, pINFO, pNOTICE, and pWARN.

Referenced by InhibitDecay(), and UnInhibitDecay().

◆ InhibitDecay()

void Pythia6Decayer2023::InhibitDecay ( int pdgc,
TDecayChannel * ch = 0 ) const
privatevirtual

Implements genie::Decayer.

Definition at line 260 of file Pythia6Decayer2023.cxx.

261{
262 if(! this->IsHandled(pdg_code)) return;
263
264#ifdef __GENIE_PYTHIA6_ENABLED__
265 int kc = fPythia->Pycomp(pdg_code);
266
267 if(!dc) {
268 LOG("Pythia6Decay", pINFO)
269 << "Switching OFF ALL decay channels for particle = " << pdg_code;
270 fPythia->SetMDCY(kc, 1,0);
271 return;
272 }
273
274 LOG("Pythia6Decay", pINFO)
275 << "Switching OFF decay channel = " << dc->Number()
276 << " for particle = " << pdg_code;
277
278 int ichannel = this->FindPythiaDecayChannel(kc, dc);
279 if(ichannel != -1) {
280 fPythia->SetMDME(ichannel,1,0); // switch-off
281 }
282#else
283 LOG("Pythia6Decay", pFATAL)
284 << "calling GENIE/PYTHIA6 decay without enabling PYTHIA6";
285 gAbortingInErr = true;
286 std::exit(1);
287#endif
288
289}
int FindPythiaDecayChannel(int kc, TDecayChannel *ch) const

References FindPythiaDecayChannel(), genie::gAbortingInErr, IsHandled(), LOG, pFATAL, and pINFO.

◆ Initialize()

void Pythia6Decayer2023::Initialize ( void ) const
private

Definition at line 231 of file Pythia6Decayer2023.cxx.

232{
233#ifdef __GENIE_PYTHIA6_ENABLED__
234 fPythia = TPythia6::Instance();
235 fWeight = 1.;
236
237 // sync GENIE/PYTHIA6 seeds
239#else
240 LOG("Pythia6Decay", pFATAL)
241 << "calling GENIE/PYTHIA6 decay without enabling PYTHIA6";
242 gAbortingInErr = true;
243 std::exit(1);
244#endif
245}
static RandomGen * Instance()
Access instance.
Definition RandomGen.cxx:74

References fWeight, genie::gAbortingInErr, genie::RandomGen::Instance(), LOG, and pFATAL.

Referenced by Pythia6Decayer2023(), and Pythia6Decayer2023().

◆ IsHandled()

bool Pythia6Decayer2023::IsHandled ( int pdgc) const
privatevirtual

Implements genie::Decayer.

Definition at line 247 of file Pythia6Decayer2023.cxx.

248{
249// does not handle requests to decay baryon resonances
250
251 bool is_handled = (!utils::res::IsBaryonResonance(pdg_code));
252
253 LOG("Pythia6Decay", pDEBUG)
254 << "Can decay particle with PDG code = " << pdg_code
255 << "? " << ((is_handled)? "Yes" : "No");
256
257 return is_handled;
258}
#define pDEBUG
Definition Messenger.h:63
bool IsBaryonResonance(int pdgc)
is input a baryon resonance?

References genie::utils::res::IsBaryonResonance(), LOG, and pDEBUG.

Referenced by InhibitDecay(), ProcessEventRecord(), and UnInhibitDecay().

◆ MatchDecayChannels()

bool Pythia6Decayer2023::MatchDecayChannels ( int ic,
TDecayChannel * ch ) const
private

Definition at line 408 of file Pythia6Decayer2023.cxx.

409{
410 // num. of daughters in the input TDecayChannel & the input PYTHIA ichannel
411 int nd = dc->NDaughters();
412
413#ifdef __GENIE_PYTHIA6_ENABLED__
414 int py_nd = 0;
415 for (int i = 1; i <= 5; i++) {
416 if(fPythia->GetKFDP(ichannel,i) != 0) py_nd++;
417 }
418
419 LOG("Pythia6Decay", pDEBUG)
420 << "NDaughters: PYTHIA = " << py_nd << ", ROOT's TDecayChannel = " << nd;
421
422 if(nd != py_nd) return false;
423
424 //
425 // if the two channels have the same num. of daughters, then compare them
426 //
427
428 // store decay daughters for the input TDecayChannel
429 vector<int> dc_daughter(nd);
430 int k=0;
431 for( ; k < nd; k++) {
432 dc_daughter[k] = dc->DaughterPdgCode(k);
433 }
434 // store decay daughters for the input PYTHIA's ichannel
435 vector<int> py_daughter(nd);
436 k=0;
437 for(int i = 1; i <= 5; i++) {
438 if(fPythia->GetKFDP(ichannel,i) == 0) continue;
439 py_daughter[k] = fPythia->GetKFDP(ichannel,i);
440 k++;
441 }
442
443 // sort both daughter lists
444 sort( dc_daughter.begin(), dc_daughter.end() );
445 sort( py_daughter.begin(), py_daughter.end() );
446
447 // compare
448 for(int i = 0; i < nd; i++) {
449 if(dc_daughter[i] != py_daughter[i]) return false;
450 }
451#else
452 LOG("Pythia6Decay", pFATAL)
453 << "calling GENIE/PYTHIA6 decay without enabling PYTHIA6";
454 gAbortingInErr = true;
455 std::exit(1);
456#endif
457
458 return true;
459}

References genie::gAbortingInErr, LOG, pDEBUG, and pFATAL.

Referenced by FindPythiaDecayChannel().

◆ ProcessEventRecord()

void Pythia6Decayer2023::ProcessEventRecord ( GHepRecord * event) const
virtual

Implements genie::EventRecordVisitorI.

Definition at line 69 of file Pythia6Decayer2023.cxx.

70{
71 LOG("ResonanceDecay", pINFO)
72 << "Running PYTHIA6 particle decayer "
73 << ((fRunBefHadroTransp) ? "*before*" : "*after*") << " FSI";
74
75 // Loop over particles, find unstable ones and decay them
76 TObjArrayIter piter(event);
77 GHepParticle * p = 0;
78 int ipos = -1;
79
80 while( (p = (GHepParticle *) piter.Next()) ) {
81 ipos++;
82
83 LOG("Pythia6Decay", pDEBUG) << "Checking: " << p->Name();
84
85 int pdg_code = p->Pdg();
86 GHepStatus_t status_code = p->Status();
87
88 if(!this->IsHandled (pdg_code)) continue;
89 if(!this->ToBeDecayed(pdg_code, status_code)) continue;
90
91 LOG("Pythia6Decay", pNOTICE)
92 << "Decaying unstable particle: " << p->Name();
93
94 bool decayed = this->Decay(ipos, event);
95 assert(decayed); // handle this more graciously and throw an exception
96 }
97
98 LOG("Pythia6Decay", pNOTICE)
99 << "Done finding & decaying unstable particles";
100}
virtual bool ToBeDecayed(int pdgc, GHepStatus_t ist) const
Definition Decayer.cxx:51
string Name(void) const
Name that corresponds to the PDG code.
bool Decay(int ip, GHepRecord *event) const

References Decay(), genie::Decayer::fRunBefHadroTransp, IsHandled(), LOG, genie::GHepParticle::Name(), pDEBUG, genie::GHepParticle::Pdg(), pINFO, pNOTICE, genie::GHepParticle::Status(), and genie::Decayer::ToBeDecayed().

◆ SumOfBranchingRatios()

double Pythia6Decayer2023::SumOfBranchingRatios ( int kc) const
private

Definition at line 330 of file Pythia6Decayer2023.cxx.

331{
332// Sum of branching ratios for enabled channels
333//
334 double sumbr=0.;
335
336#ifdef __GENIE_PYTHIA6_ENABLED__
337 int first_channel = fPythia->GetMDCY(kc,2);
338 int last_channel = fPythia->GetMDCY(kc,2) + fPythia->GetMDCY(kc,3) - 1;
339
340 bool has_inhibited_channels=false;
341
342 // loop over pythia decay channels
343 for(int ichannel = first_channel;
344 ichannel < last_channel; ichannel++) {
345
346 bool enabled = (fPythia->GetMDME(ichannel,1) == 1);
347 if (!enabled) {
348 has_inhibited_channels = true;
349 } else {
350 sumbr += fPythia->GetBRAT(ichannel);
351 }
352 }
353
354 if(!has_inhibited_channels) return 1.;
355 LOG("Pythia6Decay", pINFO) << "Sum{BR} = " << sumbr;
356#else
357 LOG("Pythia6Decay", pFATAL)
358 << "calling GENIE/PYTHIA6 decay without enabling PYTHIA6";
359 gAbortingInErr = true;
360 std::exit(1);
361#endif
362
363 return sumbr;
364}

References genie::gAbortingInErr, LOG, pFATAL, and pINFO.

Referenced by Decay().

◆ UnInhibitDecay()

void Pythia6Decayer2023::UnInhibitDecay ( int pdgc,
TDecayChannel * ch = 0 ) const
privatevirtual

Implements genie::Decayer.

Definition at line 291 of file Pythia6Decayer2023.cxx.

292{
293 if(! this->IsHandled(pdg_code)) return;
294
295#ifdef __GENIE_PYTHIA6_ENABLED__
296 int kc = fPythia->Pycomp(pdg_code);
297
298 if(!dc) {
299 LOG("Pythia6Decay", pINFO)
300 << "Switching ON all PYTHIA decay channels for particle = " << pdg_code;
301
302 fPythia->SetMDCY(kc, 1,1);
303
304 int first_channel = fPythia->GetMDCY(kc,2);
305 int last_channel = fPythia->GetMDCY(kc,2) + fPythia->GetMDCY(kc,3) - 1;
306
307 for(int ichannel = first_channel;
308 ichannel < last_channel; ichannel++) {
309 fPythia->SetMDME(ichannel,1,1); // switch-on
310 }
311 return;
312 }//!dc
313
314 LOG("Pythia6Decay", pINFO)
315 << "Switching OFF decay channel = " << dc->Number()
316 << " for particle = " << pdg_code;
317
318 int ichannel = this->FindPythiaDecayChannel(kc, dc);
319 if(ichannel != -1) {
320 fPythia->SetMDME(ichannel,1,1); // switch-on
321 }
322#else
323 LOG("Pythia6Decay", pFATAL)
324 << "calling GENIE/PYTHIA6 decay without enabling PYTHIA6";
325 gAbortingInErr = true;
326 std::exit(1);
327#endif
328}

References FindPythiaDecayChannel(), genie::gAbortingInErr, IsHandled(), LOG, pFATAL, and pINFO.

Member Data Documentation

◆ fWeight

double genie::Pythia6Decayer2023::fWeight
mutableprivate

Definition at line 57 of file Pythia6Decayer2023.h.

Referenced by Decay(), and Initialize().


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