Public Member Functions | List of all members
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:
genie::HadronicSystemGenerator genie::EventRecordVisitorI genie::Algorithm

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. More...
 
virtual AlgStatus_t GetStatus (void) const
 Get algorithm status. More...
 
virtual bool AllowReconfig (void) const
 
virtual AlgCmp_t Compare (const Algorithm *alg) const
 Compare with input algorithm. More...
 
virtual void SetId (const AlgId &id)
 Set algorithm ID. More...
 
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. More...
 

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)
 
- 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. More...
 
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. More...
 
int GetParamVectKeys (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 More...
 
int AddLowRegistry (Registry *rp, bool owns=true)
 add registry with lowest priority, also update ownership More...
 
int MergeTopRegistry (const Registry &r)
 
int AddTopRegisties (const vector< Registry * > &rs, bool owns=false)
 Add registries with top priority, also udated Ownerships. More...
 
- 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,...) More...
 
AlgId fID
 algorithm name and configuration set More...
 
vector< Registry * > fConfVect
 
vector< boolfOwnerships
 ownership for every registry in fConfVect More...
 
AlgStatus_t fStatus
 algorithm execution status More...
 
AlgMapfOwnedSubAlgMp
 local pool for owned sub-algs (taken out of the factory pool) More...
 

Detailed Description

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

Author
Costas Andreopoulos <constantinos.andreopoulos cern.ch> University of Liverpool & STFC Rutherford Appleton Laboratory

March 20, 2014

Copyright (c) 2003-2020, 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::SKHadronicSystemGenerator ( )

Definition at line 39 of file SKHadronicSystemGenerator.cxx.

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

Definition at line 45 of file SKHadronicSystemGenerator.cxx.

45  :
46 HadronicSystemGenerator("genie::SKHadronicSystemGenerator", config)
47 {
48 
49 }
static Config * config
Definition: config.cpp:1054
SKHadronicSystemGenerator::~SKHadronicSystemGenerator ( )

Definition at line 51 of file SKHadronicSystemGenerator.cxx.

52 {
53 
54 }

Member Function Documentation

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);
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 }
double beta(double KE, const simb::MCParticle *part)
const TLorentzVector * P4(void) const
Definition: GHepParticle.h:78
Kinematics * KinePtr(void) const
Definition: Interaction.h:76
bool IsNucleus(void) const
Definition: Target.cxx:272
Generated/set kinematical variables for an event.
Definition: Kinematics.h:39
Contains minimal information for tagging exclusive processes.
Definition: XclsTag.h:39
Summary information for an interaction.
Definition: Interaction.h:56
const TLorentzVector & HitNucP4(void) const
Definition: Target.h:91
An exception thrown by EventRecordVisitorI when the normal processing sequence has to be disrupted (f...
int StrangeHadronPdg(void) const
Definition: XclsTag.h:55
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:40
static const double kNeutronMass
Definition: Constants.h:76
double GetKV(KineVar_t kv) const
Definition: Kinematics.cxx:323
#define pWARN
Definition: Messenger.h:60
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:57
const TLorentzVector * X4(void) const
Definition: GHepParticle.h:79
const XclsTag & ExclTag(void) const
Definition: Interaction.h:72
const InitialState & InitState(void) const
Definition: Interaction.h:69
const int kPdgProton
Definition: PDGCodes.h:81
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:75
const Target & Tgt(void) const
Definition: InitialState.h:66
const int kPdgNeutron
Definition: PDGCodes.h:83
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:39
static const double kProtonMass
Definition: Constants.h:75
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
enum genie::EGHepStatus GHepStatus_t
#define pDEBUG
Definition: Messenger.h:63
int NProtons(void) const
Definition: XclsTag.h:56
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

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