IBDHadronicSystemGenerator.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 
7  Author: Corey Reed <cjreed \at nikhef.nl> - October 29, 2009
8  using code from the QELKinematicGenerator written by
9  Costas Andreopoulos <constantinos.andreopoulos \at cern.ch>
10  University of Liverpool & STFC Rutherford Appleton Laboratory - October 03, 2004
11 
12  For the class documentation see the corresponding header file.
13 
14 */
15 //____________________________________________________________________________
16 
25 
26 using namespace genie;
27 
28 //___________________________________________________________________________
30 HadronicSystemGenerator("genie::IBDHadronicSystemGenerator")
31 {
32 
33 }
34 //___________________________________________________________________________
36 HadronicSystemGenerator("genie::IBDHadronicSystemGenerator", config)
37 {
38 
39 }
40 //___________________________________________________________________________
42 {
43 
44 }
45 //___________________________________________________________________________
47 {
48 // This method generates the final state hadronic system
49 
50  // Add the recoil baryon
51  // (p or n)
52  // Its 4-momentum is computed by requiring the energy + momentum to be
53  // conserved.
54  this->AddRecoilBaryon(evrec);
55 }
56 //___________________________________________________________________________
58 {
59  //-- Determine the pdg & status code of the recoil baryon
60  Interaction * interaction = evrec->Summary();
61  const int pdgc = interaction->RecoilNucleonPdg();
62  assert(pdgc!=0);
63 
64  //-- Determine the status code
65  const Target & tgt = interaction->InitState().Tgt();
66  const GHepStatus_t ist = (tgt.IsNucleus()) ?
68 
69  //-- Get the vtx position
70  const GHepParticle * neutrino = evrec->Probe();
71  const TLorentzVector & vtx = *(neutrino->X4());
72 
73  //-- Get nucleon 4-momentum (in the LAB frame) & position
74  const TLorentzVector p4 = this->Hadronic4pLAB(evrec);
75 
76  //-- Get mother position
77  const int mom = evrec->HitNucleonPosition();
78 
79  //-- Add the final state recoil baryon at the EventRecord
80  LOG("IBD", pINFO)
81  << "Adding recoil baryon [pdgc = " << pdgc << "]";
82 
83  GHepParticle p(pdgc, ist, mom,-1,-1,-1, p4, vtx);
84  const double w = evrec->Particle(mom)->RemovalEnergy();
85  p.SetRemovalEnergy(w);
86  evrec->AddParticle(p);
87 }
88 //___________________________________________________________________________
virtual GHepParticle * Particle(int position) const
Definition: GHepRecord.cxx:104
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
TLorentzVector Hadronic4pLAB(GHepRecord *event_rec) const
virtual Interaction * Summary(void) const
Definition: GHepRecord.cxx:91
int RecoilNucleonPdg(void) const
recoil nucleon pdg
void ProcessEventRecord(GHepRecord *event_rec) const
bool IsNucleus(void) const
Definition: Target.cxx:272
virtual int HitNucleonPosition(void) const
Definition: GHepRecord.cxx:410
double RemovalEnergy(void) const
Get removal energy.
Definition: GHepParticle.h:100
virtual GHepParticle * Probe(void) const
Definition: GHepRecord.cxx:277
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
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:40
p
Definition: test.py:223
#define pINFO
Definition: Messenger.h:62
void SetRemovalEnergy(double Erm)
const TLorentzVector * X4(void) const
Definition: GHepParticle.h:79
void AddRecoilBaryon(GHepRecord *event_rec) const
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