GENIEGenerator
Loading...
Searching...
No Matches
SecondNucleonEmissionI.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 or see $GENIE/LICENSE
6
7 Author: Afroditi Papadopoulou <apapadop \at mit.edu>
8 Massachusetts Institute of Technology - October 04, 2019
9
10 @ October 4, 2019 - Afroditi Papadopoulou (AP)
11 Created this new module that controls the addition of the recoil nucleon in the event record
12 and extracts its kinematics
13*/
14//____________________________________________________________________________
15
16#include <cstdlib>
17
18#include <TLorentzVector.h>
19#include <TVector3.h>
20#include <TParticlePDG.h>
21#include <TMath.h>
22
28
46
47using namespace genie;
48using namespace genie::constants;
49
55//___________________________________________________________________________
57EventRecordVisitorI( name, config)
58{
59
60}
61//___________________________________________________________________________
66
67//___________________________________________________________________________
68bool SecondNucleonEmissionI::EmitSecondNucleon( GHepRecord * evrec, const int eject_nucleon_pdg ) const {
69
70 LOG("SecondNucleonEmissionI", pINFO) << "Adding a recoil nucleon with PDG " << eject_nucleon_pdg ;
71
72 GHepParticle * nucleon = evrec->HitNucleon();
73
75 int imom = evrec->TargetNucleusPosition();
76
77 //-- Has opposite momentum from the struck nucleon
78 double vx = nucleon->Vx();
79 double vy = nucleon->Vy();
80 double vz = nucleon->Vz();
81 double px = -1.* nucleon->Px();
82 double py = -1.* nucleon->Py();
83 double pz = -1.* nucleon->Pz();
84 double M = PDGLibrary::Instance()->Find(eject_nucleon_pdg)->Mass();
85 double E = TMath::Sqrt(px*px+py*py+pz*pz+M*M);
86
87 evrec->AddParticle( eject_nucleon_pdg, status, imom, -1, -1, -1, px, py, pz, E, vx, vy, vz, 0 );
88
89 return true ;
90}
91//____________________________________________________________________________
93{
94
95 RgKey nuclkey = "NuclearModel";
96 fNuclModel = 0;
97 fNuclModel = dynamic_cast<const NuclearModelI *> (this->SubAlg(nuclkey));
98 assert(fNuclModel);
99
100}
101//____________________________________________________________________________
#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.
string RgKey
const Algorithm * SubAlg(const RgKey &registry_key) const
STDHEP-like event record entry that can fit a particle or a nucleus.
double Vy(void) const
Get production y.
double Px(void) const
Get Px.
double Pz(void) const
Get Pz.
double Py(void) const
Get Py.
double Vz(void) const
Get production z.
double Vx(void) const
Get production x.
GENIE's GHEP MC event record.
Definition GHepRecord.h:45
virtual void AddParticle(const GHepParticle &p)
virtual int TargetNucleusPosition(void) const
virtual GHepParticle * HitNucleon(void) const
Pure abstract base class. Defines the NuclearModelI interface to be implemented by any physics model ...
static PDGLibrary * Instance(void)
TParticlePDG * Find(int pdgc, bool must_exist=true)
const NuclearModelI * fNuclModel
nuclear model
virtual bool EmitSecondNucleon(GHepRecord *evrec, const int eject_nucleon_pdg) const
Basic constants.
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25
@ kIStHadronInTheNucleus
Definition GHepStatus.h:37
enum genie::EGHepStatus GHepStatus_t