GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
genie::DFRHadronicSystemGenerator Class Reference

#include <DFRHadronicSystemGenerator.h>

Inheritance diagram for genie::DFRHadronicSystemGenerator:
Inheritance graph
[legend]
Collaboration diagram for genie::DFRHadronicSystemGenerator:
Collaboration graph
[legend]

Public Member Functions

 DFRHadronicSystemGenerator ()
 
 DFRHadronicSystemGenerator (string config)
 
 ~DFRHadronicSystemGenerator ()
 
void ProcessEventRecord (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)
 
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. 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
 
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. More...
 
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 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< bool > fOwnerships
 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

Definition at line 26 of file DFRHadronicSystemGenerator.h.

Constructor & Destructor Documentation

DFRHadronicSystemGenerator::DFRHadronicSystemGenerator ( )

Definition at line 33 of file DFRHadronicSystemGenerator.cxx.

33  :
34 HadronicSystemGenerator("genie::DFRHadronicSystemGenerator")
35 {
36 
37 }
DFRHadronicSystemGenerator::DFRHadronicSystemGenerator ( string  config)

Definition at line 39 of file DFRHadronicSystemGenerator.cxx.

39  :
40 HadronicSystemGenerator("genie::DFRHadronicSystemGenerator", config)
41 {
42 
43 }
DFRHadronicSystemGenerator::~DFRHadronicSystemGenerator ( )

Definition at line 45 of file DFRHadronicSystemGenerator.cxx.

46 {
47 
48 }

Member Function Documentation

void DFRHadronicSystemGenerator::ProcessEventRecord ( GHepRecord event_rec) const
virtual

Implements genie::EventRecordVisitorI.

Definition at line 50 of file DFRHadronicSystemGenerator.cxx.

References genie::GHepRecord::AddParticle(), genie::GHepParticle::E(), genie::GHepRecord::EventFlags(), genie::Interaction::ExclTag(), genie::GHepRecord::FinalStatePrimaryLepton(), genie::PDGLibrary::Find(), genie::GHepRecord::HitNucleon(), genie::GHepRecord::HitNucleonPosition(), genie::Target::HitNucMass(), genie::Interaction::InitState(), genie::RandomGen::Instance(), genie::PDGLibrary::Instance(), genie::Target::IsNucleus(), genie::Interaction::Kine(), genie::kIStHadronInTheNucleus, genie::kIStStableFinalState, genie::kKineGenErr, genie::kPdgPi0, genie::kPdgPiM, genie::kPdgPiP, genie::constants::kPi, genie::kRfHitNucRest, LOG, genie::XclsTag::NPi0(), genie::XclsTag::NPiMinus(), genie::XclsTag::NPiPlus(), genie::GHepParticle::P4(), genie::GHepParticle::Pdg(), pFATAL, pINFO, genie::GHepRecord::Probe(), genie::InitialState::ProbeE(), pWARN, genie::GHepParticle::Px(), genie::GHepParticle::Py(), genie::GHepParticle::Pz(), genie::RandomGen::RndHadro(), genie::exceptions::EVGThreadException::SetReason(), genie::exceptions::EVGThreadException::SetReturnStep(), SLOG, genie::GHepRecord::Summary(), genie::exceptions::EVGThreadException::SwitchOnStepBack(), genie::Kinematics::t(), genie::InitialState::Tgt(), genie::Kinematics::x(), genie::GHepParticle::X4(), and genie::Kinematics::y().

51 {
52 // This method generates the final state hadronic system (meson + nucleus) in
53 // diffractive scattering
54 //
56 
57  //-- Access neutrino, initial nucleus and final state prim. lepton entries
58  GHepParticle * nu = evrec->Probe();
59  GHepParticle * Ni = evrec->HitNucleon();
60  GHepParticle * fsl = evrec->FinalStatePrimaryLepton();
61  assert(nu);
62  assert(Ni);
63  assert(fsl);
64 
65  Interaction * interaction = evrec->Summary();
66 
67  //-- Determine the pdg code of the final state pion
68  const XclsTag & xcls_tag = interaction->ExclTag();
69  int pion_pdgc = 0;
70  if (xcls_tag.NPi0() == 1) pion_pdgc = kPdgPi0;
71  else if (xcls_tag.NPiPlus() == 1) pion_pdgc = kPdgPiP;
72  else if (xcls_tag.NPiMinus() == 1) pion_pdgc = kPdgPiM;
73  else {
74  LOG("DFRHadronicVtx", pFATAL)
75  << "No final state pion information in XclsTag!";
76  exit(1);
77  }
78 
79  //-- Determine the pdg code of the recoil nucleon
80  int nucl_pdgc = Ni->Pdg(); // same as the hit nucleon
81 
82 
83  const TLorentzVector & p4nu = *(nu ->P4());
84  const TLorentzVector & p4Ni = *(Ni ->P4());
85  const TLorentzVector & p4fsl = *(fsl->P4());
86 
87  // q at LAB
88  TLorentzVector q = p4nu - p4fsl;
89 
90  // q at NRF
91  TLorentzVector qnrf(q);
92  TVector3 beta = p4Ni.BoostVector();
93  qnrf.Boost(-beta);
94 
95  const InitialState & init_state = interaction -> InitState();
96  const Target & target = init_state.Tgt();
97 
98  double E = init_state.ProbeE(kRfHitNucRest); // neutrino energy
99  double M = target.HitNucMass();
100  double mpi = PDGLibrary::Instance()->Find(pion_pdgc)->Mass();
101  double mpi2 = TMath::Power(mpi,2);
102  double xo = interaction->Kine().x(true);
103  double yo = interaction->Kine().y(true);
104  double to = interaction->Kine().t(true);
105  double Epi = qnrf.E() - 0.5*to/M;
106  double Epi2 = TMath::Power(Epi,2);
107  double ppi2 = Epi2-mpi2;
108  double ppi = TMath::Sqrt(TMath::Max(0.,ppi2));
109 
110  SLOG("DFRHadronicVtx", pINFO)
111  << "Ev = "<< E
112  << ", xo = " << xo << ", yo = " << yo << ", to = " << to;
113  SLOG("DFRHadronicVtx", pINFO)
114  << "f/s pion E = " << Epi << ", |p| = " << ppi;
115 
116  // find angle theta between q and ppi (xi=costheta)
117 
118  double xi = -to - mpi2 - qnrf.M2() + 2*qnrf.E()*Epi;
119  xi /= (2 * TMath::Sqrt(Epi2-mpi2) * qnrf.Vect().Mag());
120 
121  if(xi < 0. || xi > 1. || Epi<= mpi) {
122  LOG("DFRKinematics", pWARN) << "Invalid selected kinematics; Attempt regenerating";
123  evrec->EventFlags()->SetBitNumber(kKineGenErr, true);
125  exception.SetReason("Invalid selected kinematics");
126  exception.SwitchOnStepBack();
127  exception.SetReturnStep(0);
128  throw exception;
129  }
130 
131  LOG("DFRHadronicVtx", pINFO) << "|to| = " << -to;
132  LOG("DFRHadronicVtx", pINFO) << "q2 = " << qnrf.M2();
133  LOG("DFRHadronicVtx", pINFO) << "xi = " << xi;
134 
135  double costheta = xi;
136  double sintheta = TMath::Sqrt(TMath::Max(0.,1.-xi*xi));
137 
138  SLOG("DFRHadronicVtx", pINFO) << "cos(pion, q) = " << costheta;
139 
140  // compute transverse and longitudinal ppi components along q
141  double ppiL = ppi*costheta;
142  double ppiT = ppi*sintheta;
143  double phi = 2*kPi* rnd->RndHadro().Rndm();
144 
145  TVector3 ppi3(0,ppiT,ppiL); // @ NRF' (NRF rotated so that q along z)
146 
147  ppi3.RotateZ(phi); // randomize transverse components
148  ppi3.RotateUz(qnrf.Vect().Unit()); // align longit. component with q in NRF
149 
150  TLorentzVector p4pi(ppi3,Epi);
151  p4pi.Boost(beta);
152 
153 
154  //-- Now figure out the f/s nucleon 4-p
155 
156  double pxNf = nu->Px() + Ni->Px() - fsl->Px() - p4pi.Px();
157  double pyNf = nu->Py() + Ni->Py() - fsl->Py() - p4pi.Py();
158  double pzNf = nu->Pz() + Ni->Pz() - fsl->Pz() - p4pi.Pz();
159  double ENf = nu->E() + Ni->E() - fsl->E() - p4pi.E();
160 
161  //-- Save the particles at the GHEP record
162 
163  int mom = evrec->HitNucleonPosition();
164  const TLorentzVector & vtx = *(nu->X4());
165 
166  const Target & tgt = interaction->InitState().Tgt();
167  GHepStatus_t ist = (tgt.IsNucleus()) ?
169 
170  evrec->AddParticle(nucl_pdgc, ist, mom,-1,-1,-1,
171  pxNf, pyNf, pzNf, ENf, 0, 0, 0, 0);
172 
173  evrec->AddParticle(pion_pdgc, ist, mom,-1,-1,-1,
174  p4pi.Px(), p4pi.Py(),p4pi.Pz(),p4pi.E(), vtx.X(), vtx.Y(), vtx.Z(), vtx.T());
175 }
double E(void) const
Get energy.
Definition: GHepParticle.h:91
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:71
const TLorentzVector * P4(void) const
Definition: GHepParticle.h:78
double HitNucMass(void) const
Definition: Target.cxx:233
#define pFATAL
Definition: Messenger.h:56
bool IsNucleus(void) const
Definition: Target.cxx:272
int NPiMinus(void) const
Definition: XclsTag.h:60
double x(bool selected=false) const
Definition: Kinematics.cxx:99
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:29
double Pz(void) const
Get Pz.
Definition: GHepParticle.h:90
Contains minimal information for tagging exclusive processes.
Definition: XclsTag.h:39
double Px(void) const
Get Px.
Definition: GHepParticle.h:88
double y(bool selected=false) const
Definition: Kinematics.cxx:112
int Pdg(void) const
Definition: GHepParticle.h:63
Summary information for an interaction.
Definition: Interaction.h:56
An exception thrown by EventRecordVisitorI when the normal processing sequence has to be disrupted (f...
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
const Kinematics & Kine(void) const
Definition: Interaction.h:71
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:40
int NPiPlus(void) const
Definition: XclsTag.h:59
const int kPdgPiP
Definition: PDGCodes.h:158
const int kPdgPi0
Definition: PDGCodes.h:160
#define pINFO
Definition: Messenger.h:62
int NPi0(void) const
Definition: XclsTag.h:58
#define pWARN
Definition: Messenger.h:60
TRandom3 & RndHadro(void) const
rnd number generator used by hadronization models
Definition: RandomGen.h:53
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:68
const TLorentzVector * X4(void) const
Definition: GHepParticle.h:79
const XclsTag & ExclTag(void) const
Definition: Interaction.h:72
const int kPdgPiM
Definition: PDGCodes.h:159
const InitialState & InitState(void) const
Definition: Interaction.h:69
double t(bool selected=false) const
Definition: Kinematics.cxx:170
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:86
const Target & Tgt(void) const
Definition: InitialState.h:66
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:84
double ProbeE(RefFrame_t rf) const
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:39
enum genie::EGHepStatus GHepStatus_t
Initial State information.
Definition: InitialState.h:48
double Py(void) const
Get Py.
Definition: GHepParticle.h:89

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