GENIEGenerator
Loading...
Searching...
No Matches
genie::SKHadronicSystemGenerator Class Reference

Generates the f/s hadronic system in single-Kaon production interactions. Is a concrete implementation of the EventRecordVisitorI interface. More...

#include <SKHadronicSystemGenerator.h>

Inheritance diagram for genie::SKHadronicSystemGenerator:
[legend]
Collaboration diagram for genie::SKHadronicSystemGenerator:
[legend]

Public Member Functions

 SKHadronicSystemGenerator ()
 SKHadronicSystemGenerator (string config)
 ~SKHadronicSystemGenerator ()
void ProcessEventRecord (GHepRecord *event_rec) const
void CalculateHadronicSystem_AtharSingleKaon (GHepRecord *event_rec) const
Public Member Functions inherited from genie::HadronicSystemGenerator
void AddTargetNucleusRemnant (GHepRecord *event_rec) const
void AddFinalHadronicSyst (GHepRecord *event_rec) const
void PreHadronTransportDecays (GHepRecord *event_rec) const
TLorentzVector Hadronic4pLAB (GHepRecord *event_rec) const
TLorentzVector MomentumTransferLAB (GHepRecord *event_rec) const
TVector3 HCM2LAB (GHepRecord *event_rec) const
int HadronShowerCharge (GHepRecord *event_rec) const
int ResonanceCharge (GHepRecord *event_rec) const
Public Member Functions inherited from genie::EventRecordVisitorI
virtual ~EventRecordVisitorI ()
Public Member Functions inherited from genie::Algorithm
virtual ~Algorithm ()
virtual void Configure (const Registry &config)
virtual void Configure (string config)
virtual void FindConfig (void)
virtual const RegistryGetConfig (void) const
RegistryGetOwnedConfig (void)
virtual const AlgIdId (void) const
 Get algorithm ID.
virtual AlgStatus_t GetStatus (void) const
 Get algorithm status.
virtual bool AllowReconfig (void) const
virtual AlgCmp_t Compare (const Algorithm *alg) const
 Compare with input algorithm.
virtual void SetId (const AlgId &id)
 Set algorithm ID.
virtual void SetId (string name, string config)
const AlgorithmSubAlg (const RgKey &registry_key) const
void AdoptConfig (void)
void AdoptSubstructure (void)
virtual void Print (ostream &stream) const
 Print algorithm info.

Additional Inherited Members

Static Public Member Functions inherited from genie::Algorithm
static string BuildParamVectKey (const std::string &comm_name, unsigned int i)
static string BuildParamVectSizeKey (const std::string &comm_name)
static string BuildParamMatKey (const std::string &comm_name, unsigned int i, unsigned int j)
static string BuildParamMatRowSizeKey (const std::string &comm_name)
static string BuildParamMatColSizeKey (const std::string &comm_name)
Protected Member Functions inherited from genie::HadronicSystemGenerator
 HadronicSystemGenerator ()
 HadronicSystemGenerator (string name)
 HadronicSystemGenerator (string name, string config)
 ~HadronicSystemGenerator ()
Protected Member Functions inherited from genie::EventRecordVisitorI
 EventRecordVisitorI ()
 EventRecordVisitorI (string name)
 EventRecordVisitorI (string name, string config)
Protected Member Functions inherited from genie::Algorithm
 Algorithm ()
 Algorithm (string name)
 Algorithm (string name, string config)
void Initialize (void)
void DeleteConfig (void)
void DeleteSubstructure (void)
RegistryExtractLocalConfig (const Registry &in) const
RegistryExtractLowerConfig (const Registry &in, const string &alg_key) const
 Split an incoming configuration Registry into a block valid for the sub-algo identified by alg_key.
template<class T>
bool GetParam (const RgKey &name, T &p, bool is_top_call=true) const
template<class T>
bool GetParamDef (const RgKey &name, T &p, const T &def) const
template<class T>
int GetParamVect (const std::string &comm_name, std::vector< T > &v, bool is_top_call=true) const
 Handle to load vectors of parameters.
int GetParamVectKeys (const std::string &comm_name, std::vector< RgKey > &k, bool is_top_call=true) const
template<class T>
int GetParamMat (const std::string &comm_name, TMatrixT< T > &mat, bool is_top_call=true) const
 Handle to load matrix of parameters.
template<class T>
int GetParamMatSym (const std::string &comm_name, TMatrixTSym< T > &mat, bool is_top_call=true) const
int GetParamMatKeys (const std::string &comm_name, std::vector< RgKey > &k, bool is_top_call=true) const
int AddTopRegistry (Registry *rp, bool owns=true)
 add registry with top priority, also update ownership
int AddLowRegistry (Registry *rp, bool owns=true)
 add registry with lowest priority, also update ownership
int MergeTopRegistry (const Registry &r)
int AddTopRegisties (const vector< Registry * > &rs, bool owns=false)
 Add registries with top priority, also udated Ownerships.
Protected Attributes inherited from genie::HadronicSystemGenerator
const EventRecordVisitorIfPreINukeDecayer
Protected Attributes inherited from genie::Algorithm
bool fAllowReconfig
bool fOwnsSubstruc
 true if it owns its substructure (sub-algs,...)
AlgId fID
 algorithm name and configuration set
vector< Registry * > fConfVect
vector< bool > fOwnerships
 ownership for every registry in fConfVect
AlgStatus_t fStatus
 algorithm execution status
AlgMapfOwnedSubAlgMp
 local pool for owned sub-algs (taken out of the factory pool)

Detailed Description

Generates the f/s hadronic system in single-Kaon production interactions. Is a concrete implementation of the EventRecordVisitorI interface.

Author
Costas Andreopoulos <c.andreopoulos \at cern.ch> University of Liverpool
Created:\n March 20, 2014
License:\n Copyright (c) 2003-2025, The GENIE Collaboration
For the full text of the license visit http://copyright.genie-mc.org

Definition at line 26 of file SKHadronicSystemGenerator.h.

Constructor & Destructor Documentation

◆ SKHadronicSystemGenerator() [1/2]

SKHadronicSystemGenerator::SKHadronicSystemGenerator ( )

Definition at line 39 of file SKHadronicSystemGenerator.cxx.

39 :
40HadronicSystemGenerator("genie::SKHadronicSystemGenerator")
41{
42
43}

References genie::HadronicSystemGenerator::HadronicSystemGenerator().

◆ SKHadronicSystemGenerator() [2/2]

SKHadronicSystemGenerator::SKHadronicSystemGenerator ( string config)

Definition at line 45 of file SKHadronicSystemGenerator.cxx.

45 :
46HadronicSystemGenerator("genie::SKHadronicSystemGenerator", config)
47{
48
49}

References genie::HadronicSystemGenerator::HadronicSystemGenerator().

◆ ~SKHadronicSystemGenerator()

SKHadronicSystemGenerator::~SKHadronicSystemGenerator ( )

Definition at line 51 of file SKHadronicSystemGenerator.cxx.

52{
53
54}

Member Function Documentation

◆ CalculateHadronicSystem_AtharSingleKaon()

void SKHadronicSystemGenerator::CalculateHadronicSystem_AtharSingleKaon ( GHepRecord * event_rec) const

Definition at line 65 of file SKHadronicSystemGenerator.cxx.

66{
67//
68// This method generates the final state hadronic system (kaon + nucleus)
69//
70
71 Interaction * interaction = evrec->Summary();
72 Kinematics * kinematics = interaction->KinePtr();
73 const XclsTag & xcls_tag = interaction->ExclTag();
74
75 //-- Access neutrino, initial nucleus and final state prim. lepton entries
76 GHepParticle * nu = evrec->Probe();
77 GHepParticle * Ni = evrec->HitNucleon();
78 GHepParticle * fsl = evrec->FinalStatePrimaryLepton();
79 assert(nu);
80 assert(Ni);
81 assert(fsl);
82
83 const TLorentzVector vtx = *(nu->X4());
84 const TLorentzVector p4nu_lab = *(nu ->P4());
85 const TLorentzVector p4fsl_lab = *(fsl->P4());
86
87 // these will get boosted to the nucleon rest frame
88 TLorentzVector p4nu = p4nu_lab;
89 TLorentzVector p4fsl = p4fsl_lab;
90
91 // Transform the neutrino and final-state lepton to the struck nucleon rest frame
92 const TLorentzVector pnuc4 = interaction->InitState().Tgt().HitNucP4(); // 4-momentum of struck nucleon in lab frame
93 TVector3 beta = pnuc4.BoostVector();
94 p4nu.Boost(-1.*beta);
95 p4fsl.Boost(-1.*beta);
96
97 LOG( "SKHadron", pDEBUG ) << "\nStruck nucleon p = (" << pnuc4.X() << ", " << pnuc4.Y() << ", " << pnuc4.Z() << ")";
98 LOG( "SKHadron", pDEBUG ) << "\nLab frame neutrino E = " << p4nu_lab.E() << " lepton " << p4fsl_lab.E() << " rest frame " << p4nu.E() << " lepton " << p4fsl.E();
99
100 //-- Determine the pdg code of the final state nucleon
101 int nuc_pdgc = (xcls_tag.NProtons()) ? kPdgProton : kPdgNeutron; // there's only ever one nucleon
102 int kaon_pdgc = xcls_tag.StrangeHadronPdg();
103
104 const Target & tgt = interaction->InitState().Tgt();
105 GHepStatus_t ist = (tgt.IsNucleus()) ?
107
108 //-- basic kinematic inputs
109 double Mf = (xcls_tag.NProtons()) ? kProtonMass : kNeutronMass; // there's only ever one nucleon
110 double M = pnuc4.M(); // Mass of the struck nucleon
111 double mk = PDGLibrary::Instance()->Find(kaon_pdgc)->Mass(); // K+ and K0 mass are slightly different
112 double mk2 = TMath::Power(mk,2);
113
114 //-- specific kinematic quantities
115 double kaon_T = kinematics->GetKV(kKVSelTk);
116 double kaon_E = kaon_T + mk;
117 double pk = sqrt( kaon_E*kaon_E - mk2 );
118
119 TLorentzVector q = p4nu - p4fsl; // nucleon rest frame
120
121 TVector3 qvec = q.Vect(); // nucleon rest frame
122 double q3 = qvec.Mag(); // in q frame (0,0,q3)
123
124 // Equation 17 of notes from M. Rafi Alam dated 6 November 2013
125 double eN = q.E() + M - kaon_E; // FS nucleon total energy
126 double cos_thetaKq = (q3*q3 + pk*pk + Mf*Mf - eN*eN)/(2*q3*pk);
127
128 LOG( "SKHadron", pDEBUG ) <<
129 "Cosine theta_kq = " << cos_thetaKq << "\n" <<
130 "q.E = " << q.E() << " M = " << M << " kaon E " << kaon_E << " q3 = " << q3 << " pk = " << pk;
131
132 if(cos_thetaKq > 1.0) {
133 LOG("SKHadron", pWARN) << "Invalid selected kinematics; Attempt regenerating";
134 evrec->EventFlags()->SetBitNumber(kKineGenErr, true);
135 genie::exceptions::EVGThreadException exception;
136 exception.SetReason("Invalid selected kinematics");
137 exception.SwitchOnStepBack();
138 exception.SetReturnStep(0);
139 throw exception;
140 }
141
142// this can be slightly larger than 1 due to numerical precision issues -- don't let it be
143// if( cos_thetaKq > 1.0 ) {
144// LOG( "SKHadron", pWARN ) <<
145// "Cosine theta_kq = " << cos_thetaKq << ", setting to 1.0\n" <<
146// "q.E = " << q.E() << " M = " << M << " kaon E " << kaon_E << " q3 = " << q3 << " pk = " << pk;
147// cos_thetaKq = 1.0;
148// }
149
150
151 // Get phi for the k-q plane relative to nu-l plane
152 double phi_kq = kinematics->GetKV(kKVSelphikq);
153
154 TVector3 kaon;
155 kaon.SetMagThetaPhi( pk, TMath::ACos(cos_thetaKq), phi_kq );
156
157 TVector3 nucleon( -kaon.X(), -kaon.Y(), q3 - kaon.Z() ); // force 3-momentum conservation in q frame
158
159 // Transform hadron momenta from z axis along q to lab frame
160 kaon.RotateUz(qvec.Unit());
161 nucleon.RotateUz(qvec.Unit());
162
163 LOG( "SKHadron", pDEBUG ) <<
164 "\nKaon (x,y,z) in nuc rest frame: (" << kaon.X() << ", " << kaon.Y() << ", " << kaon.Z() << ")" <<
165 "\nNucleon: (" << nucleon.X() << ", " << nucleon.Y() << ", " << nucleon.Z() << ")";
166
167 // make 4-vectors for the kaon and nucleon
168 TLorentzVector p4kaon( kaon, sqrt(kaon.Mag2()+mk2) );
169 TLorentzVector p4fsnuc( nucleon, sqrt(nucleon.Mag2()+Mf*Mf) );
170 // these are in the struck nucleon rest frame...boost them to the lab frame
171 p4kaon.Boost( beta );
172 p4fsnuc.Boost( beta );
173
174 LOG( "SKHadron", pDEBUG ) <<
175 "\nKaon (x,y,z) in lab frame: (" << p4kaon.X() << ", " << p4kaon.Y() << ", " << p4kaon.Z() << ")" <<
176 "\nNucleon: (" << p4fsnuc.X() << ", " << p4fsnuc.Y() << ", " << p4fsnuc.Z() << ")";
177
178 double pxNf = p4fsnuc.Px();
179 double pyNf = p4fsnuc.Py();
180 double pzNf = p4fsnuc.Pz();
181 double ENf = p4fsnuc.E();
182
183 double pxKf = p4kaon.Px();
184 double pyKf = p4kaon.Py();
185 double pzKf = p4kaon.Pz();
186 double EKf = p4kaon.E();
187
188 //-- Save the particles at the GHEP record
189
190 // mom is mother, not momentum
191 int mom = evrec->HitNucleonPosition();
192
193 // AddParticle (int pdg, GHepStatus_t ist, int mom1, int mom2, int dau1, int dau2, double px, double py, double pz, double E, double x, double y, double z, double t)
194
195 evrec->AddParticle(
196 nuc_pdgc, ist, mom,-1,-1,-1,
197 pxNf, pyNf, pzNf, ENf, vtx.X(), vtx.Y(), vtx.Z(), vtx.T());
198
199 evrec->AddParticle(
200 kaon_pdgc,ist, mom,-1,-1,-1,
201 pxKf, pyKf, pzKf, EKf, vtx.X(), vtx.Y(), vtx.Z(), vtx.T());
202
203}
#define pDEBUG
Definition Messenger.h:63
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Definition Messenger.h:96
#define pWARN
Definition Messenger.h:60
const TLorentzVector * P4(void) const
const TLorentzVector * X4(void) const
const Target & Tgt(void) const
const XclsTag & ExclTag(void) const
Definition Interaction.h:72
const InitialState & InitState(void) const
Definition Interaction.h:69
Kinematics * KinePtr(void) const
Definition Interaction.h:76
double GetKV(KineVar_t kv) const
static PDGLibrary * Instance(void)
TParticlePDG * Find(int pdgc, bool must_exist=true)
const TLorentzVector & HitNucP4(void) const
Definition Target.h:91
bool IsNucleus(void) const
Definition Target.cxx:272
int NProtons(void) const
Definition XclsTag.h:56
int StrangeHadronPdg(void) const
Definition XclsTag.h:55
@ kIStHadronInTheNucleus
Definition GHepStatus.h:37
@ kIStStableFinalState
Definition GHepStatus.h:30
const int kPdgProton
Definition PDGCodes.h:81
const int kPdgNeutron
Definition PDGCodes.h:83
enum genie::EGHepStatus GHepStatus_t
@ kKVSelTk
Definition KineVar.h:47
@ kKVSelphikq
Definition KineVar.h:50
@ kKineGenErr
Definition GHepFlags.h:31

References genie::GHepRecord::AddParticle(), genie::GHepRecord::EventFlags(), genie::Interaction::ExclTag(), genie::GHepRecord::FinalStatePrimaryLepton(), genie::PDGLibrary::Find(), genie::Kinematics::GetKV(), genie::GHepRecord::HitNucleon(), genie::GHepRecord::HitNucleonPosition(), genie::Target::HitNucP4(), genie::Interaction::InitState(), genie::PDGLibrary::Instance(), genie::Target::IsNucleus(), genie::Interaction::KinePtr(), genie::kIStHadronInTheNucleus, genie::kIStStableFinalState, genie::kKineGenErr, genie::kKVSelphikq, genie::kKVSelTk, genie::constants::kNeutronMass, genie::kPdgNeutron, genie::kPdgProton, genie::constants::kProtonMass, LOG, genie::XclsTag::NProtons(), genie::GHepParticle::P4(), pDEBUG, genie::GHepRecord::Probe(), pWARN, genie::exceptions::EVGThreadException::SetReason(), genie::exceptions::EVGThreadException::SetReturnStep(), genie::XclsTag::StrangeHadronPdg(), genie::GHepRecord::Summary(), genie::exceptions::EVGThreadException::SwitchOnStepBack(), genie::InitialState::Tgt(), and genie::GHepParticle::X4().

Referenced by ProcessEventRecord().

◆ ProcessEventRecord()

void SKHadronicSystemGenerator::ProcessEventRecord ( GHepRecord * event_rec) const
virtual

Implements genie::EventRecordVisitorI.

Definition at line 56 of file SKHadronicSystemGenerator.cxx.

57{
58// Access cross section algorithm for running thread
59 //RunningThreadInfo * rtinfo = RunningThreadInfo::Instance();
60 //const EventGeneratorI * evg = rtinfo->RunningThread();
61 //const XSecAlgorithmI *fXSecModel = evg->CrossSectionAlg();
63}
void CalculateHadronicSystem_AtharSingleKaon(GHepRecord *event_rec) const

References CalculateHadronicSystem_AtharSingleKaon().


The documentation for this class was generated from the following files: