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

Generates the f/s hadronic system in v COH pi production interactions. Is a concrete implementation of the EventRecordVisitorI interface. More...

#include <COHHadronicSystemGenerator.h>

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

Public Member Functions

 COHHadronicSystemGenerator ()
 
 COHHadronicSystemGenerator (string config)
 
 ~COHHadronicSystemGenerator ()
 
void ProcessEventRecord (GHepRecord *event_rec) const
 
void CalculateHadronicSystem_ReinSehgal (GHepRecord *event_rec) const
 
void CalculateHadronicSystem_BergerSehgal (GHepRecord *event_rec) const
 
void CalculateHadronicSystem_BergerSehgalFM (GHepRecord *event_rec) const
 
void CalculateHadronicSystem_AlvarezRuso (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...
 

Private Member Functions

int getPionPDGCodeFromXclTag (const XclsTag &xcls_tag) const
 

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

Generates the f/s hadronic system in v COH pi production interactions. Is a concrete implementation of the EventRecordVisitorI interface.

Author
Costas Andreopoulos <c.andreopoulos cern.ch> University of Liverpool
Created:
October 03, 2004
License:
Copyright (c) 2003-2024, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 28 of file COHHadronicSystemGenerator.h.

Constructor & Destructor Documentation

COHHadronicSystemGenerator::COHHadronicSystemGenerator ( )

Definition at line 35 of file COHHadronicSystemGenerator.cxx.

35  :
36  HadronicSystemGenerator("genie::COHHadronicSystemGenerator")
37 {
38 
39 }
COHHadronicSystemGenerator::COHHadronicSystemGenerator ( string  config)

Definition at line 41 of file COHHadronicSystemGenerator.cxx.

41  :
42  HadronicSystemGenerator("genie::COHHadronicSystemGenerator", config)
43 {
44 
45 }
COHHadronicSystemGenerator::~COHHadronicSystemGenerator ( )

Definition at line 47 of file COHHadronicSystemGenerator.cxx.

48 {
49 
50 }

Member Function Documentation

void COHHadronicSystemGenerator::CalculateHadronicSystem_AlvarezRuso ( GHepRecord event_rec) const

Definition at line 322 of file COHHadronicSystemGenerator.cxx.

References genie::GHepRecord::AddParticle(), genie::GHepParticle::E(), genie::GHepRecord::FinalStatePrimaryLepton(), genie::Kinematics::HadSystP4(), genie::ProcessInfo::IsWeakCC(), genie::ProcessInfo::IsWeakNC(), genie::kIStStableFinalState, genie::kPdgPi0, genie::kPdgPiM, genie::kPdgPiP, LOG, genie::GHepParticle::Pdg(), pFATAL, genie::GHepRecord::Probe(), genie::Interaction::ProcInfo(), genie::GHepParticle::Px(), genie::GHepParticle::Py(), genie::GHepParticle::Pz(), genie::GHepRecord::Summary(), genie::GHepRecord::TargetNucleus(), genie::GHepRecord::TargetNucleusPosition(), and genie::GHepParticle::X4().

Referenced by ProcessEventRecord().

323 {
324  Interaction * interaction = evrec->Summary();
325  const Kinematics & kinematics = interaction -> Kine();
326  GHepParticle * nu = evrec->Probe();
327  GHepParticle * Ni = evrec->TargetNucleus();
328  GHepParticle * fsl = evrec->FinalStatePrimaryLepton();
329 
330  // Pion
331  const TLorentzVector ppi = kinematics.HadSystP4();
332  const TVector3 ppi3 = ppi.Vect();
333  const double Epi = ppi.E();
334  int pion_pdgc=0;
335  if ( interaction->ProcInfo().IsWeakCC() ) {
336  if( nu->Pdg() > 0 ){ // neutrino
337  pion_pdgc = kPdgPiP;
338  }
339  else{ // anti-neutrino
340  pion_pdgc = kPdgPiM;
341  }
342  }
343  else if ( interaction->ProcInfo().IsWeakNC() ) {
344  pion_pdgc = kPdgPi0;
345  }
346  else{
347  LOG("COHHadronicSystemGeneratorAR", pFATAL)
348  << "Could not determine pion involved in interaction";
349  exit(1);
350  }
351 
352  //
353  // Nucleus
354  int nucl_pdgc = Ni->Pdg(); // pdg of final nucleus same as the initial nucleus
355  double pxNf = nu->Px() + Ni->Px() - fsl->Px() - ppi3.Px();
356  double pyNf = nu->Py() + Ni->Py() - fsl->Py() - ppi3.Py();
357  double pzNf = nu->Pz() + Ni->Pz() - fsl->Pz() - ppi3.Pz();
358  double ENf = nu->E() + Ni->E() - fsl->E() - Epi;
359  //
360  // Both
361  const TLorentzVector & vtx = *(nu->X4());
362  int mom = evrec->TargetNucleusPosition();
363 
364  //
365  // Fill the records
366  evrec->AddParticle(nucl_pdgc,kIStStableFinalState, mom,-1,-1,-1,
367  pxNf, pyNf, pzNf, ENf, 0, 0, 0, 0);
368 
369  evrec->AddParticle(pion_pdgc,kIStStableFinalState, mom,-1,-1,-1,
370  ppi3.Px(), ppi3.Py(),ppi3.Pz(),Epi, vtx.X(), vtx.Y(), vtx.Z(), vtx.T());
371 }
bool IsWeakCC(void) const
double E(void) const
Get energy.
Definition: GHepParticle.h:91
#define pFATAL
Definition: Messenger.h:56
Generated/set kinematical variables for an event.
Definition: Kinematics.h:39
const TLorentzVector & HadSystP4(void) const
Definition: Kinematics.h:66
double Pz(void) const
Get Pz.
Definition: GHepParticle.h:90
double Px(void) const
Get Px.
Definition: GHepParticle.h:88
int Pdg(void) const
Definition: GHepParticle.h:63
Summary information for an interaction.
Definition: Interaction.h:56
bool IsWeakNC(void) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
const int kPdgPiP
Definition: PDGCodes.h:158
const int kPdgPi0
Definition: PDGCodes.h:160
const TLorentzVector * X4(void) const
Definition: GHepParticle.h:79
const int kPdgPiM
Definition: PDGCodes.h:159
const ProcessInfo & ProcInfo(void) const
Definition: Interaction.h:70
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:39
double Py(void) const
Get Py.
Definition: GHepParticle.h:89
void COHHadronicSystemGenerator::CalculateHadronicSystem_BergerSehgal ( GHepRecord event_rec) const

Definition at line 88 of file COHHadronicSystemGenerator.cxx.

References CalculateHadronicSystem_ReinSehgal().

Referenced by ProcessEventRecord().

89 {
90  // Treatment of the hadronic side is identical to Rein-Sehgal if we assume an infinite
91  // mass for the nucleus.
93 }
void CalculateHadronicSystem_ReinSehgal(GHepRecord *event_rec) const
void COHHadronicSystemGenerator::CalculateHadronicSystem_BergerSehgalFM ( GHepRecord event_rec) const

Definition at line 95 of file COHHadronicSystemGenerator.cxx.

References genie::GHepRecord::AddParticle(), genie::GHepParticle::E(), genie::Interaction::ExclTag(), genie::GHepRecord::FinalStatePrimaryLepton(), genie::PDGLibrary::Find(), getPionPDGCodeFromXclTag(), genie::RandomGen::Instance(), genie::PDGLibrary::Instance(), genie::Interaction::Kine(), genie::kIStStableFinalState, genie::constants::kPi, genie::Target::Mass(), genie::GHepParticle::P4(), genie::GHepParticle::Pdg(), pERROR, pINFO, genie::GHepRecord::Probe(), genie::GHepParticle::Px(), genie::GHepParticle::Py(), genie::GHepParticle::Pz(), genie::Kinematics::Q2(), genie::utils::kinematics::Q2(), genie::RandomGen::RndHadro(), SLOG, genie::GHepRecord::Summary(), genie::Kinematics::t(), genie::GHepRecord::TargetNucleus(), genie::GHepRecord::TargetNucleusPosition(), genie::InitialState::Tgt(), genie::GHepParticle::X4(), and genie::Kinematics::y().

Referenced by ProcessEventRecord().

96 {
97  //
98  // This method generates the final state hadronic system (pion + nucleus) in
99  // COH interactions
100  //
101  RandomGen * rnd = RandomGen::Instance();
102 
103  Interaction * interaction = evrec->Summary();
104  const XclsTag & xcls_tag = interaction->ExclTag();
105  const InitialState & init_state = interaction -> InitState();
106 
107  //-- Access neutrino, initial nucleus and final state prim. lepton entries
108  GHepParticle * nu = evrec->Probe();
109  GHepParticle * Ni = evrec->TargetNucleus();
110  GHepParticle * fsl = evrec->FinalStatePrimaryLepton();
111  assert(nu);
112  assert(Ni);
113  assert(fsl);
114 
115  const TLorentzVector & vtx = *(nu->X4());
116  const TLorentzVector & p4nu = *(nu ->P4());
117  const TLorentzVector & p4fsl = *(fsl->P4());
118 
119  //-- Determine the pdg code of the final state pion & nucleus
120  int nucl_pdgc = Ni->Pdg(); // same as the initial nucleus
121  int pion_pdgc = getPionPDGCodeFromXclTag(xcls_tag);
122 
123  //-- basic kinematic inputs
124  double E = nu->E();
125  double Q2 = interaction->Kine().Q2(true);
126  double y = interaction->Kine().y(true);
127  double t = interaction->Kine().t(true);
128  double MA = init_state.Tgt().Mass();
129  // double MA2 = TMath::Power(MA, 2.); // Unused
130  double mpi = PDGLibrary::Instance()->Find(pion_pdgc)->Mass();
131  double mpi2 = TMath::Power(mpi,2);
132 
133  SLOG("COHHadronicVtx", pINFO)
134  << "Ev = "<< E << ", Q^2 = " << Q2
135  << ", y = " << y << ", t = " << t;
136 
137  double Epi = y * E - t / (2 * MA);
138  double ppi2 = Epi * Epi - mpi2;
139  double ppi = ppi2 > 0.0 ? TMath::Sqrt(ppi2) : 0.0;
140 
141  double costheta = (t - Q2 - mpi2) / (2 * ( (y *E - Epi) * Epi -
142  ppi * sqrt(TMath::Power(y * E - Epi, 2.) + t) ) );
143 
144  if ((costheta > 1.0) || (costheta < -1.0)) {
145  SLOG("COHHadronicVtx", pERROR)
146  << "Unphysical pion angle!";
147  }
148 
149  double sintheta = TMath::Sqrt(1 - costheta * costheta);
150 
151  //-- first work in the c.m.s. frame
152  // double S = 2 * MA * nuh - Q2 + MA2;
153  // double S_2 = S >= 0 ? TMath::Sqrt(S) : 0.0; // TODO - Error here?
154  // double Pcm = MA * TMath::Sqrt( (nuh*nuh + Q2)/S );
155  // double Epi = (S + mpi2 - MA2)/(2 * S_2);
156  // double EAprime = (S - mpi2 + MA2)/(2 * S_2);
157  // double EA = (S + MA2 + Q2)/(2 * S_2);
158  // double PAprime2 = TMath::Power(EAprime,2.0) - MA2;
159  // double PAprime = TMath::Sqrt(PAprime2);
160  // double tA = TMath::Power((EAprime - EA),2.0) - TMath::Power(PAprime,2.0) -
161  // TMath::Power(Pcm, 2.0);
162  // double tB = 2 * Pcm * PAprime;
163  // double cosT = (t - tA)/tB;
164  // double sinT = TMath::Sqrt(1 - cosT*cosT);
165  // double PAz = PAprime * cosT;
166  // double PAperp = PAprime * sinT;
167  // double PPiz = -PAz;
168 
169  // Randomize transverse components
170  double phi = 2 * kPi * rnd->RndHadro().Rndm();
171  double ppix = ppi * sintheta * TMath::Cos(phi);
172  double ppiy = ppi * sintheta * TMath::Sin(phi);
173  double ppiz = ppi * costheta;
174 
175  // boost back to the lab frame
176  // double beta = TMath::Sqrt( nuh*nuh + Q2 )/(nuh + MA);
177  // double gamma = (nuh + MA)/TMath::Sqrt(S);
178  // double betagamma = beta * gamma;
179 
180  // double epi = gamma*Epi + betagamma*PPiz;
181  // double ppiz = betagamma*Epi + gamma*PPiz;
182 
183  // double ea = gamma*EAprime + betagamma*PAz;
184  // double paz = betagamma*EAprime + gamma*PAz;
185 
186  // Now rotate so our axes are aligned with the lab instead of q
187  TLorentzVector q = p4nu - p4fsl;
188  TVector3 ppi3(ppix, ppiy, ppiz);
189  ppi3.RotateUz(q.Vect().Unit());
190 
191  // Nucleus...
192  // TVector3 pa(PAx,PAy,paz);
193  // pa.RotateUz(q.Vect().Unit());
194 
195  // now figure out the f/s nucleus 4-p
196 
197  double pxNf = nu->Px() + Ni->Px() - fsl->Px() - ppi3.Px();
198  double pyNf = nu->Py() + Ni->Py() - fsl->Py() - ppi3.Py();
199  double pzNf = nu->Pz() + Ni->Pz() - fsl->Pz() - ppi3.Pz();
200  double ENf = nu->E() + Ni->E() - fsl->E() - Epi;
201 
202  //-- Save the particles at the GHEP record
203 
204  int mom = evrec->TargetNucleusPosition();
205 
206  // Nucleus - need to balance overall 4-momentum
207  evrec->AddParticle(nucl_pdgc,kIStStableFinalState, mom,-1,-1,-1,
208  pxNf, pyNf, pzNf, ENf, 0, 0, 0, 0);
209 
210  // evrec->AddParticle(
211  // nucl_pdgc,kIStStableFinalState, mom,-1,-1,-1,
212  // pa.Px(), pa.Py(), pa.Pz(), ea, 0, 0, 0, 0);
213 
214  evrec->AddParticle(
215  pion_pdgc,kIStStableFinalState, mom,-1,-1,-1,
216  ppi3.Px(), ppi3.Py(), ppi3.Pz(), Epi, vtx.X(), vtx.Y(), vtx.Z(), vtx.T());
217 }
#define pERROR
Definition: Messenger.h:59
double E(void) const
Get energy.
Definition: GHepParticle.h:91
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:1077
int getPionPDGCodeFromXclTag(const XclsTag &xcls_tag) const
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:71
const TLorentzVector * P4(void) const
Definition: GHepParticle.h:78
double Mass(void) const
Definition: Target.cxx:224
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
const Kinematics & Kine(void) const
Definition: Interaction.h:71
#define pINFO
Definition: Messenger.h:62
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
double t(bool selected=false) const
Definition: Kinematics.cxx:170
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:86
double Q2(bool selected=false) const
Definition: Kinematics.cxx:125
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
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:39
Initial State information.
Definition: InitialState.h:48
double Py(void) const
Get Py.
Definition: GHepParticle.h:89
void COHHadronicSystemGenerator::CalculateHadronicSystem_ReinSehgal ( GHepRecord event_rec) const

Definition at line 219 of file COHHadronicSystemGenerator.cxx.

References genie::GHepRecord::AddParticle(), genie::GHepParticle::E(), genie::Interaction::ExclTag(), genie::GHepRecord::FinalStatePrimaryLepton(), genie::PDGLibrary::Find(), getPionPDGCodeFromXclTag(), genie::RandomGen::Instance(), genie::PDGLibrary::Instance(), genie::Interaction::Kine(), genie::kIStStableFinalState, genie::constants::kNucleonMass, genie::constants::kPi, genie::GHepParticle::P4(), genie::utils::print::P4AsString(), genie::GHepParticle::Pdg(), pINFO, genie::GHepRecord::Probe(), genie::GHepParticle::Px(), genie::GHepParticle::Py(), genie::GHepParticle::Pz(), genie::RandomGen::RndHadro(), SLOG, genie::GHepRecord::Summary(), genie::Kinematics::t(), genie::GHepRecord::TargetNucleus(), genie::GHepRecord::TargetNucleusPosition(), genie::utils::print::Vec3AsString(), genie::Kinematics::x(), genie::GHepParticle::X4(), and genie::Kinematics::y().

Referenced by CalculateHadronicSystem_BergerSehgal(), and ProcessEventRecord().

220 {
221  //
222  // This method generates the final state hadronic system (pion + nucleus) in
223  // COH interactions
224  //
225  RandomGen * rnd = RandomGen::Instance();
226 
227  Interaction * interaction = evrec->Summary();
228  const XclsTag & xcls_tag = interaction->ExclTag();
229 
230  //-- Access neutrino, initial nucleus and final state prim. lepton entries
231  GHepParticle * nu = evrec->Probe();
232  GHepParticle * Ni = evrec->TargetNucleus();
233  GHepParticle * fsl = evrec->FinalStatePrimaryLepton();
234  assert(nu);
235  assert(Ni);
236  assert(fsl);
237 
238  const TLorentzVector & vtx = *(nu->X4());
239  const TLorentzVector & p4nu = *(nu ->P4());
240  const TLorentzVector & p4fsl = *(fsl->P4());
241 
242  //-- Determine the pdg code of the final state pion & nucleus
243  int nucl_pdgc = Ni->Pdg(); // same as the initial nucleus
244  int pion_pdgc = getPionPDGCodeFromXclTag(xcls_tag);
245 
246  //-- basic kinematic inputs
247  double E = nu->E();
248  double M = kNucleonMass;
249  double mpi = PDGLibrary::Instance()->Find(pion_pdgc)->Mass();
250  double mpi2 = TMath::Power(mpi,2);
251  double xo = interaction->Kine().x(true);
252  double yo = interaction->Kine().y(true);
253  double to = interaction->Kine().t(true);
254 
255  SLOG("COHHadronicVtx", pINFO)
256  << "Ev = "<< E << ", xo = " << xo
257  << ", yo = " << yo << ", to = " << to;
258 
259  //-- compute pion energy and |momentum|
260  double Epi = yo * E;
261  double Epi2 = TMath::Power(Epi,2);
262  double ppi2 = Epi2-mpi2;
263  double ppi = TMath::Sqrt(TMath::Max(0.,ppi2));
264 
265  SLOG("COHHadronicVtx", pINFO)
266  << "f/s pion E = " << Epi << ", |p| = " << ppi;
267  assert(Epi>mpi);
268 
269  //-- 4-momentum transfer q=p(neutrino) - p(f/s lepton)
270  // Note: m^2 = q^2 < 0
271  // Also, since the nucleus is heavy all energy loss is comminicated to
272  // the outgoing pion Rein & Sehgal, Nucl.Phys.B223.29-44(1983), p.35
273 
274  TLorentzVector q = p4nu - p4fsl;
275 
276  SLOG("COHHadronicVtx", pINFO)
277  << "\n 4-p transfer q @ LAB: " << utils::print::P4AsString(&q);
278 
279  //-- find angle theta between q and ppi (xi=costheta)
280  // note: t=|(ppi-q)^2|, Rein & Sehgal, Nucl.Phys.B223.29-44(1983), p.36
281 
282  double xi = 1. + M*xo/Epi - 0.5*mpi2/Epi2 - 0.5*to/Epi2;
283  xi /= TMath::Sqrt((1.+2.*M*xo/Epi)*(1.-mpi2/Epi2));
284 
285  double costheta = xi;
286  double sintheta = TMath::Sqrt(TMath::Max(0.,1.-xi*xi));
287 
288  SLOG("COHHadronicVtx", pINFO) << "cos(pion, q) = " << costheta;
289 
290  // compute transverse and longitudinal ppi components along q
291  double ppiL = ppi*costheta;
292  double ppiT = ppi*sintheta;
293 
294  double phi = 2*kPi* rnd->RndHadro().Rndm();
295 
296  TVector3 ppi3(0,ppiT,ppiL);
297 
298  ppi3.RotateZ(phi); // randomize transverse components
299  ppi3.RotateUz(q.Vect().Unit()); // align longit. component with q in LAB
300 
301  SLOG("COHHadronicVtx", pINFO)
302  << "Pion 3-p @ LAB: " << utils::print::Vec3AsString(&ppi3);
303 
304  // now figure out the f/s nucleus 4-p
305 
306  double pxNf = nu->Px() + Ni->Px() - fsl->Px() - ppi3.Px();
307  double pyNf = nu->Py() + Ni->Py() - fsl->Py() - ppi3.Py();
308  double pzNf = nu->Pz() + Ni->Pz() - fsl->Pz() - ppi3.Pz();
309  double ENf = nu->E() + Ni->E() - fsl->E() - Epi;
310 
311  //-- Save the particles at the GHEP record
312 
313  int mom = evrec->TargetNucleusPosition();
314 
315  evrec->AddParticle(nucl_pdgc,kIStStableFinalState, mom,-1,-1,-1,
316  pxNf, pyNf, pzNf, ENf, 0, 0, 0, 0);
317 
318  evrec->AddParticle(pion_pdgc,kIStStableFinalState, mom,-1,-1,-1,
319  ppi3.Px(), ppi3.Py(),ppi3.Pz(),Epi, vtx.X(), vtx.Y(), vtx.Z(), vtx.T());
320 }
double E(void) const
Get energy.
Definition: GHepParticle.h:91
static const double kNucleonMass
int getPionPDGCodeFromXclTag(const XclsTag &xcls_tag) const
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:71
const TLorentzVector * P4(void) const
Definition: GHepParticle.h:78
string P4AsString(const TLorentzVector *p)
Definition: PrintUtils.cxx:27
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
const Kinematics & Kine(void) const
Definition: Interaction.h:71
#define pINFO
Definition: Messenger.h:62
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
double t(bool selected=false) const
Definition: Kinematics.cxx:170
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:86
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:84
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:39
string Vec3AsString(const TVector3 *vec)
Definition: PrintUtils.cxx:80
double Py(void) const
Get Py.
Definition: GHepParticle.h:89
int COHHadronicSystemGenerator::getPionPDGCodeFromXclTag ( const XclsTag xcls_tag) const
private

Definition at line 74 of file COHHadronicSystemGenerator.cxx.

References genie::kPdgPi0, genie::kPdgPiM, genie::kPdgPiP, LOG, genie::XclsTag::NPi0(), genie::XclsTag::NPiMinus(), genie::XclsTag::NPiPlus(), and pFATAL.

Referenced by CalculateHadronicSystem_BergerSehgalFM(), and CalculateHadronicSystem_ReinSehgal().

75 {
76  int pion_pdgc = 0;
77  if (xcls_tag.NPi0() == 1) pion_pdgc = kPdgPi0;
78  else if (xcls_tag.NPiPlus() == 1) pion_pdgc = kPdgPiP;
79  else if (xcls_tag.NPiMinus() == 1) pion_pdgc = kPdgPiM;
80  else {
81  LOG("COHHadronicVtx", pFATAL)
82  << "No final state pion information in XclsTag!";
83  exit(1);
84  }
85  return pion_pdgc;
86 }
#define pFATAL
Definition: Messenger.h:56
int NPiMinus(void) const
Definition: XclsTag.h:60
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
int NPiPlus(void) const
Definition: XclsTag.h:59
const int kPdgPiP
Definition: PDGCodes.h:158
const int kPdgPi0
Definition: PDGCodes.h:160
int NPi0(void) const
Definition: XclsTag.h:58
const int kPdgPiM
Definition: PDGCodes.h:159
void COHHadronicSystemGenerator::ProcessEventRecord ( GHepRecord event_rec) const
virtual

Implements genie::EventRecordVisitorI.

Definition at line 52 of file COHHadronicSystemGenerator.cxx.

References CalculateHadronicSystem_AlvarezRuso(), CalculateHadronicSystem_BergerSehgal(), CalculateHadronicSystem_BergerSehgalFM(), CalculateHadronicSystem_ReinSehgal(), genie::EventGeneratorI::CrossSectionAlg(), genie::Algorithm::Id(), genie::RunningThreadInfo::Instance(), LOG, genie::AlgId::Name(), pFATAL, and genie::RunningThreadInfo::RunningThread().

53 {
54  // Access cross section algorithm for running thread
56  const EventGeneratorI * evg = rtinfo->RunningThread();
57  const XSecAlgorithmI *fXSecModel = evg->CrossSectionAlg();
58  if (fXSecModel->Id().Name() == "genie::ReinSehgalCOHPiPXSec") {
60  } else if ((fXSecModel->Id().Name() == "genie::BergerSehgalCOHPiPXSec2015")) {
62  } else if ((fXSecModel->Id().Name() == "genie::BergerSehgalFMCOHPiPXSec2015")) {
64  } else if ((fXSecModel->Id().Name() == "genie::AlvarezRusoCOHPiPXSec")) {
66  }
67  else {
68  LOG("COHHadronicSystemGenerator",pFATAL) <<
69  "ProcessEventRecord >> Cannot calculate hadronic system for " <<
70  fXSecModel->Id().Name();
71  }
72 }
Cross Section Calculation Interface.
void CalculateHadronicSystem_AlvarezRuso(GHepRecord *event_rec) const
#define pFATAL
Definition: Messenger.h:56
Defines the EventGeneratorI interface.
void CalculateHadronicSystem_ReinSehgal(GHepRecord *event_rec) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
string Name(void) const
Definition: AlgId.h:44
void CalculateHadronicSystem_BergerSehgalFM(GHepRecord *event_rec) const
void CalculateHadronicSystem_BergerSehgal(GHepRecord *event_rec) const
static RunningThreadInfo * Instance(void)
virtual const AlgId & Id(void) const
Get algorithm ID.
Definition: Algorithm.h:98
virtual const XSecAlgorithmI * CrossSectionAlg(void) const =0
const EventGeneratorI * RunningThread(void)
Keep info on the event generation thread currently on charge. This is used so that event generation m...

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