RSPPHadronicSystemGenerator.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2020, The GENIE Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5 
6  Costas Andreopoulos <constantinos.andreopoulos \at cern.ch>
7  University of Liverpool & STFC Rutherford Appleton Laboratory
8 */
9 //____________________________________________________________________________
10 
25 
26 using namespace genie;
27 using namespace genie::constants;
28 
29 //___________________________________________________________________________
31 HadronicSystemGenerator("genie::RSPPHadronicSystemGenerator")
32 {
33 
34 }
35 //___________________________________________________________________________
37 HadronicSystemGenerator("genie::RSPPHadronicSystemGenerator", config)
38 {
39 
40 }
41 //___________________________________________________________________________
43 {
44 
45 }
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 //___________________________________________________________________________
void AddResonanceDecayProducts(GHepRecord *event_rec) const
static SppChannel_t FromInteraction(const Interaction *interaction)
Definition: SppChannel.h:276
Basic constants.
virtual GHepParticle * Particle(int position) const
Definition: GHepRecord.cxx:104
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
virtual Interaction * Summary(void) const
Definition: GHepRecord.cxx:91
bool IsNucleus(void) const
Definition: Target.cxx:272
static int FinStateNucleon(SppChannel_t channel)
Definition: SppChannel.h:119
string P4AsString(const TLorentzVector *p)
Definition: PrintUtils.cxx:27
double Mass(Resonance_t res)
resonance mass (GeV)
enum genie::ESppChannel SppChannel_t
Summary information for an interaction.
Definition: Interaction.h:56
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
static Config * config
Definition: config.cpp:1054
TLorentzVector * GetP4(void) const
#define pINFO
Definition: Messenger.h:62
static int FinStatePion(SppChannel_t channel)
Definition: SppChannel.h:146
void ProcessEventRecord(GHepRecord *event_rec) const
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:57
const TLorentzVector * X4(void) const
Definition: GHepParticle.h:79
void SetStatus(GHepStatus_t s)
Definition: GHepParticle.h:126
virtual void AddParticle(const GHepParticle &p)
Definition: GHepRecord.cxx:491
const InitialState & InitState(void) const
Definition: Interaction.h:69
Abstract class. Is used to pass some commonly recurring methods to all concrete implementations of th...
const Target & Tgt(void) const
Definition: InitialState.h:66
GENIE&#39;s GHEP MC event record.
Definition: GHepRecord.h:45
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.
Definition: GHepParticle.h:39
enum genie::EGHepStatus GHepStatus_t
Initial State information.
Definition: InitialState.h:48