GENIEGenerator
Loading...
Searching...
No Matches
RSPPHadronicSystemGenerator.cxx
Go to the documentation of this file.
1//____________________________________________________________________________
2/*
3 Copyright (c) 2003-2025, The GENIE Collaboration
4 For the full text of the license visit http://copyright.genie-mc.org
5
6 Costas Andreopoulos <c.andreopoulos \at cern.ch>
7 University of Liverpool
8*/
9//____________________________________________________________________________
10
25
26using namespace genie;
27using namespace genie::constants;
28
29//___________________________________________________________________________
31HadronicSystemGenerator("genie::RSPPHadronicSystemGenerator")
32{
33
34}
35//___________________________________________________________________________
37HadronicSystemGenerator("genie::RSPPHadronicSystemGenerator", config)
38{
39
40}
41//___________________________________________________________________________
46//___________________________________________________________________________
48{
49// This method generates the final state hadronic system
50
51 //-- Add the baryon resonance decay products at the event record
52 this->AddResonanceDecayProducts(evrec);
53}
54//___________________________________________________________________________
56 GHepRecord * evrec) const
57{
58// generate momenta for the baryon resonance decay products and add them at
59// the event record
60
61 //-- find out which SPP channel we are generating
62 Interaction * interaction = evrec->Summary();
63 SppChannel_t spp_channel = SppChannel::FromInteraction(interaction);
64
65 //-- get the final state nucleon and pion
66 int nuc_pdgc = SppChannel::FinStateNucleon (spp_channel);
67 int pi_pdgc = SppChannel::FinStatePion (spp_channel);
68
69 //-- get the total 4-p for the two-hadron system (= parent resonance 4-p)
70
71 const InitialState & init_state = interaction->InitState();
72 bool is_nucleus = init_state.Tgt().IsNucleus();
73
74 //-- access the resonance entry at the GHEP record
75 int res_pos = 0;
76 if(is_nucleus) res_pos = 4;
77 else res_pos = 3;
78
79 GHepParticle * res = evrec->Particle(res_pos);
80 const TLorentzVector & x4 = *(res->X4());
81
82 //-- mark the resonance as decayed
84
85 //-- generate 4-p for the two-hadron system
86 double mnuc = PDGLibrary::Instance() -> Find(nuc_pdgc) -> Mass();
87 double mpi = PDGLibrary::Instance() -> Find(pi_pdgc) -> Mass();
88
89 double mass[2] = { mnuc, mpi };
90
91 TLorentzVector * p4 = res->GetP4();
92
93 LOG("RESHadronicVtx", pINFO)
94 << "\n RES 4-P = " << utils::print::P4AsString(p4);
95
96 bool is_permitted = fPhaseSpaceGenerator.SetDecay(*p4, 2, mass);
97 assert(is_permitted);
98
99 fPhaseSpaceGenerator.Generate();
100
101 //-- add the two hadrons at the event record
102 TLorentzVector & p4_nuc = *fPhaseSpaceGenerator.GetDecay(0);
103 TLorentzVector & p4_pi = *fPhaseSpaceGenerator.GetDecay(1);
104 TLorentzVector vdummy(0,0,0,0); // dummy 'vertex'
105
106 // decide the particle status
107 GHepStatus_t ist = (is_nucleus) ?
109 int mom = res_pos;
110 evrec->AddParticle(nuc_pdgc, ist, mom,-1,-1,-1, p4_nuc, x4);
111 evrec->AddParticle(pi_pdgc, ist, mom,-1,-1,-1, p4_pi, x4);
112 delete p4;
113}
114//___________________________________________________________________________
#define pINFO
Definition Messenger.h:62
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Definition Messenger.h:96
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.
TLorentzVector * GetP4(void) const
const TLorentzVector * X4(void) const
void SetStatus(GHepStatus_t s)
GENIE's GHEP MC event record.
Definition GHepRecord.h:45
virtual Interaction * Summary(void) const
virtual void AddParticle(const GHepParticle &p)
virtual GHepParticle * Particle(int position) const
Initial State information.
const Target & Tgt(void) const
Summary information for an interaction.
Definition Interaction.h:56
const InitialState & InitState(void) const
Definition Interaction.h:69
static PDGLibrary * Instance(void)
void ProcessEventRecord(GHepRecord *event_rec) const
void AddResonanceDecayProducts(GHepRecord *event_rec) const
static int FinStatePion(SppChannel_t channel)
Definition SppChannel.h:157
static SppChannel_t FromInteraction(const Interaction *interaction)
Definition SppChannel.h:402
static int FinStateNucleon(SppChannel_t channel)
Definition SppChannel.h:130
bool IsNucleus(void) const
Definition Target.cxx:272
Basic constants.
string P4AsString(const TLorentzVector *p)
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25
@ kIStHadronInTheNucleus
Definition GHepStatus.h:37
@ kIStStableFinalState
Definition GHepStatus.h:30
@ kIStDecayedState
Definition GHepStatus.h:32
enum genie::EGHepStatus GHepStatus_t
enum genie::ESppChannel SppChannel_t