SecondNucleonEmissionI.cxx
Go to the documentation of this file.
1 ///____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2019, 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 
47 using namespace genie;
48 using namespace genie::constants;
49 
51 EventRecordVisitorI( name )
52 {
53 
54 }
55 //___________________________________________________________________________
57 EventRecordVisitorI( name, config)
58 {
59 
60 }
61 //___________________________________________________________________________
63 {
64 
65 }
66 
67 //___________________________________________________________________________
68 bool 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 //____________________________________________________________________________
static QCString name
Definition: declinfo.cpp:673
Basic constants.
virtual bool EmitSecondNucleon(GHepRecord *evrec, const int eject_nucleon_pdg) const
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
Defines the EventRecordVisitorI interface. Concrete implementations of this interface use the &#39;Visito...
Pure abstract base class. Defines the NuclearModelI interface to be implemented by any physics model ...
Definition: NuclearModelI.h:46
double Pz(void) const
Get Pz.
Definition: GHepParticle.h:90
double Px(void) const
Get Px.
Definition: GHepParticle.h:88
#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
#define pINFO
Definition: Messenger.h:62
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:57
double Vz(void) const
Get production z.
Definition: GHepParticle.h:96
string RgKey
virtual GHepParticle * HitNucleon(void) const
Definition: GHepRecord.cxx:306
const NuclearModelI * fNuclModel
nuclear model
virtual void AddParticle(const GHepParticle &p)
Definition: GHepRecord.cxx:491
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:75
double Vy(void) const
Get production y.
Definition: GHepParticle.h:95
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
virtual int TargetNucleusPosition(void) const
Definition: GHepRecord.cxx:362
enum genie::EGHepStatus GHepStatus_t
double Vx(void) const
Get production x.
Definition: GHepParticle.h:94
double Py(void) const
Get Py.
Definition: GHepParticle.h:89
const Algorithm * SubAlg(const RgKey &registry_key) const
Definition: Algorithm.cxx:345